method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
protected void setSpecialDays() {
// political/common holidays
setDay( 1, 1 , "Neujahr" , Day.HOLIDAY );
setDay( 1, 6 , "Hl. 3 Könige" , Day.HOLYDAY );
setDay(anchors[EASTER ] - 48, "Rosenmontag" , Day.WORKING );
setDay(anchors[EASTER ] - 47, "Fastnacht" , Day.WORKING );
setDay(anchors[EASTER ] - 46, "Aschermittwoch" , Day.WORKING );
setDay(anchors[EASTER ] - 3, "Gründonnerstag" , Day.HOLYDAY );
setDay(anchors[EASTER ] - 2, "Karfreitag" , Day.HOLYDAY + Day.HOLIDAY );
setDay(anchors[EASTER ] , "Ostersonntag" , Day.HOLYDAY );
setDay(anchors[EASTER ] + 1, "Ostermontag" , Day.HOLYDAY + Day.HOLIDAY );
setDay( 5, 1 , "Maifeiertag" , Day.HOLIDAY );
setDay(anchors[EASTER ] + 39, "Christi Himmelf." , Day.HOLYDAY + Day.HOLIDAY );
setDay(anchors[EASTER ] + 49, "Pfingsten" , Day.HOLYDAY );
setDay(anchors[EASTER ] + 50, "Pfingstmontag" , Day.HOLYDAY + Day.HOLIDAY );
setDay(anchors[EASTER ] + 60, "Fronleichnam" , Day.HOLYDAY + Day.HOLIDAY );
setDay( 8, 15 , "Mariä Himmelfahrt" , Day.HOLYDAY );
setDay(10, 3 , "T.d.Wiedervereinig." , Day.HOLIDAY );
setDay(10, 31 , "Reformationsfest" , Day.HOLYDAY );
setDay(11, 1 , "Allerheiligen" , Day.HOLYDAY );
setDay(anchors[ADVENT1 ] - 11, "Buß- und Bettag" , Day.HOLYDAY );
setDay(anchors[ADVENT1 ] - 7, "Totensonntag" , Day.SUNDAY );
setDay(12, 24 , "Heiliger Abend" , Day.HALFWORK );
setDay(12, 25 , "1. Weihnachtstag" , Day.HOLYDAY + Day.HOLIDAY );
setDay(12, 26 , "2. Weihnachtstag" , Day.HOLYDAY + Day.HOLIDAY );
setDay(12, 31 , "Silvester" , Day.HALFWORK );
} // setSpecialDays
| void function() { setDay( 1, 1 , STR , Day.HOLIDAY ); setDay( 1, 6 , STR , Day.HOLYDAY ); setDay(anchors[EASTER ] - 48, STR , Day.WORKING ); setDay(anchors[EASTER ] - 47, STR , Day.WORKING ); setDay(anchors[EASTER ] - 46, STR , Day.WORKING ); setDay(anchors[EASTER ] - 3, STR , Day.HOLYDAY ); setDay(anchors[EASTER ] - 2, STR , Day.HOLYDAY + Day.HOLIDAY ); setDay(anchors[EASTER ] , STR , Day.HOLYDAY ); setDay(anchors[EASTER ] + 1, STR , Day.HOLYDAY + Day.HOLIDAY ); setDay( 5, 1 , STR , Day.HOLIDAY ); setDay(anchors[EASTER ] + 39, STR , Day.HOLYDAY + Day.HOLIDAY ); setDay(anchors[EASTER ] + 49, STR , Day.HOLYDAY ); setDay(anchors[EASTER ] + 50, STR , Day.HOLYDAY + Day.HOLIDAY ); setDay(anchors[EASTER ] + 60, STR , Day.HOLYDAY + Day.HOLIDAY ); setDay( 8, 15 , STR , Day.HOLYDAY ); setDay(10, 3 , STR , Day.HOLIDAY ); setDay(10, 31 , STR , Day.HOLYDAY ); setDay(11, 1 , STR , Day.HOLYDAY ); setDay(anchors[ADVENT1 ] - 11, STR , Day.HOLYDAY ); setDay(anchors[ADVENT1 ] - 7, STR , Day.SUNDAY ); setDay(12, 24 , STR , Day.HALFWORK ); setDay(12, 25 , STR , Day.HOLYDAY + Day.HOLIDAY ); setDay(12, 26 , STR , Day.HOLYDAY + Day.HOLIDAY ); setDay(12, 31 , STR , Day.HALFWORK ); } | /** Sets the names of special days in the year and their properties,
* sometimes depending on the current confession.
*/ | Sets the names of special days in the year and their properties, sometimes depending on the current confession | setSpecialDays | {
"repo_name": "gfis/churchcal",
"path": "src/main/java/org/teherba/churchcal/DeuCalendar.java",
"license": "apache-2.0",
"size": 4751
} | [
"org.teherba.churchcal.Day"
] | import org.teherba.churchcal.Day; | import org.teherba.churchcal.*; | [
"org.teherba.churchcal"
] | org.teherba.churchcal; | 464,091 |
public static Map<String, Map<String, InetSocketAddress>> getHaNnRpcAddresses(
Configuration conf) {
return DFSUtilClient.getAddresses(conf, null,
DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_KEY);
} | static Map<String, Map<String, InetSocketAddress>> function( Configuration conf) { return DFSUtilClient.getAddresses(conf, null, DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_KEY); } | /**
* Returns list of InetSocketAddress corresponding to HA NN RPC addresses from
* the configuration.
*
* @param conf configuration
* @return list of InetSocketAddresses
*/ | Returns list of InetSocketAddress corresponding to HA NN RPC addresses from the configuration | getHaNnRpcAddresses | {
"repo_name": "jth/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java",
"license": "apache-2.0",
"size": 58742
} | [
"java.net.InetSocketAddress",
"java.util.Map",
"org.apache.hadoop.conf.Configuration"
] | import java.net.InetSocketAddress; import java.util.Map; import org.apache.hadoop.conf.Configuration; | import java.net.*; import java.util.*; import org.apache.hadoop.conf.*; | [
"java.net",
"java.util",
"org.apache.hadoop"
] | java.net; java.util; org.apache.hadoop; | 456,664 |
private void setResubmissionProperties(Assignment a,
AssignmentSubmissionEdit edit) {
// get the assignment setting for resubmitting
ResourceProperties assignmentProperties = a.getProperties();
String assignmentAllowResubmitNumber = assignmentProperties.getProperty(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER);
if (assignmentAllowResubmitNumber != null)
{
edit.getPropertiesEdit().addProperty(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER, assignmentAllowResubmitNumber);
String assignmentAllowResubmitCloseDate = assignmentProperties.getProperty(AssignmentSubmission.ALLOW_RESUBMIT_CLOSETIME);
// if assignment's setting of resubmit close time is null, use assignment close time as the close time for resubmit
edit.getPropertiesEdit().addProperty(AssignmentSubmission.ALLOW_RESUBMIT_CLOSETIME, assignmentAllowResubmitCloseDate != null?assignmentAllowResubmitCloseDate:String.valueOf(a.getCloseTime().getTime()));
}
} | void function(Assignment a, AssignmentSubmissionEdit edit) { ResourceProperties assignmentProperties = a.getProperties(); String assignmentAllowResubmitNumber = assignmentProperties.getProperty(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER); if (assignmentAllowResubmitNumber != null) { edit.getPropertiesEdit().addProperty(AssignmentSubmission.ALLOW_RESUBMIT_NUMBER, assignmentAllowResubmitNumber); String assignmentAllowResubmitCloseDate = assignmentProperties.getProperty(AssignmentSubmission.ALLOW_RESUBMIT_CLOSETIME); edit.getPropertiesEdit().addProperty(AssignmentSubmission.ALLOW_RESUBMIT_CLOSETIME, assignmentAllowResubmitCloseDate != null?assignmentAllowResubmitCloseDate:String.valueOf(a.getCloseTime().getTime())); } } | /**
* set the resubmission related properties in AssignmentSubmission object
* @param a
* @param edit
*/ | set the resubmission related properties in AssignmentSubmission object | setResubmissionProperties | {
"repo_name": "rodriguezdevera/sakai",
"path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java",
"license": "apache-2.0",
"size": 685575
} | [
"org.sakaiproject.assignment.api.Assignment",
"org.sakaiproject.assignment.api.AssignmentSubmission",
"org.sakaiproject.assignment.api.AssignmentSubmissionEdit",
"org.sakaiproject.entity.api.ResourceProperties"
] | import org.sakaiproject.assignment.api.Assignment; import org.sakaiproject.assignment.api.AssignmentSubmission; import org.sakaiproject.assignment.api.AssignmentSubmissionEdit; import org.sakaiproject.entity.api.ResourceProperties; | import org.sakaiproject.assignment.api.*; import org.sakaiproject.entity.api.*; | [
"org.sakaiproject.assignment",
"org.sakaiproject.entity"
] | org.sakaiproject.assignment; org.sakaiproject.entity; | 1,051,802 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ManagedPrivateEndpointResourceInner> getAsync(
String resourceGroupName,
String factoryName,
String managedVirtualNetworkName,
String managedPrivateEndpointName) {
final String ifNoneMatch = null;
return getWithResponseAsync(
resourceGroupName, factoryName, managedVirtualNetworkName, managedPrivateEndpointName, ifNoneMatch)
.flatMap(
(Response<ManagedPrivateEndpointResourceInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<ManagedPrivateEndpointResourceInner> function( String resourceGroupName, String factoryName, String managedVirtualNetworkName, String managedPrivateEndpointName) { final String ifNoneMatch = null; return getWithResponseAsync( resourceGroupName, factoryName, managedVirtualNetworkName, managedPrivateEndpointName, ifNoneMatch) .flatMap( (Response<ManagedPrivateEndpointResourceInner> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { return Mono.empty(); } }); } | /**
* Gets a managed private endpoint.
*
* @param resourceGroupName The resource group name.
* @param factoryName The factory name.
* @param managedVirtualNetworkName Managed virtual network name.
* @param managedPrivateEndpointName Managed private endpoint name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a managed private endpoint on successful completion of {@link Mono}.
*/ | Gets a managed private endpoint | getAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/ManagedPrivateEndpointsClientImpl.java",
"license": "mit",
"size": 57288
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.resourcemanager.datafactory.fluent.models.ManagedPrivateEndpointResourceInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.datafactory.fluent.models.ManagedPrivateEndpointResourceInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.datafactory.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,731,197 |
public static String getState(MotionLayout layout, int stateId, int len) {
if (stateId == -1) {
return "UNDEFINED";
}
Context context = layout.getContext();
String str = context.getResources().getResourceEntryName(stateId);
if (len != -1) {
if (str.length() > len) {
str = str.replaceAll("([^_])[aeiou]+", "$1"); // del vowels ! at start
}
if (str.length() > len) {
int n = str.replaceAll("[^_]", "").length(); // count number of "_"
if (n > 0) {
int extra = (str.length() - len) / n;
String reg = CharBuffer.allocate(extra).toString().replace('\0', '.') + "_";
str = str.replaceAll(reg, "_");
}
}
}
return str;
} | static String function(MotionLayout layout, int stateId, int len) { if (stateId == -1) { return STR; } Context context = layout.getContext(); String str = context.getResources().getResourceEntryName(stateId); if (len != -1) { if (str.length() > len) { str = str.replaceAll(STR, "$1"); } if (str.length() > len) { int n = str.replaceAll("[^_]", STR_STR_"); } } } return str; } | /**
* convert an id number to an id String useful in debugging
*
* @param layout
* @param stateId
* @param len trim if string > len
* @return
*/ | convert an id number to an id String useful in debugging | getState | {
"repo_name": "AndroidX/constraintlayout",
"path": "constraintlayout/constraintlayout/src/main/java/androidx/constraintlayout/motion/widget/Debug.java",
"license": "apache-2.0",
"size": 11419
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 1,605,309 |
public static Map<String,String> getZeroOperandMapping() {
Map<String,String> zeroOperandMapping = new HashMap<String,String>();
return zeroOperandMapping;
} | static Map<String,String> function() { Map<String,String> zeroOperandMapping = new HashMap<String,String>(); return zeroOperandMapping; } | /**
* Use zeroOperandMapping.containsKey("key") to figure out if the "key"
* is indeed a zero operand mnemonic.
* @return
*/ | Use zeroOperandMapping.containsKey("key") to figure out if the "key" is indeed a zero operand mnemonic | getZeroOperandMapping | {
"repo_name": "Carrotlord/MintChime-Editor",
"path": "tools/JavaResource.java",
"license": "gpl-3.0",
"size": 5618
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 619,477 |
public void testReadKeystoreEntry() throws Exception {
DefaultPolicyScanner.KeystoreEntry ke = scanner
.readKeystoreEntry(getST("\"URL1\""));
assertEquals("URL1", ke.url);
assertNull(ke.type);
ke = scanner.readKeystoreEntry(getST("\"URL2\",\"TYPE2\""));
assertEquals("URL2", ke.url);
assertEquals("TYPE2", ke.type);
ke = scanner.readKeystoreEntry(getST("\"URL3\" \"TYPE3\""));
assertEquals("URL3", ke.url);
assertEquals("TYPE3", ke.type);
} | void function() throws Exception { DefaultPolicyScanner.KeystoreEntry ke = scanner .readKeystoreEntry(getST("\"URL1\STRURL1STR\"URL2\",\"TYPE2\STRURL2STRTYPE2STR\"URL3\" \"TYPE3\STRURL3STRTYPE3", ke.type); } | /**
* Tests readKeystoreEntry() for tokenizing all valid syntax variants.
*/ | Tests readKeystoreEntry() for tokenizing all valid syntax variants | testReadKeystoreEntry | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/archive/classlib/java6/modules/security/src/test/impl/java.injected/org/apache/harmony/security/DefaultPolicyScannerTest.java",
"license": "apache-2.0",
"size": 21182
} | [
"org.apache.harmony.security.DefaultPolicyScanner"
] | import org.apache.harmony.security.DefaultPolicyScanner; | import org.apache.harmony.security.*; | [
"org.apache.harmony"
] | org.apache.harmony; | 74,727 |
@Test
public void testLateSchemaEarlyClose() {
// Create a mock reader, return two batches: one schema-only, another with data.
MockLateSchemaReader reader = new MockLateSchemaReader();
reader.batchLimit = 2;
reader.returnDataOnFirst = false;
// Create the scan operator
ScanFixture scanFixture = simpleFixture(reader);
// Reader never opened.
scanFixture.close();
assertFalse(reader.openCalled);
assertEquals(0, reader.batchCount);
assertFalse(reader.closeCalled);
} | void function() { MockLateSchemaReader reader = new MockLateSchemaReader(); reader.batchLimit = 2; reader.returnDataOnFirst = false; ScanFixture scanFixture = simpleFixture(reader); scanFixture.close(); assertFalse(reader.openCalled); assertEquals(0, reader.batchCount); assertFalse(reader.closeCalled); } | /**
* Test the case that a late scan operator is closed before
* the first reader is opened.
*/ | Test the case that a late scan operator is closed before the first reader is opened | testLateSchemaEarlyClose | {
"repo_name": "kkhatua/drill",
"path": "exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/scan/TestScanOperExecLateSchema.java",
"license": "apache-2.0",
"size": 12713
} | [
"org.apache.drill.exec.physical.impl.scan.ScanTestUtils",
"org.junit.Assert"
] | import org.apache.drill.exec.physical.impl.scan.ScanTestUtils; import org.junit.Assert; | import org.apache.drill.exec.physical.impl.scan.*; import org.junit.*; | [
"org.apache.drill",
"org.junit"
] | org.apache.drill; org.junit; | 2,215,606 |
public void compareResults(R actual, R expected){
Assert.assertEquals(this.testInfo(),expected,actual);
} | void function(R actual, R expected){ Assert.assertEquals(this.testInfo(),expected,actual); } | /**
* Compare output of the processed model with previously stored result. This method may be overridden to implement
* more sophisticated result comparison behavior. By default, it applies assertEquals. If you override
* this method, please call {@link #testInfo()} in the failure message.
*
* @param actual the result processed model
* @param expected the stored result
*/ | Compare output of the processed model with previously stored result. This method may be overridden to implement more sophisticated result comparison behavior. By default, it applies assertEquals. If you override this method, please call <code>#testInfo()</code> in the failure message | compareResults | {
"repo_name": "overturetool/overture",
"path": "core/testing/framework/src/main/java/org/overture/core/testing/AbsResultTest.java",
"license": "gpl-3.0",
"size": 7500
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,308,578 |
public WellSampleNode copy() {
ThumbnailProvider thumbCopy = new ThumbnailProvider(
((WellSampleData) getHierarchyObject()).getImage());
thumbCopy.setFullScaleThumb(getThumbnail().getFullScaleThumb());
WellSampleNode copy = new WellSampleNode(getTitle(),
getHierarchyObject(), thumbCopy, index, parent);
copy.setWell(isWell());
return copy;
}
public int getTitleHeight() { return titleHeight; } | WellSampleNode function() { ThumbnailProvider thumbCopy = new ThumbnailProvider( ((WellSampleData) getHierarchyObject()).getImage()); thumbCopy.setFullScaleThumb(getThumbnail().getFullScaleThumb()); WellSampleNode copy = new WellSampleNode(getTitle(), getHierarchyObject(), thumbCopy, index, parent); copy.setWell(isWell()); return copy; } public int getTitleHeight() { return titleHeight; } | /**
* Creates a copy (including a copy of the thumbnail)
* @return See above.
*/ | Creates a copy (including a copy of the thumbnail) | copy | {
"repo_name": "knabar/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/browser/WellSampleNode.java",
"license": "gpl-2.0",
"size": 8362
} | [
"org.openmicroscopy.shoola.agents.dataBrowser.ThumbnailProvider"
] | import org.openmicroscopy.shoola.agents.dataBrowser.ThumbnailProvider; | import org.openmicroscopy.shoola.agents.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 2,144,469 |
public MetaProperty<Curve> curve() {
return curve;
} | MetaProperty<Curve> function() { return curve; } | /**
* The meta-property for the {@code curve} property.
* @return the meta-property, not null
*/ | The meta-property for the curve property | curve | {
"repo_name": "OpenGamma/Strata",
"path": "modules/pricer/src/main/java/com/opengamma/strata/pricer/ZeroRateDiscountFactors.java",
"license": "apache-2.0",
"size": 16626
} | [
"com.opengamma.strata.market.curve.Curve",
"org.joda.beans.MetaProperty"
] | import com.opengamma.strata.market.curve.Curve; import org.joda.beans.MetaProperty; | import com.opengamma.strata.market.curve.*; import org.joda.beans.*; | [
"com.opengamma.strata",
"org.joda.beans"
] | com.opengamma.strata; org.joda.beans; | 604,389 |
private static void updateReplicatedConfiguration(Configuration backupConfiguration,
String name,
int portOffset,
List<String> remoteConnectors,
boolean fullServer) {
backupConfiguration.setName(name);
backupConfiguration.setJournalDirectory(backupConfiguration.getJournalDirectory() + name);
backupConfiguration.setPagingDirectory(backupConfiguration.getPagingDirectory() + name);
backupConfiguration.setLargeMessagesDirectory(backupConfiguration.getLargeMessagesDirectory() + name);
backupConfiguration.setBindingsDirectory(backupConfiguration.getBindingsDirectory() + name);
updateAcceptorsAndConnectors(backupConfiguration, portOffset, remoteConnectors, fullServer);
} | static void function(Configuration backupConfiguration, String name, int portOffset, List<String> remoteConnectors, boolean fullServer) { backupConfiguration.setName(name); backupConfiguration.setJournalDirectory(backupConfiguration.getJournalDirectory() + name); backupConfiguration.setPagingDirectory(backupConfiguration.getPagingDirectory() + name); backupConfiguration.setLargeMessagesDirectory(backupConfiguration.getLargeMessagesDirectory() + name); backupConfiguration.setBindingsDirectory(backupConfiguration.getBindingsDirectory() + name); updateAcceptorsAndConnectors(backupConfiguration, portOffset, remoteConnectors, fullServer); } | /**
* update the backups configuration
*
* @param backupConfiguration the configuration to update
* @param name the new name of the backup
* @param portOffset the offset for the acceptors and any connectors that need changing
* @param remoteConnectors the connectors that don't need off setting, typically remote
*/ | update the backups configuration | updateReplicatedConfiguration | {
"repo_name": "gaohoward/activemq-artemis",
"path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ha/ColocatedHAManager.java",
"license": "apache-2.0",
"size": 14363
} | [
"java.util.List",
"org.apache.activemq.artemis.core.config.Configuration"
] | import java.util.List; import org.apache.activemq.artemis.core.config.Configuration; | import java.util.*; import org.apache.activemq.artemis.core.config.*; | [
"java.util",
"org.apache.activemq"
] | java.util; org.apache.activemq; | 27,557 |
public interface OnImageLoadCompleteListener {
public void onImageLoadComplete(int token, Object cookie, ImageView iView,
boolean imagePresent);
}
// constants
private static final int EVENT_LOAD_IMAGE = 1;
private static final int EVENT_LOAD_IMAGE_URI = 2;
private static final int EVENT_LOAD_CONTACT_URI = 3;
private static final int DEFAULT_TOKEN = -1;
private static final int TAG_PHOTO_INFOS = R.id.icon;
private static ContactsWrapper contactsWrapper;
// static objects
private static Handler sThreadHandler;
private static final class WorkerArgs {
public Context context;
public ImageView view;
public int defaultResource;
public Object result;
public Uri loadedUri;
public Object cookie;
public OnImageLoadCompleteListener listener;
}
private static class PhotoViewTag {
public Uri uri;
}
public static final String HIGH_RES_URI_PARAM = "hiRes";
private class WorkerHandler extends Handler {
public WorkerHandler(Looper looper) {
super(looper);
} | interface OnImageLoadCompleteListener { public void function(int token, Object cookie, ImageView iView, boolean imagePresent); } private static final int EVENT_LOAD_IMAGE = 1; private static final int EVENT_LOAD_IMAGE_URI = 2; private static final int EVENT_LOAD_CONTACT_URI = 3; private static final int DEFAULT_TOKEN = -1; private static final int TAG_PHOTO_INFOS = R.id.icon; private static ContactsWrapper contactsWrapper; private static Handler sThreadHandler; private static final class WorkerArgs { public Context context; public ImageView view; public int defaultResource; public Object result; public Uri loadedUri; public Object cookie; public OnImageLoadCompleteListener listener; } private static class PhotoViewTag { public Uri uri; } public static final String HIGH_RES_URI_PARAM = "hiRes"; private class WorkerHandler extends Handler { public WorkerHandler(Looper looper) { super(looper); } | /**
* Called when the image load is complete.
*
* @param imagePresent true if an image was found
*/ | Called when the image load is complete | onImageLoadComplete | {
"repo_name": "treasure-lau/CSipSimple",
"path": "app/src/main/java/com/csipsimple/utils/ContactsAsyncHelper.java",
"license": "gpl-3.0",
"size": 15328
} | [
"android.content.Context",
"android.net.Uri",
"android.os.Handler",
"android.os.Looper",
"android.widget.ImageView",
"com.csipsimple.utils.contacts.ContactsWrapper"
] | import android.content.Context; import android.net.Uri; import android.os.Handler; import android.os.Looper; import android.widget.ImageView; import com.csipsimple.utils.contacts.ContactsWrapper; | import android.content.*; import android.net.*; import android.os.*; import android.widget.*; import com.csipsimple.utils.contacts.*; | [
"android.content",
"android.net",
"android.os",
"android.widget",
"com.csipsimple.utils"
] | android.content; android.net; android.os; android.widget; com.csipsimple.utils; | 826,965 |
protected ClientPreparedStatement prepareBatchedInsertSQL(JdbcConnection localConn, int numBatches) throws SQLException {
synchronized (checkClosed().getConnectionMutex()) {
ClientPreparedStatement pstmt = new ClientPreparedStatement(localConn, "Rewritten batch of: " + ((PreparedQuery<?>) this.query).getOriginalSql(),
this.getCurrentCatalog(), ((PreparedQuery<?>) this.query).getParseInfo().getParseInfoForBatch(numBatches));
pstmt.setRetrieveGeneratedKeys(this.retrieveGeneratedKeys);
pstmt.rewrittenBatchSize = numBatches;
return pstmt;
}
} | ClientPreparedStatement function(JdbcConnection localConn, int numBatches) throws SQLException { synchronized (checkClosed().getConnectionMutex()) { ClientPreparedStatement pstmt = new ClientPreparedStatement(localConn, STR + ((PreparedQuery<?>) this.query).getOriginalSql(), this.getCurrentCatalog(), ((PreparedQuery<?>) this.query).getParseInfo().getParseInfoForBatch(numBatches)); pstmt.setRetrieveGeneratedKeys(this.retrieveGeneratedKeys); pstmt.rewrittenBatchSize = numBatches; return pstmt; } } | /**
* Returns a prepared statement for the number of batched parameters, used when re-writing batch INSERTs.
*
* @param localConn
* the connection creating this statement
* @param numBatches
* number of entries in a batch
* @return new ClientPreparedStatement
* @throws SQLException
* if a database access error occurs or this method is called on a closed PreparedStatement
*/ | Returns a prepared statement for the number of batched parameters, used when re-writing batch INSERTs | prepareBatchedInsertSQL | {
"repo_name": "ac2cz/FoxTelem",
"path": "lib/mysql-connector-java-8.0.13/src/main/user-impl/java/com/mysql/cj/jdbc/ClientPreparedStatement.java",
"license": "gpl-3.0",
"size": 84345
} | [
"com.mysql.cj.PreparedQuery",
"java.sql.SQLException"
] | import com.mysql.cj.PreparedQuery; import java.sql.SQLException; | import com.mysql.cj.*; import java.sql.*; | [
"com.mysql.cj",
"java.sql"
] | com.mysql.cj; java.sql; | 2,012,322 |
public Stroke getSeriesStroke(int series);
| Stroke function(int series); | /**
* Returns the stroke used to draw the items in a series.
*
* @param series the series (zero-based index).
*
* @return The stroke (possibly <code>null</code>).
*
* @see #setSeriesStroke(int, Stroke)
*/ | Returns the stroke used to draw the items in a series | getSeriesStroke | {
"repo_name": "sebkur/JFreeChart",
"path": "src/main/java/org/jfree/chart/renderer/xy/XYItemRenderer.java",
"license": "lgpl-3.0",
"size": 64436
} | [
"java.awt.Stroke"
] | import java.awt.Stroke; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,960,011 |
public void updateAnimation(World worldIn, Entity entityIn, int inventorySlot, boolean isCurrentItem)
{
if (this.animationsToGo > 0)
{
--this.animationsToGo;
}
if (this.item != null)
{
this.item.onUpdate(this, worldIn, entityIn, inventorySlot, isCurrentItem);
}
} | void function(World worldIn, Entity entityIn, int inventorySlot, boolean isCurrentItem) { if (this.animationsToGo > 0) { --this.animationsToGo; } if (this.item != null) { this.item.onUpdate(this, worldIn, entityIn, inventorySlot, isCurrentItem); } } | /**
* Called each tick as long the ItemStack in on player inventory. Used to progress the pickup animation and update
* maps.
*/ | Called each tick as long the ItemStack in on player inventory. Used to progress the pickup animation and update maps | updateAnimation | {
"repo_name": "boredherobrine13/morefuelsmod-1.10",
"path": "build/tmp/recompileMc/sources/net/minecraft/item/ItemStack.java",
"license": "lgpl-2.1",
"size": 40541
} | [
"net.minecraft.entity.Entity",
"net.minecraft.world.World"
] | import net.minecraft.entity.Entity; import net.minecraft.world.World; | import net.minecraft.entity.*; import net.minecraft.world.*; | [
"net.minecraft.entity",
"net.minecraft.world"
] | net.minecraft.entity; net.minecraft.world; | 1,699,947 |
public static <T> T singleOrDefault(Queryable<T> source,
FunctionExpression<Predicate1<T>> predicate) {
throw Extensions.todo();
} | static <T> T function(Queryable<T> source, FunctionExpression<Predicate1<T>> predicate) { throw Extensions.todo(); } | /**
* Returns the only element of a sequence that
* satisfies a specified condition or a default value if no such
* element exists; this method throws an exception if more than
* one element satisfies the condition.
*/ | Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition | singleOrDefault | {
"repo_name": "b-slim/calcite",
"path": "linq4j/src/main/java/org/apache/calcite/linq4j/QueryableDefaults.java",
"license": "apache-2.0",
"size": 39975
} | [
"org.apache.calcite.linq4j.function.Predicate1",
"org.apache.calcite.linq4j.tree.FunctionExpression"
] | import org.apache.calcite.linq4j.function.Predicate1; import org.apache.calcite.linq4j.tree.FunctionExpression; | import org.apache.calcite.linq4j.function.*; import org.apache.calcite.linq4j.tree.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 1,716,397 |
public String convertTemplate(String template)
{
String contents = StringUtils.fileContentsToString(template);
// Overcome Velocity 0.71 limitation.
// HELP: Is this still necessary?
if (!contents.endsWith("\n"))
{
contents += "\n";
}
// Convert most markup.
Perl5Util perl = new Perl5Util();
for (int i = 0; i < perLineREs.length; i += 2)
{
contents = perl.substitute(makeSubstRE(i), contents);
}
// Convert closing curlies.
if (perl.match("m/javascript/i", contents))
{
// ASSUMPTION: JavaScript is indented, WM is not.
contents = perl.substitute("s/\n}/\n#end/g", contents);
}
else
{
contents = perl.substitute("s/(\n\\s*)}/$1#end/g", contents);
contents = perl.substitute("s/#end\\s*\n\\s*#else/#else/g",
contents);
}
return contents;
} | String function(String template) { String contents = StringUtils.fileContentsToString(template); if (!contents.endsWith("\n")) { contents += "\n"; } Perl5Util perl = new Perl5Util(); for (int i = 0; i < perLineREs.length; i += 2) { contents = perl.substitute(makeSubstRE(i), contents); } if (perl.match(STR, contents)) { contents = perl.substitute(STR, contents); } else { contents = perl.substitute(STR, contents); contents = perl.substitute(STR, contents); } return contents; } | /**
* Apply find/replace regexes to our WM template
* @param template
* @return Returns the template with all regexprs applied.
*/ | Apply find/replace regexes to our WM template | convertTemplate | {
"repo_name": "mashuai/Open-Source-Research",
"path": "Velocity/src/java/org/apache/velocity/convert/WebMacro.java",
"license": "apache-2.0",
"size": 8941
} | [
"org.apache.oro.text.perl.Perl5Util",
"org.apache.velocity.util.StringUtils"
] | import org.apache.oro.text.perl.Perl5Util; import org.apache.velocity.util.StringUtils; | import org.apache.oro.text.perl.*; import org.apache.velocity.util.*; | [
"org.apache.oro",
"org.apache.velocity"
] | org.apache.oro; org.apache.velocity; | 172,186 |
protected static @Nonnull String getAdditionalMessages(SQLException ex) {
List<String> messages = new ArrayList<String>();
String message = ex.getMessage();
SQLException next = ex.getNextException();
while (next != null) {
String m = next.getMessage();
if (!message.equals(m)) {
messages.add(m);
}
next = next.getNextException();
}
return messages.isEmpty() ? "" : messages.toString();
} | static @Nonnull String function(SQLException ex) { List<String> messages = new ArrayList<String>(); String message = ex.getMessage(); SQLException next = ex.getNextException(); while (next != null) { String m = next.getMessage(); if (!message.equals(m)) { messages.add(m); } next = next.getNextException(); } return messages.isEmpty() ? "" : messages.toString(); } | /**
* Return a string containing additional messages from chained exceptions.
*/ | Return a string containing additional messages from chained exceptions | getAdditionalMessages | {
"repo_name": "afilimonov/jackrabbit-oak",
"path": "oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBJDBCTools.java",
"license": "apache-2.0",
"size": 7603
} | [
"java.sql.SQLException",
"java.util.ArrayList",
"java.util.List",
"javax.annotation.Nonnull"
] | import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import javax.annotation.Nonnull; | import java.sql.*; import java.util.*; import javax.annotation.*; | [
"java.sql",
"java.util",
"javax.annotation"
] | java.sql; java.util; javax.annotation; | 710,151 |
public void setExpectedValue(@Nullable String expectedValue) {
this.expectedValue = expectedValue;
this.hasExpectedValue = true;
}
/**
* Check whether the {@code newValue} field was explicitly set.
* <p/>
* This field can be set if a call to {@link SetValue#setNewValue(String)} | void function(@Nullable String expectedValue) { this.expectedValue = expectedValue; this.hasExpectedValue = true; } /** * Check whether the {@code newValue} field was explicitly set. * <p/> * This field can be set if a call to {@link SetValue#setNewValue(String)} | /**
* Set the value the caller expects to find in a KayVee {@code key=>value} pair.
*
* @param expectedValue the value (possibly null) the caller expects to find in a KayVee {@code key=>value} pair
*/ | Set the value the caller expects to find in a KayVee key=>value pair | setExpectedValue | {
"repo_name": "allengeorge/libraft",
"path": "libraft-samples/kayvee/src/main/java/io/libraft/kayvee/api/SetValue.java",
"license": "bsd-3-clause",
"size": 6888
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 103,092 |
public List<StagedSubject> getStagedSubjects() {
this.migrateInformationFromStudySubjectsToSubjects();
return this.stagedSubjectsList;
}
| List<StagedSubject> function() { this.migrateInformationFromStudySubjectsToSubjects(); return this.stagedSubjectsList; } | /**
* Getter for the list of results
*
* @return List<StagedSubject> List of StagedSubject that is build out of the arguments provided within the constructor.
*/ | Getter for the list of results | getStagedSubjects | {
"repo_name": "ddRPB/rpb",
"path": "radplanbio-core/src/main/java/de/dktk/dd/rpb/core/builder/pacs/StagedSubjectPacsResultBuilder.java",
"license": "gpl-3.0",
"size": 11733
} | [
"de.dktk.dd.rpb.core.domain.pacs.StagedSubject",
"java.util.List"
] | import de.dktk.dd.rpb.core.domain.pacs.StagedSubject; import java.util.List; | import de.dktk.dd.rpb.core.domain.pacs.*; import java.util.*; | [
"de.dktk.dd",
"java.util"
] | de.dktk.dd; java.util; | 478,327 |
public static ClusterState state(DiscoveryNode localNode, DiscoveryNode masterNode, DiscoveryNode... allNodes) {
DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder();
for (DiscoveryNode node : allNodes) {
discoBuilder.put(node);
}
if (masterNode != null) {
discoBuilder.masterNodeId(masterNode.getId());
}
discoBuilder.localNodeId(localNode.getId());
ClusterState.Builder state = ClusterState.builder(new ClusterName("test"));
state.nodes(discoBuilder);
state.metaData(MetaData.builder().generateClusterUuidIfNeeded());
return state.build();
} | static ClusterState function(DiscoveryNode localNode, DiscoveryNode masterNode, DiscoveryNode... allNodes) { DiscoveryNodes.Builder discoBuilder = DiscoveryNodes.builder(); for (DiscoveryNode node : allNodes) { discoBuilder.put(node); } if (masterNode != null) { discoBuilder.masterNodeId(masterNode.getId()); } discoBuilder.localNodeId(localNode.getId()); ClusterState.Builder state = ClusterState.builder(new ClusterName("test")); state.nodes(discoBuilder); state.metaData(MetaData.builder().generateClusterUuidIfNeeded()); return state.build(); } | /**
* Creates a cluster state where local node and master node can be specified
*
* @param localNode node in allNodes that is the local node
* @param masterNode node in allNodes that is the master node. Can be null if no master exists
* @param allNodes all nodes in the cluster
* @return cluster state
*/ | Creates a cluster state where local node and master node can be specified | state | {
"repo_name": "mmaracic/elasticsearch",
"path": "core/src/test/java/org/elasticsearch/action/support/replication/ClusterStateCreationUtils.java",
"license": "apache-2.0",
"size": 13881
} | [
"org.elasticsearch.cluster.ClusterName",
"org.elasticsearch.cluster.ClusterState",
"org.elasticsearch.cluster.metadata.MetaData",
"org.elasticsearch.cluster.node.DiscoveryNode",
"org.elasticsearch.cluster.node.DiscoveryNodes"
] | import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; | import org.elasticsearch.cluster.*; import org.elasticsearch.cluster.metadata.*; import org.elasticsearch.cluster.node.*; | [
"org.elasticsearch.cluster"
] | org.elasticsearch.cluster; | 2,826,121 |
private static String getPathFromContentURI(Context context, Uri contentUri) {
String path = "";
String[] proj = {MediaStore.Images.Media.DATA};
Cursor cursor = context.getContentResolver().query(contentUri, proj,
null, null, null);
if (cursor != null && cursor.moveToFirst()) {
path = cursor.getString(cursor
.getColumnIndexOrThrow(MediaStore.Images.Media.DATA));
}
return path;
} | static String function(Context context, Uri contentUri) { String path = ""; String[] proj = {MediaStore.Images.Media.DATA}; Cursor cursor = context.getContentResolver().query(contentUri, proj, null, null, null); if (cursor != null && cursor.moveToFirst()) { path = cursor.getString(cursor .getColumnIndexOrThrow(MediaStore.Images.Media.DATA)); } return path; } | /**
* Gets the image path from the indicated content Uri.
*
* @param context The application context.
* @param contentUri Image content Uri.
* @return The value of the requested column as a String.
*/ | Gets the image path from the indicated content Uri | getPathFromContentURI | {
"repo_name": "ChaosJohn/photo-picker-plus-android",
"path": "library/src/main/java/com/getchute/android/photopickerplus/dao/MediaDAO.java",
"license": "mit",
"size": 20777
} | [
"android.content.Context",
"android.database.Cursor",
"android.net.Uri",
"android.provider.MediaStore"
] | 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; | 2,745,214 |
public interface Configurable extends AzureConfigurable<Configurable> {
CosmosDBManager authenticate(AzureTokenCredentials credentials, String subscriptionId);
} | interface Configurable extends AzureConfigurable<Configurable> { CosmosDBManager function(AzureTokenCredentials credentials, String subscriptionId); } | /**
* Creates an instance of CosmosDBManager that exposes CosmosDB management API entry points.
*
* @param credentials the credentials to use
* @param subscriptionId the subscription UUID
* @return the interface exposing CosmosDB management API entry points that work across subscriptions
*/ | Creates an instance of CosmosDBManager that exposes CosmosDB management API entry points | authenticate | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/cosmosdb/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01/implementation/CosmosDBManager.java",
"license": "mit",
"size": 11331
} | [
"com.microsoft.azure.arm.resources.AzureConfigurable",
"com.microsoft.azure.credentials.AzureTokenCredentials"
] | import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.credentials.AzureTokenCredentials; | import com.microsoft.azure.arm.resources.*; import com.microsoft.azure.credentials.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,676,125 |
private void replicateProjectPolicyInfos(long policyId, Phase selectedPhase) {
LOG.info("Starting ProjectPolicyInfo replication...");
List<ProjectPolicyInfo> policyInfos = this.projectPolicyInfoManager.getAllPolicyInfosByPolicy(policyId);
policyInfos.removeIf(
pc -> pc == null || pc.getId() == null || pc.getPhase() == null || !pc.getPhase().equals(selectedPhase));
if (this.isNotEmpty(policyInfos)) {
ProjectPolicyInfo projectPolicyInfo = policyInfos.get(policyInfos.size() - 1);
this.projectPolicyInfoManager.saveProjectPolicyInfo(projectPolicyInfo);
}
} | void function(long policyId, Phase selectedPhase) { LOG.info(STR); List<ProjectPolicyInfo> policyInfos = this.projectPolicyInfoManager.getAllPolicyInfosByPolicy(policyId); policyInfos.removeIf( pc -> pc == null pc.getId() == null pc.getPhase() == null !pc.getPhase().equals(selectedPhase)); if (this.isNotEmpty(policyInfos)) { ProjectPolicyInfo projectPolicyInfo = policyInfos.get(policyInfos.size() - 1); this.projectPolicyInfoManager.saveProjectPolicyInfo(projectPolicyInfo); } } | /**
* Replicates the ProjectPolicyInfo associated to the policyId
*
* @param policyId the policy identifier
* @param selectedPhase the CRP phase where the info is going to be replicated
*/ | Replicates the ProjectPolicyInfo associated to the policyId | replicateProjectPolicyInfos | {
"repo_name": "CCAFS/MARLO",
"path": "marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/superadmin/ProjectPolicyReplication.java",
"license": "gpl-3.0",
"size": 25257
} | [
"java.util.List",
"org.cgiar.ccafs.marlo.data.model.Phase",
"org.cgiar.ccafs.marlo.data.model.ProjectPolicyInfo"
] | import java.util.List; import org.cgiar.ccafs.marlo.data.model.Phase; import org.cgiar.ccafs.marlo.data.model.ProjectPolicyInfo; | import java.util.*; import org.cgiar.ccafs.marlo.data.model.*; | [
"java.util",
"org.cgiar.ccafs"
] | java.util; org.cgiar.ccafs; | 230,098 |
public IScope scope_MCompiler(final MSwPackage swp, EReference reference)
{
Collection <MCommonPackageElement> elements = null;
final List<MCommonPackage> imports = ((MCommonPackageFile)swp.eContainer()).getImports();
try {
elements = PDLLibraryManager.getLibraryManager().
getElementsOfClass(imports, reference.getEReferenceType());
} catch (LibraryManagerException e) {
e.printStackTrace();
return IScope.NULLSCOPE;
}
return getFullElementScope(elements);
}
| IScope function(final MSwPackage swp, EReference reference) { Collection <MCommonPackageElement> elements = null; final List<MCommonPackage> imports = ((MCommonPackageFile)swp.eContainer()).getImports(); try { elements = PDLLibraryManager.getLibraryManager(). getElementsOfClass(imports, reference.getEReferenceType()); } catch (LibraryManagerException e) { e.printStackTrace(); return IScope.NULLSCOPE; } return getFullElementScope(elements); } | /**
* Provides the scope with the list of compilers that can be
* included in the definition of a software package. This list includes
* the compilers present in the PDL packages imported by the software
* package.
* @param swp the software package.
* @param reference the object representing the reference within the
* given class.
* @return the scope of the reference.
*/ | Provides the scope with the list of compilers that can be included in the definition of a software package. This list includes the compilers present in the PDL packages imported by the software package | scope_MCompiler | {
"repo_name": "parraman/micobs",
"path": "mesp/es.uah.aut.srg.micobs.mesp.editor.swp/src/es/uah/aut/srg/micobs/mesp/lang/scoping/SWPScopeProvider.java",
"license": "epl-1.0",
"size": 45945
} | [
"es.uah.aut.srg.micobs.common.MCommonPackage",
"es.uah.aut.srg.micobs.common.MCommonPackageElement",
"es.uah.aut.srg.micobs.common.MCommonPackageFile",
"es.uah.aut.srg.micobs.library.LibraryManagerException",
"es.uah.aut.srg.micobs.mesp.mespswp.MSwPackage",
"es.uah.aut.srg.micobs.pdl.library.pdllibrary.manager.PDLLibraryManager",
"java.util.Collection",
"java.util.List",
"org.eclipse.emf.ecore.EReference",
"org.eclipse.xtext.scoping.IScope"
] | import es.uah.aut.srg.micobs.common.MCommonPackage; import es.uah.aut.srg.micobs.common.MCommonPackageElement; import es.uah.aut.srg.micobs.common.MCommonPackageFile; import es.uah.aut.srg.micobs.library.LibraryManagerException; import es.uah.aut.srg.micobs.mesp.mespswp.MSwPackage; import es.uah.aut.srg.micobs.pdl.library.pdllibrary.manager.PDLLibraryManager; import java.util.Collection; import java.util.List; import org.eclipse.emf.ecore.EReference; import org.eclipse.xtext.scoping.IScope; | import es.uah.aut.srg.micobs.common.*; import es.uah.aut.srg.micobs.library.*; import es.uah.aut.srg.micobs.mesp.mespswp.*; import es.uah.aut.srg.micobs.pdl.library.pdllibrary.manager.*; import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.xtext.scoping.*; | [
"es.uah.aut",
"java.util",
"org.eclipse.emf",
"org.eclipse.xtext"
] | es.uah.aut; java.util; org.eclipse.emf; org.eclipse.xtext; | 2,320,480 |
public String amtPalmetal (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value)
{
if (isCalloutActive() || value == null)
return "";
if (steps) log.warning("init");
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID");
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID");
int M_PriceList_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_ID");
int StdPrecision = MPriceList.getStandardPrecision(ctx, M_PriceList_ID);
BigDecimal QtyEntered, QtyOrdered, PriceEntered, PriceActual, PriceLimit, Discount, PriceList, FreightAmt;
// get values
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
QtyOrdered = (BigDecimal)mTab.getValue("QtyOrdered");
//INICIO - MUDANÇA PALMETAL
FreightAmt = (BigDecimal)mTab.getValue("FreightAmt");
log.fine("QtyEntered=" + QtyEntered + ", Ordered=" + QtyOrdered + ", UOM=" + C_UOM_To_ID + ", FreightAmt=" + FreightAmt);
//FIM - MUDANÇA PALMETAL
//
PriceEntered = (BigDecimal)mTab.getValue("PriceEntered");
PriceActual = (BigDecimal)mTab.getValue("PriceActual");
Discount = (BigDecimal)mTab.getValue("Discount");
PriceLimit = (BigDecimal)mTab.getValue("PriceLimit");
PriceList = (BigDecimal)mTab.getValue("PriceList");
log.fine("PriceList=" + PriceList + ", Limit=" + PriceLimit + ", Precision=" + StdPrecision);
log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount);
// No Product
if (M_Product_ID == 0)
{
// if price change sync price actual and entered
// else ignore
if (mField.getColumnName().equals("PriceActual"))
{
mTab.setValue("PriceEntered", value);
}
else if (mField.getColumnName().equals("PriceEntered"))
{
mTab.setValue("PriceActual", value);
}
}
// Product Qty changed - recalc price
else if ((mField.getColumnName().equals("QtyOrdered")
|| mField.getColumnName().equals("QtyEntered")
|| mField.getColumnName().equals("M_Product_ID"))
&& !"N".equals(Env.getContext(ctx, WindowNo, "DiscountSchema")))
{
int C_BPartner_ID = Env.getContextAsInt(ctx, WindowNo, "C_BPartner_ID");
if (mField.getColumnName().equals("QtyEntered"))
QtyOrdered = MUOMConversion.convertProductTo (ctx, M_Product_ID,
C_UOM_To_ID, QtyEntered);
if (QtyOrdered == null)
QtyOrdered = QtyEntered;
boolean IsSOTrx = Env.getContext(ctx, WindowNo, "IsSOTrx").equals("Y");
MProductPricing pp = new MProductPricing (M_Product_ID, C_BPartner_ID, QtyOrdered, IsSOTrx);
pp.setM_PriceList_ID(M_PriceList_ID);
int M_PriceList_Version_ID = Env.getContextAsInt(ctx, WindowNo, "M_PriceList_Version_ID");
pp.setM_PriceList_Version_ID(M_PriceList_Version_ID);
Timestamp date = (Timestamp)mTab.getValue("DateOrdered");
pp.setPriceDate(date);
//
PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID,
C_UOM_To_ID, pp.getPriceStd());
if (PriceEntered == null)
PriceEntered = pp.getPriceStd();
//
log.fine("QtyChanged -> PriceActual=" + pp.getPriceStd()
+ ", PriceEntered=" + PriceEntered + ", Discount=" + pp.getDiscount());
mTab.setValue("PriceActual", pp.getPriceStd());
mTab.setValue("Discount", pp.getDiscount());
mTab.setValue("PriceEntered", PriceEntered);
Env.setContext(ctx, WindowNo, "DiscountSchema", pp.isDiscountSchema() ? "Y" : "N");
}
else if (mField.getColumnName().equals("PriceActual"))
{
PriceActual = (BigDecimal)value;
PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID,
C_UOM_To_ID, PriceActual);
if (PriceEntered == null)
PriceEntered = PriceActual;
//
log.fine("PriceActual=" + PriceActual
+ " -> PriceEntered=" + PriceEntered);
mTab.setValue("PriceEntered", PriceEntered);
}
else if (mField.getColumnName().equals("PriceEntered"))
{
PriceEntered = (BigDecimal)value;
PriceActual = MUOMConversion.convertProductTo (ctx, M_Product_ID,
C_UOM_To_ID, PriceEntered);
if (PriceActual == null)
PriceActual = PriceEntered;
//
log.fine("PriceEntered=" + PriceEntered
+ " -> PriceActual=" + PriceActual);
mTab.setValue("PriceActual", PriceActual);
}
// Discount entered - Calculate Actual/Entered
if (mField.getColumnName().equals("Discount"))
{
if ( PriceList.doubleValue() != 0 )
PriceActual = new BigDecimal ((100.0 - Discount.doubleValue()) / 100.0 * PriceList.doubleValue() );
if (PriceActual.scale() > StdPrecision)
PriceActual = PriceActual.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP);
PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID,
C_UOM_To_ID, PriceActual);
if (PriceEntered == null)
PriceEntered = PriceActual;
mTab.setValue("PriceActual", PriceActual);
mTab.setValue("PriceEntered", PriceEntered);
}
// calculate Discount
else
{
if (PriceList.intValue() == 0)
Discount = Env.ZERO;
else
//INICIO - MUDANÇA PALMETAL
Discount = new BigDecimal ((PriceList.doubleValue() + FreightAmt.doubleValue() - PriceActual.doubleValue()) / (PriceList.doubleValue() + FreightAmt.doubleValue()) * 100.0);
//FIM - MUDANÇA PALMETAL
if (Discount.scale() > 2)
Discount = Discount.setScale(2, BigDecimal.ROUND_HALF_UP);
mTab.setValue("Discount", Discount);
}
log.fine("PriceEntered=" + PriceEntered + ", Actual=" + PriceActual + ", Discount=" + Discount);
// Check PriceLimit
String epl = Env.getContext(ctx, WindowNo, "EnforcePriceLimit");
boolean enforce = Env.isSOTrx(ctx, WindowNo) && epl != null && epl.equals("Y");
if (enforce && MRole.getDefault().isOverwritePriceLimit())
enforce = false;
// Check Price Limit?
if (enforce && PriceLimit.doubleValue() != 0.0
&& PriceActual.compareTo(PriceLimit) < 0)
{
PriceActual = PriceLimit;
PriceEntered = MUOMConversion.convertProductFrom (ctx, M_Product_ID,
C_UOM_To_ID, PriceLimit);
if (PriceEntered == null)
PriceEntered = PriceLimit;
log.fine("(under) PriceEntered=" + PriceEntered + ", Actual" + PriceLimit);
mTab.setValue ("PriceActual", PriceLimit);
mTab.setValue ("PriceEntered", PriceEntered);
mTab.fireDataStatusEEvent ("UnderLimitPrice", "", false);
// Repeat Discount calc
if (PriceList.intValue() != 0)
{
Discount = new BigDecimal ((PriceList.doubleValue () - PriceActual.doubleValue ()) / PriceList.doubleValue () * 100.0);
if (Discount.scale () > 2)
Discount = Discount.setScale (2, BigDecimal.ROUND_HALF_UP);
mTab.setValue ("Discount", Discount);
}
}
// Line Net Amt
BigDecimal LineNetAmt = QtyOrdered.multiply(PriceActual);
if (LineNetAmt.scale() > StdPrecision)
LineNetAmt = LineNetAmt.setScale(StdPrecision, BigDecimal.ROUND_HALF_UP);
log.info("LineNetAmt=" + LineNetAmt);
mTab.setValue("LineNetAmt", LineNetAmt);
//
return "";
} // amt
| String function (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) { if (isCalloutActive() value == null) return STRinitSTRC_UOM_IDSTRM_Product_IDSTRM_PriceList_IDSTRQtyEnteredSTRQtyOrderedSTRFreightAmtSTRQtyEntered=STR, Ordered=STR, UOM=STR, FreightAmt=STRPriceEnteredSTRPriceActualSTRDiscountSTRPriceLimitSTRPriceListSTRPriceList=STR, Limit=STR, Precision=STRPriceEntered=STR, Actual=STR, Discount=STRPriceActualSTRPriceEnteredSTRPriceEnteredSTRPriceActualSTRQtyOrderedSTRQtyEnteredSTRM_Product_IDSTRNSTRDiscountSchemaSTRC_BPartner_IDSTRQtyEnteredSTRIsSOTrxSTRYSTRM_PriceList_Version_IDSTRDateOrderedSTRQtyChanged -> PriceActual=STR, PriceEntered=STR, Discount=STRPriceActualSTRDiscountSTRPriceEnteredSTRDiscountSchemaSTRYSTRNSTRPriceActualSTRPriceActual=STR -> PriceEntered=STRPriceEnteredSTRPriceEnteredSTRPriceEntered=STR -> PriceActual=STRPriceActualSTRDiscountSTRPriceActualSTRPriceEnteredSTRDiscountSTRPriceEntered=STR, Actual=STR, Discount=STREnforcePriceLimitSTRYSTR(under) PriceEntered=STR, ActualSTRPriceActualSTRPriceEnteredSTRUnderLimitPriceSTRSTRDiscountSTRLineNetAmt=STRLineNetAmtSTR"; } | /**
* Order Line - Amount.
* - called from QtyOrdered, Discount and PriceActual
* - calculates Discount or Actual Amount
* - calculates LineNetAmt
* - enforces PriceLimit
* @param ctx context
* @param WindowNo current Window No
* @param mTab Grid Tab
* @param mField Grid Field
* @param value New Value
* @return null or error message
*/ | Order Line - Amount. - called from QtyOrdered, Discount and PriceActual - calculates Discount or Actual Amount - calculates LineNetAmt - enforces PriceLimit | amtPalmetal | {
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempierelbr/base/src/org/compiere/model/CalloutOrder.java",
"license": "gpl-2.0",
"size": 55228
} | [
"java.util.Properties"
] | import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 256,851 |
Document createArMac(); | Document createArMac(); | /**
* Create a {@link Document} representing access-request-mac metadata.
*
* <pre>
* access-request-mac is link metadata that
* associates an access-request identifier with
* a mac-address identifier
* </pre>
*
* @return a {@link Document} that represents the metadata
*/ | Create a <code>Document</code> representing access-request-mac metadata. <code> access-request-mac is link metadata that associates an access-request identifier with a mac-address identifier </code> | createArMac | {
"repo_name": "trustathsh/ifmapj",
"path": "src/main/java/de/hshannover/f4/trust/ifmapj/metadata/StandardIfmapMetadataFactory.java",
"license": "apache-2.0",
"size": 16841
} | [
"org.w3c.dom.Document"
] | import org.w3c.dom.Document; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 776,719 |
public Collection<MethodNotPublicMatch> getAllMatches(final OpaqueBehavior pMe) {
return rawGetAllMatches(new Object[]{pMe});
}
| Collection<MethodNotPublicMatch> function(final OpaqueBehavior pMe) { return rawGetAllMatches(new Object[]{pMe}); } | /**
* Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
* @param pMe the fixed value of pattern parameter me, or null if not bound.
* @return matches represented as a MethodNotPublicMatch object.
*
*/ | Returns the set of all matches of the pattern that conform to the given fixed values of some parameters | getAllMatches | {
"repo_name": "ELTE-Soft/xUML-RT-Executor",
"path": "plugins/hu.eltesoft.modelexecution.validation/src-gen/hu/eltesoft/modelexecution/validation/MethodNotPublicMatcher.java",
"license": "epl-1.0",
"size": 10247
} | [
"hu.eltesoft.modelexecution.validation.MethodNotPublicMatch",
"java.util.Collection",
"org.eclipse.uml2.uml.OpaqueBehavior"
] | import hu.eltesoft.modelexecution.validation.MethodNotPublicMatch; import java.util.Collection; import org.eclipse.uml2.uml.OpaqueBehavior; | import hu.eltesoft.modelexecution.validation.*; import java.util.*; import org.eclipse.uml2.uml.*; | [
"hu.eltesoft.modelexecution",
"java.util",
"org.eclipse.uml2"
] | hu.eltesoft.modelexecution; java.util; org.eclipse.uml2; | 1,939,510 |
public void extend(ChangeAttribute a, Change change) {
a.createdOn = change.getCreatedOn().getTime() / 1000L;
a.lastUpdated = change.getLastUpdatedOn().getTime() / 1000L;
a.open = change.getStatus().isOpen();
} | void function(ChangeAttribute a, Change change) { a.createdOn = change.getCreatedOn().getTime() / 1000L; a.lastUpdated = change.getLastUpdatedOn().getTime() / 1000L; a.open = change.getStatus().isOpen(); } | /**
* Extend the existing ChangeAttribute with additional fields.
*
* @param a
* @param change
*/ | Extend the existing ChangeAttribute with additional fields | extend | {
"repo_name": "MerritCR/merrit",
"path": "gerrit-server/src/main/java/com/google/gerrit/server/events/EventFactory.java",
"license": "apache-2.0",
"size": 22924
} | [
"com.google.gerrit.reviewdb.client.Change",
"com.google.gerrit.server.data.ChangeAttribute"
] | import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.server.data.ChangeAttribute; | import com.google.gerrit.reviewdb.client.*; import com.google.gerrit.server.data.*; | [
"com.google.gerrit"
] | com.google.gerrit; | 337,447 |
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.LastQty)
public Double getLastQty() {
return lastQty;
} | @FIXVersion(introduced="4.0") @TagNumRef(tagNum=TagNum.LastQty) Double function() { return lastQty; } | /**
* Message field getter.
* @return field value
*/ | Message field getter | getLastQty | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/group/ExecAllocGroup.java",
"license": "gpl-3.0",
"size": 13509
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 1,937,535 |
@Test
public void showNotificationSuccessTest() {
final DisableGoogleAuthenticatorCredentialRequest request = new DisableGoogleAuthenticatorCredentialRequest();
final DisableGoogleAuthenticatorCredentialClickListener listener = Mockito.spy(new DisableGoogleAuthenticatorCredentialClickListener(request));
final ApplicationManager applicationManager = Mockito.mock(ApplicationManager.class);
Mockito.doReturn(applicationManager).when(listener).getApplicationManager();
final DisableGoogleAuthenticatorCredentialResponse response = new DisableGoogleAuthenticatorCredentialResponse(ServiceResult.SUCCESS);
Mockito.when(applicationManager.service(request)).thenReturn(response);
listener.buttonClick(new ClickEvent(new Panel()));
Mockito.verify(applicationManager,times(1)).service(request);
} | void function() { final DisableGoogleAuthenticatorCredentialRequest request = new DisableGoogleAuthenticatorCredentialRequest(); final DisableGoogleAuthenticatorCredentialClickListener listener = Mockito.spy(new DisableGoogleAuthenticatorCredentialClickListener(request)); final ApplicationManager applicationManager = Mockito.mock(ApplicationManager.class); Mockito.doReturn(applicationManager).when(listener).getApplicationManager(); final DisableGoogleAuthenticatorCredentialResponse response = new DisableGoogleAuthenticatorCredentialResponse(ServiceResult.SUCCESS); Mockito.when(applicationManager.service(request)).thenReturn(response); listener.buttonClick(new ClickEvent(new Panel())); Mockito.verify(applicationManager,times(1)).service(request); } | /**
* Show notification success test.
*/ | Show notification success test | showNotificationSuccessTest | {
"repo_name": "Hack23/cia",
"path": "citizen-intelligence-agency/src/test/java/com/hack23/cia/web/impl/ui/application/views/pageclicklistener/DisableGoogleAuthenticatorCredentialClickListenerTest.java",
"license": "apache-2.0",
"size": 3396
} | [
"com.hack23.cia.service.api.ApplicationManager",
"com.hack23.cia.service.api.action.common.ServiceResponse",
"com.hack23.cia.service.api.action.user.DisableGoogleAuthenticatorCredentialRequest",
"com.hack23.cia.service.api.action.user.DisableGoogleAuthenticatorCredentialResponse",
"com.vaadin.ui.Button",
"com.vaadin.ui.Panel",
"org.mockito.Mockito"
] | import com.hack23.cia.service.api.ApplicationManager; import com.hack23.cia.service.api.action.common.ServiceResponse; import com.hack23.cia.service.api.action.user.DisableGoogleAuthenticatorCredentialRequest; import com.hack23.cia.service.api.action.user.DisableGoogleAuthenticatorCredentialResponse; import com.vaadin.ui.Button; import com.vaadin.ui.Panel; import org.mockito.Mockito; | import com.hack23.cia.service.api.*; import com.hack23.cia.service.api.action.common.*; import com.hack23.cia.service.api.action.user.*; import com.vaadin.ui.*; import org.mockito.*; | [
"com.hack23.cia",
"com.vaadin.ui",
"org.mockito"
] | com.hack23.cia; com.vaadin.ui; org.mockito; | 2,863,111 |
public Enumeration getHops() {
return hops.elements();
}
| Enumeration function() { return hops.elements(); } | /**
* returns the list of hops
*
* @return Enumeration list of hops as AccessPointAdvertisement
*/ | returns the list of hops | getHops | {
"repo_name": "idega/net.jxta",
"path": "src/java/net/jxta/protocol/RouteAdvertisement.java",
"license": "gpl-3.0",
"size": 28098
} | [
"java.util.Enumeration"
] | import java.util.Enumeration; | import java.util.*; | [
"java.util"
] | java.util; | 1,181,135 |
@Test
public void testSetAsInitial() {
BorderSpacing borderSpacing = new BorderSpacing();
assertNotNull(borderSpacing.getHorizontalValue());
assertNotNull(borderSpacing.getVerticalValue());
assertNotNull(borderSpacing.getHorizontalUnit());
assertNotNull(borderSpacing.getVerticalUnit());
borderSpacing.setAsInitial();
assertEquals(BorderSpacing.INITIAL, borderSpacing.getCssValue());
assertNull(borderSpacing.getHorizontalValue());
assertNull(borderSpacing.getVerticalValue());
assertNull(borderSpacing.getHorizontalUnit());
assertNull(borderSpacing.getVerticalUnit());
} | void function() { BorderSpacing borderSpacing = new BorderSpacing(); assertNotNull(borderSpacing.getHorizontalValue()); assertNotNull(borderSpacing.getVerticalValue()); assertNotNull(borderSpacing.getHorizontalUnit()); assertNotNull(borderSpacing.getVerticalUnit()); borderSpacing.setAsInitial(); assertEquals(BorderSpacing.INITIAL, borderSpacing.getCssValue()); assertNull(borderSpacing.getHorizontalValue()); assertNull(borderSpacing.getVerticalValue()); assertNull(borderSpacing.getHorizontalUnit()); assertNull(borderSpacing.getVerticalUnit()); } | /**
* Test method for
* {@link com.webfirmframework.wffweb.css.BorderSpacing#setAsInitial()}.
*/ | Test method for <code>com.webfirmframework.wffweb.css.BorderSpacing#setAsInitial()</code> | testSetAsInitial | {
"repo_name": "webfirmframework/wff",
"path": "wffweb/src/test/java/com/webfirmframework/wffweb/css/BorderSpacingTest.java",
"license": "apache-2.0",
"size": 15460
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 343,484 |
void deleteEntity(E e, EntityDescription description); | void deleteEntity(E e, EntityDescription description); | /**
* Delete entity from database
*
* @param e entity instance
* @param description entity description
*/ | Delete entity from database | deleteEntity | {
"repo_name": "alesharik/AlesharikWebServer",
"path": "database/src/com/alesharik/database/entity/EntityManager.java",
"license": "gpl-3.0",
"size": 2058
} | [
"com.alesharik.database.entity.asm.EntityDescription"
] | import com.alesharik.database.entity.asm.EntityDescription; | import com.alesharik.database.entity.asm.*; | [
"com.alesharik.database"
] | com.alesharik.database; | 1,121,209 |
public void testFunctionReturnsNullOnNullInput() throws SQLException
{
Statement s = createStatement();
// SMALLINT -> short
s.executeUpdate(
"CREATE FUNCTION SMALLINT_P_SHORT_RN(VARCHAR(10)) RETURNS SMALLINT " +
"EXTERNAL NAME 'java.lang.Short.parseShort' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
PreparedStatement ps = prepareStatement("VALUES SMALLINT_P_SHORT_RN(?)");
ps.setString(1, "123");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123");
ps.setString(1,null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
// SMALLINT -> Integer
s.executeUpdate(
"CREATE FUNCTION SMALLINT_O_INTEGER_RN(VARCHAR(10)) RETURNS SMALLINT " +
"EXTERNAL NAME 'java.lang.Integer.valueOf' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES SMALLINT_O_INTEGER_RN(?)");
ps.setString(1, "123");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123");
ps.setString(1, null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
// INTEGER -> int
s.executeUpdate(
"CREATE FUNCTION INTEGER_P_INT_RN(VARCHAR(10)) RETURNS INTEGER " +
"EXTERNAL NAME 'java.lang.Integer.parseInt' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES INTEGER_P_INT_RN(?)");
ps.setString(1, "123");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123");
// INTEGER -> Integer
s.executeUpdate(
"CREATE FUNCTION INTEGER_O_INTEGER_RN(VARCHAR(10)) RETURNS INTEGER " +
"EXTERNAL NAME 'java.lang.Integer.valueOf' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES INTEGER_O_INTEGER_RN(?)");
ps.setString(1, "123");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123");
ps.setString(1, null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
// BIGINT -> long
s.executeUpdate(
"CREATE FUNCTION BIGINT_P_LONG_RN(VARCHAR(10)) RETURNS BIGINT " +
"EXTERNAL NAME 'java.lang.Long.parseLong' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES BIGINT_P_LONG_RN(?)");
ps.setString(1, "123");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123");
ps.setString(1, null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
// BIGINT -> Long
s.executeUpdate(
"CREATE FUNCTION BIGINT_O_LONG_NR(VARCHAR(10)) RETURNS BIGINT " +
"EXTERNAL NAME 'java.lang.Long.valueOf' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES BIGINT_O_LONG_NR(?)");
ps.setString(1, "123");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123");
ps.setString(1, null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
// REAL -> float
s.executeUpdate(
"CREATE FUNCTION REAL_P_FLOAT_NR(VARCHAR(10)) RETURNS REAL " +
"EXTERNAL NAME 'java.lang.Float.parseFloat' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES REAL_P_FLOAT_NR(?)");
ps.setString(1, "123.0");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123.0");
ps.setString(1, null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
// REAL -> Float
s.executeUpdate(
"CREATE FUNCTION REAL_O_FLOAT_NR(VARCHAR(10)) RETURNS REAL " +
"EXTERNAL NAME 'java.lang.Float.valueOf' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES REAL_O_FLOAT_NR(?)");
ps.setString(1, "123.0");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123.0");
ps.setString(1, null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
// DOUBLE -> double
s.executeUpdate(
"CREATE FUNCTION DOUBLE_P_DOUBLE_NR(VARCHAR(10)) RETURNS DOUBLE " +
"EXTERNAL NAME 'java.lang.Double.parseDouble' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES DOUBLE_P_DOUBLE_NR(?)");
ps.setString(1, "123.0");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123.0");
ps.setString(1, null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
// DOBULE -> Double
s.executeUpdate(
"CREATE FUNCTION DOUBLE_O_DOUBLE_NR(VARCHAR(10)) RETURNS DOUBLE " +
"EXTERNAL NAME 'java.lang.Double.valueOf' " +
"LANGUAGE JAVA PARAMETER STYLE JAVA " +
"RETURNS NULL ON NULL INPUT");
ps = prepareStatement("VALUES DOUBLE_O_DOUBLE_NR(?)");
ps.setString(1, "123.0");
JDBC.assertSingleValueResultSet(ps.executeQuery(), "123.0");
ps.setString(1, null);
JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
ps.close();
s.close();
} | void function() throws SQLException { Statement s = createStatement(); s.executeUpdate( STR + STR + STR + STR); PreparedStatement ps = prepareStatement(STR); ps.setString(1, "123"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123"); ps.setString(1,null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123"); ps.setString(1, null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123"); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123"); ps.setString(1, null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123"); ps.setString(1, null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123"); ps.setString(1, null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123.0"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123.0"); ps.setString(1, null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123.0"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123.0"); ps.setString(1, null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123.0"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123.0"); ps.setString(1, null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); s.executeUpdate( STR + STR + STR + STR); ps = prepareStatement(STR); ps.setString(1, "123.0"); JDBC.assertSingleValueResultSet(ps.executeQuery(), "123.0"); ps.setString(1, null); JDBC.assertSingleValueResultSet(ps.executeQuery(), null); ps.close(); s.close(); } | /**
* Test that RETURNS NULL ON NULL INPUT works properly with
* numeric datatypes for null and non-null values.
*/ | Test that RETURNS NULL ON NULL INPUT works properly with numeric datatypes for null and non-null values | testFunctionReturnsNullOnNullInput | {
"repo_name": "viaper/DBPlus",
"path": "DerbyHodgepodge/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RoutineTest.java",
"license": "apache-2.0",
"size": 28274
} | [
"java.sql.PreparedStatement",
"java.sql.SQLException",
"java.sql.Statement",
"org.apache.derbyTesting.junit.JDBC"
] | import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Statement; import org.apache.derbyTesting.junit.JDBC; | import java.sql.*; import org.apache.*; | [
"java.sql",
"org.apache"
] | java.sql; org.apache; | 2,015,383 |
public List<BackendAddressPoolInner> loadBalancerBackendAddressPools() {
return this.loadBalancerBackendAddressPools;
} | List<BackendAddressPoolInner> function() { return this.loadBalancerBackendAddressPools; } | /**
* Get the loadBalancerBackendAddressPools value.
*
* @return the loadBalancerBackendAddressPools value
*/ | Get the loadBalancerBackendAddressPools value | loadBalancerBackendAddressPools | {
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfaceIPConfigurationInner.java",
"license": "mit",
"size": 10523
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 291,820 |
public double getNorm() {
return FastMath.sqrt(q0 * q0 +
q1 * q1 +
q2 * q2 +
q3 * q3);
} | double function() { return FastMath.sqrt(q0 * q0 + q1 * q1 + q2 * q2 + q3 * q3); } | /**
* Computes the norm of the quaternion.
*
* @return the norm.
*/ | Computes the norm of the quaternion | getNorm | {
"repo_name": "SpoonLabs/astor",
"path": "examples/math_20/src/main/java/org/apache/commons/math3/complex/Quaternion.java",
"license": "gpl-2.0",
"size": 14067
} | [
"org.apache.commons.math3.util.FastMath"
] | import org.apache.commons.math3.util.FastMath; | import org.apache.commons.math3.util.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,149,164 |
public void setShadowDrawable(Drawable d) {
mViewBehind.setShadowDrawable(d);
} | void function(Drawable d) { mViewBehind.setShadowDrawable(d); } | /**
* Sets the shadow drawable.
*
* @param d the new shadow drawable
*/ | Sets the shadow drawable | setShadowDrawable | {
"repo_name": "pingping-jiang6141/appcan-android",
"path": "Engine/src/main/java/com/slidingmenu/lib/SlidingMenu.java",
"license": "lgpl-3.0",
"size": 36305
} | [
"android.graphics.drawable.Drawable"
] | import android.graphics.drawable.Drawable; | import android.graphics.drawable.*; | [
"android.graphics"
] | android.graphics; | 2,745,420 |
public ChannelBuffer formatSerializersV1() {
return serializeJSON(HttpQuery.getSerializerStatus());
} | ChannelBuffer function() { return serializeJSON(HttpQuery.getSerializerStatus()); } | /**
* Format the serializer status map
* @return A JSON structure
* @throws JSONException if serialization failed
*/ | Format the serializer status map | formatSerializersV1 | {
"repo_name": "OpenTSDB/opentsdb",
"path": "src/tsd/HttpJsonSerializer.java",
"license": "lgpl-2.1",
"size": 44736
} | [
"org.jboss.netty.buffer.ChannelBuffer"
] | import org.jboss.netty.buffer.ChannelBuffer; | import org.jboss.netty.buffer.*; | [
"org.jboss.netty"
] | org.jboss.netty; | 1,765,687 |
//-------------------------------------------------------------------------
@Override
public CrossGammaParameterSensitivities convertedTo(Currency resultCurrency, FxRateProvider rateProvider) {
List<CrossGammaParameterSensitivity> mutable = new ArrayList<>();
for (CrossGammaParameterSensitivity sens : sensitivities) {
insert(mutable, sens.convertedTo(resultCurrency, rateProvider));
}
return new CrossGammaParameterSensitivities(ImmutableList.copyOf(mutable));
} | CrossGammaParameterSensitivities function(Currency resultCurrency, FxRateProvider rateProvider) { List<CrossGammaParameterSensitivity> mutable = new ArrayList<>(); for (CrossGammaParameterSensitivity sens : sensitivities) { insert(mutable, sens.convertedTo(resultCurrency, rateProvider)); } return new CrossGammaParameterSensitivities(ImmutableList.copyOf(mutable)); } | /**
* Converts the sensitivities in this instance to an equivalent in the specified currency.
* <p>
* Any FX conversion that is required will use rates from the provider.
*
* @param resultCurrency the currency of the result
* @param rateProvider the provider of FX rates
* @return the sensitivity object expressed in terms of the result currency
* @throws RuntimeException if no FX rate could be found
*/ | Converts the sensitivities in this instance to an equivalent in the specified currency. Any FX conversion that is required will use rates from the provider | convertedTo | {
"repo_name": "OpenGamma/Strata",
"path": "modules/market/src/main/java/com/opengamma/strata/market/param/CrossGammaParameterSensitivities.java",
"license": "apache-2.0",
"size": 23278
} | [
"com.google.common.collect.ImmutableList",
"com.opengamma.strata.basics.currency.Currency",
"com.opengamma.strata.basics.currency.FxRateProvider",
"java.util.ArrayList",
"java.util.List"
] | import com.google.common.collect.ImmutableList; import com.opengamma.strata.basics.currency.Currency; import com.opengamma.strata.basics.currency.FxRateProvider; import java.util.ArrayList; import java.util.List; | import com.google.common.collect.*; import com.opengamma.strata.basics.currency.*; import java.util.*; | [
"com.google.common",
"com.opengamma.strata",
"java.util"
] | com.google.common; com.opengamma.strata; java.util; | 1,512,157 |
void drawRangeMarker(Graphics2D g2, XYPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea);
| void drawRangeMarker(Graphics2D g2, XYPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea); | /**
* Draws a horizontal line across the chart to represent a 'range marker'.
*
* @param g2 the graphics device.
* @param plot the plot.
* @param axis the value axis.
* @param marker the marker line.
* @param dataArea the axis data area.
*/ | Draws a horizontal line across the chart to represent a 'range marker' | drawRangeMarker | {
"repo_name": "jfree/jfreechart",
"path": "src/main/java/org/jfree/chart/renderer/xy/XYItemRenderer.java",
"license": "lgpl-2.1",
"size": 49520
} | [
"java.awt.Graphics2D",
"java.awt.geom.Rectangle2D",
"org.jfree.chart.axis.ValueAxis",
"org.jfree.chart.plot.Marker",
"org.jfree.chart.plot.XYPlot"
] | import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.plot.Marker; import org.jfree.chart.plot.XYPlot; | import java.awt.*; import java.awt.geom.*; import org.jfree.chart.axis.*; import org.jfree.chart.plot.*; | [
"java.awt",
"org.jfree.chart"
] | java.awt; org.jfree.chart; | 1,704,032 |
public final boolean orientedAs(final Edge e, final double error) {
// Builds two vectors and normalize them.
final Vector3d vect1 = new Vector3d(
e.getP2().getX() - e.getP1().getX(), e.getP2().getY()
- e.getP1().getY(), e.getP2().getZ() - e.getP1().getZ());
vect1.normalize();
final Vector3d vect2 = new Vector3d(this.getP2().getX()
- this.getP1().getX(), this.getP2().getY()
- this.getP1().getY(), this.getP2().getZ()
- this.getP1().getZ());
vect2.normalize();
// Then calls the angle function to check their orientation.
final double convertDegreeRadian = Edge.CONVERSION_PI_DEGREES;
return (vect1.angle(vect2) < (error / convertDegreeRadian))
|| vect1.angle(vect2) > (((Edge.PI_DEGREES - error) / convertDegreeRadian));
} | final boolean function(final Edge e, final double error) { final Vector3d vect1 = new Vector3d( e.getP2().getX() - e.getP1().getX(), e.getP2().getY() - e.getP1().getY(), e.getP2().getZ() - e.getP1().getZ()); vect1.normalize(); final Vector3d vect2 = new Vector3d(this.getP2().getX() - this.getP1().getX(), this.getP2().getY() - this.getP1().getY(), this.getP2().getZ() - this.getP1().getZ()); vect2.normalize(); final double convertDegreeRadian = Edge.CONVERSION_PI_DEGREES; return (vect1.angle(vect2) < (error / convertDegreeRadian)) vect1.angle(vect2) > (((Edge.PI_DEGREES - error) / convertDegreeRadian)); } | /**
* Checks if this edge is oriented as another edge, with an orientation
* error.
* @param e
* the other edge
* @param error
* the orientation error
* @return true if they have the same orientation, false otherwise
*/ | Checks if this edge is oriented as another edge, with an orientation error | orientedAs | {
"repo_name": "DanielLefevre/Nantes-1900-Maven",
"path": "src/main/java/fr/nantes1900/models/basis/Edge.java",
"license": "gpl-3.0",
"size": 13861
} | [
"javax.vecmath.Vector3d"
] | import javax.vecmath.Vector3d; | import javax.vecmath.*; | [
"javax.vecmath"
] | javax.vecmath; | 1,824,986 |
public interface FusionStrategy {
public void makeParameters(Set<Worker<?, ?>> workers, Configuration.Builder builder); | interface FusionStrategy { public void function(Set<Worker<?, ?>> workers, Configuration.Builder builder); | /**
* Adds parameters used by this strategy to the given builder.
* @param workers the workers the configuration is being built for
* @param builder the builder
*/ | Adds parameters used by this strategy to the given builder | makeParameters | {
"repo_name": "jbosboom/streamjit",
"path": "src/edu/mit/streamjit/impl/compiler2/FusionStrategy.java",
"license": "mit",
"size": 2120
} | [
"edu.mit.streamjit.api.Worker",
"edu.mit.streamjit.impl.common.Configuration",
"java.util.Set"
] | import edu.mit.streamjit.api.Worker; import edu.mit.streamjit.impl.common.Configuration; import java.util.Set; | import edu.mit.streamjit.api.*; import edu.mit.streamjit.impl.common.*; import java.util.*; | [
"edu.mit.streamjit",
"java.util"
] | edu.mit.streamjit; java.util; | 2,094,613 |
@Nonnull
@CheckReturnValue
SqlUpdate toUpdate(@Syntax("SQL") @Nonnull String sql); | SqlUpdate toUpdate(@Syntax("SQL") @Nonnull String sql); | /**
* Create a SQL "update" statement for further manipulation and execution.
* Note this call does not actually execute the SQL.
*
* @param sql the SQL to execute, optionally containing indexed ("?") or
* named (":foo") parameters. To include the characters '?' or ':'
* in the SQL you must escape them with two ("??" or "::"). You
* MUST be careful not to pass untrusted strings in as SQL, since
* this will be executed in the database.
* @return an interface for further manipulating the statement; never null
*/ | Create a SQL "update" statement for further manipulation and execution. Note this call does not actually execute the SQL | toUpdate | {
"repo_name": "susom/database",
"path": "src/main/java/com/github/susom/database/Database.java",
"license": "apache-2.0",
"size": 9838
} | [
"javax.annotation.Nonnull",
"javax.annotation.Syntax"
] | import javax.annotation.Nonnull; import javax.annotation.Syntax; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,827,519 |
public void testURIFailure() throws ValidationException {
AuthnContextDeclRef authnContextDeclRef = (AuthnContextDeclRef) target;
authnContextDeclRef.setAuthnContextDeclRef(null);
assertValidationFail("DeclRef was null, should raise a Validation Exception");
authnContextDeclRef.setAuthnContextDeclRef("");
assertValidationFail("DeclRef was empty string, should raise a Validation Exception");
authnContextDeclRef.setAuthnContextDeclRef(" ");
assertValidationFail("DeclRef was white space, should raise a Validation Exception");
} | void function() throws ValidationException { AuthnContextDeclRef authnContextDeclRef = (AuthnContextDeclRef) target; authnContextDeclRef.setAuthnContextDeclRef(null); assertValidationFail(STR); authnContextDeclRef.setAuthnContextDeclRef(STRDeclRef was empty string, should raise a Validation ExceptionSTR STRDeclRef was white space, should raise a Validation Exception"); } | /**
* Tests absent Declaration Reference failure.
*
* @throws ValidationException
*/ | Tests absent Declaration Reference failure | testURIFailure | {
"repo_name": "danpal/OpenSAML",
"path": "src/test/java/org/opensaml/saml2/core/validator/AuthnContextDeclRefSchemaTest.java",
"license": "apache-2.0",
"size": 2375
} | [
"org.opensaml.saml2.core.AuthnContextDeclRef",
"org.opensaml.xml.validation.ValidationException"
] | import org.opensaml.saml2.core.AuthnContextDeclRef; import org.opensaml.xml.validation.ValidationException; | import org.opensaml.saml2.core.*; import org.opensaml.xml.validation.*; | [
"org.opensaml.saml2",
"org.opensaml.xml"
] | org.opensaml.saml2; org.opensaml.xml; | 632,336 |
@Test
public strictfp void testAdd_double() {
ListStatistics stats = new ListStatistics();
stats.addValue(VALUES[0]);
assertEquals(1, stats.getN());
assertEquals(VALUES[0], stats.getSum(), 0.0);
assertEquals(VALUES[0], stats.getMax(), 0.0);
assertEquals(VALUES[0], stats.getMin(), 0.0);
assertEquals(VALUES[0], stats.getMean(), 0.0);
assertEquals(Double.NaN, stats.getVariance(), 0.0);
assertEquals(Double.NaN, stats.getStandardDeviation(), 0.0);
} | strictfp void function() { ListStatistics stats = new ListStatistics(); stats.addValue(VALUES[0]); assertEquals(1, stats.getN()); assertEquals(VALUES[0], stats.getSum(), 0.0); assertEquals(VALUES[0], stats.getMax(), 0.0); assertEquals(VALUES[0], stats.getMin(), 0.0); assertEquals(VALUES[0], stats.getMean(), 0.0); assertEquals(Double.NaN, stats.getVariance(), 0.0); assertEquals(Double.NaN, stats.getStandardDeviation(), 0.0); } | /**
* Test of add method, of class Statistics.
*/ | Test of add method, of class Statistics | testAdd_double | {
"repo_name": "msteindorfer/jmh",
"path": "jmh-core/src/test/java/org/openjdk/jmh/util/TestListStatistics.java",
"license": "gpl-2.0",
"size": 7624
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 930,071 |
// ofc service
@POST
@Path("/ofc")
@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
public Response createOfc(@RequestBody String newOfcInfoJson); | @Path("/ofc") @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) Response function(@RequestBody String newOfcInfoJson); | /**
* Create ofc
* @param newOfcInfoJson String
* @return Http Response
*/ | Create ofc | createOfc | {
"repo_name": "okinawaopenlabs/of-patch-manager",
"path": "src/main/java/org/okinawaopenlabs/ofpm/service/DeviceService.java",
"license": "apache-2.0",
"size": 5133
} | [
"javax.ws.rs.Consumes",
"javax.ws.rs.Path",
"javax.ws.rs.Produces",
"javax.ws.rs.core.MediaType",
"javax.ws.rs.core.Response",
"org.springframework.web.bind.annotation.RequestBody"
] | import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.springframework.web.bind.annotation.RequestBody; | import javax.ws.rs.*; import javax.ws.rs.core.*; import org.springframework.web.bind.annotation.*; | [
"javax.ws",
"org.springframework.web"
] | javax.ws; org.springframework.web; | 2,101,671 |
public void setExpires(int expires) throws InvalidArgumentException; | void function(int expires) throws InvalidArgumentException; | /**
* Sets the relative expires value of the SubscriptionStateHeader. The
* expires value MUST be greater than zero and MUST be less than 2**31.
*
* @param expires - the new expires value of this SubscriptionStateHeader.
* @throws InvalidArgumentException if supplied value is less than zero.
*/ | Sets the relative expires value of the SubscriptionStateHeader. The expires value MUST be greater than zero and MUST be less than 2**31 | setExpires | {
"repo_name": "fhg-fokus-nubomedia/ims-connector",
"path": "src/main/java/javax/sip/header/SubscriptionStateHeader.java",
"license": "apache-2.0",
"size": 8549
} | [
"javax.sip.InvalidArgumentException"
] | import javax.sip.InvalidArgumentException; | import javax.sip.*; | [
"javax.sip"
] | javax.sip; | 2,130,345 |
public static <T> NamedFactory<T> get(List<NamedFactory<T>> factories, String name) {
for (NamedFactory<T> f : factories) {
if (f.getName().equals(name)) {
return f;
}
}
return null;
}
} | static <T> NamedFactory<T> function(List<NamedFactory<T>> factories, String name) { for (NamedFactory<T> f : factories) { if (f.getName().equals(name)) { return f; } } return null; } } | /**
* Retrieve the factory identified by its name from the list.
*
* @param factories list of available factories
* @param name the name of the factory to retrieve
* @param <T> type of object create by the factories
* @return a factory or <code>null</code> if not found in the list
*/ | Retrieve the factory identified by its name from the list | get | {
"repo_name": "lucastheisen/mina-sshd",
"path": "sshd-core/src/main/java/org/apache/sshd/common/NamedFactory.java",
"license": "apache-2.0",
"size": 4088
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 335,589 |
public static Map<String, String> getAttributes(SAMLSSOAuthnReqDTO authnReqDTO) throws IdentityException {
int index = 0;
// trying to get the Service Provider Configurations
SSOServiceProviderConfigManager spConfigManager =
SSOServiceProviderConfigManager.getInstance();
SAMLSSOServiceProviderDO spDO = spConfigManager.getServiceProvider(authnReqDTO.getIssuer());
if (spDO == null) {
spDO = getSAMLServiceProviderFromRegistry(authnReqDTO.getIssuer(), authnReqDTO.getTenantDomain());
}
if (!authnReqDTO.isIdPInitSSOEnabled()) {
if ( authnReqDTO.getAttributeConsumingServiceIndex() == 0) {
//SP has not provide a AttributeConsumingServiceIndex in the authnReqDTO
if (StringUtils.isNotBlank(spDO.getAttributeConsumingServiceIndex()) && spDO
.isEnableAttributesByDefault()) {
index = Integer.parseInt(spDO.getAttributeConsumingServiceIndex());
} else if (CollectionUtils.isEmpty(authnReqDTO.getRequestedAttributes())) {
return Collections.emptyMap();
}
} else {
//SP has provide a AttributeConsumingServiceIndex in the authnReqDTO
index = authnReqDTO.getAttributeConsumingServiceIndex();
}
} else {
if (StringUtils.isNotBlank(spDO.getAttributeConsumingServiceIndex()) && spDO.isEnableAttributesByDefault
()) {
index = Integer.parseInt(spDO.getAttributeConsumingServiceIndex());
} else {
return Collections.emptyMap();
}
}
if (((spDO.getAttributeConsumingServiceIndex() == null ||
"".equals(spDO.getAttributeConsumingServiceIndex())) &&
CollectionUtils.isEmpty(authnReqDTO.getRequestedAttributes())) ||
(index !=0 && index != Integer.parseInt(spDO.getAttributeConsumingServiceIndex()))) {
if (log.isDebugEnabled()) {
log.debug("Invalid AttributeConsumingServiceIndex in AuthnRequest");
}
return Collections.emptyMap();
}
Map<String, String> claimsMap = new HashMap<String, String>();
if (authnReqDTO.getUser().getUserAttributes() != null) {
for (Map.Entry<ClaimMapping, String> entry : authnReqDTO.getUser().getUserAttributes().entrySet()) {
claimsMap.put(entry.getKey().getRemoteClaim().getClaimUri(), entry.getValue());
}
}
return claimsMap;
} | static Map<String, String> function(SAMLSSOAuthnReqDTO authnReqDTO) throws IdentityException { int index = 0; SSOServiceProviderConfigManager spConfigManager = SSOServiceProviderConfigManager.getInstance(); SAMLSSOServiceProviderDO spDO = spConfigManager.getServiceProvider(authnReqDTO.getIssuer()); if (spDO == null) { spDO = getSAMLServiceProviderFromRegistry(authnReqDTO.getIssuer(), authnReqDTO.getTenantDomain()); } if (!authnReqDTO.isIdPInitSSOEnabled()) { if ( authnReqDTO.getAttributeConsumingServiceIndex() == 0) { if (StringUtils.isNotBlank(spDO.getAttributeConsumingServiceIndex()) && spDO .isEnableAttributesByDefault()) { index = Integer.parseInt(spDO.getAttributeConsumingServiceIndex()); } else if (CollectionUtils.isEmpty(authnReqDTO.getRequestedAttributes())) { return Collections.emptyMap(); } } else { index = authnReqDTO.getAttributeConsumingServiceIndex(); } } else { if (StringUtils.isNotBlank(spDO.getAttributeConsumingServiceIndex()) && spDO.isEnableAttributesByDefault ()) { index = Integer.parseInt(spDO.getAttributeConsumingServiceIndex()); } else { return Collections.emptyMap(); } } if (((spDO.getAttributeConsumingServiceIndex() == null STRInvalid AttributeConsumingServiceIndex in AuthnRequest"); } return Collections.emptyMap(); } Map<String, String> claimsMap = new HashMap<String, String>(); if (authnReqDTO.getUser().getUserAttributes() != null) { for (Map.Entry<ClaimMapping, String> entry : authnReqDTO.getUser().getUserAttributes().entrySet()) { claimsMap.put(entry.getKey().getRemoteClaim().getClaimUri(), entry.getValue()); } } return claimsMap; } | /**
* Return a Array of Claims containing requested attributes and values
*
* @param authnReqDTO
* @return Map with attributes and values
* @throws IdentityException
*/ | Return a Array of Claims containing requested attributes and values | getAttributes | {
"repo_name": "wso2-extensions/identity-inbound-auth-saml",
"path": "components/org.wso2.carbon.identity.sso.saml/src/main/java/org/wso2/carbon/identity/sso/saml/util/SAMLSSOUtil.java",
"license": "apache-2.0",
"size": 115944
} | [
"java.util.Collections",
"java.util.HashMap",
"java.util.Map",
"org.apache.commons.collections.CollectionUtils",
"org.apache.commons.lang.StringUtils",
"org.opensaml.saml.saml2.core.AuthnRequest",
"org.wso2.carbon.identity.application.common.model.ClaimMapping",
"org.wso2.carbon.identity.base.IdentityException",
"org.wso2.carbon.identity.core.model.SAMLSSOServiceProviderDO",
"org.wso2.carbon.identity.sso.saml.SSOServiceProviderConfigManager",
"org.wso2.carbon.identity.sso.saml.dto.SAMLSSOAuthnReqDTO"
] | import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.opensaml.saml.saml2.core.AuthnRequest; import org.wso2.carbon.identity.application.common.model.ClaimMapping; import org.wso2.carbon.identity.base.IdentityException; import org.wso2.carbon.identity.core.model.SAMLSSOServiceProviderDO; import org.wso2.carbon.identity.sso.saml.SSOServiceProviderConfigManager; import org.wso2.carbon.identity.sso.saml.dto.SAMLSSOAuthnReqDTO; | import java.util.*; import org.apache.commons.collections.*; import org.apache.commons.lang.*; import org.opensaml.saml.saml2.core.*; import org.wso2.carbon.identity.application.common.model.*; import org.wso2.carbon.identity.base.*; import org.wso2.carbon.identity.core.model.*; import org.wso2.carbon.identity.sso.saml.*; import org.wso2.carbon.identity.sso.saml.dto.*; | [
"java.util",
"org.apache.commons",
"org.opensaml.saml",
"org.wso2.carbon"
] | java.util; org.apache.commons; org.opensaml.saml; org.wso2.carbon; | 2,234,118 |
protected List<Object> getAnnotationToRemove()
{
return new ArrayList<Object>();
} | List<Object> function() { return new ArrayList<Object>(); } | /**
* No-operation implementation in our case.
* @see AnnotationUI#getAnnotationToRemove()
*/ | No-operation implementation in our case | getAnnotationToRemove | {
"repo_name": "ximenesuk/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/metadata/editor/GroupProfile.java",
"license": "gpl-2.0",
"size": 13784
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 486,022 |
@Override
public void mousePressed(MouseEvent e) {
synchronized (mouseLock) {
mouseX = StdDraw.userX(e.getX());
mouseY = StdDraw.userY(e.getY());
mousePressed = true;
}
} | void function(MouseEvent e) { synchronized (mouseLock) { mouseX = StdDraw.userX(e.getX()); mouseY = StdDraw.userY(e.getY()); mousePressed = true; } } | /**
* This method cannot be called directly.
*/ | This method cannot be called directly | mousePressed | {
"repo_name": "WalkingValleyChen/java-adt-test",
"path": "src/main/java/edu/princeton/cs/algs4/StdDraw.java",
"license": "apache-2.0",
"size": 74178
} | [
"java.awt.event.MouseEvent"
] | import java.awt.event.MouseEvent; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 1,322,984 |
public Iterator<Node> getSubnodes() throws UnsupportedOperationException
{
throw (new UnsupportedOperationException());
} | Iterator<Node> function() throws UnsupportedOperationException { throw (new UnsupportedOperationException()); } | /** metodo non implementato
* @throws UnsupportedOperationException */ | metodo non implementato | getSubnodes | {
"repo_name": "dakk/twitter-tree",
"path": "src/dgsf/twittertree/SessionNode.java",
"license": "gpl-2.0",
"size": 2662
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,661,860 |
@SuppressWarnings ("unchecked")
@Override
public List<T> readAll ()
{
return find ("FROM " + entityClass.getName ());
} | @SuppressWarnings (STR) List<T> function () { return find (STR + entityClass.getName ()); } | /**
* Returns all Objects in a List.
*
* @return List containing all Objects.
*/ | Returns all Objects in a List | readAll | {
"repo_name": "calogera/DataHubSystem",
"path": "core/src/main/java/fr/gael/dhus/database/dao/interfaces/HibernateDao.java",
"license": "agpl-3.0",
"size": 11433
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 462,501 |
private static void createDataSource() {
HikariConfig config = new HikariConfig("src/main/resources/hikari.properties");
HikariDataSource ds = new HikariDataSource(config);
try {
InitialContext ctx = new InitialContext();
ensureCtx(ctx, "java:/comp/env");
ensureCtx(ctx, "java:/comp/env/jdbc");
ctx.bind("java:/comp/env/jdbc/ApiManagerDS", ds);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | static void function() { HikariConfig config = new HikariConfig(STR); HikariDataSource ds = new HikariDataSource(config); try { InitialContext ctx = new InitialContext(); ensureCtx(ctx, STR); ensureCtx(ctx, STR); ctx.bind(STR, ds); } catch (Exception e) { throw new RuntimeException(e); } } | /**
* Creates a datasource and binds it to JNDI.
*/ | Creates a datasource and binds it to JNDI | createDataSource | {
"repo_name": "KurtStam/apiman-servers",
"path": "manager-postgres/src/main/java/io/apiman/servers/manager_postgres/Starter.java",
"license": "apache-2.0",
"size": 2608
} | [
"com.zaxxer.hikari.HikariConfig",
"com.zaxxer.hikari.HikariDataSource",
"javax.naming.InitialContext"
] | import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariDataSource; import javax.naming.InitialContext; | import com.zaxxer.hikari.*; import javax.naming.*; | [
"com.zaxxer.hikari",
"javax.naming"
] | com.zaxxer.hikari; javax.naming; | 378,313 |
@GET("sj/v2.5/fetchartist")
Call<Artist> getArtist(@Query("nid") String artistID,
@Query("include-albums") boolean includeAlbums,
@Query("num-top-tracks") int numTopTracks,
@Query("num-related-artists") int numRelArtist); | @GET(STR) Call<Artist> getArtist(@Query("nid") String artistID, @Query(STR) boolean includeAlbums, @Query(STR) int numTopTracks, @Query(STR) int numRelArtist); | /**
* Fetches for an artist by {@code artistID}.
*
* @param artistID {@link Artist#getArtistId()} of the artist searched for.
* @param includeAlbums whether albums of the artist shall be included in the response.
* @param numTopTracks response includes up to provided number of most heard songs in response
* @param numRelArtist response includes up to provided number of similar artist in response
* @return An executable call which returns an artist on execution.
*/ | Fetches for an artist by artistID | getArtist | {
"repo_name": "FelixGail/gplaymusic",
"path": "src/main/java/com/github/felixgail/gplaymusic/api/GPlayService.java",
"license": "mit",
"size": 7645
} | [
"com.github.felixgail.gplaymusic.model.Artist"
] | import com.github.felixgail.gplaymusic.model.Artist; | import com.github.felixgail.gplaymusic.model.*; | [
"com.github.felixgail"
] | com.github.felixgail; | 73,935 |
public BigDecimal remainingQuantity() {
return this.remainingQuantity;
} | BigDecimal function() { return this.remainingQuantity; } | /**
* Get the remainingQuantity property: This is the remaining quantity for the reservationId.
*
* @return the remainingQuantity value.
*/ | Get the remainingQuantity property: This is the remaining quantity for the reservationId | remainingQuantity | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java",
"license": "mit",
"size": 9687
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 2,289,092 |
public void set(int index, String value) throws IOException {
Writer writer = null;
try {
writer = new OutputStreamWriter(newOutputStream(index), UTF_8);
writer.write(value);
} finally {
closeQuietly(writer);
}
} | void function(int index, String value) throws IOException { Writer writer = null; try { writer = new OutputStreamWriter(newOutputStream(index), UTF_8); writer.write(value); } finally { closeQuietly(writer); } } | /**
* Sets the value at {@code index} to {@code value}.
*/ | Sets the value at index to value | set | {
"repo_name": "leonzone/MyPlan",
"path": "src/com/sunday/myplan/io/DiskLruCache.java",
"license": "apache-2.0",
"size": 33908
} | [
"java.io.IOException",
"java.io.OutputStreamWriter",
"java.io.Writer"
] | import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; | import java.io.*; | [
"java.io"
] | java.io; | 2,641,477 |
public void saveMetadata() throws IgniteCheckedException {
long nextPageId = metaPageId;
assert nextPageId != 0;
if (!changed)
return;
//This guaranteed that any concurrently changes of list will be detected.
changed = false;
try {
long unusedPageId = writeFreeList(nextPageId);
markUnusedPagesDirty(unusedPageId);
}
catch (Throwable e) {
changed = true;//Return changed flag due to exception.
throw e;
}
} | void function() throws IgniteCheckedException { long nextPageId = metaPageId; assert nextPageId != 0; if (!changed) return; changed = false; try { long unusedPageId = writeFreeList(nextPageId); markUnusedPagesDirty(unusedPageId); } catch (Throwable e) { changed = true; throw e; } } | /**
* Save metadata without exclusive lock on it.
*
* @throws IgniteCheckedException If failed.
*/ | Save metadata without exclusive lock on it | saveMetadata | {
"repo_name": "shroman/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/freelist/PagesList.java",
"license": "apache-2.0",
"size": 58560
} | [
"org.apache.ignite.IgniteCheckedException"
] | import org.apache.ignite.IgniteCheckedException; | import org.apache.ignite.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,548,067 |
byte[][] getAllColumns(HTable table) throws IOException {
HColumnDescriptor[] cds = table.getTableDescriptor().getColumnFamilies();
byte[][] columns = new byte[cds.length][];
for (int i = 0; i < cds.length; i++) {
columns[i] = Bytes.add(cds[i].getName(),
KeyValue.COLUMN_FAMILY_DELIM_ARRAY);
}
return columns;
} | byte[][] getAllColumns(HTable table) throws IOException { HColumnDescriptor[] cds = table.getTableDescriptor().getColumnFamilies(); byte[][] columns = new byte[cds.length][]; for (int i = 0; i < cds.length; i++) { columns[i] = Bytes.add(cds[i].getName(), KeyValue.COLUMN_FAMILY_DELIM_ARRAY); } return columns; } | /**
* Returns a list of all the column families for a given htable.
*
* @param table
* @return
* @throws IOException
*/ | Returns a list of all the column families for a given htable | getAllColumns | {
"repo_name": "lichongxin/hbase-snapshot",
"path": "src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java",
"license": "apache-2.0",
"size": 31294
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.HColumnDescriptor",
"org.apache.hadoop.hbase.KeyValue",
"org.apache.hadoop.hbase.client.HTable",
"org.apache.hadoop.hbase.util.Bytes"
] | import java.io.IOException; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.HTable; import org.apache.hadoop.hbase.util.Bytes; | import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.util.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,854,479 |
public FloatBuffer getBuffer() {
FloatBuffer buffer = BufferUtils.createFloatBuffer(3);
buffer.put(x).put(y).put(z);
buffer.flip();
return buffer;
} | FloatBuffer function() { FloatBuffer buffer = BufferUtils.createFloatBuffer(3); buffer.put(x).put(y).put(z); buffer.flip(); return buffer; } | /**
* Returns the Buffer representation of this vector.
*
* @return Vector as FloatBuffer
*/ | Returns the Buffer representation of this vector | getBuffer | {
"repo_name": "kinztechcom/League-File-Manager",
"path": "src/com/kinztech/league/scene/Vector3f.java",
"license": "gpl-3.0",
"size": 3966
} | [
"java.nio.FloatBuffer",
"org.lwjgl.BufferUtils"
] | import java.nio.FloatBuffer; import org.lwjgl.BufferUtils; | import java.nio.*; import org.lwjgl.*; | [
"java.nio",
"org.lwjgl"
] | java.nio; org.lwjgl; | 811,859 |
public int getColumnIndex(Object identifier, boolean onlyVisible) {
if (identifier == null) {
throw new IllegalArgumentException("Identifier is null");
}
List<TableColumn> columns = getColumnsFast(onlyVisible);
int noColumns = columns.size();
TableColumn column;
for (int columnIndex = 0; columnIndex < noColumns; ++columnIndex) {
column = columns.get(columnIndex);
if (identifier.equals(column.getIdentifier()))
return columnIndex;
}
throw new IllegalArgumentException("Identifier not found");
}
| int function(Object identifier, boolean onlyVisible) { if (identifier == null) { throw new IllegalArgumentException(STR); } List<TableColumn> columns = getColumnsFast(onlyVisible); int noColumns = columns.size(); TableColumn column; for (int columnIndex = 0; columnIndex < noColumns; ++columnIndex) { column = columns.get(columnIndex); if (identifier.equals(column.getIdentifier())) return columnIndex; } throw new IllegalArgumentException(STR); } | /**
* Returns the position of the first column whose identifier equals <code>identifier</code>.
* Position is the the index in all visible columns if <code>onlyVisible</code> is true or else
* the index in all columns.
*
* @param identifier the identifier object to search for
* @param onlyVisible if set searches only visible columns
*
* @return the index of the first column whose identifier equals <code>identifier</code>
*
* @exception IllegalArgumentException if <code>identifier</code> is <code>null</code>, or if no
* <code>TableColumn</code> has this <code>identifier</code>
* @see #getColumn
*/ | Returns the position of the first column whose identifier equals <code>identifier</code>. Position is the the index in all visible columns if <code>onlyVisible</code> is true or else the index in all columns | getColumnIndex | {
"repo_name": "mbshopM/openconcerto",
"path": "OpenConcerto/src/org/openconcerto/ui/table/XTableColumnModel.java",
"license": "gpl-3.0",
"size": 10860
} | [
"java.util.List",
"javax.swing.table.TableColumn"
] | import java.util.List; import javax.swing.table.TableColumn; | import java.util.*; import javax.swing.table.*; | [
"java.util",
"javax.swing"
] | java.util; javax.swing; | 289,429 |
@SmallTest
@Feature({"Browser", "Main"})
public void testKeyboardMenuEnterOnTopItemLandscape() throws InterruptedException {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
showAppMenuAndAssertMenuShown();
moveToBoundary(true, false);
assertEquals(0, getCurrentFocusedRow());
hitEnterAndAssertAppMenuDismissed();
} | @Feature({STR, "Main"}) void function() throws InterruptedException { getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); showAppMenuAndAssertMenuShown(); moveToBoundary(true, false); assertEquals(0, getCurrentFocusedRow()); hitEnterAndAssertAppMenuDismissed(); } | /**
* Test that hitting ENTER on the top item actually triggers the top item.
* Catches regressions for https://crbug.com/191239 for shrunken menus.
*/ | Test that hitting ENTER on the top item actually triggers the top item. Catches regressions for HREF for shrunken menus | testKeyboardMenuEnterOnTopItemLandscape | {
"repo_name": "XiaosongWei/chromium-crosswalk",
"path": "chrome/android/javatests/src/org/chromium/chrome/browser/appmenu/AppMenuTest.java",
"license": "bsd-3-clause",
"size": 10894
} | [
"android.content.pm.ActivityInfo",
"org.chromium.base.test.util.Feature"
] | import android.content.pm.ActivityInfo; import org.chromium.base.test.util.Feature; | import android.content.pm.*; import org.chromium.base.test.util.*; | [
"android.content",
"org.chromium.base"
] | android.content; org.chromium.base; | 2,761,316 |
private JcrPropertyMapCacheEntry cacheProperty(final Property prop) {
try {
// calculate the key
final String name = prop.getName();
String key = null;
if ( name.indexOf("_x") != -1 ) {
// for compatibility with older versions we use the (wrong)
// ISO9075 path encoding
key = ISO9075.decode(name);
if ( key.equals(name) ) {
key = null;
}
}
if ( key == null ) {
key = Text.unescapeIllegalJcrChars(name);
}
JcrPropertyMapCacheEntry entry = cache.get(key);
if ( entry == null ) {
entry = new JcrPropertyMapCacheEntry(prop);
cache.put(key, entry);
final Object defaultValue = entry.getPropertyValue();
if (defaultValue != null) {
valueCache.put(key, entry.getPropertyValue());
}
}
return entry;
} catch (final RepositoryException re) {
throw new IllegalArgumentException(re);
}
} | JcrPropertyMapCacheEntry function(final Property prop) { try { final String name = prop.getName(); String key = null; if ( name.indexOf("_x") != -1 ) { key = ISO9075.decode(name); if ( key.equals(name) ) { key = null; } } if ( key == null ) { key = Text.unescapeIllegalJcrChars(name); } JcrPropertyMapCacheEntry entry = cache.get(key); if ( entry == null ) { entry = new JcrPropertyMapCacheEntry(prop); cache.put(key, entry); final Object defaultValue = entry.getPropertyValue(); if (defaultValue != null) { valueCache.put(key, entry.getPropertyValue()); } } return entry; } catch (final RepositoryException re) { throw new IllegalArgumentException(re); } } | /**
* Put a single property into the cache
* @param prop
* @return
* @throws IllegalArgumentException if a repository exception occurs
*/ | Put a single property into the cache | cacheProperty | {
"repo_name": "cleliameneghin/sling",
"path": "bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java",
"license": "apache-2.0",
"size": 16411
} | [
"javax.jcr.Property",
"javax.jcr.RepositoryException",
"org.apache.jackrabbit.util.Text",
"org.apache.sling.jcr.resource.internal.helper.JcrPropertyMapCacheEntry"
] | import javax.jcr.Property; import javax.jcr.RepositoryException; import org.apache.jackrabbit.util.Text; import org.apache.sling.jcr.resource.internal.helper.JcrPropertyMapCacheEntry; | import javax.jcr.*; import org.apache.jackrabbit.util.*; import org.apache.sling.jcr.resource.internal.helper.*; | [
"javax.jcr",
"org.apache.jackrabbit",
"org.apache.sling"
] | javax.jcr; org.apache.jackrabbit; org.apache.sling; | 2,518,302 |
private static void centreOnScreen() {
Rectangle bds = newShell.getDisplay().getBounds();
newShell.setSize(110,35);
Point p = newShell.getSize();
newShell.setBounds((bds.width - p.x) / 2, (bds.height - p.y)/2, p.x, p.y);
}
| static void function() { Rectangle bds = newShell.getDisplay().getBounds(); newShell.setSize(110,35); Point p = newShell.getSize(); newShell.setBounds((bds.width - p.x) / 2, (bds.height - p.y)/2, p.x, p.y); } | /**
* This method centres the shell on the screen
*/ | This method centres the shell on the screen | centreOnScreen | {
"repo_name": "shaze/genesis",
"path": "src/shared/WaitDialog.java",
"license": "agpl-3.0",
"size": 2332
} | [
"org.eclipse.swt.graphics.Point",
"org.eclipse.swt.graphics.Rectangle"
] | import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; | import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 2,690,396 |
public static BufferedImage getIcon(String key)
{ BufferedImage result;
BufferedImage temp = icons.get(key);
if(temp==null)
result = ImageTools.getAbsentImage(64,64);
else
result = temp;
return result;
}
| static BufferedImage function(String key) { BufferedImage result; BufferedImage temp = icons.get(key); if(temp==null) result = ImageTools.getAbsentImage(64,64); else result = temp; return result; } | /**
* Get the image for the specified key.
*
* @param key
* Id requested.
* @return
* The corresponding image.
*/ | Get the image for the specified key | getIcon | {
"repo_name": "vlabatut/totalboumboum",
"path": "src/org/totalboumboum/gui/tools/GuiImageTools.java",
"license": "gpl-2.0",
"size": 50456
} | [
"java.awt.image.BufferedImage",
"org.totalboumboum.tools.images.ImageTools"
] | import java.awt.image.BufferedImage; import org.totalboumboum.tools.images.ImageTools; | import java.awt.image.*; import org.totalboumboum.tools.images.*; | [
"java.awt",
"org.totalboumboum.tools"
] | java.awt; org.totalboumboum.tools; | 2,595,896 |
void addView(@NonNull View view) throws IOException; | void addView(@NonNull View view) throws IOException; | /**
* Add new {@link View} to this {@link ViewGroup}.
*/ | Add new <code>View</code> to this <code>ViewGroup</code> | addView | {
"repo_name": "oleg-nenashev/jenkins",
"path": "core/src/main/java/hudson/model/ModifiableViewGroup.java",
"license": "mit",
"size": 1518
} | [
"edu.umd.cs.findbugs.annotations.NonNull",
"java.io.IOException"
] | import edu.umd.cs.findbugs.annotations.NonNull; import java.io.IOException; | import edu.umd.cs.findbugs.annotations.*; import java.io.*; | [
"edu.umd.cs",
"java.io"
] | edu.umd.cs; java.io; | 2,279,435 |
@SuppressWarnings("unchecked")
static Set<? extends String> getAnyStringSet() {
return any(Set.class); // unchecked
} | @SuppressWarnings(STR) static Set<? extends String> getAnyStringSet() { return any(Set.class); } | /**
* Returns a Mockito {@code any} Matcher for {@code java.util.Set<String>}.
*
* @return a Mockito {@code any} matcher for {@code Set<String>}.
*/ | Returns a Mockito any Matcher for java.util.Set | getAnyStringSet | {
"repo_name": "ljacomet/ehcache3",
"path": "ehcache-core/src/test/java/org/ehcache/core/EhcacheBasicGetAllTest.java",
"license": "apache-2.0",
"size": 12703
} | [
"java.util.Set",
"org.mockito.ArgumentMatchers"
] | import java.util.Set; import org.mockito.ArgumentMatchers; | import java.util.*; import org.mockito.*; | [
"java.util",
"org.mockito"
] | java.util; org.mockito; | 2,435,847 |
protected void emitGraphStart( Appendable stream ) throws IOException
{
stream.append( "digraph Neo {\n" );
emitHeaders(stream);
} | void function( Appendable stream ) throws IOException { stream.append( STR ); emitHeaders(stream); } | /**
* Emit the start of a graph. Override this method to change the format of
* the start of a graph.
* @param stream
* the stream to emit the graph start to.
* @throws IOException
* if there is an error in emitting the graph start.
*/ | Emit the start of a graph. Override this method to change the format of the start of a graph | emitGraphStart | {
"repo_name": "HuangLS/neo4j",
"path": "community/graphviz/src/main/java/org/neo4j/visualization/graphviz/GraphStyle.java",
"license": "apache-2.0",
"size": 6294
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 311,640 |
public void testGetIssuerX500Principal() {
assertEquals("Incorrect issuer value",
new X500Principal(issuerName), crl.getIssuerDN());
} | void function() { assertEquals(STR, new X500Principal(issuerName), crl.getIssuerDN()); } | /**
* getIssuerX500Principal() method testing.
*/ | getIssuerX500Principal() method testing | testGetIssuerX500Principal | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/security/src/test/impl/java/org/apache/harmony/security/tests/provider/cert/X509CRLImplTest.java",
"license": "apache-2.0",
"size": 22623
} | [
"javax.security.auth.x500.X500Principal"
] | import javax.security.auth.x500.X500Principal; | import javax.security.auth.x500.*; | [
"javax.security"
] | javax.security; | 185,042 |
public ProjectCode getDefaultInvoiceProject() {
return defaultInvoiceProject;
}
| ProjectCode function() { return defaultInvoiceProject; } | /**
* Gets the defaultInvoiceProject attribute.
*
* @return Returns the defaultInvoiceProject
*
*/ | Gets the defaultInvoiceProject attribute | getDefaultInvoiceProject | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/ar/businessobject/CustomerInvoiceItemCode.java",
"license": "agpl-3.0",
"size": 16200
} | [
"org.kuali.kfs.coa.businessobject.ProjectCode"
] | import org.kuali.kfs.coa.businessobject.ProjectCode; | import org.kuali.kfs.coa.businessobject.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 670,788 |
public void setParameter(@NonNull String name, int x, int y, int z, int w) {
nSetParameterInt4(getNativeObject(), name, x, y, z, w);
} | void function(@NonNull String name, int x, int y, int z, int w) { nSetParameterInt4(getNativeObject(), name, x, y, z, w); } | /**
* Sets the value of a int4 parameter.
*
* @param name the name of the material parameter
* @param x the value of the first component
* @param y the value of the second component
* @param z the value of the third component
* @param w the value of the fourth component
*/ | Sets the value of a int4 parameter | setParameter | {
"repo_name": "google/filament",
"path": "android/filament-android/src/main/java/com/google/android/filament/MaterialInstance.java",
"license": "apache-2.0",
"size": 22777
} | [
"androidx.annotation.NonNull"
] | import androidx.annotation.NonNull; | import androidx.annotation.*; | [
"androidx.annotation"
] | androidx.annotation; | 2,489,993 |
public RequestEnvelope getRequestEnvelope() {
return requestEnvelope;
}
| RequestEnvelope function() { return requestEnvelope; } | /**
* Getter for requestEnvelope
*/ | Getter for requestEnvelope | getRequestEnvelope | {
"repo_name": "DAC-2014-Equipe-3/sujet-2",
"path": "sujet2/src/main/java/com/paypal/svcs/types/ap/GetFundingPlansRequest.java",
"license": "mit",
"size": 1697
} | [
"com.paypal.svcs.types.common.RequestEnvelope"
] | import com.paypal.svcs.types.common.RequestEnvelope; | import com.paypal.svcs.types.common.*; | [
"com.paypal.svcs"
] | com.paypal.svcs; | 1,259,308 |
protected float[] calculateAnchorPoint(ValueTick tick, double cursor,
Rectangle2D dataArea,
RectangleEdge edge) {
if (tick instanceof CycleBoundTick) {
boolean mapsav = this.boundMappedToLastCycle;
this.boundMappedToLastCycle
= ((CycleBoundTick) tick).mapToLastCycle;
float[] ret = super.calculateAnchorPoint(
tick, cursor, dataArea, edge
);
this.boundMappedToLastCycle = mapsav;
return ret;
}
return super.calculateAnchorPoint(tick, cursor, dataArea, edge);
} | float[] function(ValueTick tick, double cursor, Rectangle2D dataArea, RectangleEdge edge) { if (tick instanceof CycleBoundTick) { boolean mapsav = this.boundMappedToLastCycle; this.boundMappedToLastCycle = ((CycleBoundTick) tick).mapToLastCycle; float[] ret = super.calculateAnchorPoint( tick, cursor, dataArea, edge ); this.boundMappedToLastCycle = mapsav; return ret; } return super.calculateAnchorPoint(tick, cursor, dataArea, edge); } | /**
* Calculates the anchor point for a tick.
*
* @param tick the tick.
* @param cursor the cursor.
* @param dataArea the data area.
* @param edge the side on which the axis is displayed.
*
* @return The anchor point.
*/ | Calculates the anchor point for a tick | calculateAnchorPoint | {
"repo_name": "Epsilon2/Memetic-Algorithm-for-TSP",
"path": "jfreechart-1.0.16/source/org/jfree/chart/axis/CyclicNumberAxis.java",
"license": "mit",
"size": 41207
} | [
"java.awt.geom.Rectangle2D",
"org.jfree.ui.RectangleEdge"
] | import java.awt.geom.Rectangle2D; import org.jfree.ui.RectangleEdge; | import java.awt.geom.*; import org.jfree.ui.*; | [
"java.awt",
"org.jfree.ui"
] | java.awt; org.jfree.ui; | 1,587,567 |
public void send(byte[] data) throws IOException {
// Use local copy of the socket, ensuring it's not going to NULL while
// we're working with it. If it gets closed, while we're in the middle
// of data transfer - it's OK, since it will produce an exception, and
// the caller will gracefully handle it.
//
// Same technique is used everywhere in this class where mSocket member
// is touched.
LocalSocket socket = mSocket;
if (socket == null) {
Logw("'send' request on closed Socket " + mChannelName);
throw new ClosedChannelException();
}
socket.getOutputStream().write(data);
} | void function(byte[] data) throws IOException { LocalSocket socket = mSocket; if (socket == null) { Logw(STR + mChannelName); throw new ClosedChannelException(); } socket.getOutputStream().write(data); } | /**
* Sends data to the socket.
*
* @param data Data to send. Data size is defined by the length of the
* array.
* @throws IOException
*/ | Sends data to the socket | send | {
"repo_name": "consulo/consulo-android",
"path": "tools-base/apps/SdkController/src/com/android/tools/sdkcontroller/lib/Socket.java",
"license": "apache-2.0",
"size": 6955
} | [
"android.net.LocalSocket",
"java.io.IOException",
"java.nio.channels.ClosedChannelException"
] | import android.net.LocalSocket; import java.io.IOException; import java.nio.channels.ClosedChannelException; | import android.net.*; import java.io.*; import java.nio.channels.*; | [
"android.net",
"java.io",
"java.nio"
] | android.net; java.io; java.nio; | 1,619,810 |
public void writePacketData(DataOutput par1DataOutput) throws IOException
{
writeString(this.teamName, par1DataOutput);
par1DataOutput.writeByte(this.mode);
if (this.mode == 0 || this.mode == 2)
{
writeString(this.teamDisplayName, par1DataOutput);
writeString(this.teamPrefix, par1DataOutput);
writeString(this.teamSuffix, par1DataOutput);
par1DataOutput.writeByte(this.friendlyFire);
}
if (this.mode == 0 || this.mode == 3 || this.mode == 4)
{
par1DataOutput.writeShort(this.playerNames.size());
Iterator var2 = this.playerNames.iterator();
while (var2.hasNext())
{
String var3 = (String)var2.next();
writeString(var3, par1DataOutput);
}
}
} | void function(DataOutput par1DataOutput) throws IOException { writeString(this.teamName, par1DataOutput); par1DataOutput.writeByte(this.mode); if (this.mode == 0 this.mode == 2) { writeString(this.teamDisplayName, par1DataOutput); writeString(this.teamPrefix, par1DataOutput); writeString(this.teamSuffix, par1DataOutput); par1DataOutput.writeByte(this.friendlyFire); } if (this.mode == 0 this.mode == 3 this.mode == 4) { par1DataOutput.writeShort(this.playerNames.size()); Iterator var2 = this.playerNames.iterator(); while (var2.hasNext()) { String var3 = (String)var2.next(); writeString(var3, par1DataOutput); } } } | /**
* Abstract. Writes the raw packet data to the data stream.
*/ | Abstract. Writes the raw packet data to the data stream | writePacketData | {
"repo_name": "herpingdo/Hakkit",
"path": "net/minecraft/src/Packet209SetPlayerTeam.java",
"license": "gpl-3.0",
"size": 4630
} | [
"java.io.DataOutput",
"java.io.IOException",
"java.util.Iterator"
] | import java.io.DataOutput; import java.io.IOException; import java.util.Iterator; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,699,919 |
public Value callMethod(Env env, Value qThis,
StringValue methodName, int hash,
Value a1, Value a2, Value a3)
{
if (qThis.isNull())
qThis = this;
AbstractFunction fun = _methodMap.get(methodName, hash);
return fun.callMethod(env, this, qThis, a1, a2, a3);
} | Value function(Env env, Value qThis, StringValue methodName, int hash, Value a1, Value a2, Value a3) { if (qThis.isNull()) qThis = this; AbstractFunction fun = _methodMap.get(methodName, hash); return fun.callMethod(env, this, qThis, a1, a2, a3); } | /**
* calls the function.
*/ | calls the function | callMethod | {
"repo_name": "WelcomeHUME/svn-caucho-com-resin",
"path": "modules/quercus/src/com/caucho/quercus/env/QuercusClass.java",
"license": "gpl-2.0",
"size": 70646
} | [
"com.caucho.quercus.function.AbstractFunction"
] | import com.caucho.quercus.function.AbstractFunction; | import com.caucho.quercus.function.*; | [
"com.caucho.quercus"
] | com.caucho.quercus; | 1,775,180 |
public static String DAY_OF_WEEK_SHORT(ZonedDateTime date) {
validate(date, "DAY_OF_WEEK_SHORT");
DateTime dt = getDateTime(date);
DateTime.Property value = dt.dayOfWeek();
return value.getAsShortText();
} | static String function(ZonedDateTime date) { validate(date, STR); DateTime dt = getDateTime(date); DateTime.Property value = dt.dayOfWeek(); return value.getAsShortText(); } | /**
* Extracts day of the week from the date.
*
* @param date to extract date of the week.
* @return day of the week.
*/ | Extracts day of the week from the date | DAY_OF_WEEK_SHORT | {
"repo_name": "data-integrations/wrangler",
"path": "wrangler-core/src/main/java/io/cdap/functions/Dates.java",
"license": "apache-2.0",
"size": 8081
} | [
"java.time.ZonedDateTime",
"org.joda.time.DateTime"
] | import java.time.ZonedDateTime; import org.joda.time.DateTime; | import java.time.*; import org.joda.time.*; | [
"java.time",
"org.joda.time"
] | java.time; org.joda.time; | 179,799 |
public static void main(String[] args) {
JFrame frame = new JFrame("JOutlookBar Test");
JOutlookBar outlookBar = new JOutlookBar();
outlookBar.addBar("One", getDummyPanel("One"));
outlookBar.addBar("Two", getDummyPanel("Two"));
outlookBar.addBar("Three", getDummyPanel("Three"));
outlookBar.addBar("Four", getDummyPanel("Four"));
outlookBar.addBar("Five", getDummyPanel("Five"));
outlookBar.setVisibleBar(2);
frame.getContentPane().add(outlookBar);
frame.setSize(800, 600);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation(d.width / 2 - 400, d.height / 2 - 300);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
class BarInfo {
private String name;
private JButton button;
private JComponent component;
public BarInfo(String name, JComponent component, final boolean horizontal) {
this.name = name;
this.component = component;
if (horizontal){
this.button = new JButton(name);
} else {
this.button = new VerticalButton(name);
}
}
public BarInfo(String name, Icon icon, JComponent component, final boolean horizontal) {
this.name = name;
this.component = component;
if (horizontal){
this.button = new JButton(name, icon);
} else {
this.button = new VerticalButton(name, icon);
}
} | static void function(String[] args) { JFrame frame = new JFrame(STR); JOutlookBar outlookBar = new JOutlookBar(); outlookBar.addBar("One", getDummyPanel("One")); outlookBar.addBar("Two", getDummyPanel("Two")); outlookBar.addBar("Three", getDummyPanel("Three")); outlookBar.addBar("Four", getDummyPanel("Four")); outlookBar.addBar("Five", getDummyPanel("Five")); outlookBar.setVisibleBar(2); frame.getContentPane().add(outlookBar); frame.setSize(800, 600); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); frame.setLocation(d.width / 2 - 400, d.height / 2 - 300); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } class BarInfo { private String name; private JButton button; private JComponent component; public BarInfo(String name, JComponent component, final boolean horizontal) { this.name = name; this.component = component; if (horizontal){ this.button = new JButton(name); } else { this.button = new VerticalButton(name); } } public BarInfo(String name, Icon icon, JComponent component, final boolean horizontal) { this.name = name; this.component = component; if (horizontal){ this.button = new JButton(name, icon); } else { this.button = new VerticalButton(name, icon); } } | /**
* Debug test...
*/ | Debug test.. | main | {
"repo_name": "crisis-economics/CRISIS",
"path": "CRISIS/src/eu/crisis_economics/abm/dashboard/JOutlookBar.java",
"license": "gpl-3.0",
"size": 10583
} | [
"java.awt.Dimension",
"java.awt.Toolkit",
"javax.swing.Icon",
"javax.swing.JButton",
"javax.swing.JComponent",
"javax.swing.JFrame"
] | import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.Icon; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 2,485,284 |
public void newRow() {
rows.add(currentRow);
indexRow++;
// create new row with number of cells of
// the last row, this is a good guess
currentRow = new ArrayList(indexCol);
indexCol = 0;
} | void function() { rows.add(currentRow); indexRow++; currentRow = new ArrayList(indexCol); indexCol = 0; } | /**
* Finishes current row and starts a new one
*/ | Finishes current row and starts a new one | newRow | {
"repo_name": "grails/grails-gdoc-engine",
"path": "src/main/java/org/radeox/macro/table/Table.java",
"license": "apache-2.0",
"size": 5523
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,887,980 |
//-----------------------------------------------------------------------
public List<ManageableUser> getUsers() {
return _users;
} | List<ManageableUser> function() { return _users; } | /**
* Gets the users that matched the search.
* @return the value of the property, not null
*/ | Gets the users that matched the search | getUsers | {
"repo_name": "DevStreet/FinanceAnalytics",
"path": "projects/OG-Master/src/main/java/com/opengamma/master/user/UserSearchResult.java",
"license": "apache-2.0",
"size": 8676
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 744,097 |
public void iamPrincipalPartitionCheck(String iamPrincipalArn) {
final Matcher iamRoleArnMatcher =
DomainConstants.IAM_PRINCIPAL_ARN_PATTERN_ALLOWED.matcher(iamPrincipalArn);
if (iamRoleArnMatcher.find()) {
partitionCheck(iamRoleArnMatcher.group("partition"));
} else {
final Matcher iamRootArnMatcher =
DomainConstants.AWS_ACCOUNT_ROOT_ARN_PATTERN.matcher(iamPrincipalArn);
if (iamRootArnMatcher.find()) {
partitionCheck(iamRootArnMatcher.group("partition"));
}
}
} | void function(String iamPrincipalArn) { final Matcher iamRoleArnMatcher = DomainConstants.IAM_PRINCIPAL_ARN_PATTERN_ALLOWED.matcher(iamPrincipalArn); if (iamRoleArnMatcher.find()) { partitionCheck(iamRoleArnMatcher.group(STR)); } else { final Matcher iamRootArnMatcher = DomainConstants.AWS_ACCOUNT_ROOT_ARN_PATTERN.matcher(iamPrincipalArn); if (iamRootArnMatcher.find()) { partitionCheck(iamRootArnMatcher.group(STR)); } } } | /**
* Checks if the partition of an IAM principal ARN is enabled
*
* @param iamPrincipalArn The IAM principal ARN to be checked
* @throws ApiException Throws an exception if the partition of the IAM principal isn't enabled
*/ | Checks if the partition of an IAM principal ARN is enabled | iamPrincipalPartitionCheck | {
"repo_name": "Nike-Inc/cerberus-management-service",
"path": "cerberus-web/src/main/java/com/nike/cerberus/util/AwsIamRoleArnParser.java",
"license": "apache-2.0",
"size": 7742
} | [
"com.nike.cerberus.domain.DomainConstants",
"java.util.regex.Matcher"
] | import com.nike.cerberus.domain.DomainConstants; import java.util.regex.Matcher; | import com.nike.cerberus.domain.*; import java.util.regex.*; | [
"com.nike.cerberus",
"java.util"
] | com.nike.cerberus; java.util; | 2,492,958 |
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == PHOTO_ACTIVITY_REQUEST && resultCode == RESULT_OK) {
imageByte = data.getStringExtra("imagebyte");
}
} | void function(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PHOTO_ACTIVITY_REQUEST && resultCode == RESULT_OK) { imageByte = data.getStringExtra(STR); } } | /**
* Retrieve the uploaded image from TakePhotoActivity to be used in an annotation for this activity
*/ | Retrieve the uploaded image from TakePhotoActivity to be used in an annotation for this activity | onActivityResult | {
"repo_name": "hoyjustin/AdventureBookApp",
"path": "AdventureBook/src/c301/AdventureBook/AnnotationActivity.java",
"license": "gpl-2.0",
"size": 8626
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 378,099 |
public static void assertRepeatedFieldsModified(TestAllTypesOrBuilder message) {
// ModifyRepeatedFields only sets the second repeated element of each
// field. In addition to verifying this, we also verify that the first
// element and size were *not* modified.
Assert.assertEquals(2, message.getRepeatedInt32Count());
Assert.assertEquals(2, message.getRepeatedInt64Count());
Assert.assertEquals(2, message.getRepeatedUint32Count());
Assert.assertEquals(2, message.getRepeatedUint64Count());
Assert.assertEquals(2, message.getRepeatedSint32Count());
Assert.assertEquals(2, message.getRepeatedSint64Count());
Assert.assertEquals(2, message.getRepeatedFixed32Count());
Assert.assertEquals(2, message.getRepeatedFixed64Count());
Assert.assertEquals(2, message.getRepeatedSfixed32Count());
Assert.assertEquals(2, message.getRepeatedSfixed64Count());
Assert.assertEquals(2, message.getRepeatedFloatCount());
Assert.assertEquals(2, message.getRepeatedDoubleCount());
Assert.assertEquals(2, message.getRepeatedBoolCount());
Assert.assertEquals(2, message.getRepeatedStringCount());
Assert.assertEquals(2, message.getRepeatedBytesCount());
Assert.assertEquals(2, message.getRepeatedGroupCount());
Assert.assertEquals(2, message.getRepeatedNestedMessageCount());
Assert.assertEquals(2, message.getRepeatedForeignMessageCount());
Assert.assertEquals(2, message.getRepeatedImportMessageCount());
Assert.assertEquals(2, message.getRepeatedLazyMessageCount());
Assert.assertEquals(2, message.getRepeatedNestedEnumCount());
Assert.assertEquals(2, message.getRepeatedForeignEnumCount());
Assert.assertEquals(2, message.getRepeatedImportEnumCount());
Assert.assertEquals(2, message.getRepeatedStringPieceCount());
Assert.assertEquals(2, message.getRepeatedCordCount());
Assert.assertEquals(201, message.getRepeatedInt32(0));
Assert.assertEquals(202L, message.getRepeatedInt64(0));
Assert.assertEquals(203, message.getRepeatedUint32(0));
Assert.assertEquals(204L, message.getRepeatedUint64(0));
Assert.assertEquals(205, message.getRepeatedSint32(0));
Assert.assertEquals(206L, message.getRepeatedSint64(0));
Assert.assertEquals(207, message.getRepeatedFixed32(0));
Assert.assertEquals(208L, message.getRepeatedFixed64(0));
Assert.assertEquals(209, message.getRepeatedSfixed32(0));
Assert.assertEquals(210L, message.getRepeatedSfixed64(0));
Assert.assertEquals(211F, message.getRepeatedFloat(0));
Assert.assertEquals(212D, message.getRepeatedDouble(0));
Assert.assertEquals(true, message.getRepeatedBool(0));
Assert.assertEquals("215", message.getRepeatedString(0));
Assert.assertEquals(toBytes("216"), message.getRepeatedBytes(0));
Assert.assertEquals(217, message.getRepeatedGroup(0).getA());
Assert.assertEquals(218, message.getRepeatedNestedMessage(0).getBb());
Assert.assertEquals(219, message.getRepeatedForeignMessage(0).getC());
Assert.assertEquals(220, message.getRepeatedImportMessage(0).getD());
Assert.assertEquals(227, message.getRepeatedLazyMessage(0).getBb());
Assert.assertEquals(TestAllTypes.NestedEnum.BAR, message.getRepeatedNestedEnum(0));
Assert.assertEquals(ForeignEnum.FOREIGN_BAR, message.getRepeatedForeignEnum(0));
Assert.assertEquals(ImportEnum.IMPORT_BAR, message.getRepeatedImportEnum(0));
Assert.assertEquals("224", message.getRepeatedStringPiece(0));
Assert.assertEquals("225", message.getRepeatedCord(0));
// Actually verify the second (modified) elements now.
Assert.assertEquals(501, message.getRepeatedInt32(1));
Assert.assertEquals(502L, message.getRepeatedInt64(1));
Assert.assertEquals(503, message.getRepeatedUint32(1));
Assert.assertEquals(504L, message.getRepeatedUint64(1));
Assert.assertEquals(505, message.getRepeatedSint32(1));
Assert.assertEquals(506L, message.getRepeatedSint64(1));
Assert.assertEquals(507, message.getRepeatedFixed32(1));
Assert.assertEquals(508L, message.getRepeatedFixed64(1));
Assert.assertEquals(509, message.getRepeatedSfixed32(1));
Assert.assertEquals(510L, message.getRepeatedSfixed64(1));
Assert.assertEquals(511F, message.getRepeatedFloat(1));
Assert.assertEquals(512D, message.getRepeatedDouble(1));
Assert.assertEquals(true, message.getRepeatedBool(1));
Assert.assertEquals("515", message.getRepeatedString(1));
Assert.assertEquals(toBytes("516"), message.getRepeatedBytes(1));
Assert.assertEquals(517, message.getRepeatedGroup(1).getA());
Assert.assertEquals(518, message.getRepeatedNestedMessage(1).getBb());
Assert.assertEquals(519, message.getRepeatedForeignMessage(1).getC());
Assert.assertEquals(520, message.getRepeatedImportMessage(1).getD());
Assert.assertEquals(527, message.getRepeatedLazyMessage(1).getBb());
Assert.assertEquals(TestAllTypes.NestedEnum.FOO, message.getRepeatedNestedEnum(1));
Assert.assertEquals(ForeignEnum.FOREIGN_FOO, message.getRepeatedForeignEnum(1));
Assert.assertEquals(ImportEnum.IMPORT_FOO, message.getRepeatedImportEnum(1));
Assert.assertEquals("524", message.getRepeatedStringPiece(1));
Assert.assertEquals("525", message.getRepeatedCord(1));
} | static void function(TestAllTypesOrBuilder message) { Assert.assertEquals(2, message.getRepeatedInt32Count()); Assert.assertEquals(2, message.getRepeatedInt64Count()); Assert.assertEquals(2, message.getRepeatedUint32Count()); Assert.assertEquals(2, message.getRepeatedUint64Count()); Assert.assertEquals(2, message.getRepeatedSint32Count()); Assert.assertEquals(2, message.getRepeatedSint64Count()); Assert.assertEquals(2, message.getRepeatedFixed32Count()); Assert.assertEquals(2, message.getRepeatedFixed64Count()); Assert.assertEquals(2, message.getRepeatedSfixed32Count()); Assert.assertEquals(2, message.getRepeatedSfixed64Count()); Assert.assertEquals(2, message.getRepeatedFloatCount()); Assert.assertEquals(2, message.getRepeatedDoubleCount()); Assert.assertEquals(2, message.getRepeatedBoolCount()); Assert.assertEquals(2, message.getRepeatedStringCount()); Assert.assertEquals(2, message.getRepeatedBytesCount()); Assert.assertEquals(2, message.getRepeatedGroupCount()); Assert.assertEquals(2, message.getRepeatedNestedMessageCount()); Assert.assertEquals(2, message.getRepeatedForeignMessageCount()); Assert.assertEquals(2, message.getRepeatedImportMessageCount()); Assert.assertEquals(2, message.getRepeatedLazyMessageCount()); Assert.assertEquals(2, message.getRepeatedNestedEnumCount()); Assert.assertEquals(2, message.getRepeatedForeignEnumCount()); Assert.assertEquals(2, message.getRepeatedImportEnumCount()); Assert.assertEquals(2, message.getRepeatedStringPieceCount()); Assert.assertEquals(2, message.getRepeatedCordCount()); Assert.assertEquals(201, message.getRepeatedInt32(0)); Assert.assertEquals(202L, message.getRepeatedInt64(0)); Assert.assertEquals(203, message.getRepeatedUint32(0)); Assert.assertEquals(204L, message.getRepeatedUint64(0)); Assert.assertEquals(205, message.getRepeatedSint32(0)); Assert.assertEquals(206L, message.getRepeatedSint64(0)); Assert.assertEquals(207, message.getRepeatedFixed32(0)); Assert.assertEquals(208L, message.getRepeatedFixed64(0)); Assert.assertEquals(209, message.getRepeatedSfixed32(0)); Assert.assertEquals(210L, message.getRepeatedSfixed64(0)); Assert.assertEquals(211F, message.getRepeatedFloat(0)); Assert.assertEquals(212D, message.getRepeatedDouble(0)); Assert.assertEquals(true, message.getRepeatedBool(0)); Assert.assertEquals("215", message.getRepeatedString(0)); Assert.assertEquals(toBytes("216"), message.getRepeatedBytes(0)); Assert.assertEquals(217, message.getRepeatedGroup(0).getA()); Assert.assertEquals(218, message.getRepeatedNestedMessage(0).getBb()); Assert.assertEquals(219, message.getRepeatedForeignMessage(0).getC()); Assert.assertEquals(220, message.getRepeatedImportMessage(0).getD()); Assert.assertEquals(227, message.getRepeatedLazyMessage(0).getBb()); Assert.assertEquals(TestAllTypes.NestedEnum.BAR, message.getRepeatedNestedEnum(0)); Assert.assertEquals(ForeignEnum.FOREIGN_BAR, message.getRepeatedForeignEnum(0)); Assert.assertEquals(ImportEnum.IMPORT_BAR, message.getRepeatedImportEnum(0)); Assert.assertEquals("224", message.getRepeatedStringPiece(0)); Assert.assertEquals("225", message.getRepeatedCord(0)); Assert.assertEquals(501, message.getRepeatedInt32(1)); Assert.assertEquals(502L, message.getRepeatedInt64(1)); Assert.assertEquals(503, message.getRepeatedUint32(1)); Assert.assertEquals(504L, message.getRepeatedUint64(1)); Assert.assertEquals(505, message.getRepeatedSint32(1)); Assert.assertEquals(506L, message.getRepeatedSint64(1)); Assert.assertEquals(507, message.getRepeatedFixed32(1)); Assert.assertEquals(508L, message.getRepeatedFixed64(1)); Assert.assertEquals(509, message.getRepeatedSfixed32(1)); Assert.assertEquals(510L, message.getRepeatedSfixed64(1)); Assert.assertEquals(511F, message.getRepeatedFloat(1)); Assert.assertEquals(512D, message.getRepeatedDouble(1)); Assert.assertEquals(true, message.getRepeatedBool(1)); Assert.assertEquals("515", message.getRepeatedString(1)); Assert.assertEquals(toBytes("516"), message.getRepeatedBytes(1)); Assert.assertEquals(517, message.getRepeatedGroup(1).getA()); Assert.assertEquals(518, message.getRepeatedNestedMessage(1).getBb()); Assert.assertEquals(519, message.getRepeatedForeignMessage(1).getC()); Assert.assertEquals(520, message.getRepeatedImportMessage(1).getD()); Assert.assertEquals(527, message.getRepeatedLazyMessage(1).getBb()); Assert.assertEquals(TestAllTypes.NestedEnum.FOO, message.getRepeatedNestedEnum(1)); Assert.assertEquals(ForeignEnum.FOREIGN_FOO, message.getRepeatedForeignEnum(1)); Assert.assertEquals(ImportEnum.IMPORT_FOO, message.getRepeatedImportEnum(1)); Assert.assertEquals("524", message.getRepeatedStringPiece(1)); Assert.assertEquals("525", message.getRepeatedCord(1)); } | /**
* Assert (using {@code junit.framework.Assert}} that all fields of {@code message} are set to the
* values assigned by {@code setAllFields} followed by {@code modifyRepeatedFields}.
*/ | Assert (using junit.framework.Assert} that all fields of message are set to the values assigned by setAllFields followed by modifyRepeatedFields | assertRepeatedFieldsModified | {
"repo_name": "grpc/grpc-ios",
"path": "native_src/third_party/protobuf/java/core/src/test/java/com/google/protobuf/TestUtil.java",
"license": "apache-2.0",
"size": 218232
} | [
"com.google.protobuf.test.UnittestImport",
"junit.framework.Assert"
] | import com.google.protobuf.test.UnittestImport; import junit.framework.Assert; | import com.google.protobuf.test.*; import junit.framework.*; | [
"com.google.protobuf",
"junit.framework"
] | com.google.protobuf; junit.framework; | 568,296 |
public double getHeight(Graphics2D g2) {
Size2D d = this.textBlock.calculateDimensions(g2);
return this.interiorGap.extendHeight(d.getHeight());
} | double function(Graphics2D g2) { Size2D d = this.textBlock.calculateDimensions(g2); return this.interiorGap.extendHeight(d.getHeight()); } | /**
* Returns the height of the text box.
*
* @param g2 the graphics device.
*
* @return The height (in Java2D units).
*/ | Returns the height of the text box | getHeight | {
"repo_name": "akardapolov/ASH-Viewer",
"path": "jfreechart-fse/src/main/java/org/jfree/chart/text/TextBox.java",
"license": "gpl-3.0",
"size": 12597
} | [
"java.awt.Graphics2D",
"org.jfree.chart.ui.Size2D"
] | import java.awt.Graphics2D; import org.jfree.chart.ui.Size2D; | import java.awt.*; import org.jfree.chart.ui.*; | [
"java.awt",
"org.jfree.chart"
] | java.awt; org.jfree.chart; | 245,581 |
private int getExportMethod(final int numPixels) {
int result;
final String questionText = "How do you want to export the pixel values?\n";
final String numPixelsText;
if (numPixels == 1) {
numPixelsText = "One pin pixel will be exported.\n";
} else {
numPixelsText = numPixels + " pin pixels will be exported.\n";
}
result = SelectExportMethodDialog.run(VisatApp.getApp().getMainFrame(),
getWindowTitle(),
questionText + numPixelsText,
getHelpId());
return result;
} | int function(final int numPixels) { int result; final String questionText = STR; final String numPixelsText; if (numPixels == 1) { numPixelsText = STR; } else { numPixelsText = numPixels + STR; } result = SelectExportMethodDialog.run(VisatApp.getApp().getMainFrame(), getWindowTitle(), questionText + numPixelsText, getHelpId()); return result; } | /**
* Opens a modal dialog that asks the user which method to use in order to export the pin
* pixels.
*/ | Opens a modal dialog that asks the user which method to use in order to export the pin pixels | getExportMethod | {
"repo_name": "lveci/nest",
"path": "beam/beam-visat-rcp/src/main/java/org/esa/beam/visat/actions/pin/ExportPinPixelsAction.java",
"license": "gpl-3.0",
"size": 17025
} | [
"org.esa.beam.framework.ui.SelectExportMethodDialog",
"org.esa.beam.visat.VisatApp"
] | import org.esa.beam.framework.ui.SelectExportMethodDialog; import org.esa.beam.visat.VisatApp; | import org.esa.beam.framework.ui.*; import org.esa.beam.visat.*; | [
"org.esa.beam"
] | org.esa.beam; | 112,167 |
public void setPlayer(GamePlayer p) {
this.player = p;
} | void function(GamePlayer p) { this.player = p; } | /** Resets the source of the action. The intent is that it be used only
* by ProxyGame and ProxyPlayer.
*
* @param p
* the new player to which the action is to be associated
*/ | Resets the source of the action. The intent is that it be used only by ProxyGame and ProxyPlayer | setPlayer | {
"repo_name": "MaxRobinson/Phase10",
"path": "TTTProj/src/edu/up/cs301/game/actionMsg/GameAction.java",
"license": "gpl-2.0",
"size": 1779
} | [
"edu.up.cs301.game.GamePlayer"
] | import edu.up.cs301.game.GamePlayer; | import edu.up.cs301.game.*; | [
"edu.up.cs301"
] | edu.up.cs301; | 2,034,255 |
public void traverse(ASTVisitor visitor, CompilationUnitScope scope) {
visitor.visit(this, scope);
visitor.endVisit(this, scope);
}
| void function(ASTVisitor visitor, CompilationUnitScope scope) { visitor.visit(this, scope); visitor.endVisit(this, scope); } | /**
* Traverse the node
* @param visitor
* @param scope
*/ | Traverse the node | traverse | {
"repo_name": "boniatillo-com/PhaserEditor",
"path": "source/thirdparty/jsdt/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/ImportReference.java",
"license": "epl-1.0",
"size": 3328
} | [
"org.eclipse.wst.jsdt.internal.compiler.ASTVisitor",
"org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope"
] | import org.eclipse.wst.jsdt.internal.compiler.ASTVisitor; import org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope; | import org.eclipse.wst.jsdt.internal.compiler.*; import org.eclipse.wst.jsdt.internal.compiler.lookup.*; | [
"org.eclipse.wst"
] | org.eclipse.wst; | 1,798,011 |
public void exitPartition_name(SQLParser.Partition_nameContext ctx) { } | public void exitPartition_name(SQLParser.Partition_nameContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterPartition_name | {
"repo_name": "HEIG-GAPS/slasher",
"path": "slasher.corrector/src/main/java/ch/gaps/slasher/corrector/SQLParserBaseListener.java",
"license": "mit",
"size": 73849
} | [
"ch.gaps.slasher.corrector.SQLParser"
] | import ch.gaps.slasher.corrector.SQLParser; | import ch.gaps.slasher.corrector.*; | [
"ch.gaps.slasher"
] | ch.gaps.slasher; | 761,053 |
public CalendarImportSettings getUserSettings(String userId) {
Connection connection = null;
PreparedStatement st = null;
ResultSet rs = null;
CalendarImportSettings settings = null;
String query = "select * from sb_agenda_import_settings where userId = ?";
try {
connection = getConnection();
st = connection.prepareStatement(query);
st.setInt(1, Integer.parseInt(userId));
rs = st.executeQuery();
if (rs.next()) {
settings = new CalendarImportSettings();
settings.setUserId(rs.getInt("userId"));
settings.setHostName(rs.getString("hostname"));
settings.setSynchroType(rs.getInt("synchroType"));
settings.setSynchroDelay(rs.getInt("synchroDelay"));
settings.setUrlIcalendar(rs.getString("url"));
settings.setLoginIcalendar(rs.getString("remoteLogin"));
settings.setPwdIcalendar(rs.getString("remotePwd"));
settings.setCharset(rs.getString("charset"));
}
} catch (Exception e) {
SilverLogger.getLogger(this).error(e);
} finally {
DBUtil.close(rs, st);
close(connection);
}
return settings;
} | CalendarImportSettings function(String userId) { Connection connection = null; PreparedStatement st = null; ResultSet rs = null; CalendarImportSettings settings = null; String query = STR; try { connection = getConnection(); st = connection.prepareStatement(query); st.setInt(1, Integer.parseInt(userId)); rs = st.executeQuery(); if (rs.next()) { settings = new CalendarImportSettings(); settings.setUserId(rs.getInt(STR)); settings.setHostName(rs.getString(STR)); settings.setSynchroType(rs.getInt(STR)); settings.setSynchroDelay(rs.getInt(STR)); settings.setUrlIcalendar(rs.getString("url")); settings.setLoginIcalendar(rs.getString(STR)); settings.setPwdIcalendar(rs.getString(STR)); settings.setCharset(rs.getString(STR)); } } catch (Exception e) { SilverLogger.getLogger(this).error(e); } finally { DBUtil.close(rs, st); close(connection); } return settings; } | /**
* Get synchronisation user settings
* @param userId Id of user whose settings belong to
* @return CalendarImportSettings object containing user settings, null if no settings found
* @see org.silverpeas.core.web.tools.agenda.model.CalendarImportSettings
*/ | Get synchronisation user settings | getUserSettings | {
"repo_name": "SilverDav/Silverpeas-Core",
"path": "core-web/src/main/java/org/silverpeas/core/web/tools/agenda/model/CalendarImportSettingsDaoJdbc.java",
"license": "agpl-3.0",
"size": 5921
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"org.silverpeas.core.persistence.jdbc.DBUtil",
"org.silverpeas.core.util.logging.SilverLogger"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import org.silverpeas.core.persistence.jdbc.DBUtil; import org.silverpeas.core.util.logging.SilverLogger; | import java.sql.*; import org.silverpeas.core.persistence.jdbc.*; import org.silverpeas.core.util.logging.*; | [
"java.sql",
"org.silverpeas.core"
] | java.sql; org.silverpeas.core; | 2,127,374 |
protected void fireContentsChanged(Object source, int index0, int index1) {
Object[] listeners = listenerList.getListenerList();
ListDataEvent e = null;
for( int i = listeners.length - 2; i >= 0; i -= 2 ) {
if( listeners[i] == ListDataListener.class ) {
if( e == null ) {
e = new ListDataEvent( source, ListDataEvent.CONTENTS_CHANGED, index0, index1 );
}
((ListDataListener) listeners[i + 1]).contentsChanged( e );
}
}
} | void function(Object source, int index0, int index1) { Object[] listeners = listenerList.getListenerList(); ListDataEvent e = null; for( int i = listeners.length - 2; i >= 0; i -= 2 ) { if( listeners[i] == ListDataListener.class ) { if( e == null ) { e = new ListDataEvent( source, ListDataEvent.CONTENTS_CHANGED, index0, index1 ); } ((ListDataListener) listeners[i + 1]).contentsChanged( e ); } } } | /**
* <code>AbstractListModel</code> subclasses must call this method <b>after</b> one
* or more elements of the list change. The changed elements are specified by the
* closed interval index0, index1 -- the endpoints are included. Note that index0 need
* not be less than or equal to index1.
*
* @param source the <code>ListModel</code> that changed, typically "this"
* @param index0 one end of the new interval
* @param index1 the other end of the new interval
* @see EventListenerList
* @see DefaultListModel
*/ | <code>AbstractListModel</code> subclasses must call this method after one or more elements of the list change. The changed elements are specified by the closed interval index0, index1 -- the endpoints are included. Note that index0 need not be less than or equal to index1 | fireContentsChanged | {
"repo_name": "springrichclient/springrcp",
"path": "spring-richclient-sandbox/src/main/java/org/springframework/binding/value/support/ObservableEventList.java",
"license": "apache-2.0",
"size": 8436
} | [
"javax.swing.event.ListDataEvent",
"javax.swing.event.ListDataListener"
] | import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; | import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 222,164 |
public Number getX(int series, int item) {
List bins = getBins(series);
HistogramBin bin = (HistogramBin) bins.get(item);
double x = (bin.getStartBoundary() + bin.getEndBoundary()) / 2.;
return new Double(x);
}
| Number function(int series, int item) { List bins = getBins(series); HistogramBin bin = (HistogramBin) bins.get(item); double x = (bin.getStartBoundary() + bin.getEndBoundary()) / 2.; return new Double(x); } | /**
* Returns the X value for a bin. This value won't be used for plotting
* histograms, since the renderer will ignore it. But other renderers can
* use it (for example, you could use the dataset to create a line
* chart).
*
* @param series the series index (in the range <code>0</code> to
* <code>getSeriesCount() - 1</code>).
* @param item the item index (zero based).
*
* @return The start value.
*
* @throws IndexOutOfBoundsException if <code>series</code> is outside the
* specified range.
*/ | Returns the X value for a bin. This value won't be used for plotting histograms, since the renderer will ignore it. But other renderers can use it (for example, you could use the dataset to create a line chart) | getX | {
"repo_name": "SpoonLabs/astor",
"path": "examples/chart_11/source/org/jfree/data/statistics/HistogramDataset.java",
"license": "gpl-2.0",
"size": 17526
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,603,577 |
public boolean isPure() {
if (!isResolved()) {
return false;
}
if (state.function.type() == FunctionRef.Type.EXTERN) {
return false;
}
return SoyFunctions.isPure(state.function.either());
} | boolean function() { if (!isResolved()) { return false; } if (state.function.type() == FunctionRef.Type.EXTERN) { return false; } return SoyFunctions.isPure(state.function.either()); } | /**
* Whether or not this function is pure.
*
* <p>See {@link SoyPureFunction} for the definition of a pure function.
*/ | Whether or not this function is pure. See <code>SoyPureFunction</code> for the definition of a pure function | isPure | {
"repo_name": "google/closure-templates",
"path": "java/src/com/google/template/soy/exprtree/FunctionNode.java",
"license": "apache-2.0",
"size": 11974
} | [
"com.google.template.soy.shared.restricted.SoyFunctions"
] | import com.google.template.soy.shared.restricted.SoyFunctions; | import com.google.template.soy.shared.restricted.*; | [
"com.google.template"
] | com.google.template; | 1,085,172 |
public static void updateTableState(Connection conn, TableName tableName,
TableState.State actual) throws IOException {
updateTableState(conn, new TableState(tableName, actual));
} | static void function(Connection conn, TableName tableName, TableState.State actual) throws IOException { updateTableState(conn, new TableState(tableName, actual)); } | /**
* Updates state in META
* @param conn connection to use
* @param tableName table to look for
* @throws IOException
*/ | Updates state in META | updateTableState | {
"repo_name": "juwi/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java",
"license": "apache-2.0",
"size": 74846
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.client.Connection",
"org.apache.hadoop.hbase.client.TableState"
] | import java.io.IOException; import org.apache.hadoop.hbase.client.Connection; import org.apache.hadoop.hbase.client.TableState; | import java.io.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 968,310 |
@SuppressLint("InflateParams")
private void showError(boolean module, boolean settings) { | @SuppressLint(STR) void function(boolean module, boolean settings) { | /**
* Shows an error at the bottom of the screen.
*/ | Shows an error at the bottom of the screen | showError | {
"repo_name": "pylerSM/XInstaller",
"path": "src/com/pyler/xinstaller/legacy/Preferences.java",
"license": "bsd-2-clause",
"size": 27225
} | [
"android.annotation.SuppressLint"
] | import android.annotation.SuppressLint; | import android.annotation.*; | [
"android.annotation"
] | android.annotation; | 2,481,491 |
public ActionListener[] getActionListeners()
{
return (ActionListener[]) listenerList.getListeners(ActionListener.class);
} | ActionListener[] function() { return (ActionListener[]) listenerList.getListeners(ActionListener.class); } | /**
* Returns an array of all the action listeners
* registered on this file chooser.
*
* @return all of this file chooser's <code>ActionListener</code>s
* or an empty
* array if no action listeners are currently registered
*
* @see #addActionListener
* @see #removeActionListener
*
* @since 1.4
*/ | Returns an array of all the action listeners registered on this file chooser | getActionListeners | {
"repo_name": "fracpete/vfsjfilechooser2",
"path": "src/main/java/com/googlecode/vfsjfilechooser2/VFSJFileChooser.java",
"license": "apache-2.0",
"size": 73550
} | [
"java.awt.event.ActionListener"
] | import java.awt.event.ActionListener; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 752,048 |
@SuppressWarnings("unused")
public void setupShellEnvironment(ImmutableMap.Builder<String, String> builder) {
} | @SuppressWarnings(STR) void function(ImmutableMap.Builder<String, String> builder) { } | /**
* Add items to the shell environment.
*/ | Add items to the shell environment | setupShellEnvironment | {
"repo_name": "Krasnyanskiy/bazel",
"path": "src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java",
"license": "apache-2.0",
"size": 74047
} | [
"com.google.common.collect.ImmutableMap"
] | import com.google.common.collect.ImmutableMap; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 2,725,051 |
public static QName getTextAsQName(OMElement elmt) {
QName qname = elmt.getTextAsQName();
// The getTextAsQName is buggy, it sometimes return the full text without extracting namespace
if (qname == null || qname.getNamespaceURI().length() == 0) {
int colonIdx = elmt.getText().indexOf(":");
String localpart = elmt.getText().substring(colonIdx + 1, elmt.getText().length());
String prefix = elmt.getText().substring(0, colonIdx);
String ns = elmt.findNamespaceURI(prefix).getNamespaceURI();
qname = new QName(ns, localpart, prefix);
}
return qname;
} | static QName function(OMElement elmt) { QName qname = elmt.getTextAsQName(); if (qname == null qname.getNamespaceURI().length() == 0) { int colonIdx = elmt.getText().indexOf(":"); String localpart = elmt.getText().substring(colonIdx + 1, elmt.getText().length()); String prefix = elmt.getText().substring(0, colonIdx); String ns = elmt.findNamespaceURI(prefix).getNamespaceURI(); qname = new QName(ns, localpart, prefix); } return qname; } | /**
* Axiom is supposed to handle this properly however this method is buggy and doesn't work (whereas setting a QName as text
* works).
*
* @param elmt
* @return text qname
*/ | Axiom is supposed to handle this properly however this method is buggy and doesn't work (whereas setting a QName as text works) | getTextAsQName | {
"repo_name": "Subasinghe/ode",
"path": "bpel-epr/src/main/java/org/apache/ode/il/OMUtils.java",
"license": "apache-2.0",
"size": 11564
} | [
"javax.xml.namespace.QName",
"org.apache.axiom.om.OMElement"
] | import javax.xml.namespace.QName; import org.apache.axiom.om.OMElement; | import javax.xml.namespace.*; import org.apache.axiom.om.*; | [
"javax.xml",
"org.apache.axiom"
] | javax.xml; org.apache.axiom; | 2,331,194 |
public HostingEnvironmentProfile hostingEnvironmentProfile() {
return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironmentProfile();
} | HostingEnvironmentProfile function() { return this.innerProperties() == null ? null : this.innerProperties().hostingEnvironmentProfile(); } | /**
* Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App
* Service plan.
*
* @return the hostingEnvironmentProfile value.
*/ | Get the hostingEnvironmentProfile property: Specification for the App Service Environment to use for the App Service plan | hostingEnvironmentProfile | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/fluent/models/AppServicePlanInner.java",
"license": "mit",
"size": 16232
} | [
"com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile"
] | import com.azure.resourcemanager.appservice.models.HostingEnvironmentProfile; | import com.azure.resourcemanager.appservice.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 2,833,486 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.