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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
@GET @Path("/maps") @Produces({"application/xml", "application/json", "text/xml"}) public List<MapLink> getMapsFirstLevelLinks(@HeaderParam("x-session-token") String sSessionId) { ArrayList<MapLink> aoMapLinks = new ArrayList<>(); Object oConfObj = m_oServletConfig.getServletContext().getAttribute("Config"); if (oConfObj != null) { OmirlNavigationConfig oConfig = (OmirlNavigationConfig) oConfObj; // Call get user from session to update last touch if user is logged. Don't care about return here that is free access OmirlUser oUser = Omirl.getUserFromSession(sSessionId); int iUserAccessLevel = 9999; if (oUser!=null) iUserAccessLevel = oUser.getRole(); for (MapLinkConfig oLinkConfig : oConfig.getMapLinks()) { if (oLinkConfig.getAccessLevel() == 0 || oLinkConfig.getAccessLevel()>= iUserAccessLevel) aoMapLinks.add(oLinkConfig.getMapLink()); } } return aoMapLinks; }
@Path("/maps") @Produces({STR, STR, STR}) List<MapLink> function(@HeaderParam(STR) String sSessionId) { ArrayList<MapLink> aoMapLinks = new ArrayList<>(); Object oConfObj = m_oServletConfig.getServletContext().getAttribute(STR); if (oConfObj != null) { OmirlNavigationConfig oConfig = (OmirlNavigationConfig) oConfObj; OmirlUser oUser = Omirl.getUserFromSession(sSessionId); int iUserAccessLevel = 9999; if (oUser!=null) iUserAccessLevel = oUser.getRole(); for (MapLinkConfig oLinkConfig : oConfig.getMapLinks()) { if (oLinkConfig.getAccessLevel() == 0 oLinkConfig.getAccessLevel()>= iUserAccessLevel) aoMapLinks.add(oLinkConfig.getMapLink()); } } return aoMapLinks; }
/** * Gets the first level of dynamic layers * @return */
Gets the first level of dynamic layers
getMapsFirstLevelLinks
{ "repo_name": "fadeoutsoftware/omirl", "path": "OmirlServer/Omirl/src/it/fadeout/omirl/MapNavigatorService.java", "license": "apache-2.0", "size": 21912 }
[ "it.fadeout.omirl.business.OmirlUser", "it.fadeout.omirl.business.config.MapLinkConfig", "it.fadeout.omirl.business.config.OmirlNavigationConfig", "it.fadeout.omirl.viewmodels.MapLink", "java.util.ArrayList", "java.util.List", "javax.ws.rs.HeaderParam", "javax.ws.rs.Path", "javax.ws.rs.Produces" ]
import it.fadeout.omirl.business.OmirlUser; import it.fadeout.omirl.business.config.MapLinkConfig; import it.fadeout.omirl.business.config.OmirlNavigationConfig; import it.fadeout.omirl.viewmodels.MapLink; import java.util.ArrayList; import java.util.List; import javax.ws.rs.HeaderParam; import javax.ws.rs.Path; import javax.ws.rs.Produces;
import it.fadeout.omirl.business.*; import it.fadeout.omirl.business.config.*; import it.fadeout.omirl.viewmodels.*; import java.util.*; import javax.ws.rs.*;
[ "it.fadeout.omirl", "java.util", "javax.ws" ]
it.fadeout.omirl; java.util; javax.ws;
2,243,343
private JSONObject emailQuery(Cursor cursor) { JSONObject email = new JSONObject(); try { email.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Email._ID))); email.put("pref", false); // Android does not store pref attribute email.put("value", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Email.DATA))); email.put("type", getContactType(cursor.getInt(cursor.getColumnIndex(CommonDataKinds.Email.TYPE)))); } catch (JSONException e) { Log.e(LOG_TAG, e.getMessage(), e); } return email; }
JSONObject function(Cursor cursor) { JSONObject email = new JSONObject(); try { email.put("id", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Email._ID))); email.put("pref", false); email.put("value", cursor.getString(cursor.getColumnIndex(CommonDataKinds.Email.DATA))); email.put("type", getContactType(cursor.getInt(cursor.getColumnIndex(CommonDataKinds.Email.TYPE)))); } catch (JSONException e) { Log.e(LOG_TAG, e.getMessage(), e); } return email; }
/** * Create a ContactField JSONObject * @param cursor the current database row * @return a JSONObject representing a ContactField */
Create a ContactField JSONObject
emailQuery
{ "repo_name": "purplecabbage/cordova-plugin-contacts", "path": "src/android/ContactAccessorSdk5.java", "license": "apache-2.0", "size": 101760 }
[ "android.database.Cursor", "android.provider.ContactsContract", "android.util.Log", "org.json.JSONException", "org.json.JSONObject" ]
import android.database.Cursor; import android.provider.ContactsContract; import android.util.Log; import org.json.JSONException; import org.json.JSONObject;
import android.database.*; import android.provider.*; import android.util.*; import org.json.*;
[ "android.database", "android.provider", "android.util", "org.json" ]
android.database; android.provider; android.util; org.json;
2,259,853
private void writeSelected(PrintStream out, Journal.JournalEntry entry) { if (entry == null) { return; } Preconditions.checkState( entry.toBuilder().clearOperationId().clearSequenceNumber().getAllFields().size() <= 1, "Raft journal entries should never set multiple fields in addition to sequence " + "number, but found\n%s", entry); if (entry.getJournalEntriesCount() > 0) { // This entry aggregates multiple entries. for (Journal.JournalEntry e : entry.getJournalEntriesList()) { writeSelected(out, e); } } else if (entry.toBuilder().clearSequenceNumber().build() .equals(Journal.JournalEntry.getDefaultInstance())) { // Ignore empty entries, they are created during snapshotting. } else { if (isSelected(entry)) { out.println(entry); } } }
void function(PrintStream out, Journal.JournalEntry entry) { if (entry == null) { return; } Preconditions.checkState( entry.toBuilder().clearOperationId().clearSequenceNumber().getAllFields().size() <= 1, STR + STR, entry); if (entry.getJournalEntriesCount() > 0) { for (Journal.JournalEntry e : entry.getJournalEntriesList()) { writeSelected(out, e); } } else if (entry.toBuilder().clearSequenceNumber().build() .equals(Journal.JournalEntry.getDefaultInstance())) { } else { if (isSelected(entry)) { out.println(entry); } } }
/** * Writes given entry after going through range and validity checks. * * @param out out stream to write the entry to * @param entry the entry to write to */
Writes given entry after going through range and validity checks
writeSelected
{ "repo_name": "wwjiang007/alluxio", "path": "core/server/master/src/main/java/alluxio/master/journal/tool/RaftJournalDumper.java", "license": "apache-2.0", "size": 7329 }
[ "com.google.common.base.Preconditions", "java.io.PrintStream" ]
import com.google.common.base.Preconditions; import java.io.PrintStream;
import com.google.common.base.*; import java.io.*;
[ "com.google.common", "java.io" ]
com.google.common; java.io;
1,621,833
private String getLatestReleasedDatasetVersionQuery(String identifierClause){ if (identifierClause == null){ return null; } String releasedClause = " AND dv.versionstate = '" + VersionState.RELEASED.toString() + "'"; return getDatasetVersionBasicQuery(identifierClause, releasedClause); }
String function(String identifierClause){ if (identifierClause == null){ return null; } String releasedClause = STR + VersionState.RELEASED.toString() + "'"; return getDatasetVersionBasicQuery(identifierClause, releasedClause); }
/** * Query to return the last Released DatasetVersion by Persistent ID * * @param identifierClause - query clause to retrieve via DatasetVersion.Id or DatasetVersion.persistentId * @return String fullQuery */
Query to return the last Released DatasetVersion by Persistent ID
getLatestReleasedDatasetVersionQuery
{ "repo_name": "ekoi/DANS-DVN-4.6.1", "path": "src/main/java/edu/harvard/iq/dataverse/DatasetVersionServiceBean.java", "license": "apache-2.0", "size": 43309 }
[ "edu.harvard.iq.dataverse.DatasetVersion" ]
import edu.harvard.iq.dataverse.DatasetVersion;
import edu.harvard.iq.dataverse.*;
[ "edu.harvard.iq" ]
edu.harvard.iq;
2,367,416
public static boolean isZipStream(InputStream in) throws IOException { if (!in.markSupported()) { throw new IllegalArgumentException("Mark is not supported."); } byte[] buf = new byte[MAGIC.length]; in.mark(MAGIC.length); for (int i = 0; i < MAGIC.length; i++) { int b = in.read(); if (b == -1) { break; } else { buf[i] = (byte) b; } } in.reset(); return Arrays.equals(buf, MAGIC); }
static boolean function(InputStream in) throws IOException { if (!in.markSupported()) { throw new IllegalArgumentException(STR); } byte[] buf = new byte[MAGIC.length]; in.mark(MAGIC.length); for (int i = 0; i < MAGIC.length; i++) { int b = in.read(); if (b == -1) { break; } else { buf[i] = (byte) b; } } in.reset(); return Arrays.equals(buf, MAGIC); }
/** * check if the {@link InputStream} provided is a zip file * * @param in * the stream. * @return if it is a ZIP file. */
check if the <code>InputStream</code> provided is a zip file
isZipStream
{ "repo_name": "webanno/webanno", "path": "webanno-support/src/main/java/de/tudarmstadt/ukp/clarin/webanno/support/ZipUtils.java", "license": "apache-2.0", "size": 4097 }
[ "java.io.IOException", "java.io.InputStream", "java.util.Arrays" ]
import java.io.IOException; import java.io.InputStream; import java.util.Arrays;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
384,829
private void traceSuccess(String method, Instant starts) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("End successfully '{}' in {} millis", method, Duration.between(starts, Instant.now()).getNano()/1000); } }
void function(String method, Instant starts) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(STR, method, Duration.between(starts, Instant.now()).getNano()/1000); } }
/** * Utility to TRACE. * * @param method * current operation * @param start * timestamp for starting */
Utility to TRACE
traceSuccess
{ "repo_name": "KillrVideo/killrvideo-java", "path": "killrvideo-service-sugestedvideo/src/main/java/com/killrvideo/service/sugestedvideo/grpc/SuggestedVideosServiceGrpc.java", "license": "apache-2.0", "size": 6566 }
[ "java.time.Duration", "java.time.Instant" ]
import java.time.Duration; import java.time.Instant;
import java.time.*;
[ "java.time" ]
java.time;
2,208,011
public void registerCFGs() { int removed = getRawGraph().removeIsolatedNodes(); if (removed > 0) logger.info("removed isolated nodes: " + removed + " in " + methodName); // non-minimized cfg needed for defuse-coverage and control // dependence calculation GraphPool.getInstance(classLoader).registerRawCFG(getRawGraph()); GraphPool.getInstance(classLoader).registerActualCFG(computeActualCFG()); } // build up the graph
void function() { int removed = getRawGraph().removeIsolatedNodes(); if (removed > 0) logger.info(STR + removed + STR + methodName); GraphPool.getInstance(classLoader).registerRawCFG(getRawGraph()); GraphPool.getInstance(classLoader).registerActualCFG(computeActualCFG()); }
/** * Adds the RawControlFlowGraph created by this instance to the GraphPool, * computes the resulting ActualControlFlowGraph */
Adds the RawControlFlowGraph created by this instance to the GraphPool, computes the resulting ActualControlFlowGraph
registerCFGs
{ "repo_name": "sefaakca/EvoSuite-Sefa", "path": "client/src/main/java/org/evosuite/graphs/cfg/CFGGenerator.java", "license": "lgpl-3.0", "size": 9727 }
[ "org.evosuite.graphs.GraphPool" ]
import org.evosuite.graphs.GraphPool;
import org.evosuite.graphs.*;
[ "org.evosuite.graphs" ]
org.evosuite.graphs;
2,030,588
@SuppressWarnings("unchecked") public void testEdValue3ByDetachedCriteria() throws ApplicationException { DetachedCriteria criteria = DetachedCriteria.forClass(EdDataType.class); LogicalExpression exp1 = Restrictions.or(Property.forName("value3.data").isNotNull(), Property.forName("value3.nullFlavor").isNotNull()); LogicalExpression exp2 = Restrictions.or(Property.forName("value3.value").isNotNull(), Property.forName("value3.compression").isNotNull()); criteria.add(Restrictions.or(exp1, exp2)); Collection<EdDataType> result = search(criteria, "gov.nih.nci.cacoresdk.domain.other.datatype.EdDataType"); assertNotNull(result); assertEquals(5, result.size()); assertValue3(result); }
@SuppressWarnings(STR) void function() throws ApplicationException { DetachedCriteria criteria = DetachedCriteria.forClass(EdDataType.class); LogicalExpression exp1 = Restrictions.or(Property.forName(STR).isNotNull(), Property.forName(STR).isNotNull()); LogicalExpression exp2 = Restrictions.or(Property.forName(STR).isNotNull(), Property.forName(STR).isNotNull()); criteria.add(Restrictions.or(exp1, exp2)); Collection<EdDataType> result = search(criteria, STR); assertNotNull(result); assertEquals(5, result.size()); assertValue3(result); }
/** * Search Value3 by detached criteria Test * * @throws ApplicationException */
Search Value3 by detached criteria Test
testEdValue3ByDetachedCriteria
{ "repo_name": "NCIP/cacore-sdk", "path": "sdk-toolkit/iso-example-project/junit/src/test/xml/other/EdDataTypeXMLTest.java", "license": "bsd-3-clause", "size": 9406 }
[ "gov.nih.nci.cacoresdk.domain.other.datatype.EdDataType", "gov.nih.nci.system.applicationservice.ApplicationException", "java.util.Collection", "org.hibernate.criterion.DetachedCriteria", "org.hibernate.criterion.LogicalExpression", "org.hibernate.criterion.Property", "org.hibernate.criterion.Restrictions" ]
import gov.nih.nci.cacoresdk.domain.other.datatype.EdDataType; import gov.nih.nci.system.applicationservice.ApplicationException; import java.util.Collection; import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.LogicalExpression; import org.hibernate.criterion.Property; import org.hibernate.criterion.Restrictions;
import gov.nih.nci.cacoresdk.domain.other.datatype.*; import gov.nih.nci.system.applicationservice.*; import java.util.*; import org.hibernate.criterion.*;
[ "gov.nih.nci", "java.util", "org.hibernate.criterion" ]
gov.nih.nci; java.util; org.hibernate.criterion;
2,041,034
void onHeadsUpUnPinned(ExpandableNotificationRow headsUp);
void onHeadsUpUnPinned(ExpandableNotificationRow headsUp);
/** * A notification was just unpinned from the top. */
A notification was just unpinned from the top
onHeadsUpUnPinned
{ "repo_name": "xorware/android_frameworks_base", "path": "packages/SystemUI/src/com/android/systemui/statusbar/policy/HeadsUpManager.java", "license": "apache-2.0", "size": 27788 }
[ "com.android.systemui.statusbar.ExpandableNotificationRow" ]
import com.android.systemui.statusbar.ExpandableNotificationRow;
import com.android.systemui.statusbar.*;
[ "com.android.systemui" ]
com.android.systemui;
171,063
protected boolean checkTriangles(float gridX, float gridY, Ray pick, Vector3f intersection, TerrainBlock block) { if (!getTriangles(gridX, gridY, block)) return false; if (!pick.intersectWhere(_gridTriA, intersection)) { return pick.intersectWhere(_gridTriB, intersection); } else { return true; } }
boolean function(float gridX, float gridY, Ray pick, Vector3f intersection, TerrainBlock block) { if (!getTriangles(gridX, gridY, block)) return false; if (!pick.intersectWhere(_gridTriA, intersection)) { return pick.intersectWhere(_gridTriB, intersection); } else { return true; } }
/** * Check the two triangles of a given grid space for intersection. * * @param gridX * grid row * @param gridY * grid column * @param pick * our pick ray * @param intersection * the store variable * @param block * the terrain block we are currently testing against. * @return true if a pick was found on these triangles. */
Check the two triangles of a given grid space for intersection
checkTriangles
{ "repo_name": "tectronics/xenogeddon", "path": "src/com/jmex/terrain/util/BresenhamTerrainPicker.java", "license": "gpl-2.0", "size": 10864 }
[ "com.jme.math.Ray", "com.jme.math.Vector3f", "com.jmex.terrain.TerrainBlock" ]
import com.jme.math.Ray; import com.jme.math.Vector3f; import com.jmex.terrain.TerrainBlock;
import com.jme.math.*; import com.jmex.terrain.*;
[ "com.jme.math", "com.jmex.terrain" ]
com.jme.math; com.jmex.terrain;
887,906
public void setUpdateTime(Timestamp value) { set(3, value); }
void function(Timestamp value) { set(3, value); }
/** * Setter for <code>isy.graduation_design_presubject.update_time</code>. */
Setter for <code>isy.graduation_design_presubject.update_time</code>
setUpdateTime
{ "repo_name": "zbeboy/ISY", "path": "src/main/java/top/zbeboy/isy/domain/tables/records/GraduationDesignPresubjectRecord.java", "license": "mit", "size": 10357 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,469,878
OwncloudOcsCreateShare create(@Assisted OwncloudAccount account, @Assisted("path") String path, @Assisted ShareType type, @Nullable @Assisted("shareWith") String shareWith, @Nullable Boolean publicUpload, @Nullable @Assisted("password") String password, @Nullable Integer permissions, @Assisted @Nullable CloseableHttpClient httpClient); } private final OwncloudAccount account; private final String path; private final ShareType type; private final String shareWith; private final Boolean publicUpload; private final String password; private final Integer permissions; @Inject private OwncloudOcsPropertiesProvider propertiesProvider; @Inject private SimplePostWorkerFactory simpleWorkerFactory; @Inject private ShareResultParseJsonResponse parseResponse; @Inject private NopParseResponse nopParseResponse; private CloseableHttpClient httpClient; @AssistedInject OwncloudOcsCreateShare(@Assisted OwncloudAccount account, @Assisted("path") String path, @Assisted ShareType type, @Assisted("shareWith") @Nullable String shareWith, @Assisted @Nullable Boolean publicUpload, @Assisted("password") @Nullable String password, @Assisted @Nullable Integer permissions) { this(account, path, type, shareWith, publicUpload, password, permissions, null); } @AssistedInject OwncloudOcsCreateShare(@Assisted OwncloudAccount account, @Assisted("path") String path, @Assisted ShareType type, @Assisted("shareWith") @Nullable String shareWith, @Assisted @Nullable Boolean publicUpload, @Assisted("password") @Nullable String password, @Assisted @Nullable Integer permissions, @Assisted @Nullable CloseableHttpClient httpClient) { this.httpClient = httpClient; this.account = account; this.path = path; this.type = type; this.shareWith = shareWith; this.publicUpload = publicUpload; this.password = password; this.permissions = permissions; }
OwncloudOcsCreateShare create(@Assisted OwncloudAccount account, @Assisted("path") String path, @Assisted ShareType type, @Nullable @Assisted(STR) String shareWith, @Nullable Boolean publicUpload, @Nullable @Assisted(STR) String password, @Nullable Integer permissions, @Assisted @Nullable CloseableHttpClient httpClient); } private final OwncloudAccount account; private final String path; private final ShareType type; private final String shareWith; private final Boolean publicUpload; private final String password; private final Integer permissions; private OwncloudOcsPropertiesProvider propertiesProvider; private SimplePostWorkerFactory simpleWorkerFactory; private ShareResultParseJsonResponse parseResponse; private NopParseResponse nopParseResponse; private CloseableHttpClient httpClient; OwncloudOcsCreateShare(@Assisted OwncloudAccount account, @Assisted("path") String path, @Assisted ShareType type, @Assisted(STR) @Nullable String shareWith, @Assisted @Nullable Boolean publicUpload, @Assisted(STR) @Nullable String password, @Assisted @Nullable Integer permissions) { this(account, path, type, shareWith, publicUpload, password, permissions, null); } OwncloudOcsCreateShare(@Assisted OwncloudAccount account, @Assisted("path") String path, @Assisted ShareType type, @Assisted(STR) @Nullable String shareWith, @Assisted @Nullable Boolean publicUpload, @Assisted(STR) @Nullable String password, @Assisted @Nullable Integer permissions, @Assisted @Nullable CloseableHttpClient httpClient) { this.httpClient = httpClient; this.account = account; this.path = path; this.type = type; this.shareWith = shareWith; this.publicUpload = publicUpload; this.password = password; this.permissions = permissions; }
/** * Creates the new share using the specified pooling HTTP client. */
Creates the new share using the specified pooling HTTP client
create
{ "repo_name": "devent/simplerest", "path": "simplerest-owncloud-ocs/src/main/java/com/anrisoftware/simplerest/owncloudocs/OwncloudOcsCreateShare.java", "license": "apache-2.0", "size": 9579 }
[ "com.anrisoftware.simplerest.owncloud.OwncloudAccount", "com.anrisoftware.simplerest.owncloud.ShareType", "com.anrisoftware.simplerest.owncloudocs.SimplePostWorker", "com.google.inject.assistedinject.Assisted", "javax.annotation.Nullable", "org.apache.http.impl.client.CloseableHttpClient" ]
import com.anrisoftware.simplerest.owncloud.OwncloudAccount; import com.anrisoftware.simplerest.owncloud.ShareType; import com.anrisoftware.simplerest.owncloudocs.SimplePostWorker; import com.google.inject.assistedinject.Assisted; import javax.annotation.Nullable; import org.apache.http.impl.client.CloseableHttpClient;
import com.anrisoftware.simplerest.owncloud.*; import com.anrisoftware.simplerest.owncloudocs.*; import com.google.inject.assistedinject.*; import javax.annotation.*; import org.apache.http.impl.client.*;
[ "com.anrisoftware.simplerest", "com.google.inject", "javax.annotation", "org.apache.http" ]
com.anrisoftware.simplerest; com.google.inject; javax.annotation; org.apache.http;
850,037
protected void selectAndReveal(IResource newResource) { selectAndReveal(newResource, getWorkbench().getActiveWorkbenchWindow()); }
void function(IResource newResource) { selectAndReveal(newResource, getWorkbench().getActiveWorkbenchWindow()); }
/** * Selects and reveals the newly added resource in all parts * of the active workbench window's active page. * * @see ISetSelectionTarget */
Selects and reveals the newly added resource in all parts of the active workbench window's active page
selectAndReveal
{ "repo_name": "TeamSPoon/logicmoo_base", "path": "prolog/logicmoo/pdt_server/pdt.editor/src/org/cs3/pdt/editor/internal/wizards/NewModuleCreationWizard.java", "license": "mit", "size": 6908 }
[ "org.eclipse.core.resources.IResource" ]
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.*;
[ "org.eclipse.core" ]
org.eclipse.core;
2,502,643
private void hookContextMenu() { MenuManager menuMgr = new MenuManager("#ZestViewPopupMenu"); //$NON-NLS-1$ menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() {
void function() { MenuManager menuMgr = new MenuManager(STR); menuMgr.setRemoveAllWhenShown(true); menuMgr.addMenuListener(new IMenuListener() {
/** * Hook into a right-click menu */
Hook into a right-click menu
hookContextMenu
{ "repo_name": "archimatetool/archi", "path": "com.archimatetool.zest/src/com/archimatetool/zest/ZestView.java", "license": "mit", "size": 33680 }
[ "org.eclipse.jface.action.IMenuListener", "org.eclipse.jface.action.MenuManager" ]
import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
1,392,148
@Generated @CVariable() public static native CFStringRef kMIDIPropertyReceivesBankSelectLSB();
@CVariable() static native CFStringRef function();
/** * [@constant] kMIDIPropertyReceivesBankSelectLSB * <p> * device/entity property, integer (0/1). Indicates whether the device or entity responds * to MIDI bank select LSB messages (control 32). */
[@constant] kMIDIPropertyReceivesBankSelectLSB device/entity property, integer (0/1). Indicates whether the device or entity responds to MIDI bank select LSB messages (control 32)
kMIDIPropertyReceivesBankSelectLSB
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/coremidi/c/CoreMIDI.java", "license": "apache-2.0", "size": 96911 }
[ "org.moe.natj.c.ann.CVariable" ]
import org.moe.natj.c.ann.CVariable;
import org.moe.natj.c.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
114,797
private JPanel createDeletePanel() { VerticalPanel panel = new VerticalPanel(); panel.add(createLabelPanel("delete", delete)); return panel; }
JPanel function() { VerticalPanel panel = new VerticalPanel(); panel.add(createLabelPanel(STR, delete)); return panel; }
/** * This will create the Delete panel in the LdapConfigGui. */
This will create the Delete panel in the LdapConfigGui
createDeletePanel
{ "repo_name": "d0k1/jmeter", "path": "src/protocol/ldap/org/apache/jmeter/protocol/ldap/config/gui/LdapConfigGui.java", "license": "apache-2.0", "size": 15982 }
[ "javax.swing.JPanel", "org.apache.jmeter.gui.util.VerticalPanel" ]
import javax.swing.JPanel; import org.apache.jmeter.gui.util.VerticalPanel;
import javax.swing.*; import org.apache.jmeter.gui.util.*;
[ "javax.swing", "org.apache.jmeter" ]
javax.swing; org.apache.jmeter;
825,735
public void addSelectionListener(SelectionListener listener) { checkWidget(); this.listeners.add(listener); }
void function(SelectionListener listener) { checkWidget(); this.listeners.add(listener); }
/** * Adds the given selection listener * * @param listener */
Adds the given selection listener
addSelectionListener
{ "repo_name": "prasser/swtknob", "path": "src/main/de/linearbits/swt/widgets/Knob.java", "license": "epl-1.0", "size": 27578 }
[ "org.eclipse.swt.events.SelectionListener" ]
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.events.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
892,940
public Point toMapPixelsProjected(final int latituteE6, final int longitudeE6, final Point reuse) { final Point out = (reuse != null) ? reuse : new Point(); //26 is the biggest zoomlevel we can project final int[] coords = Mercator.projectGeoPoint(latituteE6, longitudeE6, 28, this.reuseInt2); out.set(coords[MAPTILE_LONGITUDE_INDEX], coords[MAPTILE_LATITUDE_INDEX]); return out; }
Point function(final int latituteE6, final int longitudeE6, final Point reuse) { final Point out = (reuse != null) ? reuse : new Point(); final int[] coords = Mercator.projectGeoPoint(latituteE6, longitudeE6, 28, this.reuseInt2); out.set(coords[MAPTILE_LONGITUDE_INDEX], coords[MAPTILE_LATITUDE_INDEX]); return out; }
/** * Performs only the first computationally heavy part of the projection, needToCall toMapPixelsTranslated to get final position. * @param latituteE6 * the latitute of the point * @param longitudeE6 * the longitude of the point * @param reuse * just pass null if you do not have a Point to be * 'recycled'. * @return intermediate value to be stored and passed to toMapPixelsTranslated on paint. */
Performs only the first computationally heavy part of the projection, needToCall toMapPixelsTranslated to get final position
toMapPixelsProjected
{ "repo_name": "kruzel/citypark-android", "path": "lib/src/osmdroid-android/src/org/andnav/osm/views/OpenStreetMapView.java", "license": "gpl-2.0", "size": 39513 }
[ "android.graphics.Point", "org.andnav.osm.views.util.Mercator" ]
import android.graphics.Point; import org.andnav.osm.views.util.Mercator;
import android.graphics.*; import org.andnav.osm.views.util.*;
[ "android.graphics", "org.andnav.osm" ]
android.graphics; org.andnav.osm;
993,846
@Test public void testImplementsNoPickerWithAdapterEqualsImplementation() { factory.unbindImplementationPicker(firstImplementationPicker, firstImplementationPickerProps); Resource res = getMockResourceWithProps(); SampleServiceInterface model = factory.getAdapter(res, ImplementsInterfacePropertyModel.class); assertNotNull(model); assertEquals("first-value|null|third-value", model.getAllProperties()); assertTrue(factory.canCreateFromAdaptable(res, ImplementsInterfacePropertyModel.class)); }
void function() { factory.unbindImplementationPicker(firstImplementationPicker, firstImplementationPickerProps); Resource res = getMockResourceWithProps(); SampleServiceInterface model = factory.getAdapter(res, ImplementsInterfacePropertyModel.class); assertNotNull(model); assertEquals(STR, model.getAllProperties()); assertTrue(factory.canCreateFromAdaptable(res, ImplementsInterfacePropertyModel.class)); }
/** * Try to adapt in a case where there is no picker available. * This causes the extend adaptation to fail. */
Try to adapt in a case where there is no picker available. This causes the extend adaptation to fail
testImplementsNoPickerWithAdapterEqualsImplementation
{ "repo_name": "tteofili/sling", "path": "bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/ImplementsExtendsTest.java", "license": "apache-2.0", "size": 12463 }
[ "org.apache.sling.api.resource.Resource", "org.apache.sling.models.testmodels.classes.implextend.ImplementsInterfacePropertyModel", "org.apache.sling.models.testmodels.classes.implextend.SampleServiceInterface", "org.junit.Assert" ]
import org.apache.sling.api.resource.Resource; import org.apache.sling.models.testmodels.classes.implextend.ImplementsInterfacePropertyModel; import org.apache.sling.models.testmodels.classes.implextend.SampleServiceInterface; import org.junit.Assert;
import org.apache.sling.api.resource.*; import org.apache.sling.models.testmodels.classes.implextend.*; import org.junit.*;
[ "org.apache.sling", "org.junit" ]
org.apache.sling; org.junit;
321,311
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { this.onNeighborChangeInternal(worldIn, pos, state); }
void function(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { this.onNeighborChangeInternal(worldIn, pos, state); }
/** * Called when a neighboring block changes. */
Called when a neighboring block changes
onNeighborBlockChange
{ "repo_name": "SkidJava/BaseClient", "path": "lucid_1.8.8/net/minecraft/block/BlockTorch.java", "license": "gpl-2.0", "size": 7983 }
[ "net.minecraft.block.state.IBlockState", "net.minecraft.util.BlockPos", "net.minecraft.world.World" ]
import net.minecraft.block.state.IBlockState; import net.minecraft.util.BlockPos; import net.minecraft.world.World;
import net.minecraft.block.state.*; import net.minecraft.util.*; import net.minecraft.world.*;
[ "net.minecraft.block", "net.minecraft.util", "net.minecraft.world" ]
net.minecraft.block; net.minecraft.util; net.minecraft.world;
2,052,223
public static String gensalt(int log_rounds) { return gensalt(log_rounds, new SecureRandom()); }
static String function(int log_rounds) { return gensalt(log_rounds, new SecureRandom()); }
/** * Generate a salt for use with the BCrypt.hashpw() method * @param log_rounds the log2 of the number of rounds of * hashing to apply - the work factor therefore increases as * 2**log_rounds. * @return an encoded salt value */
Generate a salt for use with the BCrypt.hashpw() method
gensalt
{ "repo_name": "zuowang/voltdb", "path": "third_party/java/src/org/mindrot/BCrypt.java", "license": "agpl-3.0", "size": 31485 }
[ "java.security.SecureRandom" ]
import java.security.SecureRandom;
import java.security.*;
[ "java.security" ]
java.security;
1,520,093
public String readLine() throws IOException, EOFException { throw new UnsupportedOperationException( "Operation not supported: readLine()" ); }
String function() throws IOException, EOFException { throw new UnsupportedOperationException( STR ); }
/** * Not currently supported - throws {@link UnsupportedOperationException}. * @return the line read * @throws EOFException if an end of file is reached unexpectedly * @throws IOException if an I/O error occurs */
Not currently supported - throws <code>UnsupportedOperationException</code>
readLine
{ "repo_name": "wiyarmir/GPT-Organize", "path": "src/org/apache/commons/io/input/SwappedDataInputStream.java", "license": "gpl-3.0", "size": 7948 }
[ "java.io.EOFException", "java.io.IOException" ]
import java.io.EOFException; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,476,319
public void setMimetypeService(MimetypeService mimetypeService) { this.mimetypeService = mimetypeService; }
void function(MimetypeService mimetypeService) { this.mimetypeService = mimetypeService; }
/** * Sets the Mimetype Service to be used to get the * list of mime types */
Sets the Mimetype Service to be used to get the list of mime types
setMimetypeService
{ "repo_name": "loftuxab/alfresco-community-loftux", "path": "projects/remote-api/source/java/org/alfresco/repo/web/scripts/content/MimetypesGet.java", "license": "lgpl-3.0", "size": 11428 }
[ "org.alfresco.service.cmr.repository.MimetypeService" ]
import org.alfresco.service.cmr.repository.MimetypeService;
import org.alfresco.service.cmr.repository.*;
[ "org.alfresco.service" ]
org.alfresco.service;
2,086,215
void setMessageType(MessageType type);
void setMessageType(MessageType type);
/** * The type of message this method can handle * * @param type * the type of message */
The type of message this method can handle
setMessageType
{ "repo_name": "sdw2330976/Research-jetty-9.2.5", "path": "jetty-websocket/javax-websocket-client-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/annotations/IJsrMethod.java", "license": "apache-2.0", "size": 2360 }
[ "org.eclipse.jetty.websocket.jsr356.MessageType" ]
import org.eclipse.jetty.websocket.jsr356.MessageType;
import org.eclipse.jetty.websocket.jsr356.*;
[ "org.eclipse.jetty" ]
org.eclipse.jetty;
2,189,963
public Vector3 transformNormalObjectToWorld(Vector3 n) { return o2w == null ? new Vector3(n) : w2o.transformTransposeV(n); }
Vector3 function(Vector3 n) { return o2w == null ? new Vector3(n) : w2o.transformTransposeV(n); }
/** * Transform the given normal from object space to world space. A new * {@link Vector3} object is returned. * * @param n object space normal to transform * @return transformed normal */
Transform the given normal from object space to world space. A new <code>Vector3</code> object is returned
transformNormalObjectToWorld
{ "repo_name": "monkstone/sunflow", "path": "src/main/java/org/sunflow/core/ShadingState.java", "license": "mit", "size": 29285 }
[ "org.sunflow.math.Vector3" ]
import org.sunflow.math.Vector3;
import org.sunflow.math.*;
[ "org.sunflow.math" ]
org.sunflow.math;
2,370,729
public ZoneOffset getOffsetBefore() { return offsetBefore; }
ZoneOffset function() { return offsetBefore; }
/** * Gets the offset before the transition. * <p> * This is the offset in use before the instant of the transition. * * @return the offset before the transition, not null */
Gets the offset before the transition. This is the offset in use before the instant of the transition
getOffsetBefore
{ "repo_name": "FauxFaux/jdk9-jdk", "path": "src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java", "license": "gpl-2.0", "size": 17674 }
[ "java.time.ZoneOffset" ]
import java.time.ZoneOffset;
import java.time.*;
[ "java.time" ]
java.time;
989,423
private static void removeContent(Node node) { while (node.hasChildNodes()) { node.removeChild(node.getFirstChild()); } }
static void function(Node node) { while (node.hasChildNodes()) { node.removeChild(node.getFirstChild()); } }
/** * Removes the contents of a <code>Node</code>. * * @param node the <code>Node</code> to clear. */
Removes the contents of a <code>Node</code>
removeContent
{ "repo_name": "greghaskins/openjdk-jdk7u-jdk", "path": "src/share/classes/com/sun/org/apache/xml/internal/security/encryption/XMLCipher.java", "license": "gpl-2.0", "size": 155482 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,508,511
@Auditable(parameters={"targetName"}) public NodeRef transfer(String targetName, TransferDefinition definition, Collection<TransferCallback> callback) throws TransferException;
@Auditable(parameters={STR}) NodeRef function(String targetName, TransferDefinition definition, Collection<TransferCallback> callback) throws TransferException;
/** * Transfer nodes sync, with callback. This synchronous version of the transfer method waits for the transfer to complete * before returning to the caller. Callbacks are called in the current thread context, so will be associated with the current * transaction and user. * * @param targetName the name of the target to transfer to * @param definition - the definition of the transfer. Specifies which nodes to transfer. * The following properties must be set, nodes * @param callback - a set of callback handlers that will be called as transfer proceeds. May be null. * @throws TransferException * @return the node reference of the transfer report */
Transfer nodes sync, with callback. This synchronous version of the transfer method waits for the transfer to complete before returning to the caller. Callbacks are called in the current thread context, so will be associated with the current transaction and user
transfer
{ "repo_name": "daniel-he/community-edition", "path": "projects/repository/source/java/org/alfresco/service/cmr/transfer/TransferService.java", "license": "lgpl-3.0", "size": 10950 }
[ "java.util.Collection", "org.alfresco.service.Auditable", "org.alfresco.service.cmr.repository.NodeRef" ]
import java.util.Collection; import org.alfresco.service.Auditable; import org.alfresco.service.cmr.repository.NodeRef;
import java.util.*; import org.alfresco.service.*; import org.alfresco.service.cmr.repository.*;
[ "java.util", "org.alfresco.service" ]
java.util; org.alfresco.service;
1,118,319
public void setSecondaryFileSystem(IgfsSecondaryFileSystem fileSystem) { secondaryFs = fileSystem; }
void function(IgfsSecondaryFileSystem fileSystem) { secondaryFs = fileSystem; }
/** * Sets the secondary file system. Secondary file system is provided for pass-through, write-through, * and read-through purposes. * * @param fileSystem */
Sets the secondary file system. Secondary file system is provided for pass-through, write-through, and read-through purposes
setSecondaryFileSystem
{ "repo_name": "dlnufox/ignite", "path": "modules/core/src/main/java/org/apache/ignite/configuration/FileSystemConfiguration.java", "license": "apache-2.0", "size": 29112 }
[ "org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem" ]
import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem;
import org.apache.ignite.igfs.secondary.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,707,370
public PdfArray readArray() throws IOException { PdfArray array = new PdfArray(); while (true) { PdfObject obj = readPRObject(); int type = obj.type(); if (-type == PRTokeniser.TK_END_ARRAY) break; if (-type == PRTokeniser.TK_END_DIC) throw new IOException("Unexpected '>>'"); array.add(obj); } return array; }
PdfArray function() throws IOException { PdfArray array = new PdfArray(); while (true) { PdfObject obj = readPRObject(); int type = obj.type(); if (-type == PRTokeniser.TK_END_ARRAY) break; if (-type == PRTokeniser.TK_END_DIC) throw new IOException(STR); array.add(obj); } return array; }
/** * Reads an array. The tokeniser must be positioned past the "[" token. * @return an array * @throws IOException on error */
Reads an array. The tokeniser must be positioned past the "[" token
readArray
{ "repo_name": "bullda/DroidText", "path": "src/core/com/lowagie/text/pdf/PdfContentParser.java", "license": "lgpl-3.0", "size": 7727 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
80,079
private void createDummyPlugins(int pCount) { String string = getPluginFolder(); try { File folder = new File(string); folder.mkdir(); for (int i = 0; i < pCount; i++) { String pluginFolder = string + File.separator + "DummyPlugin" + i; File file = new File(pluginFolder); file.mkdir(); fFolders.add(file); createPluginManifest(i, file.getAbsolutePath()); createResourceFile(file.getAbsolutePath()); } } catch (IOException e) { e.printStackTrace(); } }
void function(int pCount) { String string = getPluginFolder(); try { File folder = new File(string); folder.mkdir(); for (int i = 0; i < pCount; i++) { String pluginFolder = string + File.separator + STR + i; File file = new File(pluginFolder); file.mkdir(); fFolders.add(file); createPluginManifest(i, file.getAbsolutePath()); createResourceFile(file.getAbsolutePath()); } } catch (IOException e) { e.printStackTrace(); } }
/** * Creates some Dummy Plugins * * @param pCount */
Creates some Dummy Plugins
createDummyPlugins
{ "repo_name": "commoncrawl/nutch", "path": "src/test/org/apache/nutch/plugin/TestPluginSystem.java", "license": "apache-2.0", "size": 9476 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,031,731
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if(!rowModel.rowNumberVisible) { column++; } DecimalFormat f = formats.get(column); if(f==null) { f = defaultFormat; } if(value==null) { setText(""); //$NON-NLS-1$ } else if(value instanceof String) { setText((String) value); } else if(f==null) { setText(value.toString()); } else { try { setText(f.format(value)); } catch(IllegalArgumentException ex) { setText(value.toString()); } } return this; } } private class HeaderRenderer extends RowNumberRenderer { public HeaderRenderer() { super(); setHorizontalAlignment(SwingConstants.CENTER); setForeground(Color.BLUE); setBorder(javax.swing.BorderFactory.createLineBorder(new Color(224, 224, 224))); } } private static class RowNumberRenderer extends JLabel implements TableCellRenderer { public RowNumberRenderer() { super(); setHorizontalAlignment(SwingConstants.RIGHT); setOpaque(true); // make background visible. setForeground(Color.BLACK); setBackground(PANEL_BACKGROUND); setBorder(new CellBorder(new Color(224, 224, 224))); }
Component function(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if(!rowModel.rowNumberVisible) { column++; } DecimalFormat f = formats.get(column); if(f==null) { f = defaultFormat; } if(value==null) { setText(""); } else if(value instanceof String) { setText((String) value); } else if(f==null) { setText(value.toString()); } else { try { setText(f.format(value)); } catch(IllegalArgumentException ex) { setText(value.toString()); } } return this; } } private class HeaderRenderer extends RowNumberRenderer { public HeaderRenderer() { super(); setHorizontalAlignment(SwingConstants.CENTER); setForeground(Color.BLUE); setBorder(javax.swing.BorderFactory.createLineBorder(new Color(224, 224, 224))); } } private static class RowNumberRenderer extends JLabel implements TableCellRenderer { public RowNumberRenderer() { super(); setHorizontalAlignment(SwingConstants.RIGHT); setOpaque(true); setForeground(Color.BLACK); setBackground(PANEL_BACKGROUND); setBorder(new CellBorder(new Color(224, 224, 224))); }
/** * returns a JLabel that is highlighted if the row is selected. * * @param table * @param value * @param isSelected * @param hasFocus * @param row * @param column * @return */
returns a JLabel that is highlighted if the row is selected
getTableCellRendererComponent
{ "repo_name": "dobrown/tracker-mvn", "path": "src/main/java/org/opensourcephysics/display/DataRowTable.java", "license": "gpl-3.0", "size": 12041 }
[ "java.awt.Color", "java.awt.Component", "java.text.DecimalFormat", "javax.swing.JLabel", "javax.swing.JTable", "javax.swing.SwingConstants", "javax.swing.table.TableCellRenderer" ]
import java.awt.Color; import java.awt.Component; import java.text.DecimalFormat; import javax.swing.JLabel; import javax.swing.JTable; import javax.swing.SwingConstants; import javax.swing.table.TableCellRenderer;
import java.awt.*; import java.text.*; import javax.swing.*; import javax.swing.table.*;
[ "java.awt", "java.text", "javax.swing" ]
java.awt; java.text; javax.swing;
2,527,441
@Override public void actionPerformed(ActionEvent evt) { if (evt.getSource() == classnameCombo) { setupMethods(); } }
void function(ActionEvent evt) { if (evt.getSource() == classnameCombo) { setupMethods(); } }
/** * Handle action events for this component. This method currently handles * events for the classname combo box, and sets up the associated method names. * * @param evt the ActionEvent to be handled */
Handle action events for this component. This method currently handles events for the classname combo box, and sets up the associated method names
actionPerformed
{ "repo_name": "gabehamilton/jmeter-spock-sampler", "path": "src/main/java/com/github/gabehamilton/jmeter/SpockSamplerGui.java", "license": "apache-2.0", "size": 15601 }
[ "java.awt.event.ActionEvent" ]
import java.awt.event.ActionEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
246,264
void sendSuccessMessage(int statusCode, Header[] headers, byte[] responseBody);
void sendSuccessMessage(int statusCode, Header[] headers, byte[] responseBody);
/** * Notifies callback, that request was handled successfully * * @param statusCode HTTP status code * @param headers returned headers * @param responseBody returned data */
Notifies callback, that request was handled successfully
sendSuccessMessage
{ "repo_name": "zhenyue007/Decrypt-The-Stranger", "path": "src/com/loopj/android/http/ResponseHandlerInterface.java", "license": "gpl-2.0", "size": 3848 }
[ "org.apache.http.Header" ]
import org.apache.http.Header;
import org.apache.http.*;
[ "org.apache.http" ]
org.apache.http;
455,188
public void draw(ModelSnapshot queueState, ModelSnapshot utilizationState) { int MAX_NUMBER_OF_CLASSES_QUEUE = Defaults.getAsInteger("representableClasses").intValue(); double nClasses = mediator.getClassDefinition().getClassKeys().size(); double maxNJobs = queueState.getMaxValue(); //used to avoid extreme queue lenght variation when the number of jobs inside the system is very small if (maxNJobs < 10) { maxNJobs = 10; } double QUEUE_HEIGHT = (JMTImageLoader.loadImage("queue")).getIconHeight(); double QUEUE_WIDTH = (JMTImageLoader.loadImage("queue")).getIconWidth() - QUEUE_HEIGHT; double SOURCE_SIZE = (JMTImageLoader.loadImage("source")).getIconWidth(); double SOURCE_MARGIN = 9; double source_usable_space = SOURCE_SIZE - SOURCE_MARGIN * 2; double H_MARGIN = 2; double V_MARGIN = 2; double width = QUEUE_WIDTH - 2 * H_MARGIN; double height = QUEUE_HEIGHT - 2 * V_MARGIN; int H_FREE_SPACE = 2; int V_FREE_SPACE = (int) ((QUEUE_HEIGHT - (((int) (height / nClasses)) * nClasses)) / 2); //int V_FREE_SPACE = 1; Graphics2D g = mediator.getGraphGraphics(); Vector openClasses = mediator.getClassDefinition().getOpenClassKeys(); Vector sources = mediator.getStationDefinition().getStationKeysSource(); for (int i = 0; i < sources.size(); i++) { Vector<Object> refClasses = new Vector<Object>(0, 1); Object thisSource = sources.get(i); JmtCell cell = tm.get(thisSource); int classCount = 0; for (int k = 0; k < openClasses.size(); k++) { Object thisClass = openClasses.get(k); if (mediator.getClassDefinition().getClassRefStation(thisClass) == thisSource) { refClasses.add(thisClass); classCount++; } } Point2D p = mediator.getCellCoordinates(cell); //int xStart = (int)(p.x + SOURCE_MARGIN) + 8; double xStart = p.getX() + ((mediator.getCellDimension(cell).getWidth() - SOURCE_SIZE + 2 * SOURCE_MARGIN) / 2); double yStart = (int) (p.getY() + SOURCE_MARGIN) + 1; //if the number of class is less than the maximum representable if (classCount < MAX_NUMBER_OF_CLASSES_QUEUE) { int classSpace; for (int k = 0; k < classCount; k++) { classSpace = (int) (source_usable_space / classCount); if ((((source_usable_space / classCount) - classSpace) * k) > 1) { classSpace++; } Object thisClass = refClasses.get(k); g.setColor(mediator.getClassDefinition().getClassColor(thisClass)); g.fillRect((int) xStart, (int) yStart, classSpace, (int) source_usable_space); xStart += classSpace; } } //else.. else { int classSpace; Vector<Object> classesReplication = (Vector<Object>) refClasses.clone(); Vector<Object> classesToBeDrawn = new Vector<Object>(0, 1); double min; double mean; //... find the first MAX_NUMBER_OF_CLASSES_QUEUE with the smallest mean value for (int k = 0; k < MAX_NUMBER_OF_CLASSES_QUEUE; k++) { min = Double.MAX_VALUE; int index = 0; for (int j = 0; j < classesReplication.size(); j++) { Object thisClass = classesReplication.get(j); Distribution temp = (Distribution) mediator.getClassDefinition().getClassParameter(thisClass, ClassDefinition.CLASS_DISTRIBUTION); if (temp.hasMean()) { mean = temp.getMean(); if (mean < min) { index = j; min = mean; } } } classesToBeDrawn.add(classesReplication.get(index)); classesReplication.remove(classesReplication.get(index)); } //if less than MAX_NUMBER_OF_CLASSES_QUEUE classes where found //add the ( MAX_NUMBER_OF_CLASSES_QUEUE - classesToBeDrawn.size() ) //with the highest priority if (classesToBeDrawn.size() < MAX_NUMBER_OF_CLASSES_QUEUE) { int left = MAX_NUMBER_OF_CLASSES_QUEUE - classesToBeDrawn.size(); for (int j = 0; j < left; j++) { int max = -1; int priority; int index = 0; for (int k = 0; k < classesReplication.size(); k++) { Object thisClass = classesReplication.get(k); priority = mediator.getClassDefinition().getClassPriority(thisClass); if (priority > max) { max = priority; index = k; } } classesToBeDrawn.add(classesReplication.get(index)); classesReplication.remove(classesReplication.get(index)); } } //draw the classes inside the source for (int k = 0; k < MAX_NUMBER_OF_CLASSES_QUEUE; k++) { classSpace = (int) (source_usable_space / MAX_NUMBER_OF_CLASSES_QUEUE); if ((((source_usable_space / MAX_NUMBER_OF_CLASSES_QUEUE) - classSpace) * k) > 1) { classSpace++; } Object thisClass = classesToBeDrawn.get(k); g.setColor(mediator.getClassDefinition().getClassColor(thisClass)); g.fill(new Rectangle2D.Double(xStart, yStart, classSpace, (int) source_usable_space)); xStart += classSpace; } } } //Now draw station's queue Vector servers = queueState.getServers(); Vector classes = mediator.getClassDefinition().getClassKeys(); //for each server ... for (int i = 0; i < servers.size(); i++) { JmtCell cell = tm.get(servers.get(i)); // Skips blocking region special nodes - Bertoli Marco if (cell == null) { continue; } g.setColor(Color.LIGHT_GRAY); Point2D p = mediator.getCellCoordinates(cell); double offset; double xStart; double yStart = p.getY() + V_FREE_SPACE; offset = (int) ((mediator.getCellDimension(cell).getWidth() - QUEUE_WIDTH - QUEUE_HEIGHT) / 2); g.fill(new Rectangle2D.Double(p.getX() + offset, p.getY(), (int) width + 1, (int) height + 2)); //First draw the queues .... //if the number of classes is less then MAX_NUMBER_OF_CLASSES_QUEUE if (nClasses <= MAX_NUMBER_OF_CLASSES_QUEUE) { for (int j = 0; j < nClasses; j++) { double nJobs = queueState.getValue(servers.get(i), classes.get(j)); int thisWidth = (int) ((nJobs / maxNJobs) * width); int thisHeight = (int) (height / nClasses); Color color = mediator.getClassDefinition().getClassColor(classes.get(j)); g.setColor(color); xStart = p.getX() + offset + (int) (width - thisWidth) + H_FREE_SPACE; g.fill(new Rectangle2D.Double(xStart, yStart, thisWidth, thisHeight)); yStart += thisHeight; } } // else draw only the first MAX_NUMBER_OF_CLASSES_QUEUE with the greates // number of job inside thisStation else { V_FREE_SPACE = (int) ((QUEUE_HEIGHT - (((int) (height / MAX_NUMBER_OF_CLASSES_QUEUE)) * (double) MAX_NUMBER_OF_CLASSES_QUEUE)) / 2); yStart = p.getY() + V_FREE_SPACE; Vector classesReplication = (Vector) classes.clone(); Vector classesToBeDrawn = new Vector(0, 1); double max; double nJobs; for (int k = 0; k < MAX_NUMBER_OF_CLASSES_QUEUE; k++) { max = -1; int index = 0; for (int j = 0; j < classesReplication.size(); j++) { Object thisClass = classesReplication.get(j); nJobs = queueState.getValue(servers.get(i), thisClass); if (nJobs > max) { index = j; max = nJobs; } } classesToBeDrawn.add(classesReplication.get(index)); classesReplication.remove(classesReplication.get(index)); } for (int k = 0; k < nClasses; k++) { Object thisStation = classes.get(k); if (classesToBeDrawn.contains(thisStation)) { nJobs = queueState.getValue(servers.get(i), thisStation); int thisWidth = (int) ((nJobs / maxNJobs) * width); int thisHeight = (int) (height / MAX_NUMBER_OF_CLASSES_QUEUE); Color color = mediator.getClassDefinition().getClassColor(thisStation); g.setColor(color); xStart = p.getX() + offset + (int) (width - thisWidth) + H_FREE_SPACE; g.fill(new Rectangle2D.Double(xStart, yStart, thisWidth, thisHeight)); yStart += thisHeight; } } } //then draw the utilization //if the number of classes is less then MAX_NUMBER_OF_CLASSES_QUEUE //offset = (int) ( (getCellDimension(cell).getWidth() - QUEUE_WIDTH - QUEUE_HEIGHT)/2 + QUEUE_HEIGHT ); int startAngle = 0; int arcDiameter = (int) (QUEUE_HEIGHT) - 2; xStart = p.getX() + offset + (int) QUEUE_WIDTH + 1; yStart = p.getY() + 1; g.setColor(Color.LIGHT_GRAY); g.fill(new Arc2D.Double(xStart, yStart, arcDiameter, arcDiameter, 0, 360, Arc2D.PIE)); for (int j = 0; j < nClasses; j++) { double utilization = utilizationState.getValue(servers.get(i), classes.get(j)); if (mediator.getStationDefinition().getStationNumberOfServers(servers.get(i)).intValue() > 1) { utilization = utilization / (mediator.getStationDefinition().getStationNumberOfServers(servers.get(i))).doubleValue(); } int thisAngle = (int) (utilization * 360); Color color = mediator.getClassDefinition().getClassColor(classes.get(j)); g.setColor(color); myFillArc(g, (int) xStart, (int) yStart, arcDiameter, startAngle, thisAngle); startAngle += thisAngle; } } }
void function(ModelSnapshot queueState, ModelSnapshot utilizationState) { int MAX_NUMBER_OF_CLASSES_QUEUE = Defaults.getAsInteger(STR).intValue(); double nClasses = mediator.getClassDefinition().getClassKeys().size(); double maxNJobs = queueState.getMaxValue(); if (maxNJobs < 10) { maxNJobs = 10; } double QUEUE_HEIGHT = (JMTImageLoader.loadImage("queue")).getIconHeight(); double QUEUE_WIDTH = (JMTImageLoader.loadImage("queue")).getIconWidth() - QUEUE_HEIGHT; double SOURCE_SIZE = (JMTImageLoader.loadImage(STR)).getIconWidth(); double SOURCE_MARGIN = 9; double source_usable_space = SOURCE_SIZE - SOURCE_MARGIN * 2; double H_MARGIN = 2; double V_MARGIN = 2; double width = QUEUE_WIDTH - 2 * H_MARGIN; double height = QUEUE_HEIGHT - 2 * V_MARGIN; int H_FREE_SPACE = 2; int V_FREE_SPACE = (int) ((QUEUE_HEIGHT - (((int) (height / nClasses)) * nClasses)) / 2); Graphics2D g = mediator.getGraphGraphics(); Vector openClasses = mediator.getClassDefinition().getOpenClassKeys(); Vector sources = mediator.getStationDefinition().getStationKeysSource(); for (int i = 0; i < sources.size(); i++) { Vector<Object> refClasses = new Vector<Object>(0, 1); Object thisSource = sources.get(i); JmtCell cell = tm.get(thisSource); int classCount = 0; for (int k = 0; k < openClasses.size(); k++) { Object thisClass = openClasses.get(k); if (mediator.getClassDefinition().getClassRefStation(thisClass) == thisSource) { refClasses.add(thisClass); classCount++; } } Point2D p = mediator.getCellCoordinates(cell); double xStart = p.getX() + ((mediator.getCellDimension(cell).getWidth() - SOURCE_SIZE + 2 * SOURCE_MARGIN) / 2); double yStart = (int) (p.getY() + SOURCE_MARGIN) + 1; if (classCount < MAX_NUMBER_OF_CLASSES_QUEUE) { int classSpace; for (int k = 0; k < classCount; k++) { classSpace = (int) (source_usable_space / classCount); if ((((source_usable_space / classCount) - classSpace) * k) > 1) { classSpace++; } Object thisClass = refClasses.get(k); g.setColor(mediator.getClassDefinition().getClassColor(thisClass)); g.fillRect((int) xStart, (int) yStart, classSpace, (int) source_usable_space); xStart += classSpace; } } else { int classSpace; Vector<Object> classesReplication = (Vector<Object>) refClasses.clone(); Vector<Object> classesToBeDrawn = new Vector<Object>(0, 1); double min; double mean; for (int k = 0; k < MAX_NUMBER_OF_CLASSES_QUEUE; k++) { min = Double.MAX_VALUE; int index = 0; for (int j = 0; j < classesReplication.size(); j++) { Object thisClass = classesReplication.get(j); Distribution temp = (Distribution) mediator.getClassDefinition().getClassParameter(thisClass, ClassDefinition.CLASS_DISTRIBUTION); if (temp.hasMean()) { mean = temp.getMean(); if (mean < min) { index = j; min = mean; } } } classesToBeDrawn.add(classesReplication.get(index)); classesReplication.remove(classesReplication.get(index)); } if (classesToBeDrawn.size() < MAX_NUMBER_OF_CLASSES_QUEUE) { int left = MAX_NUMBER_OF_CLASSES_QUEUE - classesToBeDrawn.size(); for (int j = 0; j < left; j++) { int max = -1; int priority; int index = 0; for (int k = 0; k < classesReplication.size(); k++) { Object thisClass = classesReplication.get(k); priority = mediator.getClassDefinition().getClassPriority(thisClass); if (priority > max) { max = priority; index = k; } } classesToBeDrawn.add(classesReplication.get(index)); classesReplication.remove(classesReplication.get(index)); } } for (int k = 0; k < MAX_NUMBER_OF_CLASSES_QUEUE; k++) { classSpace = (int) (source_usable_space / MAX_NUMBER_OF_CLASSES_QUEUE); if ((((source_usable_space / MAX_NUMBER_OF_CLASSES_QUEUE) - classSpace) * k) > 1) { classSpace++; } Object thisClass = classesToBeDrawn.get(k); g.setColor(mediator.getClassDefinition().getClassColor(thisClass)); g.fill(new Rectangle2D.Double(xStart, yStart, classSpace, (int) source_usable_space)); xStart += classSpace; } } } Vector servers = queueState.getServers(); Vector classes = mediator.getClassDefinition().getClassKeys(); for (int i = 0; i < servers.size(); i++) { JmtCell cell = tm.get(servers.get(i)); if (cell == null) { continue; } g.setColor(Color.LIGHT_GRAY); Point2D p = mediator.getCellCoordinates(cell); double offset; double xStart; double yStart = p.getY() + V_FREE_SPACE; offset = (int) ((mediator.getCellDimension(cell).getWidth() - QUEUE_WIDTH - QUEUE_HEIGHT) / 2); g.fill(new Rectangle2D.Double(p.getX() + offset, p.getY(), (int) width + 1, (int) height + 2)); if (nClasses <= MAX_NUMBER_OF_CLASSES_QUEUE) { for (int j = 0; j < nClasses; j++) { double nJobs = queueState.getValue(servers.get(i), classes.get(j)); int thisWidth = (int) ((nJobs / maxNJobs) * width); int thisHeight = (int) (height / nClasses); Color color = mediator.getClassDefinition().getClassColor(classes.get(j)); g.setColor(color); xStart = p.getX() + offset + (int) (width - thisWidth) + H_FREE_SPACE; g.fill(new Rectangle2D.Double(xStart, yStart, thisWidth, thisHeight)); yStart += thisHeight; } } else { V_FREE_SPACE = (int) ((QUEUE_HEIGHT - (((int) (height / MAX_NUMBER_OF_CLASSES_QUEUE)) * (double) MAX_NUMBER_OF_CLASSES_QUEUE)) / 2); yStart = p.getY() + V_FREE_SPACE; Vector classesReplication = (Vector) classes.clone(); Vector classesToBeDrawn = new Vector(0, 1); double max; double nJobs; for (int k = 0; k < MAX_NUMBER_OF_CLASSES_QUEUE; k++) { max = -1; int index = 0; for (int j = 0; j < classesReplication.size(); j++) { Object thisClass = classesReplication.get(j); nJobs = queueState.getValue(servers.get(i), thisClass); if (nJobs > max) { index = j; max = nJobs; } } classesToBeDrawn.add(classesReplication.get(index)); classesReplication.remove(classesReplication.get(index)); } for (int k = 0; k < nClasses; k++) { Object thisStation = classes.get(k); if (classesToBeDrawn.contains(thisStation)) { nJobs = queueState.getValue(servers.get(i), thisStation); int thisWidth = (int) ((nJobs / maxNJobs) * width); int thisHeight = (int) (height / MAX_NUMBER_OF_CLASSES_QUEUE); Color color = mediator.getClassDefinition().getClassColor(thisStation); g.setColor(color); xStart = p.getX() + offset + (int) (width - thisWidth) + H_FREE_SPACE; g.fill(new Rectangle2D.Double(xStart, yStart, thisWidth, thisHeight)); yStart += thisHeight; } } } int startAngle = 0; int arcDiameter = (int) (QUEUE_HEIGHT) - 2; xStart = p.getX() + offset + (int) QUEUE_WIDTH + 1; yStart = p.getY() + 1; g.setColor(Color.LIGHT_GRAY); g.fill(new Arc2D.Double(xStart, yStart, arcDiameter, arcDiameter, 0, 360, Arc2D.PIE)); for (int j = 0; j < nClasses; j++) { double utilization = utilizationState.getValue(servers.get(i), classes.get(j)); if (mediator.getStationDefinition().getStationNumberOfServers(servers.get(i)).intValue() > 1) { utilization = utilization / (mediator.getStationDefinition().getStationNumberOfServers(servers.get(i))).doubleValue(); } int thisAngle = (int) (utilization * 360); Color color = mediator.getClassDefinition().getClassColor(classes.get(j)); g.setColor(color); myFillArc(g, (int) xStart, (int) yStart, arcDiameter, startAngle, thisAngle); startAngle += thisAngle; } } }
/** * Draws the queues and the utilizations over the graph * @param queueState a <code> SimulationSnapshot </code> containing information about the queues * @param utilizationState a <code> SimulationSnapshot </code> containing information about the utilizations */
Draws the queues and the utilizations over the graph
draw
{ "repo_name": "HOMlab/QN-ACTR-Release", "path": "QN-ACTR Java/src/jmt/gui/jmodel/JGraphMod/GraphicalQueueState.java", "license": "lgpl-3.0", "size": 13016 }
[ "java.awt.Color", "java.awt.Graphics2D", "java.awt.geom.Arc2D", "java.awt.geom.Point2D", "java.awt.geom.Rectangle2D", "java.util.Vector" ]
import java.awt.Color; import java.awt.Graphics2D; import java.awt.geom.Arc2D; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.util.Vector;
import java.awt.*; import java.awt.geom.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
2,627,459
public Iterator<Resource> iterator() { if (isReference()) { return ((Archives) getCheckedRef()).iterator(); } dieOnCircularReference(); List<Resource> l = new LinkedList<Resource>(); for (Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext(); ) { l.addAll(CollectionUtils .asCollection(i.next().iterator())); } return l.iterator(); }
Iterator<Resource> function() { if (isReference()) { return ((Archives) getCheckedRef()).iterator(); } dieOnCircularReference(); List<Resource> l = new LinkedList<Resource>(); for (Iterator<ArchiveFileSet> i = grabArchives(); i.hasNext(); ) { l.addAll(CollectionUtils .asCollection(i.next().iterator())); } return l.iterator(); }
/** * Merges the nested collections. */
Merges the nested collections
iterator
{ "repo_name": "Mayo-WE01051879/mayosapp", "path": "Build/src/main/org/apache/tools/ant/types/resources/Archives.java", "license": "mit", "size": 5855 }
[ "java.util.Iterator", "java.util.LinkedList", "java.util.List", "org.apache.tools.ant.types.ArchiveFileSet", "org.apache.tools.ant.types.Resource", "org.apache.tools.ant.util.CollectionUtils" ]
import java.util.Iterator; import java.util.LinkedList; import java.util.List; import org.apache.tools.ant.types.ArchiveFileSet; import org.apache.tools.ant.types.Resource; import org.apache.tools.ant.util.CollectionUtils;
import java.util.*; import org.apache.tools.ant.types.*; import org.apache.tools.ant.util.*;
[ "java.util", "org.apache.tools" ]
java.util; org.apache.tools;
1,717,119
@Test public void testHashcode_twoUnEqualObjects_produceDifferentNumber() { int xhashcode = x.hashCode(); int notxHashcode = notx.hashCode(); assertNotEquals("Equal object, return unequal hashcode test fails", xhashcode, notxHashcode); }
void function() { int xhashcode = x.hashCode(); int notxHashcode = notx.hashCode(); assertNotEquals(STR, xhashcode, notxHashcode); }
/** * A more optimal implementation of hashcode ensures that if the objects are * unequal different integers are produced. */
A more optimal implementation of hashcode ensures that if the objects are unequal different integers are produced
testHashcode_twoUnEqualObjects_produceDifferentNumber
{ "repo_name": "tomdcsmith/variation-commons", "path": "src/test/java/uk/ac/ebi/eva/commons/models/metadata/StudyTest.java", "license": "apache-2.0", "size": 15376 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
112,769
private static String regionStatus(PartitionedRegion partitionedRegion, Collection<InternalDistributedMember> allStores, Collection<InternalDistributedMember> alreadyUsed, boolean forLog) { String newLine = forLog ? " " : lineSeparator(); String spaces = forLog ? "" : " "; StringBuilder sb = new StringBuilder(); sb.append("Partitioned Region name = "); sb.append(partitionedRegion.getFullPath()); if (allStores != null) { sb.append(newLine).append(spaces); sb.append("Redundancy level set to "); sb.append(partitionedRegion.getRedundantCopies()); sb.append(newLine); sb.append(". Number of available data stores: "); sb.append(allStores.size()); sb.append(newLine).append(spaces); sb.append(". Number successfully allocated = "); sb.append(alreadyUsed.size()); sb.append(newLine); sb.append(". Data stores: "); sb.append(printCollection(allStores)); sb.append(newLine); sb.append(". Data stores successfully allocated: "); sb.append(printCollection(alreadyUsed)); sb.append(newLine); sb.append(". Equivalent members: "); sb.append(printCollection(partitionedRegion.getDistributionManager().getMembersInThisZone())); } return sb.toString(); }
static String function(PartitionedRegion partitionedRegion, Collection<InternalDistributedMember> allStores, Collection<InternalDistributedMember> alreadyUsed, boolean forLog) { String newLine = forLog ? " " : lineSeparator(); String spaces = forLog ? STR STRPartitioned Region name = STRRedundancy level set to STR. Number of available data stores: STR. Number successfully allocated = STR. Data stores: STR. Data stores successfully allocated: STR. Equivalent members: "); sb.append(printCollection(partitionedRegion.getDistributionManager().getMembersInThisZone())); } return sb.toString(); }
/** * Display bucket allocation status * * @param partitionedRegion the given region * @param allStores the list of available stores. If null, unknown. * @param alreadyUsed stores allocated; only used if allStores != null * @param forLog true if the generated string is for a log message * @return the description string */
Display bucket allocation status
regionStatus
{ "repo_name": "davebarnes97/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/PRHARedundancyProvider.java", "license": "apache-2.0", "size": 84377 }
[ "java.lang.System", "java.util.Collection", "org.apache.geode.cache.Region", "org.apache.geode.distributed.internal.membership.InternalDistributedMember" ]
import java.lang.System; import java.util.Collection; import org.apache.geode.cache.Region; import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import java.lang.*; import java.util.*; import org.apache.geode.cache.*; import org.apache.geode.distributed.internal.membership.*;
[ "java.lang", "java.util", "org.apache.geode" ]
java.lang; java.util; org.apache.geode;
1,243,023
protected MslObject nextMslObject() throws MslEncodingException { // Make sure this message is allowed to have payload chunks. final MessageHeader messageHeader = getMessageHeader(); if (messageHeader == null) throw new MslInternalException("Read attempted with error message."); // If we previously reached the end of the message, don't try to read // more. if (eom) return null; // Otherwise read the next MSL object. try { if (!tokenizer.more(-1)) { eom = true; return null; } return tokenizer.nextObject(-1); } catch (final MslEncoderException e) { throw new MslEncodingException(MslError.MSL_PARSE_ERROR, "payloadchunk", e); } }
MslObject function() throws MslEncodingException { final MessageHeader messageHeader = getMessageHeader(); if (messageHeader == null) throw new MslInternalException(STR); if (eom) return null; try { if (!tokenizer.more(-1)) { eom = true; return null; } return tokenizer.nextObject(-1); } catch (final MslEncoderException e) { throw new MslEncodingException(MslError.MSL_PARSE_ERROR, STR, e); } }
/** * Retrieve the next MSL object. * * @return the next MSL object or null if none remaining. * @throws MslEncodingException if there is a problem parsing the data. */
Retrieve the next MSL object
nextMslObject
{ "repo_name": "Netflix/msl", "path": "core/src/main/java/com/netflix/msl/msg/MessageInputStream.java", "license": "apache-2.0", "size": 40385 }
[ "com.netflix.msl.MslEncodingException", "com.netflix.msl.MslError", "com.netflix.msl.MslInternalException", "com.netflix.msl.io.MslEncoderException", "com.netflix.msl.io.MslObject" ]
import com.netflix.msl.MslEncodingException; import com.netflix.msl.MslError; import com.netflix.msl.MslInternalException; import com.netflix.msl.io.MslEncoderException; import com.netflix.msl.io.MslObject;
import com.netflix.msl.*; import com.netflix.msl.io.*;
[ "com.netflix.msl" ]
com.netflix.msl;
1,704,612
public static DPMapProvider getMapProvider(Context context) { DroidPlannerPrefs prefs = new DroidPlannerPrefs(context); final String mapProviderName = prefs.getMapProviderName(); return mapProviderName == null ? DPMapProvider.DEFAULT_MAP_PROVIDER : DPMapProvider .getMapProvider(mapProviderName); }
static DPMapProvider function(Context context) { DroidPlannerPrefs prefs = new DroidPlannerPrefs(context); final String mapProviderName = prefs.getMapProviderName(); return mapProviderName == null ? DPMapProvider.DEFAULT_MAP_PROVIDER : DPMapProvider .getMapProvider(mapProviderName); }
/** * Returns the map provider selected by the user. * * @param context * application context * @return selected map provider */
Returns the map provider selected by the user
getMapProvider
{ "repo_name": "arthurbenemann/droidplanner", "path": "Android/src/org/droidplanner/android/utils/Utils.java", "license": "gpl-3.0", "size": 3178 }
[ "android.content.Context", "org.droidplanner.android.maps.providers.DPMapProvider", "org.droidplanner.android.utils.prefs.DroidPlannerPrefs" ]
import android.content.Context; import org.droidplanner.android.maps.providers.DPMapProvider; import org.droidplanner.android.utils.prefs.DroidPlannerPrefs;
import android.content.*; import org.droidplanner.android.maps.providers.*; import org.droidplanner.android.utils.prefs.*;
[ "android.content", "org.droidplanner.android" ]
android.content; org.droidplanner.android;
1,515,485
private synchronized void startBroadcast() { Inet4Address broadcastAddress = getBroadcastAddress(); if (broadcastAddress == null) { stopBroadcast(); return; }
synchronized void function() { Inet4Address broadcastAddress = getBroadcastAddress(); if (broadcastAddress == null) { stopBroadcast(); return; }
/** * Starts scanning the local network for Google TV devices. */
Starts scanning the local network for Google TV devices
startBroadcast
{ "repo_name": "nevets801/Chromemote-Bridge", "path": "src/com/motelabs/chromemote/bridge/java/anymote/connection/TvDiscoveryService.java", "license": "gpl-2.0", "size": 8293 }
[ "java.net.Inet4Address" ]
import java.net.Inet4Address;
import java.net.*;
[ "java.net" ]
java.net;
38,444
public ApplicationGatewayInner withAuthenticationCertificates(List<ApplicationGatewayAuthenticationCertificate> authenticationCertificates) { this.authenticationCertificates = authenticationCertificates; return this; }
ApplicationGatewayInner function(List<ApplicationGatewayAuthenticationCertificate> authenticationCertificates) { this.authenticationCertificates = authenticationCertificates; return this; }
/** * Set authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). * * @param authenticationCertificates the authenticationCertificates value to set * @return the ApplicationGatewayInner object itself. */
Set authentication certificates of the application gateway resource. For default limits, see [Application Gateway limits](HREF)
withAuthenticationCertificates
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/network/v2020_06_01/implementation/ApplicationGatewayInner.java", "license": "mit", "size": 36336 }
[ "com.microsoft.azure.management.network.v2020_06_01.ApplicationGatewayAuthenticationCertificate", "java.util.List" ]
import com.microsoft.azure.management.network.v2020_06_01.ApplicationGatewayAuthenticationCertificate; import java.util.List;
import com.microsoft.azure.management.network.v2020_06_01.*; import java.util.*;
[ "com.microsoft.azure", "java.util" ]
com.microsoft.azure; java.util;
1,662,807
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux<PollResult<Void>, Void> beginPurgeContentAsync( String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents) { Mono<Response<Flux<ByteBuffer>>> mono = purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contents); return this .client .<Void, Void>getLroResult( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); }
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<Void>, Void> function( String resourceGroupName, String profileName, String endpointName, AfdPurgeParameters contents) { Mono<Response<Flux<ByteBuffer>>> mono = purgeContentWithResponseAsync(resourceGroupName, profileName, endpointName, contents); return this .client .<Void, Void>getLroResult( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); }
/** * Removes a content from AzureFrontDoor. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique * within the resource group. * @param endpointName Name of the endpoint under the profile which is unique globally. * @param contents The list of paths to the content and the list of linked domains to be purged. Path can be a full * URL, e.g. '/pictures/city.png' which removes a single file, or a directory with a wildcard, e.g. * '/pictures/*' which removes all folders and files in the directory. * @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 the {@link PollerFlux} for polling of long-running operation. */
Removes a content from AzureFrontDoor
beginPurgeContentAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/implementation/AfdEndpointsClientImpl.java", "license": "mit", "size": 133372 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.management.polling.PollResult", "com.azure.core.util.polling.PollerFlux", "com.azure.resourcemanager.cdn.models.AfdPurgeParameters", "java.nio.ByteBuffer" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.PollerFlux; import com.azure.resourcemanager.cdn.models.AfdPurgeParameters; import java.nio.ByteBuffer;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.cdn.models.*; import java.nio.*;
[ "com.azure.core", "com.azure.resourcemanager", "java.nio" ]
com.azure.core; com.azure.resourcemanager; java.nio;
468,603
public KeyStoreCredentialResolverBuilder addKeyPassword(String name, String password) { requireNonNull(name, "name"); requireNonNull(password, "password"); checkArgument(!keyPasswords.containsKey(name), "key already exists: %s", name); keyPasswords.put(name, password); return this; }
KeyStoreCredentialResolverBuilder function(String name, String password) { requireNonNull(name, "name"); requireNonNull(password, STR); checkArgument(!keyPasswords.containsKey(name), STR, name); keyPasswords.put(name, password); return this; }
/** * Adds a key name and its password to the {@link KeyStoreCredentialResolverBuilder}. */
Adds a key name and its password to the <code>KeyStoreCredentialResolverBuilder</code>
addKeyPassword
{ "repo_name": "anuraaga/armeria", "path": "saml/src/main/java/com/linecorp/armeria/server/saml/KeyStoreCredentialResolverBuilder.java", "license": "apache-2.0", "size": 4997 }
[ "com.google.common.base.Preconditions", "java.util.Objects" ]
import com.google.common.base.Preconditions; import java.util.Objects;
import com.google.common.base.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
393,851
@Test public void FlowConfigurationxml2jsonxmlUnmarshallerTest() throws JAXBException, SAXException { JAXBContext context = JAXBContext.newInstance(FlowConfiguration.class); SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = sf.newSchema(new StreamSource( getClass().getClassLoader().getResourceAsStream("flow.xsd"))); Unmarshaller unmarshaller = context.createUnmarshaller(); unmarshaller.setSchema(schema); FlowConfiguration configuration = (FlowConfiguration) unmarshaller .unmarshal(getClass().getClassLoader().getResourceAsStream("xml2json2xml.xml")); assertEquals("should be two xsl steps", 2, configuration.getSteps().length); assertEquals("Name first step", "Xml2JsonStep", configuration.getSteps()[0].getName()); assertEquals("disabled first step", true, configuration.getSteps()[0].isDisabled()); assertEquals("order first step", 0, configuration.getSteps()[0].getOrder()); StepParameters parameters = configuration.getSteps()[0].getParameters(); assertEquals("mode xml2json first step", "xml2json", parameters.getMode()); assertEquals("Name first step", "Json2XmlStep", configuration.getSteps()[1].getName()); assertEquals("enabled second step", false, configuration.getSteps()[1].isDisabled()); assertEquals("order second step", 1, configuration.getSteps()[1].getOrder()); parameters = configuration.getSteps()[1].getParameters(); assertEquals("mode json2xml second step", "json2xml", parameters.getMode()); }
void function() throws JAXBException, SAXException { JAXBContext context = JAXBContext.newInstance(FlowConfiguration.class); SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = sf.newSchema(new StreamSource( getClass().getClassLoader().getResourceAsStream(STR))); Unmarshaller unmarshaller = context.createUnmarshaller(); unmarshaller.setSchema(schema); FlowConfiguration configuration = (FlowConfiguration) unmarshaller .unmarshal(getClass().getClassLoader().getResourceAsStream(STR)); assertEquals(STR, 2, configuration.getSteps().length); assertEquals(STR, STR, configuration.getSteps()[0].getName()); assertEquals(STR, true, configuration.getSteps()[0].isDisabled()); assertEquals(STR, 0, configuration.getSteps()[0].getOrder()); StepParameters parameters = configuration.getSteps()[0].getParameters(); assertEquals(STR, STR, parameters.getMode()); assertEquals(STR, STR, configuration.getSteps()[1].getName()); assertEquals(STR, false, configuration.getSteps()[1].isDisabled()); assertEquals(STR, 1, configuration.getSteps()[1].getOrder()); parameters = configuration.getSteps()[1].getParameters(); assertEquals(STR, STR, parameters.getMode()); }
/** * test a flow bindings using jaxb composes from one xml2json and one json2xml steps. * @throws JAXBException * @throws SAXException */
test a flow bindings using jaxb composes from one xml2json and one json2xml steps
FlowConfigurationxml2jsonxmlUnmarshallerTest
{ "repo_name": "gdimitriu/chappy", "path": "chappy-flows/src/test/java/chappy/flows/transformers/staticflows/test/FlowConfigurationTest.java", "license": "gpl-3.0", "size": 5125 }
[ "javax.xml.XMLConstants", "javax.xml.bind.JAXBContext", "javax.xml.bind.JAXBException", "javax.xml.bind.Unmarshaller", "javax.xml.transform.stream.StreamSource", "javax.xml.validation.Schema", "javax.xml.validation.SchemaFactory", "org.junit.Assert", "org.xml.sax.SAXException" ]
import javax.xml.XMLConstants; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import org.junit.Assert; import org.xml.sax.SAXException;
import javax.xml.*; import javax.xml.bind.*; import javax.xml.transform.stream.*; import javax.xml.validation.*; import org.junit.*; import org.xml.sax.*;
[ "javax.xml", "org.junit", "org.xml.sax" ]
javax.xml; org.junit; org.xml.sax;
197,398
EReference getReceiveTask_OperationRef();
EReference getReceiveTask_OperationRef();
/** * Returns the meta object for the reference '{@link org.eclipse.bpmn2.ReceiveTask#getOperationRef <em>Operation Ref</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>Operation Ref</em>'. * @see org.eclipse.bpmn2.ReceiveTask#getOperationRef() * @see #getReceiveTask() * @generated */
Returns the meta object for the reference '<code>org.eclipse.bpmn2.ReceiveTask#getOperationRef Operation Ref</code>'.
getReceiveTask_OperationRef
{ "repo_name": "lqjack/fixflow", "path": "modules/fixflow-core/src/main/java/org/eclipse/bpmn2/Bpmn2Package.java", "license": "apache-2.0", "size": 1014933 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,408,307
@Test public void test_setDisapprove() { Boolean value = true; instance.setDisapprove(value); assertEquals("'setDisapprove' should be correct.", value, TestsHelper.getField(instance, "disapprove")); }
void function() { Boolean value = true; instance.setDisapprove(value); assertEquals(STR, value, TestsHelper.getField(instance, STR)); }
/** * <p> * Accuracy test for the method <code>setDisapprove(Boolean disapprove)</code>.<br> * The value should be properly set. * </p> * * @since 1.2 (OPM - Data Migration - Entities Update Module Assembly 1.0) */
Accuracy test for the method <code>setDisapprove(Boolean disapprove)</code>. The value should be properly set.
test_setDisapprove
{ "repo_name": "NASA-Tournament-Lab/CoECI-OPM-Service-Credit-Redeposit-Deposit-Application", "path": "Code/FACES/src/java/tests/gov/opm/scrd/entities/application/PaymentUnitTests.java", "license": "apache-2.0", "size": 46209 }
[ "gov.opm.scrd.TestsHelper", "org.junit.Assert" ]
import gov.opm.scrd.TestsHelper; import org.junit.Assert;
import gov.opm.scrd.*; import org.junit.*;
[ "gov.opm.scrd", "org.junit" ]
gov.opm.scrd; org.junit;
696,319
@SuppressWarnings("unchecked") public static Limits<TournamentLimit> loadLimitsElement(Element root, String folder) throws ParserConfigurationException, SAXException, IOException { Limits<TournamentLimit> result = new Limits<TournamentLimit>(); List<Element> elements = root.getChildren(); Iterator<Element> i = elements.iterator(); while(i.hasNext()) { Element temp = i.next(); TournamentLimit limit = (TournamentLimit)LimitLoader.loadLimitElement(temp,folder); result.addLimit(limit); } return result; }
@SuppressWarnings(STR) static Limits<TournamentLimit> function(Element root, String folder) throws ParserConfigurationException, SAXException, IOException { Limits<TournamentLimit> result = new Limits<TournamentLimit>(); List<Element> elements = root.getChildren(); Iterator<Element> i = elements.iterator(); while(i.hasNext()) { Element temp = i.next(); TournamentLimit limit = (TournamentLimit)LimitLoader.loadLimitElement(temp,folder); result.addLimit(limit); } return result; }
/** * Loads an XML element representing the tournament limits. * * @param root * Root XML element. * @param folder * Folder containing the XML file. * @return * A list of limits. * * @throws ParserConfigurationException * Problem while accessing the XML file. * @throws SAXException * Problem while accessing the XML file. * @throws IOException * Problem while accessing the XML file. */
Loads an XML element representing the tournament limits
loadLimitsElement
{ "repo_name": "vlabatut/totalboumboum", "path": "src/org/totalboumboum/game/tournament/sequence/SequenceTournamentLoader.java", "license": "gpl-2.0", "size": 5615 }
[ "java.io.IOException", "java.util.Iterator", "java.util.List", "javax.xml.parsers.ParserConfigurationException", "org.jdom.Element", "org.totalboumboum.game.limit.LimitLoader", "org.totalboumboum.game.limit.Limits", "org.totalboumboum.game.limit.TournamentLimit", "org.xml.sax.SAXException" ]
import java.io.IOException; import java.util.Iterator; import java.util.List; import javax.xml.parsers.ParserConfigurationException; import org.jdom.Element; import org.totalboumboum.game.limit.LimitLoader; import org.totalboumboum.game.limit.Limits; import org.totalboumboum.game.limit.TournamentLimit; import org.xml.sax.SAXException;
import java.io.*; import java.util.*; import javax.xml.parsers.*; import org.jdom.*; import org.totalboumboum.game.limit.*; import org.xml.sax.*;
[ "java.io", "java.util", "javax.xml", "org.jdom", "org.totalboumboum.game", "org.xml.sax" ]
java.io; java.util; javax.xml; org.jdom; org.totalboumboum.game; org.xml.sax;
2,513,759
@ParameterParser(syntax = "('of' arg2=OFFSET)?") @Xpect public void astOrder(@N4JSCommaSeparatedValuesExpectation IN4JSCommaSeparatedValuesExpectation expectation, IEObjectCoveringRegion offset) { EObject context = offset.getEObject(); Iterator<ControlFlowElement> astIter = new ASTIterator(context); int idx = 0; List<String> astElements = new LinkedList<>(); while (astIter.hasNext()) { ControlFlowElement cfe = astIter.next(); String elem = idx + ": " + FGUtils.getSourceText(cfe); astElements.add(elem); idx++; } expectation.assertEquals(astElements); }
@ParameterParser(syntax = STR) void function(@N4JSCommaSeparatedValuesExpectation IN4JSCommaSeparatedValuesExpectation expectation, IEObjectCoveringRegion offset) { EObject context = offset.getEObject(); Iterator<ControlFlowElement> astIter = new ASTIterator(context); int idx = 0; List<String> astElements = new LinkedList<>(); while (astIter.hasNext()) { ControlFlowElement cfe = astIter.next(); String elem = idx + STR + FGUtils.getSourceText(cfe); astElements.add(elem); idx++; } expectation.assertEquals(astElements); }
/** * This xpect method can evaluate the direct predecessors of a code element. The predecessors can be limited when * specifying the edge type. * <p> * <b>Attention:</b> The type parameter <i>does not</i> work on self loops! */
This xpect method can evaluate the direct predecessors of a code element. The predecessors can be limited when specifying the edge type. Attention: The type parameter does not work on self loops
astOrder
{ "repo_name": "lbeurerkellner/n4js", "path": "plugins/org.eclipse.n4js.xpect/src/org/eclipse/n4js/xpect/methods/FlowgraphsXpectMethod.java", "license": "epl-1.0", "size": 16258 }
[ "java.util.Iterator", "java.util.LinkedList", "java.util.List", "org.eclipse.emf.ecore.EObject", "org.eclipse.n4js.flowgraphs.ASTIterator", "org.eclipse.n4js.flowgraphs.FGUtils", "org.eclipse.n4js.n4JS.ControlFlowElement", "org.eclipse.n4js.xpect.common.N4JSOffsetAdapter", "org.eclipse.n4js.xpect.methods.scoping.IN4JSCommaSeparatedValuesExpectation", "org.eclipse.n4js.xpect.methods.scoping.N4JSCommaSeparatedValuesExpectation", "org.eclipse.xpect.parameter.ParameterParser" ]
import java.util.Iterator; import java.util.LinkedList; import java.util.List; import org.eclipse.emf.ecore.EObject; import org.eclipse.n4js.flowgraphs.ASTIterator; import org.eclipse.n4js.flowgraphs.FGUtils; import org.eclipse.n4js.n4JS.ControlFlowElement; import org.eclipse.n4js.xpect.common.N4JSOffsetAdapter; import org.eclipse.n4js.xpect.methods.scoping.IN4JSCommaSeparatedValuesExpectation; import org.eclipse.n4js.xpect.methods.scoping.N4JSCommaSeparatedValuesExpectation; import org.eclipse.xpect.parameter.ParameterParser;
import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.n4js.*; import org.eclipse.n4js.flowgraphs.*; import org.eclipse.n4js.xpect.common.*; import org.eclipse.n4js.xpect.methods.scoping.*; import org.eclipse.xpect.parameter.*;
[ "java.util", "org.eclipse.emf", "org.eclipse.n4js", "org.eclipse.xpect" ]
java.util; org.eclipse.emf; org.eclipse.n4js; org.eclipse.xpect;
546,800
public MailSessionType<T> removeStoreProtocol() { childNode.removeChildren("store-protocol"); return this; } // --------------------------------------------------------------------------------------------------------|| // ClassName: MailSessionType ElementName: xsd:token ElementType : store-protocol-class // MaxOccurs: - isGeneric: true isAttribute: false isEnum: false isDataType: true // --------------------------------------------------------------------------------------------------------||
MailSessionType<T> function() { childNode.removeChildren(STR); return this; }
/** * Removes the <code>store-protocol</code> element * @return the current instance of <code>MailSessionType<T></code> */
Removes the <code>store-protocol</code> element
removeStoreProtocol
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/javaee7/MailSessionTypeImpl.java", "license": "epl-1.0", "size": 17447 }
[ "org.jboss.shrinkwrap.descriptor.api.javaee7.MailSessionType" ]
import org.jboss.shrinkwrap.descriptor.api.javaee7.MailSessionType;
import org.jboss.shrinkwrap.descriptor.api.javaee7.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
1,029,739
public ExecutorService chooseThread(long orderingKey) { if (threads.length == 1) { return threads[0]; } return threads[MathUtils.signSafeMod(orderingKey, threads.length)]; }
ExecutorService function(long orderingKey) { if (threads.length == 1) { return threads[0]; } return threads[MathUtils.signSafeMod(orderingKey, threads.length)]; }
/** * skip hashcode generation in this special case. * * @param orderingKey long ordering key * @return the thread for executing this order key */
skip hashcode generation in this special case
chooseThread
{ "repo_name": "ivankelly/bookkeeper", "path": "bookkeeper-common/src/main/java/org/apache/bookkeeper/common/util/OrderedExecutor.java", "license": "apache-2.0", "size": 17147 }
[ "java.util.concurrent.ExecutorService" ]
import java.util.concurrent.ExecutorService;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
398,985
public final MetaProperty<ExternalId> regionId() { return _regionId; }
final MetaProperty<ExternalId> function() { return _regionId; }
/** * The meta-property for the {@code regionId} property. * @return the meta-property, not null */
The meta-property for the regionId property
regionId
{ "repo_name": "McLeodMoores/starling", "path": "projects/financial-types/src/main/java/com/opengamma/financial/security/fx/NonDeliverableFXForwardSecurity.java", "license": "apache-2.0", "size": 20124 }
[ "com.opengamma.id.ExternalId", "org.joda.beans.MetaProperty" ]
import com.opengamma.id.ExternalId; import org.joda.beans.MetaProperty;
import com.opengamma.id.*; import org.joda.beans.*;
[ "com.opengamma.id", "org.joda.beans" ]
com.opengamma.id; org.joda.beans;
1,075,073
public Charset getCharset() { // RFC2616 3.7 for (String type : this.request.headers().getAll("Content-Type")) { int idx = type.toUpperCase().indexOf("CHARSET="); if (idx > 1) { String charset = type.substring(idx+8); return Charset.forName(charset); } } return Charset.forName("UTF-8"); }
Charset function() { for (String type : this.request.headers().getAll(STR)) { int idx = type.toUpperCase().indexOf(STR); if (idx > 1) { String charset = type.substring(idx+8); return Charset.forName(charset); } } return Charset.forName("UTF-8"); }
/** * Attempts to parse the character set from the request header. If not set * defaults to UTF-8 * @return A Charset object * @throws UnsupportedCharsetException if the parsed character set is invalid */
Attempts to parse the character set from the request header. If not set defaults to UTF-8
getCharset
{ "repo_name": "johann8384/opentsdb", "path": "src/tsd/AbstractHttpQuery.java", "license": "lgpl-2.1", "size": 13952 }
[ "java.nio.charset.Charset" ]
import java.nio.charset.Charset;
import java.nio.charset.*;
[ "java.nio" ]
java.nio;
264,195
public void unscale(short[] data, WritableRaster wr) { int width = wr.getWidth(); int height = wr.getHeight(); int pos = 0; if (isTTypeIntegral) { int sample; for (int row=wr.getMinX(); row<width; row++) { for (int col=wr.getMinY(); col<height; col++) { for (int chan = 0; chan < nColorChannels; chan++) { sample = (int) ((data[pos++] & 0xFFFF) * invChannelMulipliers[chan] + 0.5f); wr.setSample(row, col, chan, sample); } } } } else { float sample; for (int row=wr.getMinX(); row<width; row++) { for (int col=wr.getMinY(); col<height; col++) { for (int chan = 0; chan < nColorChannels; chan++) { sample = (data[pos++] & 0xFFFF) * invChannelMulipliers[chan] + channelMinValues[chan]; wr.setSample(row, col, chan, sample); } } } } }
void function(short[] data, WritableRaster wr) { int width = wr.getWidth(); int height = wr.getHeight(); int pos = 0; if (isTTypeIntegral) { int sample; for (int row=wr.getMinX(); row<width; row++) { for (int col=wr.getMinY(); col<height; col++) { for (int chan = 0; chan < nColorChannels; chan++) { sample = (int) ((data[pos++] & 0xFFFF) * invChannelMulipliers[chan] + 0.5f); wr.setSample(row, col, chan, sample); } } } } else { float sample; for (int row=wr.getMinX(); row<width; row++) { for (int col=wr.getMinY(); col<height; col++) { for (int chan = 0; chan < nColorChannels; chan++) { sample = (data[pos++] & 0xFFFF) * invChannelMulipliers[chan] + channelMinValues[chan]; wr.setSample(row, col, chan, sample); } } } } }
/** * Unscales the whole data array and puts obtained values to the raster * @param data - input data * @param wr - destination raster */
Unscales the whole data array and puts obtained values to the raster
unscale
{ "repo_name": "mike10004/appengine-imaging", "path": "gaecompat-awt-imaging/src/awt/org/apache/harmony/awt/gl/color/ColorScaler.java", "license": "apache-2.0", "size": 13340 }
[ "com.google.code.appengine.awt.image.WritableRaster" ]
import com.google.code.appengine.awt.image.WritableRaster;
import com.google.code.appengine.awt.image.*;
[ "com.google.code" ]
com.google.code;
659,349
List<ChatEntryModelClass> getLines();
List<ChatEntryModelClass> getLines();
/** * This method returns all the chatlines in the chat. * @return The current list of chatlines. */
This method returns all the chatlines in the chat
getLines
{ "repo_name": "xranby/nifty-gui", "path": "nifty-controls/src/main/java/de/lessvoid/nifty/controls/Chat.java", "license": "bsd-2-clause", "size": 3567 }
[ "de.lessvoid.nifty.controls.chatcontrol.ChatEntryModelClass", "java.util.List" ]
import de.lessvoid.nifty.controls.chatcontrol.ChatEntryModelClass; import java.util.List;
import de.lessvoid.nifty.controls.chatcontrol.*; import java.util.*;
[ "de.lessvoid.nifty", "java.util" ]
de.lessvoid.nifty; java.util;
2,744,679
public final TOSCAComponentId getId() { return this.id; }
final TOSCAComponentId function() { return this.id; }
/** * Returns the id associated with this resource */
Returns the id associated with this resource
getId
{ "repo_name": "YannicSowoidnich/winery", "path": "org.eclipse.winery.repository/src/main/java/org/eclipse/winery/repository/resources/AbstractComponentInstanceResource.java", "license": "apache-2.0", "size": 19986 }
[ "org.eclipse.winery.common.ids.definitions.TOSCAComponentId" ]
import org.eclipse.winery.common.ids.definitions.TOSCAComponentId;
import org.eclipse.winery.common.ids.definitions.*;
[ "org.eclipse.winery" ]
org.eclipse.winery;
1,009,260
private ProcessingComponentConfiguration resolveComponent(Object classOrId) { if (classOrId instanceof String) { // Check if there's a matching configuration final ProcessingComponentConfiguration configuration = componentIdToConfiguration.get(classOrId); if (configuration != null) { return configuration; } // If not, check if the string denotes an existing class name try { classOrId = ReflectionUtils.classForName((String) classOrId); // Fall through to the condition below } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Unknown component id: " + classOrId); } } if (classOrId instanceof Class<?>) { final Class<?> clazz = (Class<?>) classOrId; if (!IProcessingComponent.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException("Expected a Class<? extends " + IProcessingComponent.class.getSimpleName() + "> but got: " + clazz.getName()); } return new ProcessingComponentConfiguration( clazz.asSubclass(IProcessingComponent.class), null); } throw new IllegalArgumentException("Expected a String or a Class<? extends " + IProcessingComponent.class.getSimpleName() + ">"); }
ProcessingComponentConfiguration function(Object classOrId) { if (classOrId instanceof String) { final ProcessingComponentConfiguration configuration = componentIdToConfiguration.get(classOrId); if (configuration != null) { return configuration; } try { classOrId = ReflectionUtils.classForName((String) classOrId); } catch (ClassNotFoundException e) { throw new IllegalArgumentException(STR + classOrId); } } if (classOrId instanceof Class<?>) { final Class<?> clazz = (Class<?>) classOrId; if (!IProcessingComponent.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException(STR + IProcessingComponent.class.getSimpleName() + STR + clazz.getName()); } return new ProcessingComponentConfiguration( clazz.asSubclass(IProcessingComponent.class), null); } throw new IllegalArgumentException(STR + IProcessingComponent.class.getSimpleName() + ">"); }
/** * Returns an internal {@link ProcessingComponentConfiguration} based on the component * id, class or class name. */
Returns an internal <code>ProcessingComponentConfiguration</code> based on the component id, class or class name
resolveComponent
{ "repo_name": "MjAbuz/carrot2", "path": "core/carrot2-core/src/org/carrot2/core/Controller.java", "license": "bsd-3-clause", "size": 26301 }
[ "org.carrot2.util.ReflectionUtils" ]
import org.carrot2.util.ReflectionUtils;
import org.carrot2.util.*;
[ "org.carrot2.util" ]
org.carrot2.util;
219,138
public synchronized Version getLatestFinalVersion() { refreshLatestVersion(); return latestFinalVersion; }
synchronized Version function() { refreshLatestVersion(); return latestFinalVersion; }
/** * Returns the version number for the latest available Libresonic final version. * * @return The version number for the latest available Libresonic final version, or <code>null</code> * if the version number can't be resolved. */
Returns the version number for the latest available Libresonic final version
getLatestFinalVersion
{ "repo_name": "langera/libresonic", "path": "libresonic-main/src/main/java/org/libresonic/player/service/VersionService.java", "license": "gpl-3.0", "size": 9315 }
[ "org.libresonic.player.domain.Version" ]
import org.libresonic.player.domain.Version;
import org.libresonic.player.domain.*;
[ "org.libresonic.player" ]
org.libresonic.player;
2,436,885
public void onAfterResultSetGet(ResultSetInformation resultSetInformation, String columnLabel, Object value, SQLException e) { }
void function(ResultSetInformation resultSetInformation, String columnLabel, Object value, SQLException e) { }
/** * This callback method is executed after any of the {@link ResultSet}#get*(String) methods are invoked. * * @param resultSetInformation The meta information about the {@link ResultSet} being invoked * @param columnLabel The label for the column specified with the SQL AS clause. If the SQL AS clause was * not specified, then the label is the name of the column * @param value The column value; if the value is SQL NULL, the value returned is null * @param e The {@link SQLException} which may be triggered by the call (<code>null</code> if * there was no exception). */
This callback method is executed after any of the <code>ResultSet</code>#get*(String) methods are invoked
onAfterResultSetGet
{ "repo_name": "p6spy/p6spy", "path": "src/main/java/com/p6spy/engine/event/JdbcEventListener.java", "license": "apache-2.0", "size": 22874 }
[ "com.p6spy.engine.common.ResultSetInformation", "java.sql.SQLException" ]
import com.p6spy.engine.common.ResultSetInformation; import java.sql.SQLException;
import com.p6spy.engine.common.*; import java.sql.*;
[ "com.p6spy.engine", "java.sql" ]
com.p6spy.engine; java.sql;
1,673,333
public void setLogoDescription(@StringRes int resId) { setLogoDescription(getContext().getText(resId)); }
void function(@StringRes int resId) { setLogoDescription(getContext().getText(resId)); }
/** * Set a description of the toolbar's logo. * * <p>This description will be used for accessibility or other similar descriptions * of the UI.</p> * * @param resId String resource id */
Set a description of the toolbar's logo. This description will be used for accessibility or other similar descriptions of the UI
setLogoDescription
{ "repo_name": "zhaolewei/Chuang", "path": "AndroidSupportLibrary/src/android/support/v7/widget/Toolbar.java", "license": "apache-2.0", "size": 79622 }
[ "android.support.annotation.StringRes" ]
import android.support.annotation.StringRes;
import android.support.annotation.*;
[ "android.support" ]
android.support;
2,660,487
private static void writeToSparqlLog(String s) { new File("log").mkdirs(); File f = new File(sparqlLog); if(!f.canWrite() ){ try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } // logger.info("could not write SPARQL log to : " + f.getAbsolutePath()); // return ; } if (!logDeletedOnStart) { Files.createFile(f, s + "\n"); logDeletedOnStart = true; } else { Files.appendToFile(f, s + "\n"); } }
static void function(String s) { new File("log").mkdirs(); File f = new File(sparqlLog); if(!f.canWrite() ){ try { f.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } if (!logDeletedOnStart) { Files.createFile(f, s + "\n"); logDeletedOnStart = true; } else { Files.appendToFile(f, s + "\n"); } }
/** * Special log for debugging SPARQL query execution. It lives here: * "log/sparql.txt" if the directory doesn't exist, there could be an error. * * @param s * the String to log */
Special log for debugging SPARQL query execution. It lives here: "log/sparql.txt" if the directory doesn't exist, there could be an error
writeToSparqlLog
{ "repo_name": "eschwert/DL-Learner", "path": "components-core/src/main/java/org/dllearner/kb/sparql/SparqlQuery.java", "license": "gpl-3.0", "size": 8563 }
[ "java.io.File", "java.io.IOException", "org.dllearner.utilities.Files" ]
import java.io.File; import java.io.IOException; import org.dllearner.utilities.Files;
import java.io.*; import org.dllearner.utilities.*;
[ "java.io", "org.dllearner.utilities" ]
java.io; org.dllearner.utilities;
2,649,763
public static SystemUiHider getInstance(Activity activity, View anchorView, int flags) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { return new SystemUiHiderHoneycomb(activity, anchorView, flags); } else { return new SystemUiHiderBase(activity, anchorView, flags); } } protected SystemUiHider(Activity activity, View anchorView, int flags) { mActivity = activity; mAnchorView = anchorView; mFlags = flags; }
static SystemUiHider function(Activity activity, View anchorView, int flags) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { return new SystemUiHiderHoneycomb(activity, anchorView, flags); } else { return new SystemUiHiderBase(activity, anchorView, flags); } } protected SystemUiHider(Activity activity, View anchorView, int flags) { mActivity = activity; mAnchorView = anchorView; mFlags = flags; }
/** * Creates and returns an instance of {@link SystemUiHider} that is * appropriate for this device. The object will be either a * {@link SystemUiHiderBase} or {@link SystemUiHiderHoneycomb} depending on * the device. * * @param activity The activity whose window's system UI should be * controlled by this class. * @param anchorView The view on which * {@link View#setSystemUiVisibility(int)} will be called. * @param flags Either 0 or any combination of {@link #FLAG_FULLSCREEN}, * {@link #FLAG_HIDE_NAVIGATION}, and * {@link #FLAG_LAYOUT_IN_SCREEN_OLDER_DEVICES}. */
Creates and returns an instance of <code>SystemUiHider</code> that is appropriate for this device. The object will be either a <code>SystemUiHiderBase</code> or <code>SystemUiHiderHoneycomb</code> depending on the device
getInstance
{ "repo_name": "statox/robotz", "path": "app/src/main/java/com/statox/robotz/util/SystemUiHider.java", "license": "mit", "size": 5843 }
[ "android.app.Activity", "android.os.Build", "android.view.View" ]
import android.app.Activity; import android.os.Build; import android.view.View;
import android.app.*; import android.os.*; import android.view.*;
[ "android.app", "android.os", "android.view" ]
android.app; android.os; android.view;
2,092,349
public void quit() { mState = STATE_CLOSED; if (DEBUG) Log.d(TAG, "quit"); }
void function() { mState = STATE_CLOSED; if (DEBUG) Log.d(TAG, "quit"); }
/** * Graceful shutdown of background reader thread (called from master). */
Graceful shutdown of background reader thread (called from master)
quit
{ "repo_name": "A-Studio0/InsPicSoc", "path": "src/de/tavendo/autobahn/WebSocketReader.java", "license": "apache-2.0", "size": 23035 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
976,225
public void checkCurrencyIsValid(Group changedGroup) throws CurrencyNotValidException { if (changedGroup.getCurrency() == null) { throw new CurrencyNotValidException(); } }
void function(Group changedGroup) throws CurrencyNotValidException { if (changedGroup.getCurrency() == null) { throw new CurrencyNotValidException(); } }
/** * Checks if the currency in the given group is a valid one. * * <p> * This is done by looking if it's null. * If it is null, then GSON could'nt correctly map the textual currency to the enum. * Therefore, the given currency is invalid * </p> * * @param changedGroup The group object to check * @throws CurrencyNotValidException the given currency is invalid */
Checks if the currency in the given group is a valid one. This is done by looking if it's null. If it is null, then GSON could'nt correctly map the textual currency to the enum. Therefore, the given currency is invalid
checkCurrencyIsValid
{ "repo_name": "teiler/api.teiler.io", "path": "src/main/java/io/teiler/server/services/util/GroupUtil.java", "license": "mit", "size": 1628 }
[ "io.teiler.server.dto.Group", "io.teiler.server.util.exceptions.CurrencyNotValidException" ]
import io.teiler.server.dto.Group; import io.teiler.server.util.exceptions.CurrencyNotValidException;
import io.teiler.server.dto.*; import io.teiler.server.util.exceptions.*;
[ "io.teiler.server" ]
io.teiler.server;
2,313,111
public final V getAndUpdate(UnaryOperator<V> updateFunction) { V prev = get(), next = null; for (boolean haveNext = false;;) { if (!haveNext) next = updateFunction.apply(prev); if (weakCompareAndSetVolatile(prev, next)) return prev; haveNext = (prev == (prev = get())); } }
final V function(UnaryOperator<V> updateFunction) { V prev = get(), next = null; for (boolean haveNext = false;;) { if (!haveNext) next = updateFunction.apply(prev); if (weakCompareAndSetVolatile(prev, next)) return prev; haveNext = (prev == (prev = get())); } }
/** * Atomically updates (with memory effects as specified by {@link * VarHandle#compareAndSet}) the current value with the results of * applying the given function, returning the previous value. The * function should be side-effect-free, since it may be re-applied * when attempted updates fail due to contention among threads. * * @param updateFunction a side-effect-free function * @return the previous value * @since 1.8 */
Atomically updates (with memory effects as specified by <code>VarHandle#compareAndSet</code>) the current value with the results of applying the given function, returning the previous value. The function should be side-effect-free, since it may be re-applied when attempted updates fail due to contention among threads
getAndUpdate
{ "repo_name": "YouDiSN/OpenJDK-Research", "path": "jdk9/jdk/src/java.base/share/classes/java/util/concurrent/atomic/AtomicReference.java", "license": "gpl-2.0", "size": 15383 }
[ "java.util.function.UnaryOperator" ]
import java.util.function.UnaryOperator;
import java.util.function.*;
[ "java.util" ]
java.util;
2,034,433
String applicationDirectoryName = InstallationManager .getOrCreateApplicationDataDirectory() .getAbsolutePath(); // Create a wallet from a seed SeedPhraseGenerator seedGenerator = new Bip39SeedPhraseGenerator(); byte[] seed = seedGenerator.convertToSeed(Bip39SeedPhraseGenerator.split(ABANDON_SEED_PHRASE)); DeterministicKey privateMasterKey = HDKeyDerivation.createMasterPrivateKey(seed); // Trezor uses BIP-44 // BIP-44 starts from M/44h/0h/0h // Create a root node from which all addresses will be generated DeterministicKey trezorRootNode = WalletManager.generateTrezorWalletRootNode(privateMasterKey); WalletManager walletManager = WalletManager.INSTANCE; long nowInSeconds = Dates.nowInSeconds(); return walletManager.getOrCreateTrezorCloneHardWalletSummaryFromRootNode( new File(applicationDirectoryName), trezorRootNode, nowInSeconds, ABANDON_TREZOR_PASSWORD, "Example Trezor hard wallet", "Example empty wallet. Password is '" + ABANDON_TREZOR_PASSWORD + "'.", false); // No need to sync }
String applicationDirectoryName = InstallationManager .getOrCreateApplicationDataDirectory() .getAbsolutePath(); SeedPhraseGenerator seedGenerator = new Bip39SeedPhraseGenerator(); byte[] seed = seedGenerator.convertToSeed(Bip39SeedPhraseGenerator.split(ABANDON_SEED_PHRASE)); DeterministicKey privateMasterKey = HDKeyDerivation.createMasterPrivateKey(seed); DeterministicKey trezorRootNode = WalletManager.generateTrezorWalletRootNode(privateMasterKey); WalletManager walletManager = WalletManager.INSTANCE; long nowInSeconds = Dates.nowInSeconds(); return walletManager.getOrCreateTrezorCloneHardWalletSummaryFromRootNode( new File(applicationDirectoryName), trezorRootNode, nowInSeconds, ABANDON_TREZOR_PASSWORD, STR, STR + ABANDON_TREZOR_PASSWORD + "'.", false); }
/** * <p>Create an empty Trezor hard wallet in the current installation directory</p> * * @return The wallet summary if successful */
Create an empty Trezor hard wallet in the current installation directory
createEmptyTrezorHardWalletFixture
{ "repo_name": "akonring/multibit-hd-modified", "path": "mbhd-swing/src/test/java/org/multibit/hd/testing/WalletSummaryFixtures.java", "license": "mit", "size": 6798 }
[ "java.io.File", "org.bitcoinj.crypto.DeterministicKey", "org.bitcoinj.crypto.HDKeyDerivation", "org.multibit.commons.utils.Dates", "org.multibit.hd.brit.core.seed_phrase.Bip39SeedPhraseGenerator", "org.multibit.hd.brit.core.seed_phrase.SeedPhraseGenerator", "org.multibit.hd.core.managers.InstallationManager", "org.multibit.hd.core.managers.WalletManager" ]
import java.io.File; import org.bitcoinj.crypto.DeterministicKey; import org.bitcoinj.crypto.HDKeyDerivation; import org.multibit.commons.utils.Dates; import org.multibit.hd.brit.core.seed_phrase.Bip39SeedPhraseGenerator; import org.multibit.hd.brit.core.seed_phrase.SeedPhraseGenerator; import org.multibit.hd.core.managers.InstallationManager; import org.multibit.hd.core.managers.WalletManager;
import java.io.*; import org.bitcoinj.crypto.*; import org.multibit.commons.utils.*; import org.multibit.hd.brit.core.seed_phrase.*; import org.multibit.hd.core.managers.*;
[ "java.io", "org.bitcoinj.crypto", "org.multibit.commons", "org.multibit.hd" ]
java.io; org.bitcoinj.crypto; org.multibit.commons; org.multibit.hd;
271,735
boolean unlockBlock(final long blockId) throws IOException;
boolean unlockBlock(final long blockId) throws IOException;
/** * Unlocks the block. * * @param blockId The id of the block * @return true if success, false otherwise * @throws IOException if an I/O error occurs */
Unlocks the block
unlockBlock
{ "repo_name": "bit-zyl/Alluxio-Nvdimm", "path": "core/client/src/main/java/alluxio/client/block/BlockWorkerClient.java", "license": "apache-2.0", "size": 4125 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
604,628
public static Cursor getAllSongs(Context context, String[] projection, String sortOrder) { ContentResolver contentResolver = context.getContentResolver(); Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; String selection = MediaStore.Audio.Media.IS_MUSIC + "!= 0"; return contentResolver.query(uri, null, selection, null, sortOrder); }
static Cursor function(Context context, String[] projection, String sortOrder) { ContentResolver contentResolver = context.getContentResolver(); Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI; String selection = MediaStore.Audio.Media.IS_MUSIC + STR; return contentResolver.query(uri, null, selection, null, sortOrder); }
/** * Queries MediaStore and returns a cursor with all songs. */
Queries MediaStore and returns a cursor with all songs
getAllSongs
{ "repo_name": "yongjiliu/MusicPlayer", "path": "ACEMusicPlayer/src/main/java/com/aniruddhc/acemusic/player/DBHelpers/MediaStoreAccessHelper.java", "license": "gpl-2.0", "size": 4606 }
[ "android.content.ContentResolver", "android.content.Context", "android.database.Cursor", "android.net.Uri", "android.provider.MediaStore" ]
import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.provider.MediaStore;
import android.content.*; import android.database.*; import android.net.*; import android.provider.*;
[ "android.content", "android.database", "android.net", "android.provider" ]
android.content; android.database; android.net; android.provider;
744,581
public LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches) { LinkedList<Patch> patchesCopy = new LinkedList<Patch>(); for (Patch aPatch : patches) { Patch patchCopy = new Patch(); for (Diff aDiff : aPatch.diffs) { Diff diffCopy = new Diff(aDiff.operation, aDiff.text); patchCopy.diffs.add(diffCopy); } patchCopy.start1 = aPatch.start1; patchCopy.start2 = aPatch.start2; patchCopy.length1 = aPatch.length1; patchCopy.length2 = aPatch.length2; patchesCopy.add(patchCopy); } return patchesCopy; }
LinkedList<Patch> function(LinkedList<Patch> patches) { LinkedList<Patch> patchesCopy = new LinkedList<Patch>(); for (Patch aPatch : patches) { Patch patchCopy = new Patch(); for (Diff aDiff : aPatch.diffs) { Diff diffCopy = new Diff(aDiff.operation, aDiff.text); patchCopy.diffs.add(diffCopy); } patchCopy.start1 = aPatch.start1; patchCopy.start2 = aPatch.start2; patchCopy.length1 = aPatch.length1; patchCopy.length2 = aPatch.length2; patchesCopy.add(patchCopy); } return patchesCopy; }
/** * Given an array of patches, return another array that is identical. * @param patches Array of Patch objects. * @return Array of Patch objects. */
Given an array of patches, return another array that is identical
patch_deepCopy
{ "repo_name": "bluelatex/bluelatex-server", "path": "core/src/main/java/name/fraser/neil/plaintext/DiffMatchPatch.java", "license": "apache-2.0", "size": 85286 }
[ "java.util.LinkedList" ]
import java.util.LinkedList;
import java.util.*;
[ "java.util" ]
java.util;
1,517,641
public synchronized boolean download(@NonNull Context context, @NonNull DownloadRequest request) { if (downloads.containsKey(request.getSource())) { if (BuildConfig.DEBUG) Log.i(TAG, "DownloadRequest is already stored."); return false; } downloads.put(request.getSource(), request); Intent launchIntent = new Intent(context, DownloadService.class); launchIntent.putExtra(DownloadService.EXTRA_REQUEST, request); context.startService(launchIntent); return true; }
synchronized boolean function(@NonNull Context context, @NonNull DownloadRequest request) { if (downloads.containsKey(request.getSource())) { if (BuildConfig.DEBUG) Log.i(TAG, STR); return false; } downloads.put(request.getSource(), request); Intent launchIntent = new Intent(context, DownloadService.class); launchIntent.putExtra(DownloadService.EXTRA_REQUEST, request); context.startService(launchIntent); return true; }
/** * Starts a new download with the given DownloadRequest. This method should only * be used from outside classes if the DownloadRequest was created by the DownloadService to * ensure that the data is valid. Use downloadFeed(), downloadImage() or downloadMedia() instead. * * @param context Context object for starting the DownloadService * @param request The DownloadRequest. If another DownloadRequest with the same source URL is already stored, this method * call will return false. * @return True if the download request was accepted, false otherwise. */
Starts a new download with the given DownloadRequest. This method should only be used from outside classes if the DownloadRequest was created by the DownloadService to ensure that the data is valid. Use downloadFeed(), downloadImage() or downloadMedia() instead
download
{ "repo_name": "Woogis/SisatongPodcast", "path": "core/src/main/java/net/sisatong/podcast/core/storage/DownloadRequester.java", "license": "mit", "size": 14361 }
[ "android.content.Context", "android.content.Intent", "android.support.annotation.NonNull", "android.util.Log", "net.sisatong.podcast.core.BuildConfig", "net.sisatong.podcast.core.service.download.DownloadRequest", "net.sisatong.podcast.core.service.download.DownloadService" ]
import android.content.Context; import android.content.Intent; import android.support.annotation.NonNull; import android.util.Log; import net.sisatong.podcast.core.BuildConfig; import net.sisatong.podcast.core.service.download.DownloadRequest; import net.sisatong.podcast.core.service.download.DownloadService;
import android.content.*; import android.support.annotation.*; import android.util.*; import net.sisatong.podcast.core.*; import net.sisatong.podcast.core.service.download.*;
[ "android.content", "android.support", "android.util", "net.sisatong.podcast" ]
android.content; android.support; android.util; net.sisatong.podcast;
55,321
private void writeMockHook(final File hooksDirectory, final String hookName) throws FileNotFoundException, UnsupportedEncodingException { final PrintWriter writer = new PrintWriter(new File(hooksDirectory, hookName), "UTF-8"); writer.println("# something"); writer.close(); }
void function(final File hooksDirectory, final String hookName) throws FileNotFoundException, UnsupportedEncodingException { final PrintWriter writer = new PrintWriter(new File(hooksDirectory, hookName), "UTF-8"); writer.println(STR); writer.close(); }
/** * Creates mock hook in defined hooks directory. * @param hooksDirectory Directory in which mock hook is created. * @param hookName Name of the created hook. This is the filename of created hook file. * @throws FileNotFoundException * @throws UnsupportedEncodingException */
Creates mock hook in defined hooks directory
writeMockHook
{ "repo_name": "porcelli-forks/uberfire", "path": "uberfire-nio2-backport/uberfire-nio2-impls/uberfire-nio2-jgit/src/test/java/org/uberfire/java/nio/fs/jgit/JGitFileSystemProviderHookTest.java", "license": "apache-2.0", "size": 6718 }
[ "java.io.File", "java.io.FileNotFoundException", "java.io.PrintWriter", "java.io.UnsupportedEncodingException" ]
import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException;
import java.io.*;
[ "java.io" ]
java.io;
1,390,819
@NotNull LoaderStreamBuilderCompat<IN, OUT> on(@Nullable LoaderContextCompat context); interface LoaderStreamConfigurationCompat extends StreamConfiguration {
LoaderStreamBuilderCompat<IN, OUT> on(@Nullable LoaderContextCompat context); interface LoaderStreamConfigurationCompat extends StreamConfiguration {
/** * Sets the stream Loader context. * <br> * The context will be used by all the concatenated routines until changed. * <br> * If null it will cause the next routines to employ the configured runner instead of an Android * Loader. * * @param context the Loader context. * @return the new stream instance. */
Sets the stream Loader context. The context will be used by all the concatenated routines until changed. If null it will cause the next routines to employ the configured runner instead of an Android Loader
on
{ "repo_name": "davide-maestroni/jroutine", "path": "android-stream/src/main/java/com/github/dm/jrt/android/v4/stream/LoaderStreamBuilderCompat.java", "license": "apache-2.0", "size": 12450 }
[ "com.github.dm.jrt.android.v4.core.LoaderContextCompat", "org.jetbrains.annotations.Nullable" ]
import com.github.dm.jrt.android.v4.core.LoaderContextCompat; import org.jetbrains.annotations.Nullable;
import com.github.dm.jrt.android.v4.core.*; import org.jetbrains.annotations.*;
[ "com.github.dm", "org.jetbrains.annotations" ]
com.github.dm; org.jetbrains.annotations;
2,720,724
ByteBufUtils.writeItemStack(data, itemstack); }
ByteBufUtils.writeItemStack(data, itemstack); }
/** * Writes an ItemStack to a, Output Stream * * @param data * @param itemstack */
Writes an ItemStack to a, Output Stream
writeItemStack
{ "repo_name": "SlimeVoid/SlimevoidLibrary", "path": "src/main/java/net/slimevoid/library/util/helpers/NBTHelper.java", "license": "lgpl-3.0", "size": 3611 }
[ "net.minecraftforge.fml.common.network.ByteBufUtils" ]
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.*;
[ "net.minecraftforge.fml" ]
net.minecraftforge.fml;
1,162,808
public @Nonnull String createRoutingTable(@Nonnull String vlanId, @Nonnull String name, @Nonnull String description) throws CloudException, InternalException;
@Nonnull String function(@Nonnull String vlanId, @Nonnull String name, @Nonnull String description) throws CloudException, InternalException;
/** * Creates a new routing table for the target VLAN. * @param vlanId the VLAN for which a routing table is being created * @param name the name of the new routing table * @param description a description for the new routing table * @return a unique ID within the cloud for the specified routing table * @throws CloudException an error occurred with the cloud provider while creating the routing table * @throws InternalException a local error occurred creating the routing table */
Creates a new routing table for the target VLAN
createRoutingTable
{ "repo_name": "maksimov/dasein-cloud-core", "path": "src/main/java/org/dasein/cloud/network/VLANSupport.java", "license": "apache-2.0", "size": 44522 }
[ "javax.annotation.Nonnull", "org.dasein.cloud.CloudException", "org.dasein.cloud.InternalException" ]
import javax.annotation.Nonnull; import org.dasein.cloud.CloudException; import org.dasein.cloud.InternalException;
import javax.annotation.*; import org.dasein.cloud.*;
[ "javax.annotation", "org.dasein.cloud" ]
javax.annotation; org.dasein.cloud;
1,575,135
String toString(int indentFactor, int indent) { int i; Iterator<String> keys = keys(); String pad = ""; StringBuffer sb = new StringBuffer(); indent += indentFactor; for (i = 0; i < indent; i += 1) { pad += ' '; } sb.append("{\n"); while (keys.hasNext()) { String s = keys.next().toString(); Object o = myHashMap.get(s); if (o != null) { if (sb.length() > 2) { sb.append(",\n"); } sb.append(pad); sb.append(quote(s)); sb.append(": "); if (o instanceof String) { sb.append(quote((String)o)); } else if (o instanceof Number) { sb.append(numberToString((Number) o)); } else if (o instanceof JSONObject) { sb.append(((JSONObject)o).toString(indentFactor, indent)); } else if (o instanceof JSONArray) { sb.append(((JSONArray)o).toString(indentFactor, indent)); } else { sb.append(o.toString()); } } } sb.append('}'); return sb.toString(); }
String toString(int indentFactor, int indent) { int i; Iterator<String> keys = keys(); String pad = STR{\nSTR,\nSTR: "); if (o instanceof String) { sb.append(quote((String)o)); } else if (o instanceof Number) { sb.append(numberToString((Number) o)); } else if (o instanceof JSONObject) { sb.append(((JSONObject)o).toString(indentFactor, indent)); } else if (o instanceof JSONArray) { sb.append(((JSONArray)o).toString(indentFactor, indent)); } else { sb.append(o.toString()); } } } sb.append('}'); return sb.toString(); }
/** * Make a prettyprinted JSON string of this JSONObject. * <p> * Warning: This method assumes that the data structure is acyclical. * @param indentFactor The number of spaces to add to each level of * indentation. * @param indent The indentation of the top level. * @return a printable, displayable, transmittable * representation of the object, beginning * with <code>{</code>&nbsp;<small>(left brace)</small> and ending * with <code>}</code>&nbsp;<small>(right brace)</small>. */
Make a prettyprinted JSON string of this JSONObject. Warning: This method assumes that the data structure is acyclical
toString
{ "repo_name": "bjorn/tiled-java", "path": "plugins/json/src/org/json/JSONObject.java", "license": "gpl-2.0", "size": 27644 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,239,387
@Override public Statement createStatement() throws SQLException { checkStatus(); DASJStatement statement = new DASJStatement(this, ResultSet.TYPE_FORWARD_ONLY); this.dasStatements.add(statement); return statement; }
Statement function() throws SQLException { checkStatus(); DASJStatement statement = new DASJStatement(this, ResultSet.TYPE_FORWARD_ONLY); this.dasStatements.add(statement); return statement; }
/** * Creates a Statement object for sending SQL statements to the database. * Default type is TYPE_FORWARD_ONLY and default concurrency level is CONCUR_READ_ONLY. * * @return a new default Statement object * @throws SQLException */
Creates a Statement object for sending SQL statements to the database. Default type is TYPE_FORWARD_ONLY and default concurrency level is CONCUR_READ_ONLY
createStatement
{ "repo_name": "wso2/analytics-data-agents", "path": "das-jdbc/src/main/java/org/wso2/das/jdbcdriver/jdbc/DASJConnection.java", "license": "apache-2.0", "size": 19634 }
[ "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement" ]
import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,631,975
public static ViewDragHelper create(ViewGroup forParent, float sensitivity, Callback cb) { final ViewDragHelper helper = create(forParent, cb); helper.mTouchSlop = (int) (helper.mTouchSlop * (1 / sensitivity)); return helper; } private ViewDragHelper(Context context, ViewGroup forParent, Callback cb) { if (forParent == null) { throw new IllegalArgumentException("Parent view may not be null"); } if (cb == null) { throw new IllegalArgumentException("Callback may not be null"); } mParentView = forParent; mCallback = cb; final ViewConfiguration vc = ViewConfiguration.get(context); final float density = context.getResources().getDisplayMetrics().density; mEdgeSize = (int) (EDGE_SIZE * density + 0.5f); mTouchSlop = vc.getScaledTouchSlop(); mMaxVelocity = vc.getScaledMaximumFlingVelocity(); mMinVelocity = vc.getScaledMinimumFlingVelocity(); mScroller = ScrollerCompat.create(context, sInterpolator); }
static ViewDragHelper function(ViewGroup forParent, float sensitivity, Callback cb) { final ViewDragHelper helper = create(forParent, cb); helper.mTouchSlop = (int) (helper.mTouchSlop * (1 / sensitivity)); return helper; } private ViewDragHelper(Context context, ViewGroup forParent, Callback cb) { if (forParent == null) { throw new IllegalArgumentException(STR); } if (cb == null) { throw new IllegalArgumentException(STR); } mParentView = forParent; mCallback = cb; final ViewConfiguration vc = ViewConfiguration.get(context); final float density = context.getResources().getDisplayMetrics().density; mEdgeSize = (int) (EDGE_SIZE * density + 0.5f); mTouchSlop = vc.getScaledTouchSlop(); mMaxVelocity = vc.getScaledMaximumFlingVelocity(); mMinVelocity = vc.getScaledMinimumFlingVelocity(); mScroller = ScrollerCompat.create(context, sInterpolator); }
/** * Factory method to create a new ViewDragHelper. * * @param forParent Parent view to monitor * @param sensitivity Multiplier for how sensitive the helper should be * about detecting the start of a drag. Larger values are more * sensitive. 1.0f is normal. * @param cb Callback to provide information and receive events * @return a new ViewDragHelper instance */
Factory method to create a new ViewDragHelper
create
{ "repo_name": "KouChengjian/PhoneMate", "path": "PhoneSuperviser/src/com/kcj/phonesuperviser/view/swipeback/ViewDragHelper.java", "license": "gpl-2.0", "size": 61280 }
[ "android.content.Context", "android.support.v4.widget.ScrollerCompat", "android.view.ViewConfiguration", "android.view.ViewGroup" ]
import android.content.Context; import android.support.v4.widget.ScrollerCompat; import android.view.ViewConfiguration; import android.view.ViewGroup;
import android.content.*; import android.support.v4.widget.*; import android.view.*;
[ "android.content", "android.support", "android.view" ]
android.content; android.support; android.view;
2,787,674
@Test public void testGetKeysPrefixSynchronized() { config.getKeys("test"); sync.verify(Methods.BEGIN_READ, Methods.END_READ); }
void function() { config.getKeys("test"); sync.verify(Methods.BEGIN_READ, Methods.END_READ); }
/** * Tests whether getKeys(String prefix) is correctly synchronized. */
Tests whether getKeys(String prefix) is correctly synchronized
testGetKeysPrefixSynchronized
{ "repo_name": "mohanaraosv/commons-configuration", "path": "src/test/java/org/apache/commons/configuration2/TestAbstractConfigurationSynchronization.java", "license": "apache-2.0", "size": 7729 }
[ "org.apache.commons.configuration2.SynchronizerTestImpl" ]
import org.apache.commons.configuration2.SynchronizerTestImpl;
import org.apache.commons.configuration2.*;
[ "org.apache.commons" ]
org.apache.commons;
2,552,931
public static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height) { Insets insets; if(b != null) insets = b.getBorderInsets(c); else insets = new Insets(0, 0, 0, 0); return new Rectangle(x + insets.left, y + insets.top, width - insets.right - insets.left, height - insets.top - insets.bottom); }
static Rectangle function(Component c, Border b, int x, int y, int width, int height) { Insets insets; if(b != null) insets = b.getBorderInsets(c); else insets = new Insets(0, 0, 0, 0); return new Rectangle(x + insets.left, y + insets.top, width - insets.right - insets.left, height - insets.top - insets.bottom); }
/** * Returns a rectangle using the arguments minus the * insets of the border. This is useful for determining the area * that components should draw in that will not intersect the border. * @param c the component for which this border is being computed * @param b the <code>Border</code> object * @param x the x position of the border * @param y the y position of the border * @param width the width of the border * @param height the height of the border * @return a <code>Rectangle</code> containing the interior coordinates */
Returns a rectangle using the arguments minus the insets of the border. This is useful for determining the area that components should draw in that will not intersect the border
getInteriorRectangle
{ "repo_name": "TheTypoMaster/Scaper", "path": "openjdk/jdk/src/share/classes/javax/swing/border/AbstractBorder.java", "license": "gpl-2.0", "size": 8281 }
[ "java.awt.Component", "java.awt.Insets", "java.awt.Rectangle" ]
import java.awt.Component; import java.awt.Insets; import java.awt.Rectangle;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,072,115
public Builder withState(@NonNull String state) { this.values.put(KEY_STATE, state); return this; }
Builder function(@NonNull String state) { this.values.put(KEY_STATE, state); return this; }
/** * Use a custom state in the requests * * @param state to use in the requests * @return the current builder instance */
Use a custom state in the requests
withState
{ "repo_name": "thirteen23/Auth0.Android", "path": "auth0/src/main/java/com/auth0/android/provider/WebAuthProvider.java", "license": "mit", "size": 24956 }
[ "android.support.annotation.NonNull" ]
import android.support.annotation.NonNull;
import android.support.annotation.*;
[ "android.support" ]
android.support;
1,653,872
public void writeExif(byte[] jpeg, String exifOutFileName) throws FileNotFoundException, IOException { if (jpeg == null || exifOutFileName == null) { throw new IllegalArgumentException(NULL_ARGUMENT_STRING); } OutputStream s = null; try { s = getExifWriterStream(exifOutFileName); s.write(jpeg, 0, jpeg.length); s.flush(); } catch (IOException e) { closeSilently(s); throw e; } s.close(); }
void function(byte[] jpeg, String exifOutFileName) throws FileNotFoundException, IOException { if (jpeg == null exifOutFileName == null) { throw new IllegalArgumentException(NULL_ARGUMENT_STRING); } OutputStream s = null; try { s = getExifWriterStream(exifOutFileName); s.write(jpeg, 0, jpeg.length); s.flush(); } catch (IOException e) { closeSilently(s); throw e; } s.close(); }
/** * Writes the tags from this ExifInterface object into a jpeg image, * removing prior exif tags. * * @param jpeg a byte array containing a jpeg compressed image. * @param exifOutFileName a String containing the filepath to which the jpeg * image with added exif tags will be written. * @throws FileNotFoundException * @throws IOException */
Writes the tags from this ExifInterface object into a jpeg image, removing prior exif tags
writeExif
{ "repo_name": "Mr-lin930819/SimplOS", "path": "WallpaperPicker/src/com/android/gallery3d/exif/ExifInterface.java", "license": "gpl-3.0", "size": 92556 }
[ "java.io.FileNotFoundException", "java.io.IOException", "java.io.OutputStream" ]
import java.io.FileNotFoundException; import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
519,516
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<DriveBitLockerKeyInner>> listSinglePageAsync(String jobName, String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (jobName == null) { return Mono.error(new IllegalArgumentException("Parameter jobName 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.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .list( this.client.getEndpoint(), jobName, this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), this.client.getAcceptLanguage(), accept, context)) .<PagedResponse<DriveBitLockerKeyInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<DriveBitLockerKeyInner>> function(String jobName, String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (jobName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } final String accept = STR; return FluxUtil .withContext( context -> service .list( this.client.getEndpoint(), jobName, this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), this.client.getAcceptLanguage(), accept, context)) .<PagedResponse<DriveBitLockerKeyInner>>map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
/** * Returns the BitLocker Keys for all drives in the specified job. * * @param jobName The name of the import/export job. * @param resourceGroupName The resource group name uniquely identifies the resource group within the user * subscription. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return getBitLockerKeys response. */
Returns the BitLocker Keys for all drives in the specified job
listSinglePageAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/storageimportexport/azure-resourcemanager-storageimportexport/src/main/java/com/azure/resourcemanager/storageimportexport/implementation/BitLockerKeysClientImpl.java", "license": "mit", "size": 12066 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedResponse", "com.azure.core.http.rest.PagedResponseBase", "com.azure.core.util.FluxUtil", "com.azure.resourcemanager.storageimportexport.fluent.models.DriveBitLockerKeyInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.storageimportexport.fluent.models.DriveBitLockerKeyInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.storageimportexport.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,518,163
List<StateBarComponent> components = CollectionUtils.copyOf(viewService.getStateBarComponents()); if (components.isEmpty()) { setVisible(false); } else { setVisible(true); Collections.sort(components, new LeftToRightComparator()); currentColumn = 0; addLeftComponents(components); addCenterComponents(components); addRightComponents(components); } }
List<StateBarComponent> components = CollectionUtils.copyOf(viewService.getStateBarComponents()); if (components.isEmpty()) { setVisible(false); } else { setVisible(true); Collections.sort(components, new LeftToRightComparator()); currentColumn = 0; addLeftComponents(components); addCenterComponents(components); addRightComponents(components); } }
/** * Build the state bar. */
Build the state bar
build
{ "repo_name": "wichtounet/jtheque-core", "path": "jtheque-views/src/main/java/org/jtheque/views/impl/components/panel/JThequeStateBar.java", "license": "apache-2.0", "size": 6049 }
[ "java.util.Collections", "java.util.List", "org.jtheque.utils.collections.CollectionUtils", "org.jtheque.views.components.StateBarComponent" ]
import java.util.Collections; import java.util.List; import org.jtheque.utils.collections.CollectionUtils; import org.jtheque.views.components.StateBarComponent;
import java.util.*; import org.jtheque.utils.collections.*; import org.jtheque.views.components.*;
[ "java.util", "org.jtheque.utils", "org.jtheque.views" ]
java.util; org.jtheque.utils; org.jtheque.views;
800,663
public NodeList<ArraySlot> getSlots() { return slots; }
NodeList<ArraySlot> function() { return slots; }
/** * Gets the slots. * * @return the slots */
Gets the slots
getSlots
{ "repo_name": "DigiArea/jse-model", "path": "com.digiarea.jse/src/com/digiarea/jse/MethodDeclaration.java", "license": "epl-1.0", "size": 8741 }
[ "com.digiarea.jse.ArraySlot", "com.digiarea.jse.NodeList" ]
import com.digiarea.jse.ArraySlot; import com.digiarea.jse.NodeList;
import com.digiarea.jse.*;
[ "com.digiarea.jse" ]
com.digiarea.jse;
2,719,739
@Override public void onBrowserEvent(Event event) { if (!shouldCancel(event)) return; switch (event.getTypeInt()) { case Event.ONTOUCHSTART: case Event.ONTOUCHEND: if (isForm()) { select(event); } case Event.ONTOUCHMOVE: case Event.ONTOUCHCANCEL: cancelBrowserEvent(event); DomEvent.fireNativeEvent(event, handlers); break; case Event.ONMOUSEDOWN: case Event.ONMOUSEUP: case Event.ONMOUSEMOVE: case Event.ONMOUSEOVER: case Event.ONMOUSEOUT: cancelBrowserEvent(event); mouseListeners.fireMouseEvent(this, event); break; case Event.ONCLICK: cancelBrowserEvent(event); select(event); break; default: // Ignore unexpected events break; } }
void function(Event event) { if (!shouldCancel(event)) return; switch (event.getTypeInt()) { case Event.ONTOUCHSTART: case Event.ONTOUCHEND: if (isForm()) { select(event); } case Event.ONTOUCHMOVE: case Event.ONTOUCHCANCEL: cancelBrowserEvent(event); DomEvent.fireNativeEvent(event, handlers); break; case Event.ONMOUSEDOWN: case Event.ONMOUSEUP: case Event.ONMOUSEMOVE: case Event.ONMOUSEOVER: case Event.ONMOUSEOUT: cancelBrowserEvent(event); mouseListeners.fireMouseEvent(this, event); break; case Event.ONCLICK: cancelBrowserEvent(event); select(event); break; default: break; } }
/** * Invoked by GWT whenever a browser event is dispatched to this component. */
Invoked by GWT whenever a browser event is dispatched to this component
onBrowserEvent
{ "repo_name": "ewpatton/appinventor-sources", "path": "appinventor/appengine/src/com/google/appinventor/client/editor/simple/components/MockComponent.java", "license": "apache-2.0", "size": 41403 }
[ "com.google.gwt.event.dom.client.DomEvent", "com.google.gwt.user.client.Event" ]
import com.google.gwt.event.dom.client.DomEvent; import com.google.gwt.user.client.Event;
import com.google.gwt.event.dom.client.*; import com.google.gwt.user.client.*;
[ "com.google.gwt" ]
com.google.gwt;
2,422,414
@Override public long getFirstMillisecond(Calendar calendar) { int month = Quarter.FIRST_MONTH_IN_QUARTER[this.quarter]; calendar.set(this.year, month - 1, 1, 0, 0, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTimeInMillis(); }
long function(Calendar calendar) { int month = Quarter.FIRST_MONTH_IN_QUARTER[this.quarter]; calendar.set(this.year, month - 1, 1, 0, 0, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTimeInMillis(); }
/** * Returns the first millisecond in the Quarter, evaluated using the * supplied calendar (which determines the time zone). * * @param calendar the calendar ({@code null} not permitted). * * @return The first millisecond in the Quarter. * * @throws NullPointerException if {@code calendar} is * {@code null}. */
Returns the first millisecond in the Quarter, evaluated using the supplied calendar (which determines the time zone)
getFirstMillisecond
{ "repo_name": "jfree/jfreechart", "path": "src/main/java/org/jfree/data/time/Quarter.java", "license": "lgpl-2.1", "size": 15687 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
1,294,943
private void acknowledgeMessage(AbstractJMSMessage message) throws AMQException { if (!_preAcquire) { RangeSet ranges = new RangeSet(); ranges.add((int) message.getDeliveryTag()); _0_10session.messageAcknowledge (ranges, _acknowledgeMode != org.wso2.andes.jms.Session.NO_ACKNOWLEDGE); AMQException amqe = _0_10session.getCurrentException(); if (amqe != null) { throw amqe; } } }
void function(AbstractJMSMessage message) throws AMQException { if (!_preAcquire) { RangeSet ranges = new RangeSet(); ranges.add((int) message.getDeliveryTag()); _0_10session.messageAcknowledge (ranges, _acknowledgeMode != org.wso2.andes.jms.Session.NO_ACKNOWLEDGE); AMQException amqe = _0_10session.getCurrentException(); if (amqe != null) { throw amqe; } } }
/** * Acknowledge a message * * @param message The message to be acknowledged * @throws AMQException If the message cannot be acquired due to some internal error. */
Acknowledge a message
acknowledgeMessage
{ "repo_name": "hastef88/andes", "path": "modules/andes-core/client/src/main/java/org/wso2/andes/client/BasicMessageConsumer_0_10.java", "license": "apache-2.0", "size": 19190 }
[ "org.wso2.andes.AMQException", "org.wso2.andes.client.message.AbstractJMSMessage", "org.wso2.andes.transport.RangeSet" ]
import org.wso2.andes.AMQException; import org.wso2.andes.client.message.AbstractJMSMessage; import org.wso2.andes.transport.RangeSet;
import org.wso2.andes.*; import org.wso2.andes.client.message.*; import org.wso2.andes.transport.*;
[ "org.wso2.andes" ]
org.wso2.andes;
1,480,812
@Override public Email setMsg(final String msg) throws EmailException { // throw exception on null message if (EmailUtils.isEmpty(msg)) { throw new EmailException("Invalid message supplied"); } try { final BodyPart primary = getPrimaryBodyPart(); if (primary instanceof MimePart && EmailUtils.isNotEmpty(charset)) { ((MimePart) primary).setText(msg, charset); } else { primary.setText(msg); } } catch (final MessagingException me) { throw new EmailException(me); } return this; }
Email function(final String msg) throws EmailException { if (EmailUtils.isEmpty(msg)) { throw new EmailException(STR); } try { final BodyPart primary = getPrimaryBodyPart(); if (primary instanceof MimePart && EmailUtils.isNotEmpty(charset)) { ((MimePart) primary).setText(msg, charset); } else { primary.setText(msg); } } catch (final MessagingException me) { throw new EmailException(me); } return this; }
/** * Set the message of the email. * * @param msg A String. * @return An Email. * @throws EmailException see javax.mail.internet.MimeBodyPart * for definitions * @since 1.0 */
Set the message of the email
setMsg
{ "repo_name": "apache/commons-email", "path": "src/main/java/org/apache/commons/mail/MultiPartEmail.java", "license": "apache-2.0", "size": 16054 }
[ "javax.mail.BodyPart", "javax.mail.MessagingException", "javax.mail.internet.MimePart" ]
import javax.mail.BodyPart; import javax.mail.MessagingException; import javax.mail.internet.MimePart;
import javax.mail.*; import javax.mail.internet.*;
[ "javax.mail" ]
javax.mail;
2,621,583
public Bitmap getBitmap() { return mBitmap; }
Bitmap function() { return mBitmap; }
/** * Returns the bitmap associated with the request URL if it has been loaded, null otherwise. */
Returns the bitmap associated with the request URL if it has been loaded, null otherwise
getBitmap
{ "repo_name": "chenjishi/itouxian", "path": "src/volley/toolbox/ImageLoader.java", "license": "mit", "size": 19031 }
[ "android.graphics.Bitmap" ]
import android.graphics.Bitmap;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
422,982
public static String parseShortOutcode(final String code) { Matcher matcher = SHORT_OUTCODE_PATTERN.matcher(code); return matcher.matches() ? matcher.group(1) : ""; }
static String function(final String code) { Matcher matcher = SHORT_OUTCODE_PATTERN.matcher(code); return matcher.matches() ? matcher.group(1) : ""; }
/** * Parse the short form of an outcode from a string. For example, SW1 from * SW1A 1AA. * * @param code the string to parse the outcode from * @return the short outcode, or the empty string if it cannot be parsed */
Parse the short form of an outcode from a string. For example, SW1 from SW1A 1AA
parseShortOutcode
{ "repo_name": "chriswareham/superfly", "path": "src/main/java/net/chriswareham/util/Postcodes.java", "license": "bsd-2-clause", "size": 4106 }
[ "java.util.regex.Matcher" ]
import java.util.regex.Matcher;
import java.util.regex.*;
[ "java.util" ]
java.util;
2,051,074
public void deleteEntries(int[] indices) { List<NamedValue> toRemove = new ArrayList<NamedValue>(); for (int index : indices) toRemove.add(getRow(index)); data.removeAll(toRemove); syncBackToMap(); } /** * Set the {@link MapAnnotationData} to represent * * @param map * The {@link MapAnnotationData}
void function(int[] indices) { List<NamedValue> toRemove = new ArrayList<NamedValue>(); for (int index : indices) toRemove.add(getRow(index)); data.removeAll(toRemove); syncBackToMap(); } /** * Set the {@link MapAnnotationData} to represent * * @param map * The {@link MapAnnotationData}
/** * Delete entries at certain positions * * @param indices * The positions of the entries to delete */
Delete entries at certain positions
deleteEntries
{ "repo_name": "stelfrich/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/maptable/MapTableModel.java", "license": "gpl-2.0", "size": 7547 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
809,528
private void setLocationForTableUI(IItem tableUIRoot) { Vector2f loc = new Vector2f(); switch (tableCount) { case 0: { loc.set(-250, 200); break; } case 1: { loc.set(250, 200); break; } case 2: { loc.set(-250, -200); break; } case 3: { loc.set(250, -200); break; } } tableUIRoot.setRelativeLocation(loc); }
void function(IItem tableUIRoot) { Vector2f loc = new Vector2f(); switch (tableCount) { case 0: { loc.set(-250, 200); break; } case 1: { loc.set(250, 200); break; } case 2: { loc.set(-250, -200); break; } case 3: { loc.set(250, -200); break; } } tableUIRoot.setRelativeLocation(loc); }
/** * Sets the location for table ui. * * @param tableUIRoot * the new location for table ui */
Sets the location for table ui
setLocationForTableUI
{ "repo_name": "synergynet/synergynet3.1", "path": "synergynet3.1-parent/synergynet3-numbernet-table/src/main/java/synergynet3/apps/numbernet/ui/projection/scores/ProjectScoresUI.java", "license": "bsd-3-clause", "size": 3897 }
[ "com.jme3.math.Vector2f" ]
import com.jme3.math.Vector2f;
import com.jme3.math.*;
[ "com.jme3.math" ]
com.jme3.math;
433,481
public void setDrafts(List<PostDraft> drafts) { this.drafts = drafts; }
void function(List<PostDraft> drafts) { this.drafts = drafts; }
/** * Sets list of drafts to current topic * * @param drafts list of drafts to set */
Sets list of drafts to current topic
setDrafts
{ "repo_name": "NCNecros/jcommune", "path": "jcommune-model/src/main/java/org/jtalks/jcommune/model/entity/Topic.java", "license": "lgpl-2.1", "size": 23384 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,900,546
public WFSResponse getMiningActivityGml(String serviceURL, String mineName, String startDate, String endDate, String oreProcessed, String producedMaterial, String cutOffGrade, String production, int maxFeatures, FilterBoundingBox bbox ) throws Exception { //create the filter MiningActivityFilter filter = new MiningActivityFilter(mineName, startDate, endDate, oreProcessed, producedMaterial, cutOffGrade, production); String filterString = generateFilterString(filter, bbox); HttpRequestBase method = generateWFSRequest(serviceURL, MINING_ACTIVITY_FEATURE_TYPE, null, filterString, maxFeatures, null, ResultType.Results); try { String response = httpServiceCaller.getMethodResponseAsString(method); return new WFSResponse(response, method); } catch (Exception ex) { throw new PortalServiceException(method, ex); } }
WFSResponse function(String serviceURL, String mineName, String startDate, String endDate, String oreProcessed, String producedMaterial, String cutOffGrade, String production, int maxFeatures, FilterBoundingBox bbox ) throws Exception { MiningActivityFilter filter = new MiningActivityFilter(mineName, startDate, endDate, oreProcessed, producedMaterial, cutOffGrade, production); String filterString = generateFilterString(filter, bbox); HttpRequestBase method = generateWFSRequest(serviceURL, MINING_ACTIVITY_FEATURE_TYPE, null, filterString, maxFeatures, null, ResultType.Results); try { String response = httpServiceCaller.getMethodResponseAsString(method); return new WFSResponse(response, method); } catch (Exception ex) { throw new PortalServiceException(method, ex); } }
/** * Given a list of parameters, call a service and get the Mineral Activity features as GML/KML * * @param serviceURL * @param mineName * @param startDate * @param endDate * @param oreProcessed * @param producedMaterial * @param cutOffGrade * @param production * @param maxFeatures * @param bbox * [Optional] the spatial bounds to constrain the result set * @return * @throws Exception */
Given a list of parameters, call a service and get the Mineral Activity features as GML/KML
getMiningActivityGml
{ "repo_name": "victortey/AuScope-Portal", "path": "src/main/java/org/auscope/portal/server/web/service/MineralOccurrenceService.java", "license": "lgpl-3.0", "size": 14213 }
[ "org.apache.http.client.methods.HttpRequestBase", "org.auscope.portal.core.services.PortalServiceException", "org.auscope.portal.core.services.methodmakers.WFSGetFeatureMethodMaker", "org.auscope.portal.core.services.methodmakers.filter.FilterBoundingBox", "org.auscope.portal.core.services.responses.wfs.WFSResponse", "org.auscope.portal.mineraloccurrence.MiningActivityFilter" ]
import org.apache.http.client.methods.HttpRequestBase; import org.auscope.portal.core.services.PortalServiceException; import org.auscope.portal.core.services.methodmakers.WFSGetFeatureMethodMaker; import org.auscope.portal.core.services.methodmakers.filter.FilterBoundingBox; import org.auscope.portal.core.services.responses.wfs.WFSResponse; import org.auscope.portal.mineraloccurrence.MiningActivityFilter;
import org.apache.http.client.methods.*; import org.auscope.portal.core.services.*; import org.auscope.portal.core.services.methodmakers.*; import org.auscope.portal.core.services.methodmakers.filter.*; import org.auscope.portal.core.services.responses.wfs.*; import org.auscope.portal.mineraloccurrence.*;
[ "org.apache.http", "org.auscope.portal" ]
org.apache.http; org.auscope.portal;
2,218,889
protected Map<String, Object> filterClaimsByScope(Map<String, Object> userClaims, String[] requestedScopes, String clientId, String serviceProviderTenantDomain) { return OpenIDConnectServiceComponentHolder.getInstance() .getHighestPriorityOpenIDConnectClaimFilter() .getClaimsFilteredByOIDCScopes(userClaims, requestedScopes, clientId, serviceProviderTenantDomain); }
Map<String, Object> function(Map<String, Object> userClaims, String[] requestedScopes, String clientId, String serviceProviderTenantDomain) { return OpenIDConnectServiceComponentHolder.getInstance() .getHighestPriorityOpenIDConnectClaimFilter() .getClaimsFilteredByOIDCScopes(userClaims, requestedScopes, clientId, serviceProviderTenantDomain); }
/** * Filter user claims based on the OIDC Scopes defined at server level. * * @param requestedScopes Requested Scopes in the OIDC Request * @param serviceProviderTenantDomain Tenant domain of the service provider * @param userClaims Map of user claims * @return */
Filter user claims based on the OIDC Scopes defined at server level
filterClaimsByScope
{ "repo_name": "darshanasbg/identity-inbound-auth-oauth", "path": "components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/openidconnect/DefaultOIDCClaimsCallbackHandler.java", "license": "apache-2.0", "size": 38401 }
[ "java.util.Map", "org.wso2.carbon.identity.openidconnect.internal.OpenIDConnectServiceComponentHolder" ]
import java.util.Map; import org.wso2.carbon.identity.openidconnect.internal.OpenIDConnectServiceComponentHolder;
import java.util.*; import org.wso2.carbon.identity.openidconnect.internal.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
2,336,460
public PublicKey getPublicKey() { return publicKey; }
PublicKey function() { return publicKey; }
/** * get the PublicKey that should be used to verify the signature in the exchange. */
get the PublicKey that should be used to verify the signature in the exchange
getPublicKey
{ "repo_name": "punkhorn/camel-upstream", "path": "components/camel-crypto/src/main/java/org/apache/camel/component/crypto/DigitalSignatureConfiguration.java", "license": "apache-2.0", "size": 16254 }
[ "java.security.PublicKey" ]
import java.security.PublicKey;
import java.security.*;
[ "java.security" ]
java.security;
1,179,186
@Test public void test254ModifyUserBarbossaDisable() throws Exception { final String TEST_NAME = "test254ModifyUserBarbossaDisable"; TestUtil.displayTestTile(this, TEST_NAME); // GIVEN Task task = taskManager.createTaskInstance(TestProjector.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); LensContext<UserType> context = createUserAccountContext(); fillContextWithUser(context, USER_BARBOSSA_OID, result); fillContextWithAccount(context, ACCOUNT_HBARBOSSA_DUMMY_OID, result); addModificationToContextReplaceUserProperty(context, new ItemPath(UserType.F_ACTIVATION, ActivationType.F_ADMINISTRATIVE_STATUS), ActivationStatusType.DISABLED); context.recompute(); display("Input context", context); assertFocusModificationSanity(context); // WHEN projector.project(context, "test", task, result); // THEN display("Output context", context); assertTrue(context.getFocusContext().getPrimaryDelta().getChangeType() == ChangeType.MODIFY); assertSideEffectiveDeltasOnly(context.getFocusContext().getSecondaryDelta(), "user secondary delta", ActivationStatusType.DISABLED); assertFalse("No account changes", context.getProjectionContexts().isEmpty()); Collection<LensProjectionContext> accountContexts = context.getProjectionContexts(); assertEquals(1, accountContexts.size()); LensProjectionContext accContext = accountContexts.iterator().next(); assertNull(accContext.getPrimaryDelta()); assertEquals(SynchronizationPolicyDecision.KEEP,accContext.getSynchronizationPolicyDecision()); ObjectDelta<ShadowType> accountSecondaryDelta = accContext.getSecondaryDelta(); assertNotNull("No account secondary delta", accountSecondaryDelta); assertEquals(ChangeType.MODIFY, accountSecondaryDelta.getChangeType()); assertEquals("Unexpected number of account secondary changes", 6, accountSecondaryDelta.getModifications().size()); PropertyDelta<ActivationStatusType> enabledDelta = accountSecondaryDelta.findPropertyDelta(new ItemPath(ShadowType.F_ACTIVATION, ActivationType.F_ADMINISTRATIVE_STATUS)); PrismAsserts.assertReplace(enabledDelta, ActivationStatusType.DISABLED); PrismAsserts.assertOrigin(enabledDelta, OriginType.OUTBOUND); PrismAsserts.assertPropertyReplace(accountSecondaryDelta, SchemaConstants.PATH_ACTIVATION_DISABLE_REASON, SchemaConstants.MODEL_DISABLE_REASON_MAPPED); ContainerDelta<TriggerType> triggerDelta = accountSecondaryDelta.findContainerDelta(ObjectType.F_TRIGGER); assertNotNull("No trigger delta in account secondary delta", triggerDelta); assertEquals("Wrong trigger delta size", 1, triggerDelta.getValuesToAdd().size()); TriggerType triggerType = triggerDelta.getValuesToAdd().iterator().next().asContainerable(); assertEquals("Wrong trigger URL", RecomputeTriggerHandler.HANDLER_URI, triggerType.getHandlerUri()); XMLGregorianCalendar start = clock.currentTimeXMLGregorianCalendar(); start.add(XmlTypeConverter.createDuration(true, 0, 0, 25, 0, 0, 0)); XMLGregorianCalendar end = clock.currentTimeXMLGregorianCalendar(); end.add(XmlTypeConverter.createDuration(true, 0, 0, 35, 0, 0, 0)); IntegrationTestTools.assertBetween("Wrong trigger timestamp", start, end, triggerType.getTimestamp()); }
void function() throws Exception { final String TEST_NAME = STR; TestUtil.displayTestTile(this, TEST_NAME); Task task = taskManager.createTaskInstance(TestProjector.class.getName() + "." + TEST_NAME); OperationResult result = task.getResult(); assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL); LensContext<UserType> context = createUserAccountContext(); fillContextWithUser(context, USER_BARBOSSA_OID, result); fillContextWithAccount(context, ACCOUNT_HBARBOSSA_DUMMY_OID, result); addModificationToContextReplaceUserProperty(context, new ItemPath(UserType.F_ACTIVATION, ActivationType.F_ADMINISTRATIVE_STATUS), ActivationStatusType.DISABLED); context.recompute(); display(STR, context); assertFocusModificationSanity(context); projector.project(context, "test", task, result); display(STR, context); assertTrue(context.getFocusContext().getPrimaryDelta().getChangeType() == ChangeType.MODIFY); assertSideEffectiveDeltasOnly(context.getFocusContext().getSecondaryDelta(), STR, ActivationStatusType.DISABLED); assertFalse(STR, context.getProjectionContexts().isEmpty()); Collection<LensProjectionContext> accountContexts = context.getProjectionContexts(); assertEquals(1, accountContexts.size()); LensProjectionContext accContext = accountContexts.iterator().next(); assertNull(accContext.getPrimaryDelta()); assertEquals(SynchronizationPolicyDecision.KEEP,accContext.getSynchronizationPolicyDecision()); ObjectDelta<ShadowType> accountSecondaryDelta = accContext.getSecondaryDelta(); assertNotNull(STR, accountSecondaryDelta); assertEquals(ChangeType.MODIFY, accountSecondaryDelta.getChangeType()); assertEquals(STR, 6, accountSecondaryDelta.getModifications().size()); PropertyDelta<ActivationStatusType> enabledDelta = accountSecondaryDelta.findPropertyDelta(new ItemPath(ShadowType.F_ACTIVATION, ActivationType.F_ADMINISTRATIVE_STATUS)); PrismAsserts.assertReplace(enabledDelta, ActivationStatusType.DISABLED); PrismAsserts.assertOrigin(enabledDelta, OriginType.OUTBOUND); PrismAsserts.assertPropertyReplace(accountSecondaryDelta, SchemaConstants.PATH_ACTIVATION_DISABLE_REASON, SchemaConstants.MODEL_DISABLE_REASON_MAPPED); ContainerDelta<TriggerType> triggerDelta = accountSecondaryDelta.findContainerDelta(ObjectType.F_TRIGGER); assertNotNull(STR, triggerDelta); assertEquals(STR, 1, triggerDelta.getValuesToAdd().size()); TriggerType triggerType = triggerDelta.getValuesToAdd().iterator().next().asContainerable(); assertEquals(STR, RecomputeTriggerHandler.HANDLER_URI, triggerType.getHandlerUri()); XMLGregorianCalendar start = clock.currentTimeXMLGregorianCalendar(); start.add(XmlTypeConverter.createDuration(true, 0, 0, 25, 0, 0, 0)); XMLGregorianCalendar end = clock.currentTimeXMLGregorianCalendar(); end.add(XmlTypeConverter.createDuration(true, 0, 0, 35, 0, 0, 0)); IntegrationTestTools.assertBetween(STR, start, end, triggerType.getTimestamp()); }
/** * User barbossa has a direct account assignment. This assignment has an expression for enabledisable flag. * Let's disable user, the account should be disabled as well. */
User barbossa has a direct account assignment. This assignment has an expression for enabledisable flag. Let's disable user, the account should be disabled as well
test254ModifyUserBarbossaDisable
{ "repo_name": "sabriarabacioglu/engerek", "path": "model/model-impl/src/test/java/com/evolveum/midpoint/model/impl/lens/TestProjector.java", "license": "apache-2.0", "size": 59530 }
[ "com.evolveum.midpoint.model.api.context.SynchronizationPolicyDecision", "com.evolveum.midpoint.model.impl.lens.LensContext", "com.evolveum.midpoint.model.impl.lens.LensProjectionContext", "com.evolveum.midpoint.model.impl.trigger.RecomputeTriggerHandler", "com.evolveum.midpoint.prism.OriginType", "com.evolveum.midpoint.prism.delta.ChangeType", "com.evolveum.midpoint.prism.delta.ContainerDelta", "com.evolveum.midpoint.prism.delta.ObjectDelta", "com.evolveum.midpoint.prism.delta.PropertyDelta", "com.evolveum.midpoint.prism.path.ItemPath", "com.evolveum.midpoint.prism.util.PrismAsserts", "com.evolveum.midpoint.prism.xml.XmlTypeConverter", "com.evolveum.midpoint.schema.constants.SchemaConstants", "com.evolveum.midpoint.schema.result.OperationResult", "com.evolveum.midpoint.task.api.Task", "com.evolveum.midpoint.test.IntegrationTestTools", "com.evolveum.midpoint.test.util.TestUtil", "com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType", "com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType", "com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentPolicyEnforcementType", "com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType", "com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType", "com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerType", "com.evolveum.midpoint.xml.ns._public.common.common_3.UserType", "java.util.Collection", "javax.xml.datatype.XMLGregorianCalendar", "org.testng.AssertJUnit" ]
import com.evolveum.midpoint.model.api.context.SynchronizationPolicyDecision; import com.evolveum.midpoint.model.impl.lens.LensContext; import com.evolveum.midpoint.model.impl.lens.LensProjectionContext; import com.evolveum.midpoint.model.impl.trigger.RecomputeTriggerHandler; import com.evolveum.midpoint.prism.OriginType; import com.evolveum.midpoint.prism.delta.ChangeType; import com.evolveum.midpoint.prism.delta.ContainerDelta; import com.evolveum.midpoint.prism.delta.ObjectDelta; import com.evolveum.midpoint.prism.delta.PropertyDelta; import com.evolveum.midpoint.prism.path.ItemPath; import com.evolveum.midpoint.prism.util.PrismAsserts; import com.evolveum.midpoint.prism.xml.XmlTypeConverter; import com.evolveum.midpoint.schema.constants.SchemaConstants; import com.evolveum.midpoint.schema.result.OperationResult; import com.evolveum.midpoint.task.api.Task; import com.evolveum.midpoint.test.IntegrationTestTools; import com.evolveum.midpoint.test.util.TestUtil; import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType; import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentPolicyEnforcementType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType; import com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerType; import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; import java.util.Collection; import javax.xml.datatype.XMLGregorianCalendar; import org.testng.AssertJUnit;
import com.evolveum.midpoint.model.api.context.*; import com.evolveum.midpoint.model.impl.lens.*; import com.evolveum.midpoint.model.impl.trigger.*; import com.evolveum.midpoint.prism.*; import com.evolveum.midpoint.prism.delta.*; import com.evolveum.midpoint.prism.path.*; import com.evolveum.midpoint.prism.util.*; import com.evolveum.midpoint.prism.xml.*; import com.evolveum.midpoint.schema.constants.*; import com.evolveum.midpoint.schema.result.*; import com.evolveum.midpoint.task.api.*; import com.evolveum.midpoint.test.*; import com.evolveum.midpoint.test.util.*; import com.evolveum.midpoint.xml.ns._public.common.common_3.*; import java.util.*; import javax.xml.datatype.*; import org.testng.*;
[ "com.evolveum.midpoint", "java.util", "javax.xml", "org.testng" ]
com.evolveum.midpoint; java.util; javax.xml; org.testng;
1,267,103
private Physics determinePhysics(int physicstype, Dimension size) { this.physicstype_id = physicstype; switch (physicstype) { case Types.PHYSICS_GRID: physics = new GridPhysics(size); break; case Types.PHYSICS_CONT: physics = new ContinuousPhysics(); break; } return physics; }
Physics function(int physicstype, Dimension size) { this.physicstype_id = physicstype; switch (physicstype) { case Types.PHYSICS_GRID: physics = new GridPhysics(size); break; case Types.PHYSICS_CONT: physics = new ContinuousPhysics(); break; } return physics; }
/** * Determines the physics type of the game, creating the Physics objects that performs the calculations. * @param physicstype identifier of the physics type. * @param size dimensions of the sprite. * @return the phyics object. */
Determines the physics type of the game, creating the Physics objects that performs the calculations
determinePhysics
{ "repo_name": "tohahn/UE_ML", "path": "UE06/gvgai/src/core/VGDLSprite.java", "license": "gpl-3.0", "size": 32756 }
[ "java.awt.Dimension" ]
import java.awt.Dimension;
import java.awt.*;
[ "java.awt" ]
java.awt;
870,535
protected void makeMenuBar() { if (menuItems.contains(SAVE)) { menuBuilder.addSave(this::onSave); } if (menuItems.contains(COPY)) { menuBuilder.addCopy(versionRecordManager.getCurrentPath(), getCopyValidator(), getCopyServiceCaller()); } if (menuItems.contains(RENAME)) { menuBuilder.addRename(versionRecordManager.getPathToLatest(), getRenameValidator(), getRenameServiceCaller()); } if (menuItems.contains(DELETE)) { menuBuilder.addDelete(versionRecordManager.getCurrentPath(), getDeleteServiceCaller()); } if (menuItems.contains(VALIDATE)) { menuBuilder.addValidate(onValidate()); } if (menuItems.contains(HISTORY)) { menuBuilder.addNewTopLevelMenu(versionRecordManager.buildMenu()); } } /** * If you want to customize the menu construction override this method. {@link BaseEditor#makeMenuBar()} * should be used to add items to the {@link BasicFileMenuBuilder}. This method then instructs * {@link BasicFileMenuBuilder#build()} to create the {@link Menus}
void function() { if (menuItems.contains(SAVE)) { menuBuilder.addSave(this::onSave); } if (menuItems.contains(COPY)) { menuBuilder.addCopy(versionRecordManager.getCurrentPath(), getCopyValidator(), getCopyServiceCaller()); } if (menuItems.contains(RENAME)) { menuBuilder.addRename(versionRecordManager.getPathToLatest(), getRenameValidator(), getRenameServiceCaller()); } if (menuItems.contains(DELETE)) { menuBuilder.addDelete(versionRecordManager.getCurrentPath(), getDeleteServiceCaller()); } if (menuItems.contains(VALIDATE)) { menuBuilder.addValidate(onValidate()); } if (menuItems.contains(HISTORY)) { menuBuilder.addNewTopLevelMenu(versionRecordManager.buildMenu()); } } /** * If you want to customize the menu construction override this method. {@link BaseEditor#makeMenuBar()} * should be used to add items to the {@link BasicFileMenuBuilder}. This method then instructs * {@link BasicFileMenuBuilder#build()} to create the {@link Menus}
/** * If you want to customize the menu content override this method. */
If you want to customize the menu content override this method
makeMenuBar
{ "repo_name": "karreiro/uberfire", "path": "uberfire-extensions/uberfire-commons-editor/uberfire-commons-editor-client/src/main/java/org/uberfire/ext/editor/commons/client/BaseEditor.java", "license": "apache-2.0", "size": 17997 }
[ "org.uberfire.ext.editor.commons.client.menu.BasicFileMenuBuilder", "org.uberfire.workbench.model.menu.Menus" ]
import org.uberfire.ext.editor.commons.client.menu.BasicFileMenuBuilder; import org.uberfire.workbench.model.menu.Menus;
import org.uberfire.ext.editor.commons.client.menu.*; import org.uberfire.workbench.model.menu.*;
[ "org.uberfire.ext", "org.uberfire.workbench" ]
org.uberfire.ext; org.uberfire.workbench;
701,057
public int getPowerRequirement() { return Criteria.POWER_HIGH; }
int function() { return Criteria.POWER_HIGH; }
/** * Returns the power requirement for this provider. * * @return the power requirement for this provider, as one of the * constants Criteria.POWER_REQUIREMENT_*. */
Returns the power requirement for this provider
getPowerRequirement
{ "repo_name": "mateor/pdroid", "path": "android-4.0.3_r1/trunk/frameworks/base/services/java/com/android/server/location/GpsLocationProvider.java", "license": "gpl-3.0", "size": 64310 }
[ "android.location.Criteria" ]
import android.location.Criteria;
import android.location.*;
[ "android.location" ]
android.location;
2,640,656