method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public Locale getCurrentThreadLocale() { if (threadLocalLocale != null) { Locale locale = threadLocalLocale.getThreadLocale(); if (locale != null) return threadLocalLocale.getThreadLocale(); } return I18nModule.getDefaultLocale(); }
Locale function() { if (threadLocalLocale != null) { Locale locale = threadLocalLocale.getThreadLocale(); if (locale != null) return threadLocalLocale.getThreadLocale(); } return I18nModule.getDefaultLocale(); }
/** * Get the locale used in the current thread or the default locale if no locale is set. Usually this is the users logged in Locale * * @return the locale of this thread */
Get the locale used in the current thread or the default locale if no locale is set. Usually this is the users logged in Locale
getCurrentThreadLocale
{ "repo_name": "RLDevOps/Demo", "path": "src/main/java/org/olat/core/util/i18n/I18nManager.java", "license": "apache-2.0", "size": 82947 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
1,884,550
public float reduceProgress() throws IOException;
float function() throws IOException;
/** * Get the <i>progress</i> of the job's reduce-tasks, as a float between 0.0 * and 1.0. When all reduce tasks have completed, the function returns 1.0. * * @return the progress of the job's reduce-tasks. * @throws IOException */
Get the progress of the job's reduce-tasks, as a float between 0.0 and 1.0. When all reduce tasks have completed, the function returns 1.0
reduceProgress
{ "repo_name": "apache/hadoop-common", "path": "src/mapred/org/apache/hadoop/mapred/RunningJob.java", "license": "apache-2.0", "size": 5750 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
238,241
public static boolean isSupportedNode(Notifier modelElement) { return modelElement instanceof Vertex || modelElement instanceof Transition; }
static boolean function(Notifier modelElement) { return modelElement instanceof Vertex modelElement instanceof Transition; }
/** * Currently, states (including the initial state) and transitions are * supported. */
Currently, states (including the initial state) and transitions are supported
isSupportedNode
{ "repo_name": "ELTE-Soft/xUML-RT-Executor", "path": "plugins/hu.eltesoft.modelexecution.ide.debug/src/hu/eltesoft/modelexecution/ide/debug/util/ModelUtils.java", "license": "epl-1.0", "size": 3095 }
[ "org.eclipse.emf.common.notify.Notifier", "org.eclipse.uml2.uml.Transition", "org.eclipse.uml2.uml.Vertex" ]
import org.eclipse.emf.common.notify.Notifier; import org.eclipse.uml2.uml.Transition; import org.eclipse.uml2.uml.Vertex;
import org.eclipse.emf.common.notify.*; import org.eclipse.uml2.uml.*;
[ "org.eclipse.emf", "org.eclipse.uml2" ]
org.eclipse.emf; org.eclipse.uml2;
900,178
protected void addDeleteCascadePropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_ConstraintsType_deleteCascade_feature"), getString("_UI_PropertyDescriptor_description", "_UI_ConstraintsType_deleteCascade_feature", "_UI_ConstraintsType_type"), DbchangelogPackage.eINSTANCE.getConstraintsType_DeleteCascade(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), DbchangelogPackage.eINSTANCE.getConstraintsType_DeleteCascade(), true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Delete Cascade feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Delete Cascade feature.
addDeleteCascadePropertyDescriptor
{ "repo_name": "dzonekl/LiquibaseEditor", "path": "plugins/org.liquidbase.model.edit/src/org/liquibase/xml/ns/dbchangelog/provider/ConstraintsTypeItemProvider.java", "license": "mit", "size": 16016 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor", "org.liquibase.xml.ns.dbchangelog.DbchangelogPackage" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.liquibase.xml.ns.dbchangelog.DbchangelogPackage;
import org.eclipse.emf.edit.provider.*; import org.liquibase.xml.ns.dbchangelog.*;
[ "org.eclipse.emf", "org.liquibase.xml" ]
org.eclipse.emf; org.liquibase.xml;
1,679,321
private static ImportedGradeWrapper parseXls(final InputStream is, final Map<String, String> userMap) throws GbImportExportInvalidColumnException, InvalidFormatException, IOException { int lineCount = 0; final List<ImportedGrade> list = new ArrayList<ImportedGrade>(); Map<Integer, ImportColumn> mapping = null; final Workbook wb = WorkbookFactory.create(is); final Sheet sheet = wb.getSheetAt(0); for (final Row row : sheet) { final String[] r = convertRow(row); if (lineCount == 0) { // header row, capture it mapping = mapHeaderRow(r); } else { // map the fields into the object list.add(mapLine(r, mapping, userMap)); } lineCount++; } final ImportedGradeWrapper importedGradeWrapper = new ImportedGradeWrapper(); importedGradeWrapper.setColumns(mapping.values()); importedGradeWrapper.setImportedGrades(list); return importedGradeWrapper; }
static ImportedGradeWrapper function(final InputStream is, final Map<String, String> userMap) throws GbImportExportInvalidColumnException, InvalidFormatException, IOException { int lineCount = 0; final List<ImportedGrade> list = new ArrayList<ImportedGrade>(); Map<Integer, ImportColumn> mapping = null; final Workbook wb = WorkbookFactory.create(is); final Sheet sheet = wb.getSheetAt(0); for (final Row row : sheet) { final String[] r = convertRow(row); if (lineCount == 0) { mapping = mapHeaderRow(r); } else { list.add(mapLine(r, mapping, userMap)); } lineCount++; } final ImportedGradeWrapper importedGradeWrapper = new ImportedGradeWrapper(); importedGradeWrapper.setColumns(mapping.values()); importedGradeWrapper.setImportedGrades(list); return importedGradeWrapper; }
/** * Parse an XLS into a list of ImportedGrade objects Note that only the first sheet of the Excel file is supported. * * @param is InputStream of the data to parse * @return * @throws IOException * @throws InvalidFormatException * @throws GbImportExportInvalidColumnException */
Parse an XLS into a list of ImportedGrade objects Note that only the first sheet of the Excel file is supported
parseXls
{ "repo_name": "Fudan-University/sakai", "path": "gradebookng/tool/src/java/org/sakaiproject/gradebookng/business/util/ImportGradesHelper.java", "license": "apache-2.0", "size": 21483 }
[ "java.io.IOException", "java.io.InputStream", "java.util.ArrayList", "java.util.List", "java.util.Map", "org.apache.poi.openxml4j.exceptions.InvalidFormatException", "org.apache.poi.ss.usermodel.Row", "org.apache.poi.ss.usermodel.Sheet", "org.apache.poi.ss.usermodel.Workbook", "org.apache.poi.ss.u...
import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; import org.sakaiproject.gradebookng.business.exception.GbImportExportInvalidColumnException; import org.sakaiproject.gradebookng.business.model.ImportColumn; import org.sakaiproject.gradebookng.business.model.ImportedGrade; import org.sakaiproject.gradebookng.business.model.ImportedGradeWrapper;
import java.io.*; import java.util.*; import org.apache.poi.openxml4j.exceptions.*; import org.apache.poi.ss.usermodel.*; import org.sakaiproject.gradebookng.business.exception.*; import org.sakaiproject.gradebookng.business.model.*;
[ "java.io", "java.util", "org.apache.poi", "org.sakaiproject.gradebookng" ]
java.io; java.util; org.apache.poi; org.sakaiproject.gradebookng;
581,087
return ScAccountoperatorsUsersCRecord.class; } public final TableField<ScAccountoperatorsUsersCRecord, String> ID = createField("id", org.jooq.impl.SQLDataType.VARCHAR.length(36).nullable(false), this, ""); public final TableField<ScAccountoperatorsUsersCRecord, Timestamp> DATE_MODIFIED = createField("date_modified", org.jooq.impl.SQLDataType.TIMESTAMP, this, ""); public final TableField<ScAccountoperatorsUsersCRecord, Byte> DELETED = createField("deleted", org.jooq.impl.SQLDataType.TINYINT.defaultValue(org.jooq.impl.DSL.inline("0", org.jooq.impl.SQLDataType.TINYINT)), this, ""); public final TableField<ScAccountoperatorsUsersCRecord, String> SC_ACCOUNTOPERATORS_USERSUSERS_IDA = createField("sc_accountoperators_usersusers_ida", org.jooq.impl.SQLDataType.VARCHAR.length(36), this, ""); public final TableField<ScAccountoperatorsUsersCRecord, String> SC_ACCOUNTOPERATORS_USERSSC_ACCOUNTOPERATORS_IDB = createField("sc_accountoperators_userssc_accountoperators_idb", org.jooq.impl.SQLDataType.VARCHAR.length(36), this, ""); public ScAccountoperatorsUsersC() { this("sc_accountoperators_users_c", null); } public ScAccountoperatorsUsersC(String alias) { this(alias, SC_ACCOUNTOPERATORS_USERS_C); } private ScAccountoperatorsUsersC(String alias, Table<ScAccountoperatorsUsersCRecord> aliased) { this(alias, aliased, null); } private ScAccountoperatorsUsersC(String alias, Table<ScAccountoperatorsUsersCRecord> aliased, Field<?>[] parameters) { super(alias, null, aliased, parameters, ""); } /** * {@inheritDoc}
return ScAccountoperatorsUsersCRecord.class; } public final TableField<ScAccountoperatorsUsersCRecord, String> ID = createField("id", org.jooq.impl.SQLDataType.VARCHAR.length(36).nullable(false), this, STRdate_modifiedSTRSTRdeletedSTR0STRSTRsc_accountoperators_usersusers_idaSTRSTRsc_accountoperators_userssc_accountoperators_idbSTRSTRsc_accountoperators_users_cSTR"); } /** * {@inheritDoc}
/** * The class holding records for this type */
The class holding records for this type
getRecordType
{ "repo_name": "SmartMedicalServices/SpringJOOQ", "path": "src/main/java/com/sms/sis/db/tables/ScAccountoperatorsUsersC.java", "license": "gpl-3.0", "size": 4532 }
[ "com.sms.sis.db.tables.records.ScAccountoperatorsUsersCRecord", "org.jooq.TableField" ]
import com.sms.sis.db.tables.records.ScAccountoperatorsUsersCRecord; import org.jooq.TableField;
import com.sms.sis.db.tables.records.*; import org.jooq.*;
[ "com.sms.sis", "org.jooq" ]
com.sms.sis; org.jooq;
451,710
public static void setUserAutoloadProject(boolean enable) { userSettings.getSettings(SettingsConstants.USER_GENERAL_SETTINGS) .changePropertyValue(SettingsConstants.USER_AUTOLOAD_PROJECT, Boolean.toString(enable)); userSettings.saveSettings(null); }
static void function(boolean enable) { userSettings.getSettings(SettingsConstants.USER_GENERAL_SETTINGS) .changePropertyValue(SettingsConstants.USER_AUTOLOAD_PROJECT, Boolean.toString(enable)); userSettings.saveSettings(null); }
/** * Sets whether to use autoloading for the current user. * * @param enable true if autoloading should be enabled or false if it should be disabled. */
Sets whether to use autoloading for the current user
setUserAutoloadProject
{ "repo_name": "halatmit/appinventor-sources", "path": "appinventor/appengine/src/com/google/appinventor/client/Ode.java", "license": "apache-2.0", "size": 99070 }
[ "com.google.appinventor.shared.settings.SettingsConstants" ]
import com.google.appinventor.shared.settings.SettingsConstants;
import com.google.appinventor.shared.settings.*;
[ "com.google.appinventor" ]
com.google.appinventor;
2,042,928
private static byte[] generateSeed() { try { ByteArrayOutputStream seedBuffer = new ByteArrayOutputStream(); DataOutputStream seedBufferOut = new DataOutputStream(seedBuffer); seedBufferOut.writeLong(System.currentTimeMillis()); seedBufferOut.writeLong(System.nanoTime()); seedBufferOut.writeInt(Process.myPid()); seedBufferOut.writeInt(Process.myUid()); seedBufferOut.write(BUILD_FINGERPRINT_AND_DEVICE_SERIAL); seedBufferOut.close(); return seedBuffer.toByteArray(); } catch (IOException e) { throw new SecurityException("Failed to generate seed", e); } }
static byte[] function() { try { ByteArrayOutputStream seedBuffer = new ByteArrayOutputStream(); DataOutputStream seedBufferOut = new DataOutputStream(seedBuffer); seedBufferOut.writeLong(System.currentTimeMillis()); seedBufferOut.writeLong(System.nanoTime()); seedBufferOut.writeInt(Process.myPid()); seedBufferOut.writeInt(Process.myUid()); seedBufferOut.write(BUILD_FINGERPRINT_AND_DEVICE_SERIAL); seedBufferOut.close(); return seedBuffer.toByteArray(); } catch (IOException e) { throw new SecurityException(STR, e); } }
/** * Generates a device- and invocation-specific seed to be mixed into the * Linux PRNG. */
Generates a device- and invocation-specific seed to be mixed into the Linux PRNG
generateSeed
{ "repo_name": "GabrielCastro/fanshawe-connect", "path": "FanshaweConnect/src/main/java/ca/GabrielCastro/fanshaweconnect/util/PRNGFixes.java", "license": "gpl-2.0", "size": 13350 }
[ "android.os.Process", "java.io.ByteArrayOutputStream", "java.io.DataOutputStream", "java.io.IOException" ]
import android.os.Process; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException;
import android.os.*; import java.io.*;
[ "android.os", "java.io" ]
android.os; java.io;
2,120,306
public List<IvyModule> getDisabledModules(boolean disabled) { if(!disabled && sortedActiveModules!=null) return sortedActiveModules; List<IvyModule> r = new ArrayList<IvyModule>(); for (IvyModule m : modules.values()) { if(m.isDisabled()==disabled) r.add(m); } return r; }
List<IvyModule> function(boolean disabled) { if(!disabled && sortedActiveModules!=null) return sortedActiveModules; List<IvyModule> r = new ArrayList<IvyModule>(); for (IvyModule m : modules.values()) { if(m.isDisabled()==disabled) r.add(m); } return r; }
/** * Possibly empty list of all disabled modules (if disabled==true) * or all enabeld modules (if disabled==false) */
Possibly empty list of all disabled modules (if disabled==true) or all enabeld modules (if disabled==false)
getDisabledModules
{ "repo_name": "jbexten/plugin-ivy", "path": "src/main/java/hudson/ivy/IvyModuleSet.java", "license": "apache-2.0", "size": 26414 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,858,366
protected void serverinfo(final PrintWriter writer) { if (debug >= 1) { log("serverinfo"); } try { final StringBuffer props = new StringBuffer(100); props.append("Tomcat Version: "); props.append(ServerInfo.getServerInfo()); props.append("\nOS Name: "); props.append(System.getProperty("os.name")); props.append("\nOS Version: "); props.append(System.getProperty("os.version")); props.append("\nOS Architecture: "); props.append(System.getProperty("os.arch")); props.append("\nJVM Version: "); props.append(System.getProperty("java.runtime.version")); props.append("\nJVM Vendor: "); props.append(System.getProperty("java.vm.vendor")); writer.println(props.toString()); } catch (Throwable t) { getServletContext().log("ManagerServlet.serverinfo", t); writer.println(sm.getString("managerServlet.exception", t.toString())); } }
void function(final PrintWriter writer) { if (debug >= 1) { log(STR); } try { final StringBuffer props = new StringBuffer(100); props.append(STR); props.append(ServerInfo.getServerInfo()); props.append(STR); props.append(System.getProperty(STR)); props.append(STR); props.append(System.getProperty(STR)); props.append(STR); props.append(System.getProperty(STR)); props.append(STR); props.append(System.getProperty(STR)); props.append(STR); props.append(System.getProperty(STR)); writer.println(props.toString()); } catch (Throwable t) { getServletContext().log(STR, t); writer.println(sm.getString(STR, t.toString())); } }
/** * Writes System OS and JVM properties. * * @param writer Writer to render to */
Writes System OS and JVM properties
serverinfo
{ "repo_name": "simeshev/parabuild-ci", "path": "src/org/parabuild/ci/manager/server/ManagerServlet.java", "license": "lgpl-3.0", "size": 45315 }
[ "java.io.PrintWriter", "org.apache.catalina.util.ServerInfo" ]
import java.io.PrintWriter; import org.apache.catalina.util.ServerInfo;
import java.io.*; import org.apache.catalina.util.*;
[ "java.io", "org.apache.catalina" ]
java.io; org.apache.catalina;
63,281
@MustBeLocked (ELockType.WRITE) protected final void initialRead () throws DAOException { File aFile = null; final String sFilename = m_aFilenameProvider.get (); if (sFilename == null) { // required for testing if (!isSilentMode ()) if (LOGGER.isInfoEnabled ()) LOGGER.info ("This DAO of class " + getClass ().getName () + " will not be able to read from a file"); // do not return - run initialization anyway } else { // Check consistency aFile = getSafeFile (sFilename, EMode.READ); } final File aFinalFile = aFile; m_aRWLock.writeLockedThrowing ( () -> { final boolean bIsInitialization = aFinalFile == null || !aFinalFile.exists (); try { ESuccess eWriteSuccess = ESuccess.SUCCESS; if (bIsInitialization) { // initial setup for non-existing file if (!isSilentMode ()) if (LOGGER.isInfoEnabled ()) LOGGER.info ("Trying to initialize DAO XML file '" + aFinalFile + "'"); beginWithoutAutoSave (); try { m_aStatsCounterInitTotal.increment (); final StopWatch aSW = StopWatch.createdStarted (); if (onInit ().isChanged ()) if (aFinalFile != null) eWriteSuccess = _writeToFile (); m_aStatsCounterInitTimer.addTime (aSW.stopAndGetMillis ()); m_aStatsCounterInitSuccess.increment (); m_nInitCount++; m_aLastInitDT = PDTFactory.getCurrentLocalDateTime (); } finally { endWithoutAutoSave (); // reset any pending changes, because the initialization should // be read-only. If the implementing class changed something, // the return value of onInit() is what counts internalSetPendingChanges (false); } } else { // Read existing file if (!isSilentMode ()) if (LOGGER.isInfoEnabled ()) LOGGER.info ("Trying to read DAO XML file '" + aFinalFile + "'"); m_aStatsCounterReadTotal.increment (); final IMicroDocument aDoc = MicroReader.readMicroXML (aFinalFile); if (aDoc == null) { if (LOGGER.isErrorEnabled ()) LOGGER.error ("Failed to read XML document from file '" + aFinalFile + "'"); } else { // Valid XML - start interpreting beginWithoutAutoSave (); try { final StopWatch aSW = StopWatch.createdStarted (); if (onRead (aDoc).isChanged ()) eWriteSuccess = _writeToFile (); m_aStatsCounterReadTimer.addTime (aSW.stopAndGetMillis ()); m_aStatsCounterReadSuccess.increment (); m_nReadCount++; m_aLastReadDT = PDTFactory.getCurrentLocalDateTime (); } finally { endWithoutAutoSave (); // reset any pending changes, because the initialization should // be read-only. If the implementing class changed something, // the return value of onRead() is what counts internalSetPendingChanges (false); } } } // Check if writing was successful on any of the 2 branches if (eWriteSuccess.isSuccess ()) internalSetPendingChanges (false); else { if (LOGGER.isErrorEnabled ()) LOGGER.error ("File '" + aFinalFile + "' has pending changes after initialRead!"); } } catch (final Exception ex) { triggerExceptionHandlersRead (ex, bIsInitialization, aFinalFile); throw new DAOException ("Error " + (bIsInitialization ? "initializing" : "reading") + " the file '" + aFinalFile + "'", ex); } }); }
@MustBeLocked (ELockType.WRITE) final void function () throws DAOException { File aFile = null; final String sFilename = m_aFilenameProvider.get (); if (sFilename == null) { if (!isSilentMode ()) if (LOGGER.isInfoEnabled ()) LOGGER.info (STR + getClass ().getName () + STR); } else { aFile = getSafeFile (sFilename, EMode.READ); } final File aFinalFile = aFile; m_aRWLock.writeLockedThrowing ( () -> { final boolean bIsInitialization = aFinalFile == null !aFinalFile.exists (); try { ESuccess eWriteSuccess = ESuccess.SUCCESS; if (bIsInitialization) { if (!isSilentMode ()) if (LOGGER.isInfoEnabled ()) LOGGER.info (STR + aFinalFile + "'"); beginWithoutAutoSave (); try { m_aStatsCounterInitTotal.increment (); final StopWatch aSW = StopWatch.createdStarted (); if (onInit ().isChanged ()) if (aFinalFile != null) eWriteSuccess = _writeToFile (); m_aStatsCounterInitTimer.addTime (aSW.stopAndGetMillis ()); m_aStatsCounterInitSuccess.increment (); m_nInitCount++; m_aLastInitDT = PDTFactory.getCurrentLocalDateTime (); } finally { endWithoutAutoSave (); internalSetPendingChanges (false); } } else { if (!isSilentMode ()) if (LOGGER.isInfoEnabled ()) LOGGER.info (STR + aFinalFile + "'"); m_aStatsCounterReadTotal.increment (); final IMicroDocument aDoc = MicroReader.readMicroXML (aFinalFile); if (aDoc == null) { if (LOGGER.isErrorEnabled ()) LOGGER.error (STR + aFinalFile + "'"); } else { beginWithoutAutoSave (); try { final StopWatch aSW = StopWatch.createdStarted (); if (onRead (aDoc).isChanged ()) eWriteSuccess = _writeToFile (); m_aStatsCounterReadTimer.addTime (aSW.stopAndGetMillis ()); m_aStatsCounterReadSuccess.increment (); m_nReadCount++; m_aLastReadDT = PDTFactory.getCurrentLocalDateTime (); } finally { endWithoutAutoSave (); internalSetPendingChanges (false); } } } if (eWriteSuccess.isSuccess ()) internalSetPendingChanges (false); else { if (LOGGER.isErrorEnabled ()) LOGGER.error (STR + aFinalFile + STR); } } catch (final Exception ex) { triggerExceptionHandlersRead (ex, bIsInitialization, aFinalFile); throw new DAOException (STR + (bIsInitialization ? STR : STR) + STR + aFinalFile + "'", ex); } }); }
/** * Call this method inside the constructor to read the file contents directly. * This method is write locked! * * @throws DAOException * in case initialization or reading failed! */
Call this method inside the constructor to read the file contents directly. This method is write locked
initialRead
{ "repo_name": "phax/ph-commons", "path": "ph-dao/src/main/java/com/helger/dao/simple/AbstractSimpleDAO.java", "license": "apache-2.0", "size": 24076 }
[ "com.helger.commons.annotation.ELockType", "com.helger.commons.annotation.MustBeLocked", "com.helger.commons.datetime.PDTFactory", "com.helger.commons.state.ESuccess", "com.helger.commons.timing.StopWatch", "com.helger.dao.DAOException", "com.helger.xml.microdom.IMicroDocument", "com.helger.xml.microd...
import com.helger.commons.annotation.ELockType; import com.helger.commons.annotation.MustBeLocked; import com.helger.commons.datetime.PDTFactory; import com.helger.commons.state.ESuccess; import com.helger.commons.timing.StopWatch; import com.helger.dao.DAOException; import com.helger.xml.microdom.IMicroDocument; import com.helger.xml.microdom.serialize.MicroReader; import java.io.File;
import com.helger.commons.annotation.*; import com.helger.commons.datetime.*; import com.helger.commons.state.*; import com.helger.commons.timing.*; import com.helger.dao.*; import com.helger.xml.microdom.*; import com.helger.xml.microdom.serialize.*; import java.io.*;
[ "com.helger.commons", "com.helger.dao", "com.helger.xml", "java.io" ]
com.helger.commons; com.helger.dao; com.helger.xml; java.io;
2,092,992
public void doBatch_Archive_PreProcess(RunData data, Context context) { SessionState state = ((JetspeedRunData)data).getPortletSessionState(((JetspeedRunData)data).getJs_peid()); if (!SecurityService.isSuperUser()) { addAlert(state, rb.getString("archive.batch.auth")); return; } //if we have a selected term then use that as the batch export param String selectedTerm = data.getParameters().getString("archive-term"); log.debug("selectedTerm: " + selectedTerm); if(StringUtils.isBlank(selectedTerm)) { addAlert(state, rb.getString("archive.batch.term.text.missingterm")); state.setAttribute(STATE_MODE, BATCH_MODE); return; } //set the message state.setAttribute("confirmString", rb.getFormattedMessage("archive.batch.term.text.confirm.1", new Object[]{selectedTerm})); //get the sites that match the criteria Map<String, String> propertyCriteria = new HashMap<String,String>(); propertyCriteria.put("term_eid", selectedTerm); List<Site> sites = siteService.getSites(SelectionType.ANY, null, null, propertyCriteria, SortType.TITLE_ASC, null); if(sites.isEmpty()) { addAlert(state, rb.getFormattedMessage("archive.batch.term.text.nosites", new Object[]{selectedTerm})); state.setAttribute(STATE_MODE, BATCH_MODE); return; } //convert to new list so that we dont load entire sites into context List<SparseSite> ssites = new ArrayList<SparseSite>(); for(Site s: sites) { ssites.add(new SparseSite(s.getId(), s.getTitle())); } state.setAttribute("sites", ssites); //put into state for next pass state.setAttribute("selectedTerm", selectedTerm); //set mode so we go to next template state.setAttribute(STATE_MODE, BATCH_ARCHIVE_CONFIRM_MODE); }
void function(RunData data, Context context) { SessionState state = ((JetspeedRunData)data).getPortletSessionState(((JetspeedRunData)data).getJs_peid()); if (!SecurityService.isSuperUser()) { addAlert(state, rb.getString(STR)); return; } String selectedTerm = data.getParameters().getString(STR); log.debug(STR + selectedTerm); if(StringUtils.isBlank(selectedTerm)) { addAlert(state, rb.getString(STR)); state.setAttribute(STATE_MODE, BATCH_MODE); return; } state.setAttribute(STR, rb.getFormattedMessage(STR, new Object[]{selectedTerm})); Map<String, String> propertyCriteria = new HashMap<String,String>(); propertyCriteria.put(STR, selectedTerm); List<Site> sites = siteService.getSites(SelectionType.ANY, null, null, propertyCriteria, SortType.TITLE_ASC, null); if(sites.isEmpty()) { addAlert(state, rb.getFormattedMessage(STR, new Object[]{selectedTerm})); state.setAttribute(STATE_MODE, BATCH_MODE); return; } List<SparseSite> ssites = new ArrayList<SparseSite>(); for(Site s: sites) { ssites.add(new SparseSite(s.getId(), s.getTitle())); } state.setAttribute("sites", ssites); state.setAttribute(STR, selectedTerm); state.setAttribute(STATE_MODE, BATCH_ARCHIVE_CONFIRM_MODE); }
/** * doImport called when "eventSubmit_doBatch_Archive_PreProcess" is in the request parameters * to do the prep work for archiving a bunch of sites that match the criteria */
doImport called when "eventSubmit_doBatch_Archive_PreProcess" is in the request parameters to do the prep work for archiving a bunch of sites that match the criteria
doBatch_Archive_PreProcess
{ "repo_name": "whumph/sakai", "path": "archive/archive-tool/tool/src/java/org/sakaiproject/archive/tool/ArchiveAction.java", "license": "apache-2.0", "size": 23970 }
[ "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map", "org.apache.commons.lang.StringUtils", "org.sakaiproject.archive.tool.model.SparseSite", "org.sakaiproject.authz.cover.SecurityService", "org.sakaiproject.cheftool.Context", "org.sakaiproject.cheftool.JetspeedRunData", ...
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.sakaiproject.archive.tool.model.SparseSite; import org.sakaiproject.authz.cover.SecurityService; import org.sakaiproject.cheftool.Context; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState; import org.sakaiproject.site.api.Site; import org.sakaiproject.site.api.SiteService;
import java.util.*; import org.apache.commons.lang.*; import org.sakaiproject.archive.tool.model.*; import org.sakaiproject.authz.cover.*; import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*; import org.sakaiproject.site.api.*;
[ "java.util", "org.apache.commons", "org.sakaiproject.archive", "org.sakaiproject.authz", "org.sakaiproject.cheftool", "org.sakaiproject.event", "org.sakaiproject.site" ]
java.util; org.apache.commons; org.sakaiproject.archive; org.sakaiproject.authz; org.sakaiproject.cheftool; org.sakaiproject.event; org.sakaiproject.site;
966,349
protected EObject createInitialModel() { EClass eClass = ExtendedMetaData.INSTANCE.getDocumentRoot(valueSetPackage); EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(initialObjectCreationPage.getInitialObjectName()); EObject rootObject = valueSetFactory.create(eClass); rootObject.eSet(eStructuralFeature, EcoreUtil.create((EClass) eStructuralFeature.getEType())); return rootObject; }
EObject function() { EClass eClass = ExtendedMetaData.INSTANCE.getDocumentRoot(valueSetPackage); EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(initialObjectCreationPage.getInitialObjectName()); EObject rootObject = valueSetFactory.create(eClass); rootObject.eSet(eStructuralFeature, EcoreUtil.create((EClass) eStructuralFeature.getEType())); return rootObject; }
/** * Create a new model. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */
Create a new model.
createInitialModel
{ "repo_name": "drbgfc/mdht", "path": "cts2/plugins/org.openhealthtools.mdht.cts2.core.editor/src/org/openhealthtools/mdht/cts2/valueset/presentation/ValueSetModelWizard.java", "license": "epl-1.0", "size": 19080 }
[ "org.eclipse.emf.ecore.EClass", "org.eclipse.emf.ecore.EObject", "org.eclipse.emf.ecore.EStructuralFeature", "org.eclipse.emf.ecore.util.EcoreUtil", "org.eclipse.emf.ecore.util.ExtendedMetaData" ]
import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.ExtendedMetaData;
import org.eclipse.emf.ecore.*; import org.eclipse.emf.ecore.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
207,817
@Override public final void setApplicationContext(final ApplicationContext applicationContext) { super.setApplicationContext(applicationContext); final Environment env = applicationContext.getEnvironment(); final String host = env.getRequiredProperty("cm.url"); final String productTokenString = env.getRequiredProperty("cm.product-token"); final String sender = env.getRequiredProperty("cm.default-sender"); final StringBuffer cmUri = new StringBuffer("cm:" + host).append("?productToken=").append(productTokenString); if (sender != null && !sender.isEmpty()) { cmUri.append("&defaultFrom=").append(sender); } // Defaults to false final Boolean testConnectionOnStartup = Boolean.parseBoolean(env.getProperty("cm.testConnectionOnStartup", "false")); if (testConnectionOnStartup) { cmUri.append("&testConnectionOnStartup=").append(testConnectionOnStartup.toString()); } // Defaults to 8 final Integer defaultMaxNumberOfParts = Integer.parseInt(env.getProperty("defaultMaxNumberOfParts", "8")); cmUri.append("&defaultMaxNumberOfParts=").append(defaultMaxNumberOfParts.toString()); uri = cmUri.toString(); }
final void function(final ApplicationContext applicationContext) { super.setApplicationContext(applicationContext); final Environment env = applicationContext.getEnvironment(); final String host = env.getRequiredProperty(STR); final String productTokenString = env.getRequiredProperty(STR); final String sender = env.getRequiredProperty(STR); final StringBuffer cmUri = new StringBuffer("cm:" + host).append(STR).append(productTokenString); if (sender != null && !sender.isEmpty()) { cmUri.append(STR).append(sender); } final Boolean testConnectionOnStartup = Boolean.parseBoolean(env.getProperty(STR, "false")); if (testConnectionOnStartup) { cmUri.append(STR).append(testConnectionOnStartup.toString()); } final Integer defaultMaxNumberOfParts = Integer.parseInt(env.getProperty(STR, "8")); cmUri.append(STR).append(defaultMaxNumberOfParts.toString()); uri = cmUri.toString(); }
/** * Build the URI of the CM Component based on Environmental properties */
Build the URI of the CM Component based on Environmental properties
setApplicationContext
{ "repo_name": "oalles/camel-cm", "path": "src/test/java/org/apache/camel/component/cm/test/CamelTestConfiguration.java", "license": "apache-2.0", "size": 4039 }
[ "org.springframework.context.ApplicationContext", "org.springframework.core.env.Environment" ]
import org.springframework.context.ApplicationContext; import org.springframework.core.env.Environment;
import org.springframework.context.*; import org.springframework.core.env.*;
[ "org.springframework.context", "org.springframework.core" ]
org.springframework.context; org.springframework.core;
2,485,857
public static MessageContext toMessageContext(StorableMessage message, org.apache.axis2.context.MessageContext axis2Ctx, MessageContext synCtx) { if (message == null) { logger.error("Cannot create Message Context. Message is null."); return null; } AxisConfiguration axisConfig = axis2Ctx.getConfigurationContext().getAxisConfiguration(); if (axisConfig == null) { logger.warn("Cannot create AxisConfiguration. AxisConfiguration is null."); return null; } Axis2Message axis2Msg = message.getAxis2message(); try { SOAPEnvelope envelope = getSoapEnvelope(axis2Msg.getSoapEnvelope()); axis2Ctx.setEnvelope(envelope); // set the RMSMessageDto properties axis2Ctx.getOptions().setAction(axis2Msg.getAction()); if (axis2Msg.getRelatesToMessageId() != null) { axis2Ctx.addRelatesTo(new RelatesTo(axis2Msg.getRelatesToMessageId())); } axis2Ctx.setMessageID(axis2Msg.getMessageID()); axis2Ctx.getOptions().setAction(axis2Msg.getAction()); axis2Ctx.setDoingREST(axis2Msg.isDoingPOX()); axis2Ctx.setDoingMTOM(axis2Msg.isDoingMTOM()); axis2Ctx.setDoingSwA(axis2Msg.isDoingSWA()); if (axis2Msg.getService() != null) { AxisService axisService = axisConfig.getServiceForActivation(axis2Msg.getService()); AxisOperation axisOperation = axisService.getOperation(axis2Msg.getOperationName()); axis2Ctx.setFLOW(axis2Msg.getFLOW()); ArrayList executionChain = new ArrayList(); if (axis2Msg.getFLOW() == org.apache.axis2.context.MessageContext.OUT_FLOW) { executionChain.addAll(axisOperation.getPhasesOutFlow()); executionChain.addAll(axisConfig.getOutFlowPhases()); } else if (axis2Msg.getFLOW() == org.apache.axis2.context.MessageContext.OUT_FAULT_FLOW) { executionChain.addAll(axisOperation.getPhasesOutFaultFlow()); executionChain.addAll(axisConfig.getOutFlowPhases()); } axis2Ctx.setExecutionChain(executionChain); ConfigurationContext configurationContext = axis2Ctx.getConfigurationContext(); axis2Ctx.setAxisService(axisService); ServiceGroupContext serviceGroupContext = configurationContext .createServiceGroupContext(axisService.getAxisServiceGroup()); ServiceContext serviceContext = serviceGroupContext.getServiceContext(axisService); OperationContext operationContext = serviceContext .createOperationContext(axis2Msg.getOperationName()); axis2Ctx.setServiceContext(serviceContext); axis2Ctx.setOperationContext(operationContext); axis2Ctx.setAxisService(axisService); axis2Ctx.setAxisOperation(axisOperation); } if (axis2Msg.getReplyToAddress() != null) { axis2Ctx.setReplyTo(new EndpointReference(axis2Msg.getReplyToAddress().trim())); } if (axis2Msg.getFaultToAddress() != null) { axis2Ctx.setFaultTo(new EndpointReference(axis2Msg.getFaultToAddress().trim())); } if (axis2Msg.getFromAddress() != null) { axis2Ctx.setFrom(new EndpointReference(axis2Msg.getFromAddress().trim())); } if (axis2Msg.getToAddress() != null) { axis2Ctx.getOptions().setTo(new EndpointReference(axis2Msg.getToAddress().trim())); } Object map = axis2Msg.getProperties().get(ABSTRACT_MC_PROPERTIES); axis2Msg.getProperties().remove(ABSTRACT_MC_PROPERTIES); axis2Ctx.setProperties(axis2Msg.getProperties()); axis2Ctx.setTransportIn( axisConfig.getTransportIn(axis2Msg.getTransportInName())); axis2Ctx.setTransportOut( axisConfig.getTransportOut(axis2Msg.getTransportOutName())); Object headers = axis2Msg.getProperties() .get(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); if (headers instanceof Map) { setTransportHeaders(axis2Ctx, (Map) headers); } if (map instanceof Map) { Map<String, Object> abstractMCProperties = (Map) map; Iterator<String> properties = abstractMCProperties.keySet().iterator(); while (properties.hasNext()) { String property = properties.next(); Object value = abstractMCProperties.get(property); axis2Ctx.setProperty(property, value); } } // axis2Ctx.setEnvelope(envelope); // XXX: always this section must come after the above step. ie. after applying Envelope. // That is to get the existing headers into the new envelope. if (axis2Msg.getJsonStream() != null) { JsonUtil.newJsonPayload(axis2Ctx, new ByteArrayInputStream(axis2Msg.getJsonStream()), true, true); } SynapseMessage synMsg = message.getSynapseMessage(); synCtx.setTracingState(synMsg.getTracingState()); Iterator<String> properties = synMsg.getProperties().keySet().iterator(); while (properties.hasNext()) { String key = properties.next(); Object value = synMsg.getProperties().get(key); synCtx.setProperty(key, value); } Iterator<String> propertyObjects = synMsg.getPropertyObjects().keySet().iterator(); while (propertyObjects.hasNext()) { String key = propertyObjects.next(); Object value = synMsg.getPropertyObjects().get(key); if(key.startsWith(OM_ELEMENT_PREFIX)){ String originalKey = key.substring(OM_ELEMENT_PREFIX.length(),key.length()); ByteArrayInputStream is = new ByteArrayInputStream((byte[])value); StAXOMBuilder builder = new StAXOMBuilder(is); OMElement omElement = builder.getDocumentElement(); synCtx.setProperty(originalKey,omElement); } } synCtx.setFaultResponse(synMsg.isFaultResponse()); synCtx.setResponse(synMsg.isResponse()); return synCtx; } catch (Exception e) { logger.error("Cannot create Message Context. Error:" + e.getLocalizedMessage(), e); return null; } }
static MessageContext function(StorableMessage message, org.apache.axis2.context.MessageContext axis2Ctx, MessageContext synCtx) { if (message == null) { logger.error(STR); return null; } AxisConfiguration axisConfig = axis2Ctx.getConfigurationContext().getAxisConfiguration(); if (axisConfig == null) { logger.warn(STR); return null; } Axis2Message axis2Msg = message.getAxis2message(); try { SOAPEnvelope envelope = getSoapEnvelope(axis2Msg.getSoapEnvelope()); axis2Ctx.setEnvelope(envelope); axis2Ctx.getOptions().setAction(axis2Msg.getAction()); if (axis2Msg.getRelatesToMessageId() != null) { axis2Ctx.addRelatesTo(new RelatesTo(axis2Msg.getRelatesToMessageId())); } axis2Ctx.setMessageID(axis2Msg.getMessageID()); axis2Ctx.getOptions().setAction(axis2Msg.getAction()); axis2Ctx.setDoingREST(axis2Msg.isDoingPOX()); axis2Ctx.setDoingMTOM(axis2Msg.isDoingMTOM()); axis2Ctx.setDoingSwA(axis2Msg.isDoingSWA()); if (axis2Msg.getService() != null) { AxisService axisService = axisConfig.getServiceForActivation(axis2Msg.getService()); AxisOperation axisOperation = axisService.getOperation(axis2Msg.getOperationName()); axis2Ctx.setFLOW(axis2Msg.getFLOW()); ArrayList executionChain = new ArrayList(); if (axis2Msg.getFLOW() == org.apache.axis2.context.MessageContext.OUT_FLOW) { executionChain.addAll(axisOperation.getPhasesOutFlow()); executionChain.addAll(axisConfig.getOutFlowPhases()); } else if (axis2Msg.getFLOW() == org.apache.axis2.context.MessageContext.OUT_FAULT_FLOW) { executionChain.addAll(axisOperation.getPhasesOutFaultFlow()); executionChain.addAll(axisConfig.getOutFlowPhases()); } axis2Ctx.setExecutionChain(executionChain); ConfigurationContext configurationContext = axis2Ctx.getConfigurationContext(); axis2Ctx.setAxisService(axisService); ServiceGroupContext serviceGroupContext = configurationContext .createServiceGroupContext(axisService.getAxisServiceGroup()); ServiceContext serviceContext = serviceGroupContext.getServiceContext(axisService); OperationContext operationContext = serviceContext .createOperationContext(axis2Msg.getOperationName()); axis2Ctx.setServiceContext(serviceContext); axis2Ctx.setOperationContext(operationContext); axis2Ctx.setAxisService(axisService); axis2Ctx.setAxisOperation(axisOperation); } if (axis2Msg.getReplyToAddress() != null) { axis2Ctx.setReplyTo(new EndpointReference(axis2Msg.getReplyToAddress().trim())); } if (axis2Msg.getFaultToAddress() != null) { axis2Ctx.setFaultTo(new EndpointReference(axis2Msg.getFaultToAddress().trim())); } if (axis2Msg.getFromAddress() != null) { axis2Ctx.setFrom(new EndpointReference(axis2Msg.getFromAddress().trim())); } if (axis2Msg.getToAddress() != null) { axis2Ctx.getOptions().setTo(new EndpointReference(axis2Msg.getToAddress().trim())); } Object map = axis2Msg.getProperties().get(ABSTRACT_MC_PROPERTIES); axis2Msg.getProperties().remove(ABSTRACT_MC_PROPERTIES); axis2Ctx.setProperties(axis2Msg.getProperties()); axis2Ctx.setTransportIn( axisConfig.getTransportIn(axis2Msg.getTransportInName())); axis2Ctx.setTransportOut( axisConfig.getTransportOut(axis2Msg.getTransportOutName())); Object headers = axis2Msg.getProperties() .get(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); if (headers instanceof Map) { setTransportHeaders(axis2Ctx, (Map) headers); } if (map instanceof Map) { Map<String, Object> abstractMCProperties = (Map) map; Iterator<String> properties = abstractMCProperties.keySet().iterator(); while (properties.hasNext()) { String property = properties.next(); Object value = abstractMCProperties.get(property); axis2Ctx.setProperty(property, value); } } if (axis2Msg.getJsonStream() != null) { JsonUtil.newJsonPayload(axis2Ctx, new ByteArrayInputStream(axis2Msg.getJsonStream()), true, true); } SynapseMessage synMsg = message.getSynapseMessage(); synCtx.setTracingState(synMsg.getTracingState()); Iterator<String> properties = synMsg.getProperties().keySet().iterator(); while (properties.hasNext()) { String key = properties.next(); Object value = synMsg.getProperties().get(key); synCtx.setProperty(key, value); } Iterator<String> propertyObjects = synMsg.getPropertyObjects().keySet().iterator(); while (propertyObjects.hasNext()) { String key = propertyObjects.next(); Object value = synMsg.getPropertyObjects().get(key); if(key.startsWith(OM_ELEMENT_PREFIX)){ String originalKey = key.substring(OM_ELEMENT_PREFIX.length(),key.length()); ByteArrayInputStream is = new ByteArrayInputStream((byte[])value); StAXOMBuilder builder = new StAXOMBuilder(is); OMElement omElement = builder.getDocumentElement(); synCtx.setProperty(originalKey,omElement); } } synCtx.setFaultResponse(synMsg.isFaultResponse()); synCtx.setResponse(synMsg.isResponse()); return synCtx; } catch (Exception e) { logger.error(STR + e.getLocalizedMessage(), e); return null; } }
/** * Converts a message read from the message store to a Synapse Message Context object. * @param message Message from the message store * @param axis2Ctx Final Axis2 Message Context * @param synCtx Final Synapse message Context * @return Final Synapse Message Context */
Converts a message read from the message store to a Synapse Message Context object
toMessageContext
{ "repo_name": "maheshika/wso2-synapse", "path": "modules/core/src/main/java/org/apache/synapse/message/store/impl/jms/MessageConverter.java", "license": "apache-2.0", "size": 21211 }
[ "java.io.ByteArrayInputStream", "java.util.ArrayList", "java.util.Iterator", "java.util.Map", "org.apache.axiom.om.OMElement", "org.apache.axiom.om.impl.builder.StAXOMBuilder", "org.apache.axiom.soap.SOAPEnvelope", "org.apache.axis2.addressing.EndpointReference", "org.apache.axis2.addressing.Relates...
import java.io.ByteArrayInputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.Map; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.impl.builder.StAXOMBuilder; import org.apache.axiom.soap.SOAPEnvelope; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.addressing.RelatesTo; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.context.OperationContext; import org.apache.axis2.context.ServiceContext; import org.apache.axis2.context.ServiceGroupContext; import org.apache.axis2.description.AxisOperation; import org.apache.axis2.description.AxisService; import org.apache.axis2.engine.AxisConfiguration; import org.apache.synapse.MessageContext; import org.apache.synapse.commons.json.JsonUtil;
import java.io.*; import java.util.*; import org.apache.axiom.om.*; import org.apache.axiom.om.impl.builder.*; import org.apache.axiom.soap.*; import org.apache.axis2.addressing.*; import org.apache.axis2.context.*; import org.apache.axis2.description.*; import org.apache.axis2.engine.*; import org.apache.synapse.*; import org.apache.synapse.commons.json.*;
[ "java.io", "java.util", "org.apache.axiom", "org.apache.axis2", "org.apache.synapse" ]
java.io; java.util; org.apache.axiom; org.apache.axis2; org.apache.synapse;
2,229,918
public void addSetterComment(Method method, FullyQualifiedTable table, String columnName) { StringBuilder sb = new StringBuilder(); method.addJavaDocLine(""); //$NON-NLS-1$ }
void function(Method method, FullyQualifiedTable table, String columnName) { StringBuilder sb = new StringBuilder(); method.addJavaDocLine(""); }
/** * Method from the old version of the interface. * * TODO - remove in release 1.2.3 * * @deprecated as of version 1.2.2. * @see CopyOfDefaultCommentGenerator#addSetterComment(Method, IntrospectedTable, IntrospectedColumn) */
Method from the old version of the interface. TODO - remove in release 1.2.3
addSetterComment
{ "repo_name": "xyz-dev/ibator122", "path": "src/main/java/org/apache/ibatis/ibator/internal/CopyOfDefaultCommentGenerator.java", "license": "apache-2.0", "size": 13899 }
[ "org.apache.ibatis.ibator.api.FullyQualifiedTable", "org.apache.ibatis.ibator.api.dom.java.Method" ]
import org.apache.ibatis.ibator.api.FullyQualifiedTable; import org.apache.ibatis.ibator.api.dom.java.Method;
import org.apache.ibatis.ibator.api.*; import org.apache.ibatis.ibator.api.dom.java.*;
[ "org.apache.ibatis" ]
org.apache.ibatis;
202,440
public static void checkArgument(boolean b, @Nullable String errorMessageTemplate, int p1) { if (!b) { throw new IllegalArgumentException(format(errorMessageTemplate, p1)); } }
static void function(boolean b, @Nullable String errorMessageTemplate, int p1) { if (!b) { throw new IllegalArgumentException(format(errorMessageTemplate, p1)); } }
/** * Ensures the truth of an expression involving one or more parameters to the calling method. * * <p>See {@link #checkArgument(boolean, String, Object...)} for details. */
Ensures the truth of an expression involving one or more parameters to the calling method. See <code>#checkArgument(boolean, String, Object...)</code> for details
checkArgument
{ "repo_name": "jakubmalek/guava", "path": "guava/src/com/google/common/base/Preconditions.java", "license": "apache-2.0", "size": 51675 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,514,768
public void store(OutputStream stream, String comments) throws IOException { CustomProperties customProperties = new CustomProperties(this.properties); if (suppressDate) { customProperties.store( new DateSuppressingPropertiesBufferedWriter(new OutputStreamWriter(stream, "8859_1")), comments); } else { customProperties.store(stream, comments); } }
void function(OutputStream stream, String comments) throws IOException { CustomProperties customProperties = new CustomProperties(this.properties); if (suppressDate) { customProperties.store( new DateSuppressingPropertiesBufferedWriter(new OutputStreamWriter(stream, STR)), comments); } else { customProperties.store(stream, comments); } }
/** * See {@link Properties#store(OutputStream, String)}. */
See <code>Properties#store(OutputStream, String)</code>
store
{ "repo_name": "bladecoder/bladecoder-adventure-engine", "path": "adventure-editor/src/main/java/com/bladecoder/engineeditor/common/OrderedProperties.java", "license": "apache-2.0", "size": 16457 }
[ "java.io.IOException", "java.io.OutputStream", "java.io.OutputStreamWriter" ]
import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter;
import java.io.*;
[ "java.io" ]
java.io;
83,753
public void setSwipeThreshold(float swipeThreshold) { this.swipeThreshold = swipeThreshold; } class AnimatePanX implements Animation { private Motion motion; private Image replaceImage; private int updatePos; public AnimatePanX(float destPan, Image replaceImage, int updatePos) { motion = Motion.createEaseInOutMotion((int)(panPositionX * 10000), (int)(destPan * 10000), 200); motion.start(); this.replaceImage = replaceImage; this.updatePos = updatePos; Display.getInstance().getCurrent().registerAnimated(this); }
void function(float swipeThreshold) { this.swipeThreshold = swipeThreshold; } class AnimatePanX implements Animation { private Motion motion; private Image replaceImage; private int updatePos; public AnimatePanX(float destPan, Image replaceImage, int updatePos) { motion = Motion.createEaseInOutMotion((int)(panPositionX * 10000), (int)(destPan * 10000), 200); motion.start(); this.replaceImage = replaceImage; this.updatePos = updatePos; Display.getInstance().getCurrent().registerAnimated(this); }
/** * The swipe threshold is a number between 0 and 1 that indicates the threshold * after which the swiped image moves to the next image. Below that number the image * will bounce back * @param swipeThreshold the swipeThreshold to set */
The swipe threshold is a number between 0 and 1 that indicates the threshold after which the swiped image moves to the next image. Below that number the image will bounce back
setSwipeThreshold
{ "repo_name": "saeder/CodenameOne", "path": "CodenameOne/src/com/codename1/components/ImageViewer.java", "license": "gpl-2.0", "size": 36773 }
[ "com.codename1.ui.Display", "com.codename1.ui.Image", "com.codename1.ui.animations.Animation", "com.codename1.ui.animations.Motion" ]
import com.codename1.ui.Display; import com.codename1.ui.Image; import com.codename1.ui.animations.Animation; import com.codename1.ui.animations.Motion;
import com.codename1.ui.*; import com.codename1.ui.animations.*;
[ "com.codename1.ui" ]
com.codename1.ui;
2,766,550
private Matrix differentiateNonlinearity(Matrix linearOut, IgniteDifferentiableDoubleToDoubleFunction nonlinearity) { Matrix diff = linearOut.copy(); diff.map(nonlinearity::differential); return diff; }
Matrix function(Matrix linearOut, IgniteDifferentiableDoubleToDoubleFunction nonlinearity) { Matrix diff = linearOut.copy(); diff.map(nonlinearity::differential); return diff; }
/** * Differentiate nonlinearity. * * @param linearOut Linear output of current layer. * @param nonlinearity Nonlinearity of current layer. * @return Gradients matrix. */
Differentiate nonlinearity
differentiateNonlinearity
{ "repo_name": "ilantukh/ignite", "path": "modules/ml/src/main/java/org/apache/ignite/ml/nn/MultilayerPerceptron.java", "license": "apache-2.0", "size": 20059 }
[ "org.apache.ignite.ml.math.functions.IgniteDifferentiableDoubleToDoubleFunction", "org.apache.ignite.ml.math.primitives.matrix.Matrix" ]
import org.apache.ignite.ml.math.functions.IgniteDifferentiableDoubleToDoubleFunction; import org.apache.ignite.ml.math.primitives.matrix.Matrix;
import org.apache.ignite.ml.math.functions.*; import org.apache.ignite.ml.math.primitives.matrix.*;
[ "org.apache.ignite" ]
org.apache.ignite;
408,872
ReportFormat getReportFormat(String format);
ReportFormat getReportFormat(String format);
/** * Finds report format and checks whether it's valid * * @param format ReportFormat */
Finds report format and checks whether it's valid
getReportFormat
{ "repo_name": "reportportal/service-api", "path": "src/main/java/com/epam/ta/reportportal/core/jasper/GetJasperReportHandler.java", "license": "apache-2.0", "size": 1932 }
[ "com.epam.ta.reportportal.entity.jasper.ReportFormat" ]
import com.epam.ta.reportportal.entity.jasper.ReportFormat;
import com.epam.ta.reportportal.entity.jasper.*;
[ "com.epam.ta" ]
com.epam.ta;
1,209,912
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { closeButton = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); jStockValue = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("proffittcenter/resource/StockByValueDepartments"); // NOI18N setTitle(bundle.getString("Title")); // NOI18N setName("StockByValueDepartments"); // NOI18N
@SuppressWarnings(STR) void function() { closeButton = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); jStockValue = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle(STR); setTitle(bundle.getString("Title")); setName(STR);
/** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */
This method is called from within the constructor to initialize the form. always regenerated by the Form Editor
initComponents
{ "repo_name": "proffitcenter/proffittcenter", "path": "StockByValueDepartmets.java", "license": "gpl-3.0", "size": 15297 }
[ "java.util.ResourceBundle" ]
import java.util.ResourceBundle;
import java.util.*;
[ "java.util" ]
java.util;
172,926
public JobSubmissionResult run(PackagedProgram prog, int parallelism) throws ProgramInvocationException, ProgramMissingJobException { Thread.currentThread().setContextClassLoader(prog.getUserCodeClassLoader()); if (prog.isUsingProgramEntryPoint()) { final JobWithJars jobWithJars; if (hasUserJarsInClassPath(prog.getAllLibraries())) { jobWithJars = prog.getPlanWithoutJars(); } else { jobWithJars = prog.getPlanWithJars(); } return run(jobWithJars, parallelism, prog.getSavepointSettings()); } else if (prog.isUsingInteractiveMode()) { log.info("Starting program in interactive mode (detached: {})", isDetached()); final List<URL> libraries; if (hasUserJarsInClassPath(prog.getAllLibraries())) { libraries = Collections.emptyList(); } else { libraries = prog.getAllLibraries(); } ContextEnvironmentFactory factory = new ContextEnvironmentFactory(this, libraries, prog.getClasspaths(), prog.getUserCodeClassLoader(), parallelism, isDetached(), prog.getSavepointSettings()); ContextEnvironment.setAsContext(factory); try { // invoke main method prog.invokeInteractiveModeForExecution(); if (lastJobExecutionResult == null && factory.getLastEnvCreated() == null) { throw new ProgramMissingJobException("The program didn't contain a Flink job."); } if (isDetached()) { // in detached mode, we execute the whole user code to extract the Flink job, afterwards we run it here return ((DetachedEnvironment) factory.getLastEnvCreated()).finalizeExecute(); } else { // in blocking mode, we execute all Flink jobs contained in the user code and then return here return this.lastJobExecutionResult; } } finally { ContextEnvironment.unsetContext(); } } else { throw new ProgramInvocationException("PackagedProgram does not have a valid invocation mode."); } }
JobSubmissionResult function(PackagedProgram prog, int parallelism) throws ProgramInvocationException, ProgramMissingJobException { Thread.currentThread().setContextClassLoader(prog.getUserCodeClassLoader()); if (prog.isUsingProgramEntryPoint()) { final JobWithJars jobWithJars; if (hasUserJarsInClassPath(prog.getAllLibraries())) { jobWithJars = prog.getPlanWithoutJars(); } else { jobWithJars = prog.getPlanWithJars(); } return run(jobWithJars, parallelism, prog.getSavepointSettings()); } else if (prog.isUsingInteractiveMode()) { log.info(STR, isDetached()); final List<URL> libraries; if (hasUserJarsInClassPath(prog.getAllLibraries())) { libraries = Collections.emptyList(); } else { libraries = prog.getAllLibraries(); } ContextEnvironmentFactory factory = new ContextEnvironmentFactory(this, libraries, prog.getClasspaths(), prog.getUserCodeClassLoader(), parallelism, isDetached(), prog.getSavepointSettings()); ContextEnvironment.setAsContext(factory); try { prog.invokeInteractiveModeForExecution(); if (lastJobExecutionResult == null && factory.getLastEnvCreated() == null) { throw new ProgramMissingJobException(STR); } if (isDetached()) { return ((DetachedEnvironment) factory.getLastEnvCreated()).finalizeExecute(); } else { return this.lastJobExecutionResult; } } finally { ContextEnvironment.unsetContext(); } } else { throw new ProgramInvocationException(STR); } }
/** * General purpose method to run a user jar from the CliFrontend in either blocking or detached mode, depending * on whether {@code setDetached(true)} or {@code setDetached(false)}. * @param prog the packaged program * @param parallelism the parallelism to execute the contained Flink job * @return The result of the execution * @throws ProgramMissingJobException * @throws ProgramInvocationException */
General purpose method to run a user jar from the CliFrontend in either blocking or detached mode, depending on whether setDetached(true) or setDetached(false)
run
{ "repo_name": "zhangminglei/flink", "path": "flink-clients/src/main/java/org/apache/flink/client/program/ClusterClient.java", "license": "apache-2.0", "size": 41128 }
[ "java.util.Collections", "java.util.List", "org.apache.flink.api.common.JobSubmissionResult" ]
import java.util.Collections; import java.util.List; import org.apache.flink.api.common.JobSubmissionResult;
import java.util.*; import org.apache.flink.api.common.*;
[ "java.util", "org.apache.flink" ]
java.util; org.apache.flink;
626,961
@WebMethod @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505") @RequestWrapper(localName = "getPreviewUrl", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.LineItemCreativeAssociationServiceInterfacegetPreviewUrl") @ResponseWrapper(localName = "getPreviewUrlResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505", className = "com.google.api.ads.dfp.jaxws.v201505.LineItemCreativeAssociationServiceInterfacegetPreviewUrlResponse") public String getPreviewUrl( @WebParam(name = "lineItemId", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505") Long lineItemId, @WebParam(name = "creativeId", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505") Long creativeId, @WebParam(name = "siteUrl", targetNamespace = "https://www.google.com/apis/ads/publisher/v201505") String siteUrl) throws ApiException_Exception ;
@WebResult(name = "rval", targetNamespace = STRgetPreviewUrlSTRhttps: @ResponseWrapper(localName = "getPreviewUrlResponseSTRhttps: String function( @WebParam(name = "lineItemIdSTRhttps: Long lineItemId, @WebParam(name = "creativeIdSTRhttps: Long creativeId, @WebParam(name = "siteUrlSTRhttps: String siteUrl) throws ApiException_Exception ;
/** * * Returns an insite preview URL that references the specified site URL with * the specified creative from the association served to it. For Creative Set * previewing you may specify the master creative Id. * * @param lineItemId the ID of the line item, which must already exist * @param creativeId the ID of the creative, which must already exist * @param siteUrl the URL of the site that the creative should be previewed in * @return a URL that references the specified site URL with the specified * creative served to it * * * @param siteUrl * @param lineItemId * @param creativeId * @return * returns java.lang.String * @throws ApiException_Exception */
Returns an insite preview URL that references the specified site URL with the specified creative from the association served to it. For Creative Set previewing you may specify the master creative Id
getPreviewUrl
{ "repo_name": "stoksey69/googleads-java-lib", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201505/LineItemCreativeAssociationServiceInterface.java", "license": "apache-2.0", "size": 11100 }
[ "javax.jws.WebParam", "javax.jws.WebResult", "javax.xml.ws.ResponseWrapper" ]
import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
import javax.jws.*; import javax.xml.ws.*;
[ "javax.jws", "javax.xml" ]
javax.jws; javax.xml;
1,793,595
@Override public ImmutableList<Element> toElementList(final ImmutableList<Ds3Element> ds3Elements) { if (isEmpty(ds3Elements)) { return ImmutableList.of(); } final ImmutableList.Builder<Element> builder = ImmutableList.builder(); for (final Ds3Element ds3Element : ds3Elements) { builder.add(toElement(ds3Element)); } return builder.build(); }
ImmutableList<Element> function(final ImmutableList<Ds3Element> ds3Elements) { if (isEmpty(ds3Elements)) { return ImmutableList.of(); } final ImmutableList.Builder<Element> builder = ImmutableList.builder(); for (final Ds3Element ds3Element : ds3Elements) { builder.add(toElement(ds3Element)); } return builder.build(); }
/** * Converts a list of Ds3Elements into a list of Element models * @param ds3Elements A list of Ds3Elements * @return A list of Element models */
Converts a list of Ds3Elements into a list of Element models
toElementList
{ "repo_name": "RachelTucker/ds3_autogen", "path": "ds3-autogen-java/src/main/java/com/spectralogic/ds3autogen/java/generators/typemodels/BaseTypeGenerator.java", "license": "apache-2.0", "size": 8268 }
[ "com.google.common.collect.ImmutableList", "com.spectralogic.ds3autogen.api.models.apispec.Ds3Element", "com.spectralogic.ds3autogen.java.models.Element" ]
import com.google.common.collect.ImmutableList; import com.spectralogic.ds3autogen.api.models.apispec.Ds3Element; import com.spectralogic.ds3autogen.java.models.Element;
import com.google.common.collect.*; import com.spectralogic.ds3autogen.api.models.apispec.*; import com.spectralogic.ds3autogen.java.models.*;
[ "com.google.common", "com.spectralogic.ds3autogen" ]
com.google.common; com.spectralogic.ds3autogen;
686,081
int getNumRegions(TableName table) throws IOException { List<HRegionInfo> regions = this.conn.getAdmin().getTableRegions(table); if (regions == null) { return 0; } return regions.size(); }
int getNumRegions(TableName table) throws IOException { List<HRegionInfo> regions = this.conn.getAdmin().getTableRegions(table); if (regions == null) { return 0; } return regions.size(); }
/** * Computes the total number of regions in a table. */
Computes the total number of regions in a table
getNumRegions
{ "repo_name": "gustavoanatoly/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/QuotaObserverChore.java", "license": "apache-2.0", "size": 30902 }
[ "java.io.IOException", "java.util.List", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.TableName" ]
import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName;
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
1,236,998
@Test public void testQueryByAssigneeExcludeSubtasksOrdered() throws Exception { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss.SSS"); // gonzo has 2 root tasks and 3+2 subtasks assigned // include subtasks TaskQuery query = taskService.createTaskQuery().taskAssignee("gonzo").orderByTaskCreateTime().desc(); assertThat(query.count()).isEqualTo(7); assertThat(query.list()).hasSize(7); assertThat(query.list().get(0).getCreateTime()).isEqualTo(sdf.parse("02/01/2009 01:01:01.000")); // exclude subtasks query = taskService.createTaskQuery().taskAssignee("gonzo").excludeSubtasks().orderByTaskCreateTime().asc(); assertThat(query.count()).isEqualTo(2); assertThat(query.list()).hasSize(2); assertThat(query.list().get(0).getCreateTime()).isEqualTo(sdf.parse("01/02/2008 02:02:02.000")); assertThat(query.list().get(1).getCreateTime()).isEqualTo(sdf.parse("05/02/2008 02:02:02.000")); // kermit has no root tasks and no subtasks assigned // include subtasks query = taskService.createTaskQuery().taskAssignee("kermit").orderByTaskCreateTime().asc(); assertThat(query.count()).isZero(); assertThat(query.list()).isEmpty(); assertThat(query.singleResult()).isNull(); // exclude subtasks query = taskService.createTaskQuery().taskAssignee("kermit").excludeSubtasks().orderByTaskCreateTime().desc(); assertThat(query.count()).isZero(); assertThat(query.list()).isEmpty(); assertThat(query.singleResult()).isNull(); }
void function() throws Exception { SimpleDateFormat sdf = new SimpleDateFormat(STR); TaskQuery query = taskService.createTaskQuery().taskAssignee("gonzo").orderByTaskCreateTime().desc(); assertThat(query.count()).isEqualTo(7); assertThat(query.list()).hasSize(7); assertThat(query.list().get(0).getCreateTime()).isEqualTo(sdf.parse(STR)); query = taskService.createTaskQuery().taskAssignee("gonzo").excludeSubtasks().orderByTaskCreateTime().asc(); assertThat(query.count()).isEqualTo(2); assertThat(query.list()).hasSize(2); assertThat(query.list().get(0).getCreateTime()).isEqualTo(sdf.parse(STR)); assertThat(query.list().get(1).getCreateTime()).isEqualTo(sdf.parse(STR)); query = taskService.createTaskQuery().taskAssignee(STR).orderByTaskCreateTime().asc(); assertThat(query.count()).isZero(); assertThat(query.list()).isEmpty(); assertThat(query.singleResult()).isNull(); query = taskService.createTaskQuery().taskAssignee(STR).excludeSubtasks().orderByTaskCreateTime().desc(); assertThat(query.count()).isZero(); assertThat(query.list()).isEmpty(); assertThat(query.singleResult()).isNull(); }
/** * test for task inclusion/exclusion when additional filter is specified (like assignee), ordered. */
test for task inclusion/exclusion when additional filter is specified (like assignee), ordered
testQueryByAssigneeExcludeSubtasksOrdered
{ "repo_name": "paulstapleton/flowable-engine", "path": "modules/flowable-engine/src/test/java/org/flowable/engine/test/api/task/SubTaskQueryTest.java", "license": "apache-2.0", "size": 14130 }
[ "java.text.SimpleDateFormat", "org.assertj.core.api.Assertions", "org.flowable.task.api.TaskQuery" ]
import java.text.SimpleDateFormat; import org.assertj.core.api.Assertions; import org.flowable.task.api.TaskQuery;
import java.text.*; import org.assertj.core.api.*; import org.flowable.task.api.*;
[ "java.text", "org.assertj.core", "org.flowable.task" ]
java.text; org.assertj.core; org.flowable.task;
2,108,459
void attach(final ArduinoReader reader) throws IOException { try { serialPort.addEventListener(reader); serialPort.notifyOnDataAvailable(true); } catch (final TooManyListenersException e) { throw new IOException(e); } }
void attach(final ArduinoReader reader) throws IOException { try { serialPort.addEventListener(reader); serialPort.notifyOnDataAvailable(true); } catch (final TooManyListenersException e) { throw new IOException(e); } }
/** * Attach an event listener to the serial port object. * * @param reader handles serial port events * @throws IOException if there are already listeners connected. */
Attach an event listener to the serial port object
attach
{ "repo_name": "EasternEdgeRobotics/2016", "path": "src/main/java/com/easternedgerobotics/rov/io/arduino/ArduinoPort.java", "license": "mit", "size": 4320 }
[ "java.io.IOException", "java.util.TooManyListenersException" ]
import java.io.IOException; import java.util.TooManyListenersException;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
672,877
public NodeRef getNodeRef() { return new NodeRef(getNodeIdentifier()); }
NodeRef function() { return new NodeRef(getNodeIdentifier()); }
/** * Return a {@link NodeRef} instance corresponding to this instance. * * @return An {@link NodeRef} instance. */
Return a <code>NodeRef</code> instance corresponding to this instance
getNodeRef
{ "repo_name": "opendaylight/vtn", "path": "manager/implementation/src/main/java/org/opendaylight/vtn/manager/internal/util/inventory/SalNode.java", "license": "epl-1.0", "size": 13071 }
[ "org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef" ]
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.*;
[ "org.opendaylight.yang" ]
org.opendaylight.yang;
1,710,846
//----------------------------------------------------------------------- public final MetaProperty<Currency> currency() { return _currency; }
final MetaProperty<Currency> function() { return _currency; }
/** * The meta-property for the {@code currency} property. * @return the meta-property, not null */
The meta-property for the currency property
currency
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/security/cash/CashBalanceSecurity.java", "license": "apache-2.0", "size": 8697 }
[ "com.opengamma.util.money.Currency", "org.joda.beans.MetaProperty" ]
import com.opengamma.util.money.Currency; import org.joda.beans.MetaProperty;
import com.opengamma.util.money.*; import org.joda.beans.*;
[ "com.opengamma.util", "org.joda.beans" ]
com.opengamma.util; org.joda.beans;
826,227
public PercolateRequest preference(String preference) { this.preference = preference; return this; } /** * Getter for {@link #getRequest(GetRequest)}
PercolateRequest function(String preference) { this.preference = preference; return this; } /** * Getter for {@link #getRequest(GetRequest)}
/** * Sets the preference to execute the search. Defaults to randomize across shards. Can be set to * <tt>_local</tt> to prefer local shards, <tt>_primary</tt> to execute only on primary shards, or * a custom value, which guarantees that the same order will be used across different requests. */
Sets the preference to execute the search. Defaults to randomize across shards. Can be set to _local to prefer local shards, _primary to execute only on primary shards, or a custom value, which guarantees that the same order will be used across different requests
preference
{ "repo_name": "danielmitterdorfer/elasticsearch", "path": "modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateRequest.java", "license": "apache-2.0", "size": 9171 }
[ "org.elasticsearch.action.get.GetRequest" ]
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.get.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
2,438,392
@Test public void testRBWReplicas() throws IOException { if(LOG.isDebugEnabled()) { LOG.debug("Running " + GenericTestUtils.getMethodName()); } ReplicaRecoveryInfo replica1 = new ReplicaRecoveryInfo(BLOCK_ID, REPLICA_LEN1, GEN_STAMP-1, ReplicaState.RBW); ReplicaRecoveryInfo replica2 = new ReplicaRecoveryInfo(BLOCK_ID, REPLICA_LEN2, GEN_STAMP-2, ReplicaState.RBW); InterDatanodeProtocol dn1 = mock(InterDatanodeProtocol.class); InterDatanodeProtocol dn2 = mock(InterDatanodeProtocol.class); long minLen = Math.min(REPLICA_LEN1, REPLICA_LEN2); testSyncReplicas(replica1, replica2, dn1, dn2, minLen); verify(dn1).updateReplicaUnderRecovery(block, RECOVERY_ID, minLen); verify(dn2).updateReplicaUnderRecovery(block, RECOVERY_ID, minLen); }
void function() throws IOException { if(LOG.isDebugEnabled()) { LOG.debug(STR + GenericTestUtils.getMethodName()); } ReplicaRecoveryInfo replica1 = new ReplicaRecoveryInfo(BLOCK_ID, REPLICA_LEN1, GEN_STAMP-1, ReplicaState.RBW); ReplicaRecoveryInfo replica2 = new ReplicaRecoveryInfo(BLOCK_ID, REPLICA_LEN2, GEN_STAMP-2, ReplicaState.RBW); InterDatanodeProtocol dn1 = mock(InterDatanodeProtocol.class); InterDatanodeProtocol dn2 = mock(InterDatanodeProtocol.class); long minLen = Math.min(REPLICA_LEN1, REPLICA_LEN2); testSyncReplicas(replica1, replica2, dn1, dn2, minLen); verify(dn1).updateReplicaUnderRecovery(block, RECOVERY_ID, minLen); verify(dn2).updateReplicaUnderRecovery(block, RECOVERY_ID, minLen); }
/** * BlockRecovery_02.11. * Two replicas are RBW. * @throws IOException in case of an error */
BlockRecovery_02.11. Two replicas are RBW
testRBWReplicas
{ "repo_name": "Nextzero/hadoop-2.6.0-cdh5.4.3", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java", "license": "apache-2.0", "size": 24984 }
[ "java.io.IOException", "org.apache.hadoop.hdfs.server.common.HdfsServerConstants", "org.apache.hadoop.hdfs.server.protocol.InterDatanodeProtocol", "org.apache.hadoop.hdfs.server.protocol.ReplicaRecoveryInfo", "org.apache.hadoop.test.GenericTestUtils", "org.mockito.Mockito" ]
import java.io.IOException; import org.apache.hadoop.hdfs.server.common.HdfsServerConstants; import org.apache.hadoop.hdfs.server.protocol.InterDatanodeProtocol; import org.apache.hadoop.hdfs.server.protocol.ReplicaRecoveryInfo; import org.apache.hadoop.test.GenericTestUtils; import org.mockito.Mockito;
import java.io.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.protocol.*; import org.apache.hadoop.test.*; import org.mockito.*;
[ "java.io", "org.apache.hadoop", "org.mockito" ]
java.io; org.apache.hadoop; org.mockito;
214,381
public void setCardCycleVolumeLimit(String cardCycleVolumeLimit) { if (StringUtils.isNotBlank(cardCycleVolumeLimit)) { this.cardCycleVolumeLimit = new KualiDecimal(cardCycleVolumeLimit); } else { this.cardCycleVolumeLimit = KualiDecimal.ZERO; } }
void function(String cardCycleVolumeLimit) { if (StringUtils.isNotBlank(cardCycleVolumeLimit)) { this.cardCycleVolumeLimit = new KualiDecimal(cardCycleVolumeLimit); } else { this.cardCycleVolumeLimit = KualiDecimal.ZERO; } }
/** * Sets the cardCycleVolumeLimit attribute. * * @param cardCycleVolumeLimit The cardCycleVolumeLimit to set. */
Sets the cardCycleVolumeLimit attribute
setCardCycleVolumeLimit
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/fp/businessobject/ProcurementCardTransaction.java", "license": "agpl-3.0", "size": 36114 }
[ "org.apache.commons.lang.StringUtils", "org.kuali.rice.core.api.util.type.KualiDecimal" ]
import org.apache.commons.lang.StringUtils; import org.kuali.rice.core.api.util.type.KualiDecimal;
import org.apache.commons.lang.*; import org.kuali.rice.core.api.util.type.*;
[ "org.apache.commons", "org.kuali.rice" ]
org.apache.commons; org.kuali.rice;
2,696,973
protected PropertyState checkProperty(String propertyId) throws XMLConfigurationException { // // Xerces Properties // if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length(); if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() && propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) { return PropertyState.RECOGNIZED; } if (suffixLength == Constants.SCHEMA_LOCATION.length() && propertyId.endsWith(Constants.SCHEMA_LOCATION)) { return PropertyState.RECOGNIZED; } if (suffixLength == Constants.SCHEMA_NONS_LOCATION.length() && propertyId.endsWith(Constants.SCHEMA_NONS_LOCATION)) { return PropertyState.RECOGNIZED; } } if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length(); if (suffixLength == Constants.SCHEMA_SOURCE.length() && propertyId.endsWith(Constants.SCHEMA_SOURCE)) { return PropertyState.RECOGNIZED; } } // special cases if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length(); // // http://xml.org/sax/properties/xml-string // Value type: String // Access: read-only // Get the literal string of characters associated with the // current event. If the parser recognises and supports this // property but is not currently parsing text, it should return // null (this is a good way to check for availability before the // parse begins). // if (suffixLength == Constants.XML_STRING_PROPERTY.length() && propertyId.endsWith(Constants.XML_STRING_PROPERTY)) { // REVISIT - we should probably ask xml-dev for a precise // definition of what this is actually supposed to return, and // in exactly which circumstances. return PropertyState.NOT_SUPPORTED; } } // // Not recognized // return super.checkProperty(propertyId); } // checkProperty(String)
PropertyState function(String propertyId) throws XMLConfigurationException { if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length(); if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() && propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) { return PropertyState.RECOGNIZED; } if (suffixLength == Constants.SCHEMA_LOCATION.length() && propertyId.endsWith(Constants.SCHEMA_LOCATION)) { return PropertyState.RECOGNIZED; } if (suffixLength == Constants.SCHEMA_NONS_LOCATION.length() && propertyId.endsWith(Constants.SCHEMA_NONS_LOCATION)) { return PropertyState.RECOGNIZED; } } if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length(); if (suffixLength == Constants.SCHEMA_SOURCE.length() && propertyId.endsWith(Constants.SCHEMA_SOURCE)) { return PropertyState.RECOGNIZED; } } if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) { final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length(); propertyId.endsWith(Constants.XML_STRING_PROPERTY)) { return PropertyState.NOT_SUPPORTED; } } return super.checkProperty(propertyId); }
/** * Check a property. If the property is know and supported, this method * simply returns. Otherwise, the appropriate exception is thrown. * * @param propertyId The unique identifier (URI) of the property * being set. * * @throws XMLConfigurationException Thrown for configuration error. * In general, components should * only throw this exception if * it is <strong>really</strong> * a critical error. */
Check a property. If the property is know and supported, this method simply returns. Otherwise, the appropriate exception is thrown
checkProperty
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java", "license": "apache-2.0", "size": 64548 }
[ "com.sun.org.apache.xerces.internal.impl.Constants", "com.sun.org.apache.xerces.internal.util.PropertyState", "com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException" ]
import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.util.PropertyState; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
import com.sun.org.apache.xerces.internal.impl.*; import com.sun.org.apache.xerces.internal.util.*; import com.sun.org.apache.xerces.internal.xni.parser.*;
[ "com.sun.org" ]
com.sun.org;
115,771
public synchronized XBridge[] getExistingBridges() throws com.sun.star.uno.RuntimeException { ArrayList<XBridge> vector = new ArrayList<XBridge>(); IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]); if(xBridge != null) vector.add(xBridge); } XBridge xBridges[]= new XBridge[vector.size()]; for(int i = 0; i < vector.size(); ++ i) xBridges[i] = vector.get(i); return xBridges; } private static final class UniqueToken { public UniqueToken() { synchronized (UniqueToken.class) { token = counter.toString(); counter = counter.add(BigInteger.ONE); } }
synchronized XBridge[] function() throws com.sun.star.uno.RuntimeException { ArrayList<XBridge> vector = new ArrayList<XBridge>(); IBridge iBridges[] = UnoRuntime.getBridges(); for(int i = 0; i < iBridges.length; ++ i) { XBridge xBridge = UnoRuntime.queryInterface(XBridge.class, iBridges[i]); if(xBridge != null) vector.add(xBridge); } XBridge xBridges[]= new XBridge[vector.size()]; for(int i = 0; i < vector.size(); ++ i) xBridges[i] = vector.get(i); return xBridges; } private static final class UniqueToken { public UniqueToken() { synchronized (UniqueToken.class) { token = counter.toString(); counter = counter.add(BigInteger.ONE); } }
/** * Gives all created bridges. * * @return the bridges. * @see com.sun.star.bridge.XBridgeFactory */
Gives all created bridges
getExistingBridges
{ "repo_name": "beppec56/core", "path": "jurt/com/sun/star/comp/bridgefactory/BridgeFactory.java", "license": "gpl-3.0", "size": 7935 }
[ "com.sun.star.bridge.XBridge", "com.sun.star.uno.IBridge", "com.sun.star.uno.UnoRuntime", "java.math.BigInteger", "java.util.ArrayList" ]
import com.sun.star.bridge.XBridge; import com.sun.star.uno.IBridge; import com.sun.star.uno.UnoRuntime; import java.math.BigInteger; import java.util.ArrayList;
import com.sun.star.bridge.*; import com.sun.star.uno.*; import java.math.*; import java.util.*;
[ "com.sun.star", "java.math", "java.util" ]
com.sun.star; java.math; java.util;
1,786,678
RelDataType getResultType(String sql);
RelDataType getResultType(String sql);
/** * Returns the data type of the row returned by a SQL query. * * <p>For example, <code>getResultType("VALUES (1, 'foo')")</code> * returns <code>RecordType(INTEGER EXPR$0, CHAR(3) EXPR#1)</code>. */
Returns the data type of the row returned by a SQL query. For example, <code>getResultType("VALUES (1, 'foo')")</code> returns <code>RecordType(INTEGER EXPR$0, CHAR(3) EXPR#1)</code>
getResultType
{ "repo_name": "googleinterns/calcite", "path": "core/src/test/java/org/apache/calcite/test/SqlValidatorTestCase.java", "license": "apache-2.0", "size": 15743 }
[ "org.apache.calcite.rel.type.RelDataType" ]
import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.rel.type.*;
[ "org.apache.calcite" ]
org.apache.calcite;
712,364
public void registerAuthAndAuditEvent(Table table, Privilege priv) { // Add access event for auditing. if (table instanceof View) { View view = (View) table; Preconditions.checkState(!view.isLocalView()); addAccessEvent(new TAccessEvent( table.getFullName(), TCatalogObjectType.VIEW, priv.toString())); } else { addAccessEvent(new TAccessEvent( table.getFullName(), TCatalogObjectType.TABLE, priv.toString())); } // Add privilege request. TableName tableName = table.getTableName(); registerPrivReq(new PrivilegeRequestBuilder() .onTable(tableName.getDb(), tableName.getTbl()) .allOf(priv).toRequest()); } private class ValueTransferGraph { // Represents all bi-directional value transfers. Each disjoint set is a complete // subgraph of value transfers. Maps from a slot id to its set of slots with mutual // value transfers (in the original slot domain). Since the value transfer graph is // a DAG these disjoint sets represent all the strongly connected components. private final DisjointSet<SlotId> completeSubGraphs_ = new DisjointSet<SlotId>(); // Maps each slot id in the original slot domain to a slot id in the new slot domain // created by coalescing complete subgraphs into a single slot, and retaining only // slots that have value transfers. // Used for representing a condensed value-transfer graph with dense slot ids. private int[] coalescedSlots_; // Used for generating slot ids in the new slot domain. private int nextCoalescedSlotId_ = 0; // Condensed DAG of value transfers in the new slot domain. private boolean[][] valueTransfer_; // Number of slots registered at the time when the value transfer graph was // computed. private final int numSlots_ = globalState_.descTbl.getMaxSlotId().asInt() + 1; public int getNumSlots() { return numSlots_; }
void function(Table table, Privilege priv) { if (table instanceof View) { View view = (View) table; Preconditions.checkState(!view.isLocalView()); addAccessEvent(new TAccessEvent( table.getFullName(), TCatalogObjectType.VIEW, priv.toString())); } else { addAccessEvent(new TAccessEvent( table.getFullName(), TCatalogObjectType.TABLE, priv.toString())); } TableName tableName = table.getTableName(); registerPrivReq(new PrivilegeRequestBuilder() .onTable(tableName.getDb(), tableName.getTbl()) .allOf(priv).toRequest()); } private class ValueTransferGraph { private final DisjointSet<SlotId> completeSubGraphs_ = new DisjointSet<SlotId>(); private int[] coalescedSlots_; private int nextCoalescedSlotId_ = 0; private boolean[][] valueTransfer_; private final int numSlots_ = globalState_.descTbl.getMaxSlotId().asInt() + 1; public int getNumSlots() { return numSlots_; }
/** * Registers a table-level privilege request and an access event for auditing * for the given table and privilege. The table must be a base table or a * catalog view (not a local view). */
Registers a table-level privilege request and an access event for auditing for the given table and privilege. The table must be a base table or a catalog view (not a local view)
registerAuthAndAuditEvent
{ "repo_name": "michaelhkw/incubator-impala", "path": "fe/src/main/java/org/apache/impala/analysis/Analyzer.java", "license": "apache-2.0", "size": 126520 }
[ "com.google.common.base.Preconditions", "org.apache.impala.authorization.Privilege", "org.apache.impala.authorization.PrivilegeRequestBuilder", "org.apache.impala.catalog.Table", "org.apache.impala.catalog.View", "org.apache.impala.thrift.TAccessEvent", "org.apache.impala.thrift.TCatalogObjectType", "...
import com.google.common.base.Preconditions; import org.apache.impala.authorization.Privilege; import org.apache.impala.authorization.PrivilegeRequestBuilder; import org.apache.impala.catalog.Table; import org.apache.impala.catalog.View; import org.apache.impala.thrift.TAccessEvent; import org.apache.impala.thrift.TCatalogObjectType; import org.apache.impala.util.DisjointSet;
import com.google.common.base.*; import org.apache.impala.authorization.*; import org.apache.impala.catalog.*; import org.apache.impala.thrift.*; import org.apache.impala.util.*;
[ "com.google.common", "org.apache.impala" ]
com.google.common; org.apache.impala;
2,788,928
public void typeSystemInit(TypeSystem typeSystem) throws AnalysisEngineProcessException { mSentenceType = AnnotatorUtil.getRequiredTypeParameter(context, typeSystem, UimaUtil.SENTENCE_TYPE_PARAMETER); mTokenType = AnnotatorUtil.getRequiredTypeParameter(context, typeSystem, UimaUtil.TOKEN_TYPE_PARAMETER); mParseType = AnnotatorUtil.getRequiredTypeParameter(context, typeSystem, PARSE_TYPE_PARAMETER); mTypeFeature = AnnotatorUtil.getRequiredFeatureParameter(context, mParseType, TYPE_FEATURE_PARAMETER, CAS.TYPE_NAME_STRING); childrenFeature = AnnotatorUtil.getRequiredFeatureParameter(context, mParseType, CHILDREN_FEATURE_PARAMETER, CAS.TYPE_NAME_FS_ARRAY); probabilityFeature = AnnotatorUtil.getOptionalFeatureParameter(context, mParseType, PROBABILITY_FEATURE_PARAMETER, CAS.TYPE_NAME_DOUBLE); }
void function(TypeSystem typeSystem) throws AnalysisEngineProcessException { mSentenceType = AnnotatorUtil.getRequiredTypeParameter(context, typeSystem, UimaUtil.SENTENCE_TYPE_PARAMETER); mTokenType = AnnotatorUtil.getRequiredTypeParameter(context, typeSystem, UimaUtil.TOKEN_TYPE_PARAMETER); mParseType = AnnotatorUtil.getRequiredTypeParameter(context, typeSystem, PARSE_TYPE_PARAMETER); mTypeFeature = AnnotatorUtil.getRequiredFeatureParameter(context, mParseType, TYPE_FEATURE_PARAMETER, CAS.TYPE_NAME_STRING); childrenFeature = AnnotatorUtil.getRequiredFeatureParameter(context, mParseType, CHILDREN_FEATURE_PARAMETER, CAS.TYPE_NAME_FS_ARRAY); probabilityFeature = AnnotatorUtil.getOptionalFeatureParameter(context, mParseType, PROBABILITY_FEATURE_PARAMETER, CAS.TYPE_NAME_DOUBLE); }
/** * Initializes the type system. */
Initializes the type system
typeSystemInit
{ "repo_name": "SowaLabs/OpenNLP", "path": "opennlp-uima/src/main/java/opennlp/uima/parser/Parser.java", "license": "apache-2.0", "size": 11022 }
[ "org.apache.uima.analysis_engine.AnalysisEngineProcessException", "org.apache.uima.cas.TypeSystem" ]
import org.apache.uima.analysis_engine.AnalysisEngineProcessException; import org.apache.uima.cas.TypeSystem;
import org.apache.uima.analysis_engine.*; import org.apache.uima.cas.*;
[ "org.apache.uima" ]
org.apache.uima;
2,289,886
void next() { Iterator<Year> it = years.values().iterator(); while (it.hasNext()) { if (currentYear == it.next() && it.hasNext()) { // go to the next year currentYear = it.next(); break; } } }
void next() { Iterator<Year> it = years.values().iterator(); while (it.hasNext()) { if (currentYear == it.next() && it.hasNext()) { currentYear = it.next(); break; } } }
/** * Go to the next year in the model */
Go to the next year in the model
next
{ "repo_name": "huihoo/olat", "path": "olat7.8/src/main/java/org/olat/presentation/webfeed/navigation/YearNavigationModel.java", "license": "apache-2.0", "size": 5753 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
760,070
public DualListModel<Student> getGroupMembers() { return groupMembers; }
DualListModel<Student> function() { return groupMembers; }
/** * Returns the group members for the current course. * * @return List of group members. */
Returns the group members for the current course
getGroupMembers
{ "repo_name": "stefanoberdoerfer/exmatrikulator", "path": "src/main/java/de/unibremen/opensores/controller/tutorial/TutorialController.java", "license": "agpl-3.0", "size": 25618 }
[ "de.unibremen.opensores.model.Student", "org.primefaces.model.DualListModel" ]
import de.unibremen.opensores.model.Student; import org.primefaces.model.DualListModel;
import de.unibremen.opensores.model.*; import org.primefaces.model.*;
[ "de.unibremen.opensores", "org.primefaces.model" ]
de.unibremen.opensores; org.primefaces.model;
1,576,099
NumberDataValue getDataValue(float value, NumberDataValue previous) throws StandardException;
NumberDataValue getDataValue(float value, NumberDataValue previous) throws StandardException;
/** * Get a SQL real with the given value. Uses the previous value, if non-null, as the data holder to return. * * @exception StandardException Thrown on error */
Get a SQL real with the given value. Uses the previous value, if non-null, as the data holder to return
getDataValue
{ "repo_name": "lpxz/grail-derby104", "path": "java/engine/org/apache/derby/iapi/types/DataValueFactory.java", "license": "apache-2.0", "size": 33852 }
[ "org.apache.derby.iapi.error.StandardException" ]
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.error.*;
[ "org.apache.derby" ]
org.apache.derby;
2,554,023
public @Override void onDisable() { soloQueue.getRunnable().cancel(); for (Arena arena : ArenaManager.getArenas(true)) { // If reloading ... reset every used arena arena.reset(); } }
@Override void function() { soloQueue.getRunnable().cancel(); for (Arena arena : ArenaManager.getArenas(true)) { arena.reset(); } }
/** * Called when Plugin gets disabled */
Called when Plugin gets disabled
onDisable
{ "repo_name": "Cuzoom/Spigot-Plugins", "path": "Duell/src/me/merlin/duell/main/Duell.java", "license": "gpl-3.0", "size": 4691 }
[ "me.merlin.duell.arenas.Arena", "me.merlin.duell.arenas.ArenaManager" ]
import me.merlin.duell.arenas.Arena; import me.merlin.duell.arenas.ArenaManager;
import me.merlin.duell.arenas.*;
[ "me.merlin.duell" ]
me.merlin.duell;
1,110,575
public Observable<ServiceResponse<StreamingLocatorInner>> createWithServiceResponseAsync(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (streamingLocatorName == null) { throw new IllegalArgumentException("Parameter streamingLocatorName is required and cannot be null."); } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); }
Observable<ServiceResponse<StreamingLocatorInner>> function(String resourceGroupName, String accountName, String streamingLocatorName, StreamingLocatorInner parameters) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (accountName == null) { throw new IllegalArgumentException(STR); } if (streamingLocatorName == null) { throw new IllegalArgumentException(STR); } if (parameters == null) { throw new IllegalArgumentException(STR); }
/** * Create a Streaming Locator. * Create a Streaming Locator in the Media Services account. * * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param streamingLocatorName The Streaming Locator name. * @param parameters The request parameters * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StreamingLocatorInner object */
Create a Streaming Locator. Create a Streaming Locator in the Media Services account
createWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/mediaservices/mgmt-v2019_05_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2019_05_01_preview/implementation/StreamingLocatorsInner.java", "license": "mit", "size": 57687 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
624,837
public void setScienceAppName(String scienceAppName, Locale locale, Locale defaultLocale);
void function(String scienceAppName, Locale locale, Locale defaultLocale);
/** * Sets the localized science app name of this simulation in the language, and sets the default locale. * * @param scienceAppName the localized science app name of this simulation * @param locale the locale of the language * @param defaultLocale the default locale */
Sets the localized science app name of this simulation in the language, and sets the default locale
setScienceAppName
{ "repo_name": "queza85/edison", "path": "edison-portal-framework/edison-simulation-portlet/docroot/WEB-INF/service/org/kisti/edison/bestsimulation/model/SimulationModel.java", "license": "gpl-3.0", "size": 18594 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
551,617
public void setCreatedDate(LocalDateTime value) { set(9, value); }
void function(LocalDateTime value) { set(9, value); }
/** * Setter for <code>public.cellared_drink.created_date</code>. */
Setter for <code>public.cellared_drink.created_date</code>
setCreatedDate
{ "repo_name": "CellarHQ/cellarhq.com", "path": "model/src/main/generated/com/cellarhq/generated/tables/records/CellaredDrinkRecord.java", "license": "mit", "size": 15928 }
[ "java.time.LocalDateTime" ]
import java.time.LocalDateTime;
import java.time.*;
[ "java.time" ]
java.time;
1,336,363
public final MetaProperty<String> fieldNonFinal() { return fieldNonFinal; }
final MetaProperty<String> function() { return fieldNonFinal; }
/** * The meta-property for the {@code fieldNonFinal} property. * @return the meta-property, not null */
The meta-property for the fieldNonFinal property
fieldNonFinal
{ "repo_name": "JodaOrg/joda-beans", "path": "src/test/java/org/joda/beans/sample/FinalFieldBean.java", "license": "apache-2.0", "size": 15410 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
1,779,312
private void findColumns(Cursor c, String[] from) { if (c != null) { int i; int count = from.length; if (mFrom == null || mFrom.length != count) { mFrom = new int[count]; } for (i = 0; i < count; i++) { mFrom[i] = c.getColumnIndexOrThrow(from[i]); } } else { mFrom = null; } }
void function(Cursor c, String[] from) { if (c != null) { int i; int count = from.length; if (mFrom == null mFrom.length != count) { mFrom = new int[count]; } for (i = 0; i < count; i++) { mFrom[i] = c.getColumnIndexOrThrow(from[i]); } } else { mFrom = null; } }
/** * Create a map from an array of strings to an array of column-id integers in cursor c. * If c is null, the array will be discarded. * * @param c the cursor to find the columns from * @param from the Strings naming the columns of interest */
Create a map from an array of strings to an array of column-id integers in cursor c. If c is null, the array will be discarded
findColumns
{ "repo_name": "jheske/Popcorn", "path": "app/src/main/java/com/nano/movies/data/SimpleCursorRecyclerAdapter.java", "license": "apache-2.0", "size": 3535 }
[ "android.database.Cursor" ]
import android.database.Cursor;
import android.database.*;
[ "android.database" ]
android.database;
2,744,106
public void removeUpdate(DocumentEvent e) { canRunScript(); }
public void removeUpdate(DocumentEvent e) { canRunScript(); }
/** * Allows the user to run or not the script. * @see DocumentListener#insertUpdate(DocumentEvent) */
Allows the user to run or not the script
insertUpdate
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/util/ui/ScriptingDialog.java", "license": "gpl-2.0", "size": 32492 }
[ "javax.swing.event.DocumentEvent" ]
import javax.swing.event.DocumentEvent;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
1,780,734
public Configuration getConfiguration() { return conf; }
Configuration function() { return conf; }
/** * Get the modified configuration * @return the configuration that has the modified parameters. */
Get the modified configuration
getConfiguration
{ "repo_name": "leechoongyon/HadoopSourceAnalyze", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/GenericOptionsParser.java", "license": "apache-2.0", "size": 18641 }
[ "org.apache.hadoop.conf.Configuration" ]
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
952,694
protected static Map<String, Integer> getPrincipalKeyNumberMap(Map<String, Object> requestSharedDataContext) { if (requestSharedDataContext == null) { return null; } else { Object map = requestSharedDataContext.get(PRINCIPAL_KEY_NUMBER_MAP); if (map == null) { map = new HashMap<String, String>(); requestSharedDataContext.put(PRINCIPAL_KEY_NUMBER_MAP, map); } return (Map<String, Integer>) map; } }
static Map<String, Integer> function(Map<String, Object> requestSharedDataContext) { if (requestSharedDataContext == null) { return null; } else { Object map = requestSharedDataContext.get(PRINCIPAL_KEY_NUMBER_MAP); if (map == null) { map = new HashMap<String, String>(); requestSharedDataContext.put(PRINCIPAL_KEY_NUMBER_MAP, map); } return (Map<String, Integer>) map; } }
/** * Gets the shared principal-to-key_number Map used to store principals and key numbers for * use within the current request context. * <p/> * If the requested Map is not found in requestSharedDataContext, one will be created and stored, * ensuring that a Map will always be returned, assuming requestSharedDataContext is not null. * * @param requestSharedDataContext a Map to be used a shared data among all ServerActions related * to a given request * @return A Map of principals-to-key_numbers */
Gets the shared principal-to-key_number Map used to store principals and key numbers for use within the current request context. If the requested Map is not found in requestSharedDataContext, one will be created and stored, ensuring that a Map will always be returned, assuming requestSharedDataContext is not null
getPrincipalKeyNumberMap
{ "repo_name": "alexryndin/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/KerberosServerAction.java", "license": "apache-2.0", "size": 23624 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,346,098
private String displayedKey( String key ) { Button button = getApp( ).getNifty( ).getCurrentScreen( ).findNiftyControl( key, Button.class ); return button.getText( ); }
String function( String key ) { Button button = getApp( ).getNifty( ).getCurrentScreen( ).findNiftyControl( key, Button.class ); return button.getText( ); }
/** * Gets the displayed text on the button with the name key. * * @param key * @return Displayed text on button key. */
Gets the displayed text on the button with the name key
displayedKey
{ "repo_name": "elliottmb/makhana", "path": "client/src/main/java/trendli/me/makhana/client/ui/OptionsController.java", "license": "apache-2.0", "size": 43131 }
[ "de.lessvoid.nifty.controls.Button" ]
import de.lessvoid.nifty.controls.Button;
import de.lessvoid.nifty.controls.*;
[ "de.lessvoid.nifty" ]
de.lessvoid.nifty;
2,521,637
public static void register(Class<? extends ResourceResolverSpi> className, boolean start) { JavaUtils.checkRegisterPermission(); try { ResourceResolverSpi resourceResolverSpi = className.newInstance(); register(resourceResolverSpi, start); } catch (IllegalAccessException e) { log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it"); } catch (InstantiationException e) { log.log(java.util.logging.Level.WARNING, "Error loading resolver " + className + " disabling it"); } }
static void function(Class<? extends ResourceResolverSpi> className, boolean start) { JavaUtils.checkRegisterPermission(); try { ResourceResolverSpi resourceResolverSpi = className.newInstance(); register(resourceResolverSpi, start); } catch (IllegalAccessException e) { log.log(java.util.logging.Level.WARNING, STR + className + STR); } catch (InstantiationException e) { log.log(java.util.logging.Level.WARNING, STR + className + STR); } }
/** * Registers a ResourceResolverSpi class. This method logs a warning if the class * cannot be registered. * @param className * @param start * @throws SecurityException if a security manager is installed and the * caller does not have permission to register a resource resolver */
Registers a ResourceResolverSpi class. This method logs a warning if the class cannot be registered
register
{ "repo_name": "frohoff/jdk8u-jdk", "path": "src/share/classes/com/sun/org/apache/xml/internal/security/utils/resolver/ResourceResolver.java", "license": "gpl-2.0", "size": 13808 }
[ "com.sun.org.apache.xml.internal.security.utils.JavaUtils" ]
import com.sun.org.apache.xml.internal.security.utils.JavaUtils;
import com.sun.org.apache.xml.internal.security.utils.*;
[ "com.sun.org" ]
com.sun.org;
1,215,559
private static Map<String, String> parseParamsToMap(String[] args){ Map<String, String> params = new HashMap<String, String>(); CommandLineParser parser = new DefaultParser(); Options options = new Options(); options.addOption(Option.builder("multisigAddress").hasArg().build()); options.addOption(Option.builder("cosignatoryPrivateKey").hasArg().build()); options.addOption(Option.builder("recipient").hasArg().build()); options.addOption(Option.builder("amount").hasArg().build()); options.addOption(Option.builder("message").hasArg().build()); options.addOption(Option.builder("mosaicName").hasArg().build()); options.addOption(Option.builder("mosaicQuantity").hasArg().build()); options.addOption(Option.builder("host").hasArg().build()); options.addOption(Option.builder("port").hasArg().build()); options.addOption(Option.builder("h").longOpt("help").build()); options.addOption(Option.builder("ignoreFee").build()); CommandLine commandLine = null; try{ commandLine = parser.parse(options, args); } catch(Exception ex) { OutputMessage.error("invalid parameter"); return null; } // print helper if(commandLine.hasOption("h")){ System.out.println(HelperUtils.printHelper(Constants.HELPER_FILE_INIT_MULTISIG_TRANSACTION)); return null; } // ignore fee if(commandLine.hasOption("ignoreFee")){ params.put("fee", "0"); } String multisigAddress = commandLine.getOptionValue("multisigAddress")==null?"":commandLine.getOptionValue("multisigAddress").replaceAll("-", ""); String cosignatoryPrivateKey = commandLine.getOptionValue("cosignatoryPrivateKey")==null?"":commandLine.getOptionValue("cosignatoryPrivateKey"); String recipient = commandLine.getOptionValue("recipient")==null?"":commandLine.getOptionValue("recipient").replaceAll("-", ""); String amount = commandLine.getOptionValue("amount")==null?"":commandLine.getOptionValue("amount"); String message = commandLine.getOptionValue("message")==null?"":commandLine.getOptionValue("message"); String mosaicName = commandLine.getOptionValue("mosaicName"); String mosaicQuantity = commandLine.getOptionValue("mosaicQuantity"); String host = commandLine.getOptionValue("host"); String port = commandLine.getOptionValue("port"); // check multisigAddress if(multisigAddress.length()!=40){ OutputMessage.error("invalid parameter [multisigAddress]"); return null; } // check recipient if(recipient.length()!=40){ OutputMessage.error("invalid parameter [recipient]"); return null; } // check amount if(!StringUtils.isNumeric(amount) || Long.valueOf(amount).longValue()<0){ OutputMessage.error("invalid parameter [amount]"); return null; } // check message if(message.getBytes().length>320){ OutputMessage.error("invalid parameter [message]"); return null; } // check mosaic name if(mosaicName!=null && !mosaicName.matches("([a-z0-9._-]+):([a-z0-9][a-z0-9'_-]*( [a-z0-9'_-]+)*)")){ OutputMessage.error("invalid parameter [mosaicName]"); return null; } // check mosaic quantity if(mosaicQuantity!=null && !mosaicQuantity.matches("[0-9]+(.[0-9]+)*")){ OutputMessage.error("invalid parameter [mosaicQuantity]"); return null; } // check host if(host!=null && !host.matches("[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)+")){ OutputMessage.error("invalid parameter [host]"); return null; } // check port if(port!=null && !port.matches("[0-9]{1,5}")){ OutputMessage.error("invalid parameter [port]"); return null; } // get cosignatory public key String cosignatoryPublicKey = KeyConvertor.getPublicFromPrivateKey(cosignatoryPrivateKey); if(StringUtils.isEmpty(cosignatoryPublicKey)){ OutputMessage.error("unable to find cosignatory public key from private key"); return null; } // get cosignatory address String cosignatoryAddress = KeyConvertor.getAddressFromPrivateKey(cosignatoryPrivateKey); if(StringUtils.isEmpty(cosignatoryAddress)){ OutputMessage.error("unable to find cosignatory address from private key"); return null; } params.put("multisigAddress", multisigAddress); params.put("cosignatoryAddress", cosignatoryAddress); params.put("cosignatoryPublicKey", cosignatoryPublicKey); params.put("cosignatoryPrivateKey", cosignatoryPrivateKey); params.put("recipient", recipient); params.put("amount", amount); params.put("message", message); params.put("mosaicName", mosaicName); params.put("mosaicQuantity", mosaicQuantity); params.put("host", host); params.put("port", port); return params; }
static Map<String, String> function(String[] args){ Map<String, String> params = new HashMap<String, String>(); CommandLineParser parser = new DefaultParser(); Options options = new Options(); options.addOption(Option.builder(STR).hasArg().build()); options.addOption(Option.builder(STR).hasArg().build()); options.addOption(Option.builder(STR).hasArg().build()); options.addOption(Option.builder(STR).hasArg().build()); options.addOption(Option.builder(STR).hasArg().build()); options.addOption(Option.builder(STR).hasArg().build()); options.addOption(Option.builder(STR).hasArg().build()); options.addOption(Option.builder("host").hasArg().build()); options.addOption(Option.builder("port").hasArg().build()); options.addOption(Option.builder("h").longOpt("help").build()); options.addOption(Option.builder(STR).build()); CommandLine commandLine = null; try{ commandLine = parser.parse(options, args); } catch(Exception ex) { OutputMessage.error(STR); return null; } if(commandLine.hasOption("h")){ System.out.println(HelperUtils.printHelper(Constants.HELPER_FILE_INIT_MULTISIG_TRANSACTION)); return null; } if(commandLine.hasOption(STR)){ params.put("feeSTR0"); } String multisigAddress = commandLine.getOptionValue(STR)==null?"":commandLine.getOptionValue(STR).replaceAll("-STR"); String cosignatoryPrivateKey = commandLine.getOptionValue(STR)==null?"":commandLine.getOptionValue(STR); String recipient = commandLine.getOptionValue(STR)==null?"":commandLine.getOptionValue(STR).replaceAll("-STR"); String amount = commandLine.getOptionValue(STR)==null?"":commandLine.getOptionValue(STR); String message = commandLine.getOptionValue(STR)==null?"":commandLine.getOptionValue(STR); String mosaicName = commandLine.getOptionValue(STR); String mosaicQuantity = commandLine.getOptionValue(STR); String host = commandLine.getOptionValue("hostSTRportSTRinvalid parameter [multisigAddress]STRinvalid parameter [recipient]STRinvalid parameter [amount]STRinvalid parameter [message]STR([a-z0-9._-]+):([a-z0-9][a-z0-9'_-]*( [a-z0-9'_-]+)*)STRinvalid parameter [mosaicName]STR[0-9]+(.[0-9]+)*STRinvalid parameter [mosaicQuantity]STR[0-9a-zA-Z]+(\\.[0-9a-zA-Z]+)+STRinvalid parameter [host]STR[0-9]{1,5}STRinvalid parameter [port]STRunable to find cosignatory public key from private keySTRunable to find cosignatory address from private key"); return null; } params.put(STR, multisigAddress); params.put("cosignatoryAddressSTRcosignatoryPublicKey", cosignatoryPublicKey); params.put(STR, cosignatoryPrivateKey); params.put(STR, recipient); params.put(STR, amount); params.put(STR, message); params.put(STR, mosaicName); params.put(STR, mosaicQuantity); params.put("hostSTRport", port); return params; }
/** * parse parameters * @param args * @return */
parse parameters
parseParamsToMap
{ "repo_name": "NEMChina/nem-apps", "path": "src/com/dfintech/nem/apps/ImplInitMultisigTransaction.java", "license": "mit", "size": 9793 }
[ "com.dfintech.nem.apps.utils.Constants", "com.dfintech.nem.apps.utils.HelperUtils", "com.dfintech.nem.apps.utils.OutputMessage", "java.util.HashMap", "java.util.Map", "org.apache.commons.cli.CommandLine", "org.apache.commons.cli.CommandLineParser", "org.apache.commons.cli.DefaultParser", "org.apache...
import com.dfintech.nem.apps.utils.Constants; import com.dfintech.nem.apps.utils.HelperUtils; import com.dfintech.nem.apps.utils.OutputMessage; import java.util.HashMap; import java.util.Map; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; import org.apache.commons.cli.Option; import org.apache.commons.cli.Options;
import com.dfintech.nem.apps.utils.*; import java.util.*; import org.apache.commons.cli.*;
[ "com.dfintech.nem", "java.util", "org.apache.commons" ]
com.dfintech.nem; java.util; org.apache.commons;
2,346,959
public DateTimeFormatterBuilder appendDecimal( DateTimeFieldType fieldType, int minDigits, int maxDigits) { if (fieldType == null) { throw new IllegalArgumentException("Field type must not be null"); } if (maxDigits < minDigits) { maxDigits = minDigits; } if (minDigits < 0 || maxDigits <= 0) { throw new IllegalArgumentException(); } if (minDigits <= 1) { return append0(new UnpaddedNumber(fieldType, maxDigits, false)); } else { return append0(new PaddedNumber(fieldType, maxDigits, false, minDigits)); } }
DateTimeFormatterBuilder function( DateTimeFieldType fieldType, int minDigits, int maxDigits) { if (fieldType == null) { throw new IllegalArgumentException(STR); } if (maxDigits < minDigits) { maxDigits = minDigits; } if (minDigits < 0 maxDigits <= 0) { throw new IllegalArgumentException(); } if (minDigits <= 1) { return append0(new UnpaddedNumber(fieldType, maxDigits, false)); } else { return append0(new PaddedNumber(fieldType, maxDigits, false, minDigits)); } }
/** * Instructs the printer to emit a field value as a decimal number, and the * parser to expect an unsigned decimal number. * * @param fieldType type of field to append * @param minDigits minimum number of digits to <i>print</i> * @param maxDigits maximum number of digits to <i>parse</i>, or the estimated * maximum number of digits to print * @return this DateTimeFormatterBuilder, for chaining * @throws IllegalArgumentException if field type is null */
Instructs the printer to emit a field value as a decimal number, and the parser to expect an unsigned decimal number
appendDecimal
{ "repo_name": "PavelSozonov/JodaTimeTesting", "path": "src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java", "license": "apache-2.0", "size": 101830 }
[ "org.joda.time.DateTimeFieldType" ]
import org.joda.time.DateTimeFieldType;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
1,977,833
public void addFilenameChangedListener( FilenameChangedListener listener ) { if ( filenameChangedListeners == null ) { filenameChangedListeners = new ArrayList<FilenameChangedListener>(); } filenameChangedListeners.add( listener ); }
void function( FilenameChangedListener listener ) { if ( filenameChangedListeners == null ) { filenameChangedListeners = new ArrayList<FilenameChangedListener>(); } filenameChangedListeners.add( listener ); }
/** * Adds the filename changed listener. * * @param listener * the listener */
Adds the filename changed listener
addFilenameChangedListener
{ "repo_name": "codek/pentaho-kettle", "path": "engine/src/org/pentaho/di/base/AbstractMeta.java", "license": "apache-2.0", "size": 46271 }
[ "java.util.ArrayList", "org.pentaho.di.core.listeners.FilenameChangedListener" ]
import java.util.ArrayList; import org.pentaho.di.core.listeners.FilenameChangedListener;
import java.util.*; import org.pentaho.di.core.listeners.*;
[ "java.util", "org.pentaho.di" ]
java.util; org.pentaho.di;
765,123
public DataNode setThicknessScalar(Double thickness);
DataNode function(Double thickness);
/** * sample thickness * <p> * <b>Type:</b> NX_FLOAT * <b>Units:</b> NX_LENGTH * </p> * * @param thickness the thickness */
sample thickness Type: NX_FLOAT Units: NX_LENGTH
setThicknessScalar
{ "repo_name": "xen-0/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXsample.java", "license": "epl-1.0", "size": 49075 }
[ "org.eclipse.dawnsci.analysis.api.tree.DataNode" ]
import org.eclipse.dawnsci.analysis.api.tree.DataNode;
import org.eclipse.dawnsci.analysis.api.tree.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
1,097,880
@Override public Sha1HashCode computeSha1(Path pathRelativeToProjectRootOrJustAbsolute) throws IOException { if (!exists(pathRelativeToProjectRootOrJustAbsolute)) { throw new NoSuchFileException(pathRelativeToProjectRootOrJustAbsolute.toString()); } // Because this class is a fake, the file contents may not be available as a stream, so we load // all of the contents into memory as a byte[] and then hash them. byte[] fileContents = getFileBytes(pathRelativeToProjectRootOrJustAbsolute); HashCode hashCode = Hashing.sha1().newHasher().putBytes(fileContents).hash(); return Sha1HashCode.fromHashCode(hashCode); }
Sha1HashCode function(Path pathRelativeToProjectRootOrJustAbsolute) throws IOException { if (!exists(pathRelativeToProjectRootOrJustAbsolute)) { throw new NoSuchFileException(pathRelativeToProjectRootOrJustAbsolute.toString()); } byte[] fileContents = getFileBytes(pathRelativeToProjectRootOrJustAbsolute); HashCode hashCode = Hashing.sha1().newHasher().putBytes(fileContents).hash(); return Sha1HashCode.fromHashCode(hashCode); }
/** * Does not support symlinks. */
Does not support symlinks
computeSha1
{ "repo_name": "davido/buck", "path": "test/com/facebook/buck/testutil/FakeProjectFilesystem.java", "license": "apache-2.0", "size": 25123 }
[ "com.facebook.buck.util.sha1.Sha1HashCode", "com.google.common.hash.HashCode", "com.google.common.hash.Hashing", "java.io.IOException", "java.nio.file.NoSuchFileException", "java.nio.file.Path" ]
import com.facebook.buck.util.sha1.Sha1HashCode; import com.google.common.hash.HashCode; import com.google.common.hash.Hashing; import java.io.IOException; import java.nio.file.NoSuchFileException; import java.nio.file.Path;
import com.facebook.buck.util.sha1.*; import com.google.common.hash.*; import java.io.*; import java.nio.file.*;
[ "com.facebook.buck", "com.google.common", "java.io", "java.nio" ]
com.facebook.buck; com.google.common; java.io; java.nio;
2,631,896
public void addColumn(String name, String expr) { throw new UnsupportedOperationException(); } // -- Client Properties --------------------------------------------------- private HashMap m_props; private SwingPropertyChangeSupport m_propSupport;
void function(String name, String expr) { throw new UnsupportedOperationException(); } private HashMap m_props; private SwingPropertyChangeSupport m_propSupport;
/** * Unsupported by default. * @see prefuse.data.tuple.TupleSet#addColumn(java.lang.String, java.lang.String) */
Unsupported by default
addColumn
{ "repo_name": "giacomovagni/Prefuse", "path": "src/prefuse/data/tuple/AbstractTupleSet.java", "license": "bsd-3-clause", "size": 10056 }
[ "java.util.HashMap", "javax.swing.event.SwingPropertyChangeSupport" ]
import java.util.HashMap; import javax.swing.event.SwingPropertyChangeSupport;
import java.util.*; import javax.swing.event.*;
[ "java.util", "javax.swing" ]
java.util; javax.swing;
1,731,025
protected static GridCacheAdapter<IgniteUuid, IgfsEntryInfo> getMetaCache(IgniteFileSystem igfs) { String dataCacheName = igfs.configuration().getMetaCacheConfiguration().getName(); IgniteEx igniteEx = ((IgfsEx)igfs).context().kernalContext().grid(); return ((IgniteKernal)igniteEx).internalCache(dataCacheName); }
static GridCacheAdapter<IgniteUuid, IgfsEntryInfo> function(IgniteFileSystem igfs) { String dataCacheName = igfs.configuration().getMetaCacheConfiguration().getName(); IgniteEx igniteEx = ((IgfsEx)igfs).context().kernalContext().grid(); return ((IgniteKernal)igniteEx).internalCache(dataCacheName); }
/** * Gets meta cache. * * @param igfs The IGFS instance. * @return The data cache. */
Gets meta cache
getMetaCache
{ "repo_name": "shroman/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractBaseSelfTest.java", "license": "apache-2.0", "size": 33036 }
[ "org.apache.ignite.IgniteFileSystem", "org.apache.ignite.internal.IgniteEx", "org.apache.ignite.internal.IgniteKernal", "org.apache.ignite.internal.processors.cache.GridCacheAdapter", "org.apache.ignite.lang.IgniteUuid" ]
import org.apache.ignite.IgniteFileSystem; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteKernal; import org.apache.ignite.internal.processors.cache.GridCacheAdapter; import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.*; import org.apache.ignite.internal.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.lang.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,861,848
ServiceCall<Void> delete204Async(final ServiceCallback<Void> serviceCallback);
ServiceCall<Void> delete204Async(final ServiceCallback<Void> serviceCallback);
/** * Delete true Boolean value in request returns 204 (no content). * * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */
Delete true Boolean value in request returns 204 (no content)
delete204Async
{ "repo_name": "yugangw-msft/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/HttpSuccess.java", "license": "mit", "size": 30999 }
[ "com.microsoft.rest.ServiceCall", "com.microsoft.rest.ServiceCallback" ]
import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,624,157
public boolean invokeFunction(String funcName, Object[] params) { // Run script if it is dirty. This makes sure the script is run // on the same thread as the caller (suppose the caller is always // calling from the same thread). checkDirty(); // Skip bad functions if (isBadFunction(funcName)) { return false; } String statement = getInvokeStatementCached(funcName, params); Bindings localBindings = null; synchronized (mEngineLock) { localBindings = mLocalEngine.getBindings(ScriptContext.ENGINE_SCOPE); if (localBindings == null) { localBindings = mLocalEngine.createBindings(); mLocalEngine.setBindings(localBindings, ScriptContext.ENGINE_SCOPE); } } fillBindings(localBindings, params); try { mLocalEngine.eval(statement); } catch (ScriptException e) { // The function is either undefined or throws, avoid invoking it later addBadFunction(funcName); return false; } finally { removeBindings(localBindings, params); } return true; }
boolean function(String funcName, Object[] params) { checkDirty(); if (isBadFunction(funcName)) { return false; } String statement = getInvokeStatementCached(funcName, params); Bindings localBindings = null; synchronized (mEngineLock) { localBindings = mLocalEngine.getBindings(ScriptContext.ENGINE_SCOPE); if (localBindings == null) { localBindings = mLocalEngine.createBindings(); mLocalEngine.setBindings(localBindings, ScriptContext.ENGINE_SCOPE); } } fillBindings(localBindings, params); try { mLocalEngine.eval(statement); } catch (ScriptException e) { addBadFunction(funcName); return false; } finally { removeBindings(localBindings, params); } return true; }
/** * Invokes a function defined in the script. * * @param funcName * The function name. * @param params * The parameter array. * @return * A boolean value representing whether the function is * executed correctly. If the function cannot be found, or * parameters don't match, {@code false} is returned. */
Invokes a function defined in the script
invokeFunction
{ "repo_name": "parthmehta209/GearVRf", "path": "GVRf/Framework/framework/src/main/java/org/gearvrf/script/GVRScriptFile.java", "license": "apache-2.0", "size": 8925 }
[ "javax.script.Bindings", "javax.script.ScriptContext", "javax.script.ScriptException" ]
import javax.script.Bindings; import javax.script.ScriptContext; import javax.script.ScriptException;
import javax.script.*;
[ "javax.script" ]
javax.script;
136,098
static String getStringValue(Node n) { // TODO(user): regex literals as well. switch (n.getType()) { case Token.STRING: case Token.STRING_KEY: return n.getString(); case Token.NAME: String name = n.getString(); if ("undefined".equals(name) || "Infinity".equals(name) || "NaN".equals(name)) { return name; } break; case Token.NUMBER: return getStringValue(n.getDouble()); case Token.FALSE: return "false"; case Token.TRUE: return "true"; case Token.NULL: return "null"; case Token.VOID: return "undefined"; case Token.NOT: TernaryValue child = getPureBooleanValue(n.getFirstChild()); if (child != TernaryValue.UNKNOWN) { return child.toBoolean(true) ? "false" : "true"; // reversed. } break; case Token.ARRAYLIT: return arrayToString(n); case Token.OBJECTLIT: return "[object Object]"; } return null; }
static String getStringValue(Node n) { switch (n.getType()) { case Token.STRING: case Token.STRING_KEY: return n.getString(); case Token.NAME: String name = n.getString(); if (STR.equals(name) STR.equals(name) "NaN".equals(name)) { return name; } break; case Token.NUMBER: return getStringValue(n.getDouble()); case Token.FALSE: return "false"; case Token.TRUE: return "true"; case Token.NULL: return "null"; case Token.VOID: return STR; case Token.NOT: TernaryValue child = getPureBooleanValue(n.getFirstChild()); if (child != TernaryValue.UNKNOWN) { return child.toBoolean(true) ? "false" : "true"; } break; case Token.ARRAYLIT: return arrayToString(n); case Token.OBJECTLIT: return STR; } return null; }
/** * Gets the value of a node as a String, or null if it cannot be converted. * When it returns a non-null String, this method effectively emulates the * <code>String()</code> JavaScript cast function. */
Gets the value of a node as a String, or null if it cannot be converted. When it returns a non-null String, this method effectively emulates the <code>String()</code> JavaScript cast function
getStringValue
{ "repo_name": "martinrosstmc/closure-compiler", "path": "src/com/google/javascript/jscomp/NodeUtil.java", "license": "apache-2.0", "size": 99366 }
[ "com.google.javascript.rhino.Node", "com.google.javascript.rhino.Token", "com.google.javascript.rhino.jstype.TernaryValue" ]
import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; import com.google.javascript.rhino.jstype.TernaryValue;
import com.google.javascript.rhino.*; import com.google.javascript.rhino.jstype.*;
[ "com.google.javascript" ]
com.google.javascript;
852,945
public boolean loadDocument(Document doc) { Node classNode = doc.getElementsByTagName("classes").item(0); Node stationNode = doc.getElementsByTagName("stations").item(0); NodeList descList = doc.getElementsByTagName("description"); NodeList solList = doc.getElementsByTagName("solutions"); //load description if (descList.item(0) != null) { if (!loadDescription((Element) descList.item(0))) { //description loading failed! return false; } } else { description = ""; } //NEW //@author Stefano Omini //load classes if (classNode != null) { if (!loadClasses(classNode)) { //classes loading failed! return false; } } //load stations if (stationNode != null) { if (!loadStations(stationNode)) { //stations loading failed! return false; } } //end NEW //load solution if (solList.item(0) != null) { if (!loadSolution((Element) solList.item(0))) { return false; } hasResults = true; } // compute flags resize(stations, classes); changed = false; return true; }
boolean function(Document doc) { Node classNode = doc.getElementsByTagName(STR).item(0); Node stationNode = doc.getElementsByTagName(STR).item(0); NodeList descList = doc.getElementsByTagName(STR); NodeList solList = doc.getElementsByTagName(STR); if (descList.item(0) != null) { if (!loadDescription((Element) descList.item(0))) { return false; } } else { description = ""; } if (classNode != null) { if (!loadClasses(classNode)) { return false; } } if (stationNode != null) { if (!loadStations(stationNode)) { return false; } } if (solList.item(0) != null) { if (!loadSolution((Element) solList.item(0))) { return false; } hasResults = true; } resize(stations, classes); changed = false; return true; }
/** * load the state of this object from the Document. * @return true if the operation was successful. * WARNING: If the operation fails the object is left in an incorrect state and should be discarded. */
load the state of this object from the Document
loadDocument
{ "repo_name": "HOMlab/QN-ACTR-Release", "path": "QN-ACTR Java/src/jmt/gui/jaba/JabaModel.java", "license": "lgpl-3.0", "size": 43723 }
[ "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Node", "org.w3c.dom.NodeList" ]
import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,337,041
public void removeHeaderNamed(String name) { List<Integer> removeIndices = new ArrayList<>(); for (int i = getHeaders().size() - 1; i >= 0; i--) { Header header = (Header) getHeaders().get(i).getObjectValue(); if (header == null) { continue; } if (header.getName().equalsIgnoreCase(name)) { removeIndices.add(Integer.valueOf(i)); } } for (Integer indice : removeIndices) { getHeaders().remove(indice.intValue()); } }
void function(String name) { List<Integer> removeIndices = new ArrayList<>(); for (int i = getHeaders().size() - 1; i >= 0; i--) { Header header = (Header) getHeaders().get(i).getObjectValue(); if (header == null) { continue; } if (header.getName().equalsIgnoreCase(name)) { removeIndices.add(Integer.valueOf(i)); } } for (Integer indice : removeIndices) { getHeaders().remove(indice.intValue()); } }
/** * Remove from Headers the header named name * @param name header name */
Remove from Headers the header named name
removeHeaderNamed
{ "repo_name": "johrstrom/cloud-meter", "path": "cloud-meter-protocols/src/main/java/org/apache/jmeter/protocol/http/control/HeaderManager.java", "license": "apache-2.0", "size": 10566 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,583,733
public Map<String, ?> dealiasListTypeKeyValueMap( Map<String, ?> aliasedKeyValueMap) { LinkedHashMap<String, Object> keyValueMap = new LinkedHashMap<>( aliasedKeyValueMap.size()); for (String alias : aliasedKeyValueMap.keySet()) { Object value = aliasedKeyValueMap.get(alias); String key = this.getListTypeKeyForAlias(alias); keyValueMap.put(key, value); } return keyValueMap; }
Map<String, ?> function( Map<String, ?> aliasedKeyValueMap) { LinkedHashMap<String, Object> keyValueMap = new LinkedHashMap<>( aliasedKeyValueMap.size()); for (String alias : aliasedKeyValueMap.keySet()) { Object value = aliasedKeyValueMap.get(alias); String key = this.getListTypeKeyForAlias(alias); keyValueMap.put(key, value); } return keyValueMap; }
/** * De-Aliases a list-type key-value map. * * @param aliasedKeyValueMap * the aliased key-value map. * @return a de-aliased key-value map. */
De-Aliases a list-type key-value map
dealiasListTypeKeyValueMap
{ "repo_name": "aftenkap/jutility", "path": "jutility-incubation/src/main/java/org/jutility/io/database/ListPropertyInfo.java", "license": "apache-2.0", "size": 12350 }
[ "java.util.LinkedHashMap", "java.util.Map" ]
import java.util.LinkedHashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
152,857
public void setWithAttributes(final MultipleWithAttributes attributes) { if (withAttributesPath == null) { withAttributesPath = new WithAttributesPath(); } if (attributes != null) { withAttributesPath.setWithAttributes(attributes); } }
void function(final MultipleWithAttributes attributes) { if (withAttributesPath == null) { withAttributesPath = new WithAttributesPath(); } if (attributes != null) { withAttributesPath.setWithAttributes(attributes); } }
/** * Sets the with attributes for this group if it has any. Also creates * the with attribute path, to store the attributes in. * * @param attributes * the attribute to be added. * */
Sets the with attributes for this group if it has any. Also creates the with attribute path, to store the attributes in
setWithAttributes
{ "repo_name": "eroslevi/titan.EclipsePlug-ins", "path": "org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/definitions/Group.java", "license": "epl-1.0", "size": 29708 }
[ "org.eclipse.titan.designer.AST" ]
import org.eclipse.titan.designer.AST;
import org.eclipse.titan.designer.*;
[ "org.eclipse.titan" ]
org.eclipse.titan;
1,853,051
public void describeTo(Description description) { description.appendText("a properly defined utility class"); }
void function(Description description) { description.appendText(STR); }
/** * Describe the source object that caused an error, using a Hamcrest * Matcher style interface. In this case, it always returns * that we are looking for a properly defined utility class. * * @param description the Description object to use to report the "to" * object */
Describe the source object that caused an error, using a Hamcrest Matcher style interface. In this case, it always returns that we are looking for a properly defined utility class
describeTo
{ "repo_name": "gkatsikas/onos", "path": "utils/junit/src/main/java/org/onlab/junit/UtilityClassChecker.java", "license": "apache-2.0", "size": 5355 }
[ "org.hamcrest.Description" ]
import org.hamcrest.Description;
import org.hamcrest.*;
[ "org.hamcrest" ]
org.hamcrest;
2,545,005
@Test public void testSetDefaultLookupsNull() { params.setDefaultLookups(new ArrayList<Lookup>()); params.setDefaultLookups(null); assertFalse("Found key", params.getParameters().containsKey("defaultLookups")); }
void function() { params.setDefaultLookups(new ArrayList<Lookup>()); params.setDefaultLookups(null); assertFalse(STR, params.getParameters().containsKey(STR)); }
/** * Tests whether null values are handled by setDefaultLookups(). */
Tests whether null values are handled by setDefaultLookups()
testSetDefaultLookupsNull
{ "repo_name": "mohanaraosv/commons-configuration", "path": "src/test/java/org/apache/commons/configuration2/builder/TestBasicBuilderParameters.java", "license": "apache-2.0", "size": 19798 }
[ "java.util.ArrayList", "org.apache.commons.configuration2.interpol.Lookup", "org.junit.Assert" ]
import java.util.ArrayList; import org.apache.commons.configuration2.interpol.Lookup; import org.junit.Assert;
import java.util.*; import org.apache.commons.configuration2.interpol.*; import org.junit.*;
[ "java.util", "org.apache.commons", "org.junit" ]
java.util; org.apache.commons; org.junit;
616,150
void onVideoDisabled(DecoderCounters counters); final class EventDispatcher { private final Handler handler; private final VideoRendererEventListener listener; public EventDispatcher(Handler handler, VideoRendererEventListener listener) { this.handler = listener != null ? Assertions.checkNotNull(handler) : null; this.listener = listener; }
void onVideoDisabled(DecoderCounters counters); final class EventDispatcher { private final Handler handler; private final VideoRendererEventListener listener; public EventDispatcher(Handler handler, VideoRendererEventListener listener) { this.handler = listener != null ? Assertions.checkNotNull(handler) : null; this.listener = listener; }
/** * Called when the renderer is disabled. * * @param counters {@link DecoderCounters} that were updated by the renderer. */
Called when the renderer is disabled
onVideoDisabled
{ "repo_name": "ClubCom/AndroidExoPlayer", "path": "library/src/main/java/com/google/android/exoplayer2/video/VideoRendererEventListener.java", "license": "apache-2.0", "size": 8026 }
[ "android.os.Handler", "com.google.android.exoplayer2.decoder.DecoderCounters", "com.google.android.exoplayer2.util.Assertions" ]
import android.os.Handler; import com.google.android.exoplayer2.decoder.DecoderCounters; import com.google.android.exoplayer2.util.Assertions;
import android.os.*; import com.google.android.exoplayer2.decoder.*; import com.google.android.exoplayer2.util.*;
[ "android.os", "com.google.android" ]
android.os; com.google.android;
1,177,849
private void startProducer(MqttMessageProducer publisher) { logger.trace("Starting message producer for broker '{}'", name); publisher.setSenderChannel(new MqttSenderChannel() {
void function(MqttMessageProducer publisher) { logger.trace(STR, name); publisher.setSenderChannel(new MqttSenderChannel() {
/** * Start a registered producer, so that it can start sending messages. * * @param publisher * to start */
Start a registered producer, so that it can start sending messages
startProducer
{ "repo_name": "falkena/openhab", "path": "bundles/io/org.openhab.io.transport.mqtt/src/main/java/org/openhab/io/transport/mqtt/internal/MqttBrokerConnection.java", "license": "epl-1.0", "size": 20258 }
[ "org.openhab.io.transport.mqtt.MqttMessageProducer", "org.openhab.io.transport.mqtt.MqttSenderChannel" ]
import org.openhab.io.transport.mqtt.MqttMessageProducer; import org.openhab.io.transport.mqtt.MqttSenderChannel;
import org.openhab.io.transport.mqtt.*;
[ "org.openhab.io" ]
org.openhab.io;
1,712,994
@Test public void testInit() { assertSame(course, participantsController.getCourse()); assertSame(loggedIn, participantsController.getLoggedInUser()); assertEquals(course.getDefaultParticipationType().getPartTypeId(), participantsController.getSelectedParticipationTypeId(), DELTA_PART_TYPE_ID); assertTrue(participantsController.isLoggedInUserCanManageStudents()); }
void function() { assertSame(course, participantsController.getCourse()); assertSame(loggedIn, participantsController.getLoggedInUser()); assertEquals(course.getDefaultParticipationType().getPartTypeId(), participantsController.getSelectedParticipationTypeId(), DELTA_PART_TYPE_ID); assertTrue(participantsController.isLoggedInUserCanManageStudents()); }
/** * Tests if the mocked dependencies got injected properly, and the test * data is in the participantsController. * Tests if the participation type id which got selected corresponds to the * first participation type id. */
Tests if the mocked dependencies got injected properly, and the test data is in the participantsController. Tests if the participation type id which got selected corresponds to the first participation type id
testInit
{ "repo_name": "stefanoberdoerfer/exmatrikulator", "path": "src/test/java/de/unibremen/opensores/controller/ParticipantsControllerTest.java", "license": "agpl-3.0", "size": 32777 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
771,244
@Override public void bestSaved(Solution<V, T> solution) { super.bestSaved(solution); if (Math.abs(iBestValue - solution.getBestValue()) >= 1.0) { iLastImprovingIter = iIter; iBestValue = solution.getBestValue(); } } }
void function(Solution<V, T> solution) { super.bestSaved(solution); if (Math.abs(iBestValue - solution.getBestValue()) >= 1.0) { iLastImprovingIter = iIter; iBestValue = solution.getBestValue(); } } }
/** * Memorize the iteration when the last best solution was found. */
Memorize the iteration when the last best solution was found
bestSaved
{ "repo_name": "UniTime/cpsolver", "path": "src/org/cpsolver/ifs/algorithms/SimulatedAnnealing.java", "license": "lgpl-3.0", "size": 19116 }
[ "org.cpsolver.ifs.solution.Solution" ]
import org.cpsolver.ifs.solution.Solution;
import org.cpsolver.ifs.solution.*;
[ "org.cpsolver.ifs" ]
org.cpsolver.ifs;
502,849
List<VmTemplate> getAllTemplatesWithDisksOnOtherStorageDomain(Guid storageDomainGuid);
List<VmTemplate> getAllTemplatesWithDisksOnOtherStorageDomain(Guid storageDomainGuid);
/** * Retrieves all templates which contains disks on other Storage Domain other then the storageDomain GUID. * * @param storageDomainGuid * the storage domain GUID * @return List of Templates */
Retrieves all templates which contains disks on other Storage Domain other then the storageDomain GUID
getAllTemplatesWithDisksOnOtherStorageDomain
{ "repo_name": "OpenUniversity/ovirt-engine", "path": "backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDao.java", "license": "apache-2.0", "size": 8008 }
[ "java.util.List", "org.ovirt.engine.core.common.businessentities.VmTemplate", "org.ovirt.engine.core.compat.Guid" ]
import java.util.List; import org.ovirt.engine.core.common.businessentities.VmTemplate; import org.ovirt.engine.core.compat.Guid;
import java.util.*; import org.ovirt.engine.core.common.businessentities.*; import org.ovirt.engine.core.compat.*;
[ "java.util", "org.ovirt.engine" ]
java.util; org.ovirt.engine;
2,613,119
@Test public void TestMapping() { if (false) { Date PURE_GREGORIAN = new Date(Long.MIN_VALUE); Date PURE_JULIAN = new Date(Long.MAX_VALUE); GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); final int EPOCH_JULIAN = 2440588; final long ONE_DAY = 24*60*60*1000L; android.icu.text.SimpleDateFormat fmt = new android.icu.text.SimpleDateFormat("EEE MMM dd yyyy G"); for (int type=0; type<2; ++type) { System.out.println(type==0 ? "Gregorian" : "Julian"); cal.setGregorianChange(type==0 ? PURE_GREGORIAN : PURE_JULIAN); fmt.setCalendar(cal); int[] J = { 0x7FFFFFFF, 0x7FFFFFF0, 0x7F000000, 0x78000000, 0x70000000, 0x60000000, 0x50000000, 0x40000000, 0x30000000, 0x20000000, 0x10000000, }; for (int i=0; i<J.length; ++i) { String[] lim = new String[2]; long[] ms = new long[2]; int jd = J[i]; for (int sign=0; sign<2; ++sign) { int julian = jd; if (sign==0) julian = -julian; long millis = ((long)julian - EPOCH_JULIAN) * ONE_DAY; ms[sign] = millis; cal.setTime(new Date(millis)); lim[sign] = fmt.format(cal.getTime()); } System.out.println("JD +/-" + Long.toString(jd, 16) + ": " + ms[0] + ".." + ms[1] + ": " + lim[0] + ".." + lim[1]); } } } TimeZone saveZone = TimeZone.getDefault(); try { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); //NEWCAL Date PURE_GREGORIAN = new Date(Long.MIN_VALUE); Date PURE_JULIAN = new Date(Long.MAX_VALUE); GregorianCalendar cal = new GregorianCalendar(); final int EPOCH_JULIAN = 2440588; final long ONE_DAY = 24*60*60*1000L; int[] DATA = { // Julian# Year Month DOM JULIAN:Year, Month, DOM 2440588, 1970, Calendar.JANUARY, 1, 1969, Calendar.DECEMBER, 19, 2415080, 1900, Calendar.MARCH, 1, 1900, Calendar.FEBRUARY, 17, 2451604, 2000, Calendar.FEBRUARY, 29, 2000, Calendar.FEBRUARY, 16, 2452269, 2001, Calendar.DECEMBER, 25, 2001, Calendar.DECEMBER, 12, 2416526, 1904, Calendar.FEBRUARY, 15, 1904, Calendar.FEBRUARY, 2, 2416656, 1904, Calendar.JUNE, 24, 1904, Calendar.JUNE, 11, 1721426, 1, Calendar.JANUARY, 1, 1, Calendar.JANUARY, 3, 2000000, 763, Calendar.SEPTEMBER, 18, 763, Calendar.SEPTEMBER, 14, 4000000, 6239, Calendar.JULY, 12, 6239, Calendar.MAY, 28, 8000000, 17191, Calendar.FEBRUARY, 26, 17190, Calendar.OCTOBER, 22, 10000000, 22666, Calendar.DECEMBER, 20, 22666, Calendar.JULY, 5, }; for (int i=0; i<DATA.length; i+=7) { int julian = DATA[i]; int year = DATA[i+1]; int month = DATA[i+2]; int dom = DATA[i+3]; int year2, month2, dom2; long millis = (julian - EPOCH_JULIAN) * ONE_DAY; String s; // Test Gregorian computation cal.setGregorianChange(PURE_GREGORIAN); cal.clear(); cal.set(year, month, dom); long calMillis = cal.getTime().getTime(); long delta = calMillis - millis; cal.setTime(new Date(millis)); year2 = cal.get(Calendar.YEAR); month2 = cal.get(Calendar.MONTH); dom2 = cal.get(Calendar.DAY_OF_MONTH); s = "G " + year + "-" + (month+1-Calendar.JANUARY) + "-" + dom + " => " + calMillis + " (" + ((float)delta/ONE_DAY) + " day delta) => " + year2 + "-" + (month2+1-Calendar.JANUARY) + "-" + dom2; if (delta != 0 || year != year2 || month != month2 || dom != dom2) errln(s + " FAIL"); else logln(s); // Test Julian computation year = DATA[i+4]; month = DATA[i+5]; dom = DATA[i+6]; cal.setGregorianChange(PURE_JULIAN); cal.clear(); cal.set(year, month, dom); calMillis = cal.getTime().getTime(); delta = calMillis - millis; cal.setTime(new Date(millis)); year2 = cal.get(Calendar.YEAR); month2 = cal.get(Calendar.MONTH); dom2 = cal.get(Calendar.DAY_OF_MONTH); s = "J " + year + "-" + (month+1-Calendar.JANUARY) + "-" + dom + " => " + calMillis + " (" + ((float)delta/ONE_DAY) + " day delta) => " + year2 + "-" + (month2+1-Calendar.JANUARY) + "-" + dom2; if (delta != 0 || year != year2 || month != month2 || dom != dom2) errln(s + " FAIL"); else logln(s); } java.util.Calendar tempcal = java.util.Calendar.getInstance(); tempcal.clear(); tempcal.set(1582, Calendar.OCTOBER, 15); cal.setGregorianChange(tempcal.getTime()); auxMapping(cal, 1582, Calendar.OCTOBER, 4); auxMapping(cal, 1582, Calendar.OCTOBER, 15); auxMapping(cal, 1582, Calendar.OCTOBER, 16); for (int y=800; y<3000; y+=1+(int)(100*Math.random())) { for (int m=Calendar.JANUARY; m<=Calendar.DECEMBER; ++m) { auxMapping(cal, y, m, 15); } } } finally { TimeZone.setDefault(saveZone); } }
void function() { if (false) { Date PURE_GREGORIAN = new Date(Long.MIN_VALUE); Date PURE_JULIAN = new Date(Long.MAX_VALUE); GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); final int EPOCH_JULIAN = 2440588; final long ONE_DAY = 24*60*60*1000L; android.icu.text.SimpleDateFormat fmt = new android.icu.text.SimpleDateFormat(STR); for (int type=0; type<2; ++type) { System.out.println(type==0 ? STR : STR); cal.setGregorianChange(type==0 ? PURE_GREGORIAN : PURE_JULIAN); fmt.setCalendar(cal); int[] J = { 0x7FFFFFFF, 0x7FFFFFF0, 0x7F000000, 0x78000000, 0x70000000, 0x60000000, 0x50000000, 0x40000000, 0x30000000, 0x20000000, 0x10000000, }; for (int i=0; i<J.length; ++i) { String[] lim = new String[2]; long[] ms = new long[2]; int jd = J[i]; for (int sign=0; sign<2; ++sign) { int julian = jd; if (sign==0) julian = -julian; long millis = ((long)julian - EPOCH_JULIAN) * ONE_DAY; ms[sign] = millis; cal.setTime(new Date(millis)); lim[sign] = fmt.format(cal.getTime()); } System.out.println(STR + Long.toString(jd, 16) + STR + ms[0] + ".." + ms[1] + STR + lim[0] + ".." + lim[1]); } } } TimeZone saveZone = TimeZone.getDefault(); try { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); Date PURE_GREGORIAN = new Date(Long.MIN_VALUE); Date PURE_JULIAN = new Date(Long.MAX_VALUE); GregorianCalendar cal = new GregorianCalendar(); final int EPOCH_JULIAN = 2440588; final long ONE_DAY = 24*60*60*1000L; int[] DATA = { 2440588, 1970, Calendar.JANUARY, 1, 1969, Calendar.DECEMBER, 19, 2415080, 1900, Calendar.MARCH, 1, 1900, Calendar.FEBRUARY, 17, 2451604, 2000, Calendar.FEBRUARY, 29, 2000, Calendar.FEBRUARY, 16, 2452269, 2001, Calendar.DECEMBER, 25, 2001, Calendar.DECEMBER, 12, 2416526, 1904, Calendar.FEBRUARY, 15, 1904, Calendar.FEBRUARY, 2, 2416656, 1904, Calendar.JUNE, 24, 1904, Calendar.JUNE, 11, 1721426, 1, Calendar.JANUARY, 1, 1, Calendar.JANUARY, 3, 2000000, 763, Calendar.SEPTEMBER, 18, 763, Calendar.SEPTEMBER, 14, 4000000, 6239, Calendar.JULY, 12, 6239, Calendar.MAY, 28, 8000000, 17191, Calendar.FEBRUARY, 26, 17190, Calendar.OCTOBER, 22, 10000000, 22666, Calendar.DECEMBER, 20, 22666, Calendar.JULY, 5, }; for (int i=0; i<DATA.length; i+=7) { int julian = DATA[i]; int year = DATA[i+1]; int month = DATA[i+2]; int dom = DATA[i+3]; int year2, month2, dom2; long millis = (julian - EPOCH_JULIAN) * ONE_DAY; String s; cal.setGregorianChange(PURE_GREGORIAN); cal.clear(); cal.set(year, month, dom); long calMillis = cal.getTime().getTime(); long delta = calMillis - millis; cal.setTime(new Date(millis)); year2 = cal.get(Calendar.YEAR); month2 = cal.get(Calendar.MONTH); dom2 = cal.get(Calendar.DAY_OF_MONTH); s = STR + year + "-" + (month+1-Calendar.JANUARY) + "-" + dom + STR + calMillis + STR + ((float)delta/ONE_DAY) + STR + year2 + "-" + (month2+1-Calendar.JANUARY) + "-" + dom2; if (delta != 0 year != year2 month != month2 dom != dom2) errln(s + STR); else logln(s); year = DATA[i+4]; month = DATA[i+5]; dom = DATA[i+6]; cal.setGregorianChange(PURE_JULIAN); cal.clear(); cal.set(year, month, dom); calMillis = cal.getTime().getTime(); delta = calMillis - millis; cal.setTime(new Date(millis)); year2 = cal.get(Calendar.YEAR); month2 = cal.get(Calendar.MONTH); dom2 = cal.get(Calendar.DAY_OF_MONTH); s = STR + year + "-" + (month+1-Calendar.JANUARY) + "-" + dom + STR + calMillis + STR + ((float)delta/ONE_DAY) + STR + year2 + "-" + (month2+1-Calendar.JANUARY) + "-" + dom2; if (delta != 0 year != year2 month != month2 dom != dom2) errln(s + STR); else logln(s); } java.util.Calendar tempcal = java.util.Calendar.getInstance(); tempcal.clear(); tempcal.set(1582, Calendar.OCTOBER, 15); cal.setGregorianChange(tempcal.getTime()); auxMapping(cal, 1582, Calendar.OCTOBER, 4); auxMapping(cal, 1582, Calendar.OCTOBER, 15); auxMapping(cal, 1582, Calendar.OCTOBER, 16); for (int y=800; y<3000; y+=1+(int)(100*Math.random())) { for (int m=Calendar.JANUARY; m<=Calendar.DECEMBER; ++m) { auxMapping(cal, y, m, 15); } } } finally { TimeZone.setDefault(saveZone); } }
/** * Test the mapping between millis and fields. For the purposes * of this test, we don't care about timezones and week data * (first day of week, minimal days in first week). */
Test the mapping between millis and fields. For the purposes of this test, we don't care about timezones and week data (first day of week, minimal days in first week)
TestMapping
{ "repo_name": "lukhnos/j2objc", "path": "jre_emul/android/platform/external/icu/android_icu4j/src/main/tests/android/icu/dev/test/calendar/CompatibilityTest.java", "license": "apache-2.0", "size": 47874 }
[ "android.icu.util.Calendar", "android.icu.util.GregorianCalendar", "android.icu.util.TimeZone", "java.util.Date" ]
import android.icu.util.Calendar; import android.icu.util.GregorianCalendar; import android.icu.util.TimeZone; import java.util.Date;
import android.icu.util.*; import java.util.*;
[ "android.icu", "java.util" ]
android.icu; java.util;
1,129,498
void onButtonPressed(Intent intent) throws Exception;
void onButtonPressed(Intent intent) throws Exception;
/** * Callback fired when we've just gone through warning dialog before encryption * * @param intent * @throws Exception */
Callback fired when we've just gone through warning dialog before encryption
onButtonPressed
{ "repo_name": "AmazengProject/AmazeFileManager", "path": "app/src/main/java/com/amaze/filemanager/utils/files/EncryptDecryptUtils.java", "license": "gpl-3.0", "size": 8056 }
[ "android.content.Intent" ]
import android.content.Intent;
import android.content.*;
[ "android.content" ]
android.content;
925,773
@Override public void setContext(final Context inContext) { context = inContext; }
void function(final Context inContext) { context = inContext; }
/** Sets the context of this Task * * @param inContext org.hip.kernel.servlet.Context The context for this task */
Sets the context of this Task
setContext
{ "repo_name": "aktion-hip/viffw", "path": "org.hip.viffw/src/org/hip/kernel/servlet/impl/AbstractTask.java", "license": "lgpl-2.1", "size": 1825 }
[ "org.hip.kernel.servlet.Context" ]
import org.hip.kernel.servlet.Context;
import org.hip.kernel.servlet.*;
[ "org.hip.kernel" ]
org.hip.kernel;
90,144
public HttpBackOffUnsuccessfulResponseHandler setBackOffRequired( BackOffRequired backOffRequired) { this.backOffRequired = Preconditions.checkNotNull(backOffRequired); return this; }
HttpBackOffUnsuccessfulResponseHandler function( BackOffRequired backOffRequired) { this.backOffRequired = Preconditions.checkNotNull(backOffRequired); return this; }
/** * Sets the {@link BackOffRequired} instance which determines if back-off is required based on an * abnormal HTTP response. * * <p> * The default value is {@link BackOffRequired#ON_SERVER_ERROR}. * </p> * * <p> * Overriding is only supported for the purpose of calling the super implementation and changing * the return type, but nothing else. * </p> */
Sets the <code>BackOffRequired</code> instance which determines if back-off is required based on an abnormal HTTP response. The default value is <code>BackOffRequired#ON_SERVER_ERROR</code>. Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setBackOffRequired
{ "repo_name": "fengshao0907/google-http-java-client", "path": "google-http-client/src/main/java/com/google/api/client/http/HttpBackOffUnsuccessfulResponseHandler.java", "license": "apache-2.0", "size": 5369 }
[ "com.google.api.client.util.Preconditions" ]
import com.google.api.client.util.Preconditions;
import com.google.api.client.util.*;
[ "com.google.api" ]
com.google.api;
2,469,875
public boolean setCursorPulseMode(MouseRayListener listener) { if (listenerLockPulse == null) { //We keep track of the listener locking the input. listenerLockPulse = listener; if (initialized) { lastScreenMousePos = app.getInputManager().getCursorPosition(); } return true; } else if (listenerLockPulse.equals(listener)) { listenerLockPulse = null; return true; } else { LoggerFactory.getLogger(GridMouseControlAppState.class).warn("Pulse already locked by : {} , Lock requested by : {}", listenerLockPulse.getClass().toString(), listener.toString()); return false; } }
boolean function(MouseRayListener listener) { if (listenerLockPulse == null) { listenerLockPulse = listener; if (initialized) { lastScreenMousePos = app.getInputManager().getCursorPosition(); } return true; } else if (listenerLockPulse.equals(listener)) { listenerLockPulse = null; return true; } else { LoggerFactory.getLogger(GridMouseControlAppState.class).warn(STR, listenerLockPulse.getClass().toString(), listener.toString()); return false; } }
/** * Activate / desactivate pulse mode, Raycast will follow the mouse, Have to * be called by the the same listener to be disabled. The pulse mode lock other * update. * * @todo Ray listener support * @param listener calling for it. * @return false if an error happen or if already on pulseMode. */
Activate / desactivate pulse mode, Raycast will follow the mouse, Have to be called by the the same listener to be disabled. The pulse mode lock other update
setCursorPulseMode
{ "repo_name": "MultiverseKing/HexGrid_JME", "path": "HexGridAPI/src/org/hexgridapi/core/mousepicking/GridMouseControlAppState.java", "license": "gpl-3.0", "size": 9062 }
[ "org.hexgridapi.events.MouseRayListener", "org.slf4j.LoggerFactory" ]
import org.hexgridapi.events.MouseRayListener; import org.slf4j.LoggerFactory;
import org.hexgridapi.events.*; import org.slf4j.*;
[ "org.hexgridapi.events", "org.slf4j" ]
org.hexgridapi.events; org.slf4j;
2,885,171
public void saveTextures(String absolutePath) { actionController.setProgressCount(imageList.size()); int i = 0; for (AdvancedTextureImage img : imageList) { if (img.getState() != EditState.unsupported){ actionController.setProgress(i); i++; img.writeTextureToPath(absolutePath); if (img.getTmpSavePath() != null) { // tmpSavePath: delete tmp image File file = new File(img.getTmpSavePath()); if (file.exists()) file.delete(); img.setTmpSavePath(null); } } } }
void function(String absolutePath) { actionController.setProgressCount(imageList.size()); int i = 0; for (AdvancedTextureImage img : imageList) { if (img.getState() != EditState.unsupported){ actionController.setProgress(i); i++; img.writeTextureToPath(absolutePath); if (img.getTmpSavePath() != null) { File file = new File(img.getTmpSavePath()); if (file.exists()) file.delete(); img.setTmpSavePath(null); } } } }
/** * Saves all Textures of the set with their folder structure to the * specified absolutePath and deletes their tmp image files (created during * manipulation) * * @param absolutePath */
Saves all Textures of the set with their folder structure to the specified absolutePath and deletes their tmp image files (created during manipulation)
saveTextures
{ "repo_name": "s3phir0th/TextureAttack", "path": "src/de/tud/textureAttack/model/WorkingImageSet.java", "license": "apache-2.0", "size": 7872 }
[ "de.tud.textureAttack.model.AdvancedTextureImage", "java.io.File" ]
import de.tud.textureAttack.model.AdvancedTextureImage; import java.io.File;
import de.tud.*; import java.io.*;
[ "de.tud", "java.io" ]
de.tud; java.io;
2,762,499
public void setStatements(Vector statements) { this.statements = statements; }
void function(Vector statements) { this.statements = statements; }
/** * The statements are the SQL lines of code in procedure. */
The statements are the SQL lines of code in procedure
setStatements
{ "repo_name": "gameduell/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/tools/schemaframework/StoredProcedureDefinition.java", "license": "epl-1.0", "size": 17002 }
[ "java.util.Vector" ]
import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
151,865
public Model getModel() { return model; }
Model function() { return model; }
/** * Get the model associated to this element. * * @return The model associated to this element. */
Get the model associated to this element
getModel
{ "repo_name": "meteoorkip/GraphterEffects", "path": "GraphterEffectsLibrary/src/main/java/com/github/meteoorkip/solver/VisElem.java", "license": "apache-2.0", "size": 11637 }
[ "org.chocosolver.solver.Model" ]
import org.chocosolver.solver.Model;
import org.chocosolver.solver.*;
[ "org.chocosolver.solver" ]
org.chocosolver.solver;
2,908,022
public boolean bind_result(Env env, @Reference Value[] outParams) { try { return bindResults(env, outParams); } catch (Exception e) { log.log(Level.FINE, e.toString(), e); return false; } }
boolean function(Env env, @Reference Value[] outParams) { try { return bindResults(env, outParams); } catch (Exception e) { log.log(Level.FINE, e.toString(), e); return false; } }
/** * Binds variables to a prepared statement for result storage. * * @param env the PHP executing environment * @param outParams the output variables * @return true on success or false on failure */
Binds variables to a prepared statement for result storage
bind_result
{ "repo_name": "dwango/quercus", "path": "src/main/java/com/caucho/quercus/lib/db/MysqliStatement.java", "license": "gpl-2.0", "size": 12173 }
[ "com.caucho.quercus.annotation.Reference", "com.caucho.quercus.env.Env", "com.caucho.quercus.env.Value", "java.util.logging.Level" ]
import com.caucho.quercus.annotation.Reference; import com.caucho.quercus.env.Env; import com.caucho.quercus.env.Value; import java.util.logging.Level;
import com.caucho.quercus.annotation.*; import com.caucho.quercus.env.*; import java.util.logging.*;
[ "com.caucho.quercus", "java.util" ]
com.caucho.quercus; java.util;
1,639,167
setProperty(new DoubleProperty(RANGE, range)); }
setProperty(new DoubleProperty(RANGE, range)); }
/** * Set the range value. */
Set the range value
setRange
{ "repo_name": "botelhojp/apache-jmeter-2.10", "path": "src/components/org/apache/jmeter/timers/RandomTimer.java", "license": "apache-2.0", "size": 2125 }
[ "org.apache.jmeter.testelement.property.DoubleProperty" ]
import org.apache.jmeter.testelement.property.DoubleProperty;
import org.apache.jmeter.testelement.property.*;
[ "org.apache.jmeter" ]
org.apache.jmeter;
488,611
@Deprecated public WireTapDefinition<Type> wireTap(String uri, ExecutorService executorService) { WireTapDefinition<Type> answer = new WireTapDefinition<Type>(); answer.setUri(uri); answer.setExecutorService(executorService); addOutput(answer); return answer; } /** * <a href="http://camel.apache.org/wiretap.html">WireTap EIP:</a> * Sends messages to all its child outputs; so that each processor and * destination gets a copy of the original message to avoid the processors * interfering with each other using {@link ExchangePattern#InOnly}. * * @param uri the destination * @param executorServiceRef reference to lookup a custom {@link ExecutorService}
WireTapDefinition<Type> function(String uri, ExecutorService executorService) { WireTapDefinition<Type> answer = new WireTapDefinition<Type>(); answer.setUri(uri); answer.setExecutorService(executorService); addOutput(answer); return answer; } /** * <a href="http: * Sends messages to all its child outputs; so that each processor and * destination gets a copy of the original message to avoid the processors * interfering with each other using {@link ExchangePattern#InOnly}. * * @param uri the destination * @param executorServiceRef reference to lookup a custom {@link ExecutorService}
/** * <a href="http://camel.apache.org/wiretap.html">WireTap EIP:</a> * Sends messages to all its child outputs; so that each processor and * destination gets a copy of the original message to avoid the processors * interfering with each other using {@link ExchangePattern#InOnly}. * * @param uri the destination * @param executorService a custom {@link ExecutorService} to use as thread pool * for sending tapped exchanges * @return the builder * @deprecated use the fluent builder from {@link WireTapDefinition}, will be removed in Camel 3.0 */
Sends messages to all its child outputs; so that each processor and destination gets a copy of the original message to avoid the processors interfering with each other using <code>ExchangePattern#InOnly</code>
wireTap
{ "repo_name": "chicagozer/rheosoft", "path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java", "license": "apache-2.0", "size": 125020 }
[ "java.util.concurrent.ExecutorService", "org.apache.camel.ExchangePattern" ]
import java.util.concurrent.ExecutorService; import org.apache.camel.ExchangePattern;
import java.util.concurrent.*; import org.apache.camel.*;
[ "java.util", "org.apache.camel" ]
java.util; org.apache.camel;
576,601
public Timestamp getDateAcct(); public static final String COLUMNNAME_DateTrx = "DateTrx";
Timestamp function(); public static final String COLUMNNAME_DateTrx = STR;
/** Get Account Date. * Accounting Date */
Get Account Date. Accounting Date
getDateAcct
{ "repo_name": "erpcya/adempierePOS", "path": "base/src/org/compiere/model/I_C_AllocationHdr.java", "license": "gpl-2.0", "size": 8292 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
793,334
@NotNull public static Collection<VirtualFile> collectParentFiles(boolean includeSelf, @NotNull PsiFile... psiFiles) { Set<VirtualFile> virtualFiles = new HashSet<>(); for (PsiFile psiFile : psiFiles) { VirtualFile sourceFile = psiFile.getVirtualFile(); if(includeSelf) { virtualFiles.add(sourceFile); } visitParentFiles(psiFile, 0, virtualFiles); } return virtualFiles; }
static Collection<VirtualFile> function(boolean includeSelf, @NotNull PsiFile... psiFiles) { Set<VirtualFile> virtualFiles = new HashSet<>(); for (PsiFile psiFile : psiFiles) { VirtualFile sourceFile = psiFile.getVirtualFile(); if(includeSelf) { virtualFiles.add(sourceFile); } visitParentFiles(psiFile, 0, virtualFiles); } return virtualFiles; }
/** * Visit parent Twig files eg on "embed" tag and provide all files in this path until root file */
Visit parent Twig files eg on "embed" tag and provide all files in this path until root file
collectParentFiles
{ "repo_name": "gencer/idea-php-symfony2-plugin", "path": "src/fr/adrienbrault/idea/symfony2plugin/twig/utils/TwigFileUtil.java", "license": "mit", "size": 2908 }
[ "com.intellij.openapi.vfs.VirtualFile", "com.intellij.psi.PsiFile", "java.util.Collection", "java.util.HashSet", "java.util.Set", "org.jetbrains.annotations.NotNull" ]
import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.jetbrains.annotations.NotNull;
import com.intellij.openapi.vfs.*; import com.intellij.psi.*; import java.util.*; import org.jetbrains.annotations.*;
[ "com.intellij.openapi", "com.intellij.psi", "java.util", "org.jetbrains.annotations" ]
com.intellij.openapi; com.intellij.psi; java.util; org.jetbrains.annotations;
571,103
public static void acquire(Semaphore sem) throws IgniteInterruptedCheckedException { try { sem.acquire(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IgniteInterruptedCheckedException(e); } }
static void function(Semaphore sem) throws IgniteInterruptedCheckedException { try { sem.acquire(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IgniteInterruptedCheckedException(e); } }
/** * Acquires a permit from provided semaphore. * * @param sem Semaphore. * @throws org.apache.ignite.internal.IgniteInterruptedCheckedException Wrapped {@link InterruptedException}. */
Acquires a permit from provided semaphore
acquire
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 385578 }
[ "java.util.concurrent.Semaphore", "org.apache.ignite.internal.IgniteInterruptedCheckedException" ]
import java.util.concurrent.Semaphore; import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import java.util.concurrent.*; import org.apache.ignite.internal.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
2,273,662
protected void writeExtraCustomSoapHeadersToXml(EwsServiceXmlWriter writer) throws XMLStreamException, ServiceXmlSerializationException { // do nothing here. // currently used only by GetUserSettingRequest to emit the BinarySecret header. }
void function(EwsServiceXmlWriter writer) throws XMLStreamException, ServiceXmlSerializationException { }
/** * Write extra headers. * * @param writer the writer * @throws ServiceXmlSerializationException the service xml serialization exception * @throws XMLStreamException the XML stream exception */
Write extra headers
writeExtraCustomSoapHeadersToXml
{ "repo_name": "KatharineYe/ews-java-api", "path": "src/main/java/microsoft/exchange/webservices/data/autodiscover/request/AutodiscoverRequest.java", "license": "mit", "size": 25983 }
[ "javax.xml.stream.XMLStreamException" ]
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.*;
[ "javax.xml" ]
javax.xml;
1,949,097
List<Object> getExtraFiles(); /** * Adds some additional srg files for reobfuscating. These are resolved to files with {@link org.gradle.api.Project#file(Object)}
List<Object> getExtraFiles(); /** * Adds some additional srg files for reobfuscating. These are resolved to files with {@link org.gradle.api.Project#file(Object)}
/** * Gets the extra srg files. Modders should prefer to use * {@link #extraFiles(Object...)} instead of setting the * list manually. * * @return The extra srg files */
Gets the extra srg files. Modders should prefer to use <code>#extraFiles(Object...)</code> instead of setting the list manually
getExtraFiles
{ "repo_name": "kashike/ForgeGradle", "path": "src/main/java/net/minecraftforge/gradle/user/IReobfuscator.java", "license": "lgpl-2.1", "size": 3994 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,425,749
public ScheduledThreadPoolExecutor getScheduledExecutorService() { return scheduledExecutor; }
ScheduledThreadPoolExecutor function() { return scheduledExecutor; }
/** * Get the ScheduledExecutorService used for housekeeping. * * @return the executor */
Get the ScheduledExecutorService used for housekeeping
getScheduledExecutorService
{ "repo_name": "ligzy/HikariCP", "path": "src/main/java/com/zaxxer/hikari/HikariConfig.java", "license": "apache-2.0", "size": 25097 }
[ "java.util.concurrent.ScheduledThreadPoolExecutor" ]
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
936,804
void enterInsertIntoExpr(@NotNull EsperEPL2GrammarParser.InsertIntoExprContext ctx); void exitInsertIntoExpr(@NotNull EsperEPL2GrammarParser.InsertIntoExprContext ctx);
void enterInsertIntoExpr(@NotNull EsperEPL2GrammarParser.InsertIntoExprContext ctx); void exitInsertIntoExpr(@NotNull EsperEPL2GrammarParser.InsertIntoExprContext ctx);
/** * Exit a parse tree produced by {@link EsperEPL2GrammarParser#insertIntoExpr}. * @param ctx the parse tree */
Exit a parse tree produced by <code>EsperEPL2GrammarParser#insertIntoExpr</code>
exitInsertIntoExpr
{ "repo_name": "georgenicoll/esper", "path": "esper/src/main/java/com/espertech/esper/epl/generated/EsperEPL2GrammarListener.java", "license": "gpl-2.0", "size": 114105 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
2,636,978
List<DiskImage> getImagesWithNoDisk(Guid vmId);
List<DiskImage> getImagesWithNoDisk(Guid vmId);
/** * Return all images that don't have a Disk entity in the DB and are part of a snapshot of the given VM ID. * * @param vmId * The VM to look up snapshots for. * @return List of images (empty if none found). */
Return all images that don't have a Disk entity in the DB and are part of a snapshot of the given VM ID
getImagesWithNoDisk
{ "repo_name": "OpenUniversity/ovirt-engine", "path": "backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDao.java", "license": "apache-2.0", "size": 4296 }
[ "java.util.List", "org.ovirt.engine.core.common.businessentities.storage.DiskImage", "org.ovirt.engine.core.compat.Guid" ]
import java.util.List; import org.ovirt.engine.core.common.businessentities.storage.DiskImage; import org.ovirt.engine.core.compat.Guid;
import java.util.*; import org.ovirt.engine.core.common.businessentities.storage.*; import org.ovirt.engine.core.compat.*;
[ "java.util", "org.ovirt.engine" ]
java.util; org.ovirt.engine;
2,423,617
private static Map<String, Double> extrapolate(Map<String, Double> values, int total, int sample) { if (total == sample) { return values; } else { Map<String, Double> result = new HashMap<String, Double>(); for (Entry<String, Double> entry : values.entrySet()) { double value = entry.getValue() * total / sample; result.put(entry.getKey(), value); } return result; } }
static Map<String, Double> function(Map<String, Double> values, int total, int sample) { if (total == sample) { return values; } else { Map<String, Double> result = new HashMap<String, Double>(); for (Entry<String, Double> entry : values.entrySet()) { double value = entry.getValue() * total / sample; result.put(entry.getKey(), value); } return result; } }
/** * Assuming the the given values represent a sum over a subset of a larger group, multiply them out to normalize * their values to the hypothetical sum over the larger group. */
Assuming the the given values represent a sum over a subset of a larger group, multiply them out to normalize their values to the hypothetical sum over the larger group
extrapolate
{ "repo_name": "deleidos/digitaledge-platform", "path": "master/src/main/java/com/deleidos/rtws/master/core/DiscoveryStatisticsCollector.java", "license": "apache-2.0", "size": 18889 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,531,956
return reader; } /** * Get minor type for this vector. The vector holds values belonging * to a particular type. * * @return {@link org.apache.arrow.vector.types.Types.MinorType}
return reader; } /** * Get minor type for this vector. The vector holds values belonging * to a particular type. * * @return {@link org.apache.arrow.vector.types.Types.MinorType}
/** * Get a reader that supports reading values from this vector * * @return Field Reader for this vector */
Get a reader that supports reading values from this vector
getReader
{ "repo_name": "wagavulin/arrow", "path": "java/vector/src/main/java/org/apache/arrow/vector/FixedSizeBinaryVector.java", "license": "apache-2.0", "size": 12942 }
[ "org.apache.arrow.vector.types.Types" ]
import org.apache.arrow.vector.types.Types;
import org.apache.arrow.vector.types.*;
[ "org.apache.arrow" ]
org.apache.arrow;
1,269,501
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { toolBar = new javax.swing.JToolBar(); toolbarRunButton = new javax.swing.JButton(); pageSizeComboBox = new javax.swing.JComboBox<PageSizeItem>(); saveParamsCheckBox = new javax.swing.JCheckBox(); mainPane = new javax.swing.JSplitPane(); topPanel = new javax.swing.JPanel(); bottomPanel = new javax.swing.JPanel(); sqlSourcePanel = new javax.swing.JPanel(); scrollSqlPane = new javax.swing.JScrollPane(); txtSqlPane = new javax.swing.JEditorPane(); setPreferredSize(new java.awt.Dimension(460, 320)); setLayout(new java.awt.BorderLayout()); toolBar.setFloatable(false); toolBar.setRollover(true);
@SuppressWarnings(STR) void function() { toolBar = new javax.swing.JToolBar(); toolbarRunButton = new javax.swing.JButton(); pageSizeComboBox = new javax.swing.JComboBox<PageSizeItem>(); saveParamsCheckBox = new javax.swing.JCheckBox(); mainPane = new javax.swing.JSplitPane(); topPanel = new javax.swing.JPanel(); bottomPanel = new javax.swing.JPanel(); sqlSourcePanel = new javax.swing.JPanel(); scrollSqlPane = new javax.swing.JScrollPane(); txtSqlPane = new javax.swing.JEditorPane(); setPreferredSize(new java.awt.Dimension(460, 320)); setLayout(new java.awt.BorderLayout()); toolBar.setFloatable(false); toolBar.setRollover(true);
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */
This method is called from within the constructor to initialize the form. regenerated by the Form Editor
initComponents
{ "repo_name": "vadimv/PlatypusJS", "path": "designer/PlatypusQueries/src/com/eas/designer/application/query/result/QuerySetupView.java", "license": "apache-2.0", "size": 13548 }
[ "com.eas.designer.application.query.result.QueryResultsView", "java.awt.BorderLayout", "javax.swing.JEditorPane", "javax.swing.JScrollPane" ]
import com.eas.designer.application.query.result.QueryResultsView; import java.awt.BorderLayout; import javax.swing.JEditorPane; import javax.swing.JScrollPane;
import com.eas.designer.application.query.result.*; import java.awt.*; import javax.swing.*;
[ "com.eas.designer", "java.awt", "javax.swing" ]
com.eas.designer; java.awt; javax.swing;
2,602,917
Collection<? extends ViewProcess> getViewProcesses();
Collection<? extends ViewProcess> getViewProcesses();
/** * Gets an unmodifiable snapshot of the view processes currently being managed by this view processor. A view process * could be in any state, and might have finished producing new results or even have been terminated. * * @return a collection of the current view processes, not null */
Gets an unmodifiable snapshot of the view processes currently being managed by this view processor. A view process could be in any state, and might have finished producing new results or even have been terminated
getViewProcesses
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-Engine/src/main/java/com/opengamma/engine/view/impl/ViewProcessorInternal.java", "license": "apache-2.0", "size": 2663 }
[ "com.opengamma.engine.view.ViewProcess", "java.util.Collection" ]
import com.opengamma.engine.view.ViewProcess; import java.util.Collection;
import com.opengamma.engine.view.*; import java.util.*;
[ "com.opengamma.engine", "java.util" ]
com.opengamma.engine; java.util;
1,664,979
boolean setVirtualAttribute(PerunSession sess, Member member, Attribute attribute) throws InternalErrorException, WrongModuleTypeException, ModuleNotExistsException, WrongReferenceAttributeValueException;
boolean setVirtualAttribute(PerunSession sess, Member member, Attribute attribute) throws InternalErrorException, WrongModuleTypeException, ModuleNotExistsException, WrongReferenceAttributeValueException;
/** * Store the particular virtual attribute associated with the member. * * @param sess perun session * @param member * @param attribute attribute to set * @return true if attribute was really changed * @throws InternalErrorException if an exception raise in concrete implementation, the exception is wrapped in InternalErrorException * @throws ModuleNotExistsException * @throws WrongModuleTypeException * @throws WrongReferenceAttributeValueException */
Store the particular virtual attribute associated with the member
setVirtualAttribute
{ "repo_name": "Simcsa/perun", "path": "perun-core/src/main/java/cz/metacentrum/perun/core/implApi/AttributesManagerImplApi.java", "license": "bsd-2-clause", "size": 98325 }
[ "cz.metacentrum.perun.core.api.Attribute", "cz.metacentrum.perun.core.api.Member", "cz.metacentrum.perun.core.api.PerunSession", "cz.metacentrum.perun.core.api.exceptions.InternalErrorException", "cz.metacentrum.perun.core.api.exceptions.ModuleNotExistsException", "cz.metacentrum.perun.core.api.exceptions...
import cz.metacentrum.perun.core.api.Attribute; import cz.metacentrum.perun.core.api.Member; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; import cz.metacentrum.perun.core.api.exceptions.ModuleNotExistsException; import cz.metacentrum.perun.core.api.exceptions.WrongModuleTypeException; import cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException;
import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*;
[ "cz.metacentrum.perun" ]
cz.metacentrum.perun;
2,424,626
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<ConnectionSettingInner>> getWithResponseAsync( String resourceGroupName, String resourceName, String connectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (resourceName == null) { return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); } if (connectionName == null) { return Mono.error(new IllegalArgumentException("Parameter connectionName is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), resourceGroupName, resourceName, connectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<ConnectionSettingInner>> function( String resourceGroupName, String resourceName, String connectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (resourceName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (connectionName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .get( this.client.getEndpoint(), resourceGroupName, resourceName, connectionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); }
/** * Get a Connection Setting registration for a Bot Service. * * @param resourceGroupName The name of the Bot resource group in the user subscription. * @param resourceName The name of the Bot resource. * @param connectionName The name of the Bot Service Connection Setting resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Connection Setting registration for a Bot Service along with {@link Response} on successful completion * of {@link Mono}. */
Get a Connection Setting registration for a Bot Service
getWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/implementation/BotConnectionsClientImpl.java", "license": "mit", "size": 71427 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.botservice.fluent.models.ConnectionSettingInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.botservice.fluent.models.ConnectionSettingInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.botservice.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,061,259
@Nonnull public ClaimsMappingPolicyCollectionRequest skip(final int value) { addSkipOption(value); return this; }
ClaimsMappingPolicyCollectionRequest function(final int value) { addSkipOption(value); return this; }
/** * Sets the skip value for the request * * @param value of the number of items to skip * @return the updated request */
Sets the skip value for the request
skip
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/ClaimsMappingPolicyCollectionRequest.java", "license": "mit", "size": 6131 }
[ "com.microsoft.graph.requests.ClaimsMappingPolicyCollectionRequest" ]
import com.microsoft.graph.requests.ClaimsMappingPolicyCollectionRequest;
import com.microsoft.graph.requests.*;
[ "com.microsoft.graph" ]
com.microsoft.graph;
2,261,057
private void startBackgroundThread() { mBackgroundThread = new HandlerThread("CameraBackground"); mBackgroundThread.start(); mBackgroundHandler = new Handler(mBackgroundThread.getLooper()); }
void function() { mBackgroundThread = new HandlerThread(STR); mBackgroundThread.start(); mBackgroundHandler = new Handler(mBackgroundThread.getLooper()); }
/** * Starts a background thread and its {@link Handler}. */
Starts a background thread and its <code>Handler</code>
startBackgroundThread
{ "repo_name": "aimbrain/aimbrain-android-sdk", "path": "aimbrain/src/main/java/com/aimbrain/sdk/faceCapture/fragments/Camera2Fragment.java", "license": "mit", "size": 25976 }
[ "android.os.Handler", "android.os.HandlerThread" ]
import android.os.Handler; import android.os.HandlerThread;
import android.os.*;
[ "android.os" ]
android.os;
1,626,593