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
static public String getStringFromResourceWithoutSpaces(final String resourceFile) { return new BufferedReader(new InputStreamReader( StreamUtils.class.getClassLoader().getResourceAsStream(resourceFile))) .lines().map(s -> s.trim()).collect(Collectors.joining("")); }
static String function(final String resourceFile) { return new BufferedReader(new InputStreamReader( StreamUtils.class.getClassLoader().getResourceAsStream(resourceFile))) .lines().map(s -> s.trim()).collect(Collectors.joining("")); }
/** * get the String from the resource without the spaces. * @param resourceFile resource file * @return the String from the resource */
get the String from the resource without the spaces
getStringFromResourceWithoutSpaces
{ "repo_name": "gdimitriu/poc_messaging", "path": "src/test/java/utils/StreamUtils.java", "license": "gpl-3.0", "size": 3229 }
[ "java.io.BufferedReader", "java.io.InputStreamReader", "java.util.stream.Collectors" ]
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.stream.Collectors;
import java.io.*; import java.util.stream.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,740,347
public void acceptApplication(int applicationID, User performer, boolean createUserMessage, boolean createPasswordMessage, boolean sendEmail) throws CreateException { UserTransaction trans=null; try { trans = this.getSessionContext().getUserTransaction(); trans.begin(); AccountApplication theCase = this.getApplication(applicationID); changeCaseStatus(theCase, getCaseStatusGranted().getStatus(), performer); //int ownerID = ((Integer) theCase.getOwner().getPrimaryKey()).intValue(); User user = theCase.getOwner(); if (user == null) { user = createUserForApplication(theCase); } //CANNOT DO THIS because if the user lives outside of the municipality he should be in a group that is outside of it until a //national registry change moves him to the root group //addUserToRootCitizenGroup(user); //this we can do! addUserToRootAcceptedCitizenGroup(user); createLoginAndSendMessage(theCase,createUserMessage, createPasswordMessage, sendEmail); //synca vi? skjalfanda og sunnan? trans.commit(); } catch (Exception e) { // System.err.println(e.getMessage()); e.printStackTrace(); if(trans!=null){ try { trans.rollback(); } catch (SystemException se) { se.printStackTrace(); } } if ( e instanceof UserHasLoginException ) { //throw (UserHasLoginException)e; throw new UserHasLoginException(); }else { throw new CreateException("There was an error accepting the application. Message was: "+e.getMessage()); } } }
void function(int applicationID, User performer, boolean createUserMessage, boolean createPasswordMessage, boolean sendEmail) throws CreateException { UserTransaction trans=null; try { trans = this.getSessionContext().getUserTransaction(); trans.begin(); AccountApplication theCase = this.getApplication(applicationID); changeCaseStatus(theCase, getCaseStatusGranted().getStatus(), performer); User user = theCase.getOwner(); if (user == null) { user = createUserForApplication(theCase); } addUserToRootAcceptedCitizenGroup(user); createLoginAndSendMessage(theCase,createUserMessage, createPasswordMessage, sendEmail); trans.commit(); } catch (Exception e) { e.printStackTrace(); if(trans!=null){ try { trans.rollback(); } catch (SystemException se) { se.printStackTrace(); } } if ( e instanceof UserHasLoginException ) { throw new UserHasLoginException(); }else { throw new CreateException(STR+e.getMessage()); } } }
/** * Accepts the application for an application with ID applicationID by User performer * @param The id of the application to be accepted * @param performer The User that accepts the application * @param createUserMessage * @param createPasswordMessage * @throws CreateException If there is an error creating data objects. * @throws FinderException If an application with applicationID is not found. */
Accepts the application for an application with ID applicationID by User performer
acceptApplication
{ "repo_name": "idega/platform2", "path": "src/se/idega/idegaweb/commune/account/business/AccountApplicationBusinessBean.java", "license": "gpl-3.0", "size": 17878 }
[ "com.idega.core.accesscontrol.business.UserHasLoginException", "com.idega.user.data.User", "javax.ejb.CreateException", "javax.transaction.SystemException", "javax.transaction.UserTransaction", "se.idega.idegaweb.commune.account.data.AccountApplication" ]
import com.idega.core.accesscontrol.business.UserHasLoginException; import com.idega.user.data.User; import javax.ejb.CreateException; import javax.transaction.SystemException; import javax.transaction.UserTransaction; import se.idega.idegaweb.commune.account.data.AccountApplication;
import com.idega.core.accesscontrol.business.*; import com.idega.user.data.*; import javax.ejb.*; import javax.transaction.*; import se.idega.idegaweb.commune.account.data.*;
[ "com.idega.core", "com.idega.user", "javax.ejb", "javax.transaction", "se.idega.idegaweb" ]
com.idega.core; com.idega.user; javax.ejb; javax.transaction; se.idega.idegaweb;
491,769
@Override public String toXMLString(Object value, Integer matcherRelation) { if (value==null || matcherRelation==null) { return null; } switch (matcherRelation.intValue()) { case MatchRelations.EQUAL: case MatchRelations.NOT_EQUAL: case MatchRelations.GREATHER_THAN: case MatchRelations.GREATHER_THAN_EQUAL: case MatchRelations.LESS_THAN: case MatchRelations.LESS_THAN_EQUAL: return value.toString(); } return null; }
String function(Object value, Integer matcherRelation) { if (value==null matcherRelation==null) { return null; } switch (matcherRelation.intValue()) { case MatchRelations.EQUAL: case MatchRelations.NOT_EQUAL: case MatchRelations.GREATHER_THAN: case MatchRelations.GREATHER_THAN_EQUAL: case MatchRelations.LESS_THAN: case MatchRelations.LESS_THAN_EQUAL: return value.toString(); } return null; }
/** * Convert the object value to xml string for save * @param value * @param matcherRelation * @return */
Convert the object value to xml string for save
toXMLString
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/fieldType/runtime/matchers/converter/DoubleMatcherConverter.java", "license": "gpl-3.0", "size": 4398 }
[ "com.aurel.track.fieldType.runtime.matchers.MatchRelations" ]
import com.aurel.track.fieldType.runtime.matchers.MatchRelations;
import com.aurel.track.*;
[ "com.aurel.track" ]
com.aurel.track;
178,971
private void cancelAlarm(Context context) { cancelAlarmOnSystem(context, getPendingAlarmIntent(context)); }
void function(Context context) { cancelAlarmOnSystem(context, getPendingAlarmIntent(context)); }
/** * Cancel a previously set alarm, if there is one. This method can be overridden in tests. * * @param context The Context to use. */
Cancel a previously set alarm, if there is one. This method can be overridden in tests
cancelAlarm
{ "repo_name": "guorendong/iridium-browser-ubuntu", "path": "chrome/android/java/src/org/chromium/chrome/browser/precache/PrecacheServiceLauncher.java", "license": "bsd-3-clause", "size": 9536 }
[ "android.content.Context" ]
import android.content.Context;
import android.content.*;
[ "android.content" ]
android.content;
245,011
public static IClasspathEntry findRawClasspathEntryFor( IJavaProject javaProject, String fullyQualifiedName) throws JavaModelException { IType type = javaProject.findType(fullyQualifiedName); if (type != null) { IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); JavaProject jProject = (JavaProject) javaProject; IClasspathEntry[] rawClasspath = javaProject.getRawClasspath(); for (IClasspathEntry rawClasspathEntry : rawClasspath) { IClasspathEntry[] resolvedClasspath = jProject.resolveClasspath(new IClasspathEntry[] {rawClasspathEntry}); // was this - which is no longer, internal api refactor //IPackageFragmentRoot[] computePackageFragmentRoots = jProject.computePackageFragmentRoots(resolvedClasspath, true, null); // now this - from IPackage List<IPackageFragmentRoot> fragmentRoots = new ArrayList<IPackageFragmentRoot>(); for (IClasspathEntry classPathEntry : resolvedClasspath) { IPackageFragmentRoot[] foundRoots = javaProject.findPackageFragmentRoots(classPathEntry); fragmentRoots.addAll(Arrays.asList(foundRoots)); } IPackageFragmentRoot[] computePackageFragmentRoots = new IPackageFragmentRoot[fragmentRoots.size()]; fragmentRoots.toArray(computePackageFragmentRoots); if (Arrays.asList(computePackageFragmentRoots).contains( packageFragmentRoot)) { return rawClasspathEntry; } } return packageFragmentRoot.getRawClasspathEntry(); } return null; }
static IClasspathEntry function( IJavaProject javaProject, String fullyQualifiedName) throws JavaModelException { IType type = javaProject.findType(fullyQualifiedName); if (type != null) { IPackageFragmentRoot packageFragmentRoot = (IPackageFragmentRoot) type.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); JavaProject jProject = (JavaProject) javaProject; IClasspathEntry[] rawClasspath = javaProject.getRawClasspath(); for (IClasspathEntry rawClasspathEntry : rawClasspath) { IClasspathEntry[] resolvedClasspath = jProject.resolveClasspath(new IClasspathEntry[] {rawClasspathEntry}); List<IPackageFragmentRoot> fragmentRoots = new ArrayList<IPackageFragmentRoot>(); for (IClasspathEntry classPathEntry : resolvedClasspath) { IPackageFragmentRoot[] foundRoots = javaProject.findPackageFragmentRoots(classPathEntry); fragmentRoots.addAll(Arrays.asList(foundRoots)); } IPackageFragmentRoot[] computePackageFragmentRoots = new IPackageFragmentRoot[fragmentRoots.size()]; fragmentRoots.toArray(computePackageFragmentRoots); if (Arrays.asList(computePackageFragmentRoots).contains( packageFragmentRoot)) { return rawClasspathEntry; } } return packageFragmentRoot.getRawClasspathEntry(); } return null; }
/** * Return the raw classpath entry on the project's classpath that contributes * the given type to the project. * * @param javaProject The java project * @param fullyQualifiedName The fully-qualified type name * @return The raw classpath entry that contributes the type to the project, * or <code>null</code> if no such classpath entry can be found. * @throws JavaModelException */
Return the raw classpath entry on the project's classpath that contributes the given type to the project
findRawClasspathEntryFor
{ "repo_name": "gwt-plugins/gwt-eclipse-plugin", "path": "plugins/com.gwtplugins.gdt.eclipse.core/src/com/google/gdt/eclipse/core/ClasspathUtilities.java", "license": "epl-1.0", "size": 18567 }
[ "java.util.ArrayList", "java.util.Arrays", "java.util.List", "org.eclipse.jdt.core.IClasspathEntry", "org.eclipse.jdt.core.IJavaElement", "org.eclipse.jdt.core.IJavaProject", "org.eclipse.jdt.core.IPackageFragmentRoot", "org.eclipse.jdt.core.IType", "org.eclipse.jdt.core.JavaModelException", "org.eclipse.jdt.internal.core.JavaProject" ]
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.core.JavaProject;
import java.util.*; import org.eclipse.jdt.core.*; import org.eclipse.jdt.internal.core.*;
[ "java.util", "org.eclipse.jdt" ]
java.util; org.eclipse.jdt;
1,190,912
public static int getDepth() { Stack stack = getCurrentStack(); if(stack == null) { return 0; } else { return stack.size(); } }
static int function() { Stack stack = getCurrentStack(); if(stack == null) { return 0; } else { return stack.size(); } }
/** * Get the current nesting depth of this diagnostic context. * * @see #setMaxDepth * @since 0.7.5 */
Get the current nesting depth of this diagnostic context
getDepth
{ "repo_name": "DRUNK2013/log4j", "path": "src/main/java/org/apache/log4j/NDC.java", "license": "apache-2.0", "size": 13960 }
[ "java.util.Stack" ]
import java.util.Stack;
import java.util.*;
[ "java.util" ]
java.util;
1,152,050
List<Tag> getTags();
List<Tag> getTags();
/** * Gets the value of the Tags attribute. If this resource is not yet loaded, * a call to {@code load()} is made to retrieve the value of the attribute. */
Gets the value of the Tags attribute. If this resource is not yet loaded, a call to load() is made to retrieve the value of the attribute
getTags
{ "repo_name": "smartpcr/aws-sdk-java-resources", "path": "aws-resources-ec2/src/main/java/com/amazonaws/resources/ec2/Volume.java", "license": "apache-2.0", "size": 20944 }
[ "com.amazonaws.services.ec2.model.Tag", "java.util.List" ]
import com.amazonaws.services.ec2.model.Tag; import java.util.List;
import com.amazonaws.services.ec2.model.*; import java.util.*;
[ "com.amazonaws.services", "java.util" ]
com.amazonaws.services; java.util;
560,365
public void bodyComplete(HTTPRequest httpRequest, ResponseWriter responseWriter); }
void function(HTTPRequest httpRequest, ResponseWriter responseWriter); }
/** * This is called when the body has completed. * NOTE: it is not always possible to know if the body data is done depending on the {@link HTTPRequest} so this might not get called. * * @param httpRequest the initial {@link HTTPRequest} for this client. * @param responseWriter the {@link ResponseWriter} for this client. */
This is called when the body has completed
bodyComplete
{ "repo_name": "threadly/litesockets-http", "path": "server/src/main/java/org/threadly/litesockets/server/http/HTTPServer.java", "license": "mpl-2.0", "size": 17847 }
[ "org.threadly.litesockets.protocols.http.request.HTTPRequest" ]
import org.threadly.litesockets.protocols.http.request.HTTPRequest;
import org.threadly.litesockets.protocols.http.request.*;
[ "org.threadly.litesockets" ]
org.threadly.litesockets;
2,071,671
public void testKeyAssignementOncePerNode() throws Exception { DotFormatter dot = DotFormatter.newInstanceForTesting(); Node node0 = new Node(Token.BLOCK); Node node1 = new Node(Token.BLOCK); Node node2 = new Node(Token.BLOCK); assertEquals(0, dot.key(node0)); assertEquals(1, dot.key(node1)); assertEquals(2, dot.key(node2)); assertEquals(0, dot.key(node0)); assertEquals(1, dot.key(node1)); assertEquals(2, dot.key(node2)); }
void function() throws Exception { DotFormatter dot = DotFormatter.newInstanceForTesting(); Node node0 = new Node(Token.BLOCK); Node node1 = new Node(Token.BLOCK); Node node2 = new Node(Token.BLOCK); assertEquals(0, dot.key(node0)); assertEquals(1, dot.key(node1)); assertEquals(2, dot.key(node2)); assertEquals(0, dot.key(node0)); assertEquals(1, dot.key(node1)); assertEquals(2, dot.key(node2)); }
/** * Tests that keys are assigned once per node. */
Tests that keys are assigned once per node
testKeyAssignementOncePerNode
{ "repo_name": "007slm/kissy", "path": "tools/module-compiler/tests/com/google/javascript/jscomp/DotFormatterTest.java", "license": "mit", "size": 2940 }
[ "com.google.javascript.rhino.Node", "com.google.javascript.rhino.Token" ]
import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
1,467,301
@Test public void testAddDataRequest5() throws Exception { clearDB(); entityManager.flush(); User user = getTestUser(); entityManager.persist(user.getRole()); entityManager.flush(); user = userService.create(user); entityManager.flush(); entityManager.clear(); Assert.assertFalse(userService.isParticipationRatioLow(user.getId())); DataRequest request = getDataRequest(); request.setOriginalRequesterId(null); request.setRequesterId(user.getId()); request.setRequestedPartners(new ArrayList<String>()); Assert.assertFalse(request.isCacheSafe()); String queueName = dataRequestQueuePrefix + user.getId(); String destinationName = queueName + "; {create: always, node:{type:queue,durable:True}}"; jmsTemplate.convertAndSend(destinationName, "create queue"); Destination destination = new AMQAnyDestination("ADDR:" + queueName + "; {create: never, delete: never}"); UserStatistics ust = userService.getUserStatistics(user.getId()); Message message = jmsTemplate.receive(destination); Assert.assertEquals("create queue", ((TextMessage) message).getText()); Assert.assertEquals(0, ust.getDataRequestsInitiated()); Assert.assertEquals(0, ust.getDataRequestsReceived()); Assert.assertEquals(initialRespondedRequestsValue, ust.getDataRequestsResponded()); dataExchangeService.addDataRequest(request); ust = userService.getUserStatistics(user.getId()); Assert.assertEquals(1, ust.getDataRequestsInitiated()); Assert.assertEquals(1, ust.getDataRequestsReceived()); Assert.assertEquals(initialRespondedRequestsValue, ust.getDataRequestsResponded()); message = jmsTemplate.receive(destination); Assert.assertTrue(message instanceof TextMessage); Template template = velocityEngine.getTemplate(dataRequestTemplatePath); VelocityContext context = new VelocityContext(); context.put("request", request); Calendar expirationTimeCal = Calendar.getInstance(); expirationTimeCal.setTime(request.getExpirationTime()); String expireTimeValue = javax.xml.bind.DatatypeConverter .printDateTime(expirationTimeCal); context.put("expirationTime", expireTimeValue); context.put("cacheAvailable", false); StringWriter sw = new StringWriter(); template.merge(context, sw); String jmsMessage = sw.toString(); String receivedMessage = ((TextMessage) message).getText(); Assert.assertEquals(jmsMessage, receivedMessage); Document doc = DOCUMENTBUILDERFACTORY.newDocumentBuilder().parse( new ByteArrayInputStream(receivedMessage.getBytes("utf-8"))); Assert.assertEquals(1, doc.getElementsByTagName("DataRequest") .getLength()); Node requestIDNode = doc.getElementsByTagName("RequestID").item(0); Assert.assertEquals(request.getId(), requestIDNode.getFirstChild() .getNodeValue()); Node queryNode = doc.getElementsByTagName("Query").item(0); Assert.assertTrue(queryNode.getFirstChild().getNodeValue() .contains(request.getQuery())); Node expireNode = doc.getElementsByTagName("ExpirationTime").item(0); Assert.assertEquals(expireTimeValue, expireNode.getFirstChild() .getNodeValue()); Node cacheNode = doc.getElementsByTagName("CacheAvailable").item(0); Assert.assertEquals("false", cacheNode.getFirstChild().getNodeValue()); }
void function() throws Exception { clearDB(); entityManager.flush(); User user = getTestUser(); entityManager.persist(user.getRole()); entityManager.flush(); user = userService.create(user); entityManager.flush(); entityManager.clear(); Assert.assertFalse(userService.isParticipationRatioLow(user.getId())); DataRequest request = getDataRequest(); request.setOriginalRequesterId(null); request.setRequesterId(user.getId()); request.setRequestedPartners(new ArrayList<String>()); Assert.assertFalse(request.isCacheSafe()); String queueName = dataRequestQueuePrefix + user.getId(); String destinationName = queueName + STR; jmsTemplate.convertAndSend(destinationName, STR); Destination destination = new AMQAnyDestination("ADDR:" + queueName + STR); UserStatistics ust = userService.getUserStatistics(user.getId()); Message message = jmsTemplate.receive(destination); Assert.assertEquals(STR, ((TextMessage) message).getText()); Assert.assertEquals(0, ust.getDataRequestsInitiated()); Assert.assertEquals(0, ust.getDataRequestsReceived()); Assert.assertEquals(initialRespondedRequestsValue, ust.getDataRequestsResponded()); dataExchangeService.addDataRequest(request); ust = userService.getUserStatistics(user.getId()); Assert.assertEquals(1, ust.getDataRequestsInitiated()); Assert.assertEquals(1, ust.getDataRequestsReceived()); Assert.assertEquals(initialRespondedRequestsValue, ust.getDataRequestsResponded()); message = jmsTemplate.receive(destination); Assert.assertTrue(message instanceof TextMessage); Template template = velocityEngine.getTemplate(dataRequestTemplatePath); VelocityContext context = new VelocityContext(); context.put(STR, request); Calendar expirationTimeCal = Calendar.getInstance(); expirationTimeCal.setTime(request.getExpirationTime()); String expireTimeValue = javax.xml.bind.DatatypeConverter .printDateTime(expirationTimeCal); context.put(STR, expireTimeValue); context.put(STR, false); StringWriter sw = new StringWriter(); template.merge(context, sw); String jmsMessage = sw.toString(); String receivedMessage = ((TextMessage) message).getText(); Assert.assertEquals(jmsMessage, receivedMessage); Document doc = DOCUMENTBUILDERFACTORY.newDocumentBuilder().parse( new ByteArrayInputStream(receivedMessage.getBytes("utf-8"))); Assert.assertEquals(1, doc.getElementsByTagName(STR) .getLength()); Node requestIDNode = doc.getElementsByTagName(STR).item(0); Assert.assertEquals(request.getId(), requestIDNode.getFirstChild() .getNodeValue()); Node queryNode = doc.getElementsByTagName("Query").item(0); Assert.assertTrue(queryNode.getFirstChild().getNodeValue() .contains(request.getQuery())); Node expireNode = doc.getElementsByTagName(STR).item(0); Assert.assertEquals(expireTimeValue, expireNode.getFirstChild() .getNodeValue()); Node cacheNode = doc.getElementsByTagName(STR).item(0); Assert.assertEquals("false", cacheNode.getFirstChild().getNodeValue()); }
/** * Accuracy test for DataExchangeService#addDataRequest when * requestedPartners is empty cache safe originalRequesterId is null * * @throws Exception * throws if any error happen */
Accuracy test for DataExchangeService#addDataRequest when requestedPartners is empty cache safe originalRequesterId is null
testAddDataRequest5
{ "repo_name": "imclab/CoECI-CMS-Healthcare-Fraud-Prevention", "path": "hub/src/java/tests/com/hfpp/network/hub/services/DataExchangeServiceTest.java", "license": "apache-2.0", "size": 73166 }
[ "com.hfpp.network.models.DataRequest", "com.hfpp.network.models.User", "com.hfpp.network.models.UserStatistics", "java.io.ByteArrayInputStream", "java.io.StringWriter", "java.util.ArrayList", "java.util.Calendar", "javax.jms.Destination", "javax.jms.Message", "javax.jms.TextMessage", "junit.framework.Assert", "org.apache.qpid.client.AMQAnyDestination", "org.apache.velocity.Template", "org.apache.velocity.VelocityContext", "org.w3c.dom.Document", "org.w3c.dom.Node" ]
import com.hfpp.network.models.DataRequest; import com.hfpp.network.models.User; import com.hfpp.network.models.UserStatistics; import java.io.ByteArrayInputStream; import java.io.StringWriter; import java.util.ArrayList; import java.util.Calendar; import javax.jms.Destination; import javax.jms.Message; import javax.jms.TextMessage; import junit.framework.Assert; import org.apache.qpid.client.AMQAnyDestination; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.w3c.dom.Document; import org.w3c.dom.Node;
import com.hfpp.network.models.*; import java.io.*; import java.util.*; import javax.jms.*; import junit.framework.*; import org.apache.qpid.client.*; import org.apache.velocity.*; import org.w3c.dom.*;
[ "com.hfpp.network", "java.io", "java.util", "javax.jms", "junit.framework", "org.apache.qpid", "org.apache.velocity", "org.w3c.dom" ]
com.hfpp.network; java.io; java.util; javax.jms; junit.framework; org.apache.qpid; org.apache.velocity; org.w3c.dom;
2,324,380
public BridgeAPI bridgeAPI();
BridgeAPI function();
/** * Returns the class {@link BridgeAPI} which summarizes all interfacing methods. * * @return <b>BridgeAPI</b> * containing all API methods. */
Returns the class <code>BridgeAPI</code> which summarizes all interfacing methods
bridgeAPI
{ "repo_name": "openhab/openhab", "path": "bundles/binding/org.openhab.binding.velux/src/main/java/org/openhab/binding/velux/bridge/VeluxBridgeProvider.java", "license": "epl-1.0", "size": 2863 }
[ "org.openhab.binding.velux.bridge.common.BridgeAPI" ]
import org.openhab.binding.velux.bridge.common.BridgeAPI;
import org.openhab.binding.velux.bridge.common.*;
[ "org.openhab.binding" ]
org.openhab.binding;
1,131,210
System.out.println(" +-------------------------------------------+"); System.out.println(" | XBee Java Library Send IPv6 Data Sample |"); System.out.println(" +-------------------------------------------+\n"); ThreadDevice myDevice = new ThreadDevice(PORT, BAUD_RATE); byte[] dataToSend = DATA_TO_SEND.getBytes(); try { myDevice.open(); if (!myDevice.isConnected()) { System.err.println(">> Error: the device is not connected to the network"); return; } System.out.format("Sending data to %s:%d >> %s | %s... ", DEST_IPV6_ADDRESS, DEST_PORT, HexUtils.prettyHexString(HexUtils.byteArrayToHexString(dataToSend)), new String(dataToSend)); myDevice.sendIPData((Inet6Address) Inet6Address.getByName(DEST_IPV6_ADDRESS), DEST_PORT, PROTOCOL, dataToSend); System.out.println("Success"); } catch (XBeeException | UnknownHostException e) { System.out.println("Error"); e.printStackTrace(); System.exit(1); } finally { myDevice.close(); } }
System.out.println(STR); System.out.println(STR); System.out.println(STR); ThreadDevice myDevice = new ThreadDevice(PORT, BAUD_RATE); byte[] dataToSend = DATA_TO_SEND.getBytes(); try { myDevice.open(); if (!myDevice.isConnected()) { System.err.println(STR); return; } System.out.format(STR, DEST_IPV6_ADDRESS, DEST_PORT, HexUtils.prettyHexString(HexUtils.byteArrayToHexString(dataToSend)), new String(dataToSend)); myDevice.sendIPData((Inet6Address) Inet6Address.getByName(DEST_IPV6_ADDRESS), DEST_PORT, PROTOCOL, dataToSend); System.out.println(STR); } catch (XBeeException UnknownHostException e) { System.out.println("Error"); e.printStackTrace(); System.exit(1); } finally { myDevice.close(); } }
/** * Application main method. * * @param args Command line arguments. */
Application main method
main
{ "repo_name": "digidotcom/XBeeJavaLibrary", "path": "examples/communication/ip/SendIPv6DataSample/src/com/digi/xbee/api/sendipv6data/MainApp.java", "license": "mpl-2.0", "size": 3173 }
[ "com.digi.xbee.api.ThreadDevice", "com.digi.xbee.api.exceptions.XBeeException", "com.digi.xbee.api.utils.HexUtils", "java.net.Inet6Address", "java.net.UnknownHostException" ]
import com.digi.xbee.api.ThreadDevice; import com.digi.xbee.api.exceptions.XBeeException; import com.digi.xbee.api.utils.HexUtils; import java.net.Inet6Address; import java.net.UnknownHostException;
import com.digi.xbee.api.*; import com.digi.xbee.api.exceptions.*; import com.digi.xbee.api.utils.*; import java.net.*;
[ "com.digi.xbee", "java.net" ]
com.digi.xbee; java.net;
2,466,291
public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); // Returns the name of a node in the DOM final int getNodeName = cpg.addInterfaceMethodref(DOM_INTF, "getNodeName", "(I)"+STRING_SIG); final int getLocalName = cpg.addMethodref(BASIS_LIBRARY_CLASS, "getLocalName", "(Ljava/lang/String;)"+ "Ljava/lang/String;"); super.translate(classGen, methodGen); il.append(new INVOKEINTERFACE(getNodeName, 2)); il.append(new INVOKESTATIC(getLocalName)); }
void function(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); final int getNodeName = cpg.addInterfaceMethodref(DOM_INTF, STR, "(I)"+STRING_SIG); final int getLocalName = cpg.addMethodref(BASIS_LIBRARY_CLASS, STR, STR+ STR); super.translate(classGen, methodGen); il.append(new INVOKEINTERFACE(getNodeName, 2)); il.append(new INVOKESTATIC(getLocalName)); }
/** * This method is called when the constructor is compiled in * Stylesheet.compileConstructor() and not as the syntax tree is traversed. */
This method is called when the constructor is compiled in Stylesheet.compileConstructor() and not as the syntax tree is traversed
translate
{ "repo_name": "kcsl/immutability-benchmark", "path": "benchmark-applications/reiminfer-oopsla-2012/source/Xalan/src/org/apache/xalan/xsltc/compiler/LocalNameCall.java", "license": "mit", "size": 2552 }
[ "org.apache.bcel.generic.ConstantPoolGen", "org.apache.bcel.generic.InstructionList", "org.apache.xalan.xsltc.compiler.util.ClassGenerator", "org.apache.xalan.xsltc.compiler.util.MethodGenerator" ]
import org.apache.bcel.generic.ConstantPoolGen; import org.apache.bcel.generic.InstructionList; import org.apache.xalan.xsltc.compiler.util.ClassGenerator; import org.apache.xalan.xsltc.compiler.util.MethodGenerator;
import org.apache.bcel.generic.*; import org.apache.xalan.xsltc.compiler.util.*;
[ "org.apache.bcel", "org.apache.xalan" ]
org.apache.bcel; org.apache.xalan;
270,088
@Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); }
void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object.
collectNewChildDescriptors
{ "repo_name": "uppaal-emf/uppaal", "path": "metamodel/org.muml.uppaal.edit/src/org/muml/uppaal/expressions/provider/MinMaxExpressionItemProvider.java", "license": "epl-1.0", "size": 4964 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,951,754
public static String getTimespanForTrack(GpxTrack trk) { Date[] bounds = getMinMaxTimeForTrack(trk); String ts = ""; if (bounds != null) { DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT); String earliestDate = df.format(bounds[0]); String latestDate = df.format(bounds[1]); if (earliestDate.equals(latestDate)) { DateFormat tf = DateFormat.getTimeInstance(DateFormat.SHORT); ts += earliestDate + " "; ts += tf.format(bounds[0]) + " - " + tf.format(bounds[1]); } else { DateFormat dtf = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); ts += dtf.format(bounds[0]) + " - " + dtf.format(bounds[1]); } int diff = (int) (bounds[1].getTime() - bounds[0].getTime()) / 1000; ts += String.format(" (%d:%02d)", diff / 3600, (diff % 3600) / 60); } return ts; }
static String function(GpxTrack trk) { Date[] bounds = getMinMaxTimeForTrack(trk); String ts = STR STR - STR - STR (%d:%02d)", diff / 3600, (diff % 3600) / 60); } return ts; }
/** * returns a human readable string that shows the timespan of the given track */
returns a human readable string that shows the timespan of the given track
getTimespanForTrack
{ "repo_name": "CURocketry/Ground_Station_GUI", "path": "src/org/openstreetmap/josm/gui/layer/GpxLayer.java", "license": "gpl-3.0", "size": 36708 }
[ "java.util.Date", "org.openstreetmap.josm.data.gpx.GpxTrack" ]
import java.util.Date; import org.openstreetmap.josm.data.gpx.GpxTrack;
import java.util.*; import org.openstreetmap.josm.data.gpx.*;
[ "java.util", "org.openstreetmap.josm" ]
java.util; org.openstreetmap.josm;
894,684
public static RuleActionImpl toImplementation(RuleAction properties) { Objects.requireNonNull(properties, "'properties' cannot be null."); if (ruleAccessor == null) { throw new ClientLogger(EntityHelper.class).logExceptionAsError( new IllegalStateException("'ruleAccessor' should not be null.")); } return ruleAccessor.toImplementation(properties); }
static RuleActionImpl function(RuleAction properties) { Objects.requireNonNull(properties, STR); if (ruleAccessor == null) { throw new ClientLogger(EntityHelper.class).logExceptionAsError( new IllegalStateException(STR)); } return ruleAccessor.toImplementation(properties); }
/** * Creates a new rule action given an existing rule action. * * @param properties Rule properties. * @return A new instance of {@link RuleActionImpl}. */
Creates a new rule action given an existing rule action
toImplementation
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/servicebus/azure-messaging-servicebus/src/main/java/com/azure/messaging/servicebus/implementation/EntityHelper.java", "license": "mit", "size": 23903 }
[ "com.azure.core.util.logging.ClientLogger", "com.azure.messaging.servicebus.administration.models.RuleAction", "com.azure.messaging.servicebus.implementation.models.RuleActionImpl", "java.util.Objects" ]
import com.azure.core.util.logging.ClientLogger; import com.azure.messaging.servicebus.administration.models.RuleAction; import com.azure.messaging.servicebus.implementation.models.RuleActionImpl; import java.util.Objects;
import com.azure.core.util.logging.*; import com.azure.messaging.servicebus.administration.models.*; import com.azure.messaging.servicebus.implementation.models.*; import java.util.*;
[ "com.azure.core", "com.azure.messaging", "java.util" ]
com.azure.core; com.azure.messaging; java.util;
1,601,502
public List<RouteDefinition> asRouteDefinition(CamelContext camelContext) { List<RouteDefinition> answer = new ArrayList<RouteDefinition>(); if (camelContext.getRestConfigurations().isEmpty()) { camelContext.getRestConfiguration(); } for (RestConfiguration config : camelContext.getRestConfigurations()) { addRouteDefinition(camelContext, answer, config.getComponent()); } return answer; }
List<RouteDefinition> function(CamelContext camelContext) { List<RouteDefinition> answer = new ArrayList<RouteDefinition>(); if (camelContext.getRestConfigurations().isEmpty()) { camelContext.getRestConfiguration(); } for (RestConfiguration config : camelContext.getRestConfigurations()) { addRouteDefinition(camelContext, answer, config.getComponent()); } return answer; }
/** * Transforms this REST definition into a list of {@link org.apache.camel.model.RouteDefinition} which * Camel routing engine can add and run. This allows us to define REST services using this * REST DSL and turn those into regular Camel routes. */
Transforms this REST definition into a list of <code>org.apache.camel.model.RouteDefinition</code> which Camel routing engine can add and run. This allows us to define REST services using this REST DSL and turn those into regular Camel routes
asRouteDefinition
{ "repo_name": "brreitme/camel", "path": "camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java", "license": "apache-2.0", "size": 27227 }
[ "java.util.ArrayList", "java.util.List", "org.apache.camel.CamelContext", "org.apache.camel.model.RouteDefinition", "org.apache.camel.spi.RestConfiguration" ]
import java.util.ArrayList; import java.util.List; import org.apache.camel.CamelContext; import org.apache.camel.model.RouteDefinition; import org.apache.camel.spi.RestConfiguration;
import java.util.*; import org.apache.camel.*; import org.apache.camel.model.*; import org.apache.camel.spi.*;
[ "java.util", "org.apache.camel" ]
java.util; org.apache.camel;
1,758,325
public int restoreAll(long token, RestoreObserver observer) { int err = -1; if (mObserver != null) { Log.d(TAG, "restoreAll() called during active restore"); return -1; } mObserver = new RestoreObserverWrapper(mContext, observer); try { err = mBinder.restoreAll(token, mObserver); } catch (RemoteException e) { Log.d(TAG, "Can't contact server to restore"); } return err; }
int function(long token, RestoreObserver observer) { int err = -1; if (mObserver != null) { Log.d(TAG, STR); return -1; } mObserver = new RestoreObserverWrapper(mContext, observer); try { err = mBinder.restoreAll(token, mObserver); } catch (RemoteException e) { Log.d(TAG, STR); } return err; }
/** * Restore the given set onto the device, replacing the current data of any app * contained in the restore set with the data previously backed up. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @return Zero on success; nonzero on error. The observer will only receive * progress callbacks if this method returned zero. * @param token The token from {@link #getAvailableRestoreSets()} corresponding to * the restore set that should be used. * @param observer If non-null, this binder points to an object that will receive * progress callbacks during the restore operation. */
Restore the given set onto the device, replacing the current data of any app contained in the restore set with the data previously backed up. Callers must hold the android.permission.BACKUP permission to use this method
restoreAll
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/app/backup/RestoreSession.java", "license": "gpl-3.0", "size": 9479 }
[ "android.app.backup.RestoreObserver", "android.os.RemoteException", "android.util.Log" ]
import android.app.backup.RestoreObserver; import android.os.RemoteException; import android.util.Log;
import android.app.backup.*; import android.os.*; import android.util.*;
[ "android.app", "android.os", "android.util" ]
android.app; android.os; android.util;
1,352,580
@RequestMapping(value = "/queue", method = RequestMethod.POST) public ResponseDTO queueUser(@RequestBody String jsonRequest) { return queue(readRequest(jsonRequest)); }
@RequestMapping(value = STR, method = RequestMethod.POST) ResponseDTO function(@RequestBody String jsonRequest) { return queue(readRequest(jsonRequest)); }
/** * Add user do merging queue. * * @param jsonRequest * @return */
Add user do merging queue
queueUser
{ "repo_name": "renatomrcosta/jeevesServer", "path": "src/main/java/br/com/xunfos/jeeves/QueueController.java", "license": "mit", "size": 8613 }
[ "br.com.xunfos.jeeves.dto.ResponseDTO", "org.springframework.web.bind.annotation.RequestBody", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import br.com.xunfos.jeeves.dto.ResponseDTO; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import br.com.xunfos.jeeves.dto.*; import org.springframework.web.bind.annotation.*;
[ "br.com.xunfos", "org.springframework.web" ]
br.com.xunfos; org.springframework.web;
357,145
@Override public ByteChunk getEncodingName() { return ENCODING; }
ByteChunk function() { return ENCODING; }
/** * Return the name of the associated encoding; Here, the value is * "identity". */
Return the name of the associated encoding; Here, the value is "identity"
getEncodingName
{ "repo_name": "WhiteBearSolutions/WBSAirback", "path": "packages/wbsairback-tomcat/wbsairback-tomcat-7.0.22/java/org/apache/coyote/http11/filters/IdentityInputFilter.java", "license": "apache-2.0", "size": 5414 }
[ "org.apache.tomcat.util.buf.ByteChunk" ]
import org.apache.tomcat.util.buf.ByteChunk;
import org.apache.tomcat.util.buf.*;
[ "org.apache.tomcat" ]
org.apache.tomcat;
1,229,532
Result result = Caller.getInstance().call("tasteometer.compare", apiKey, "type1", type1.name().toLowerCase(), "type2", type2.name().toLowerCase(), "value1", value1, "value2", value2); if (!result.isSuccessful()) return null; DomElement element = result.getContentElement(); DomElement re = element.getChild("result"); float score = Float.parseFloat(re.getChildText("score")); List<Artist> artists = new ArrayList<Artist>(); for (DomElement domElement : re.getChild("artists").getChildren("artist")) { artists.add(ResponseBuilder.buildItem(domElement, Artist.class)); } return new ComparisonResult(score, artists); } public static class ComparisonResult { private float score; private Collection<Artist> matches; ComparisonResult(float score, Collection<Artist> matches) { this.score = score; this.matches = matches; }
Result result = Caller.getInstance().call(STR, apiKey, "type1", type1.name().toLowerCase(), "type2", type2.name().toLowerCase(), STR, value1, STR, value2); if (!result.isSuccessful()) return null; DomElement element = result.getContentElement(); DomElement re = element.getChild(STR); float score = Float.parseFloat(re.getChildText("score")); List<Artist> artists = new ArrayList<Artist>(); for (DomElement domElement : re.getChild(STR).getChildren(STR)) { artists.add(ResponseBuilder.buildItem(domElement, Artist.class)); } return new ComparisonResult(score, artists); } public static class ComparisonResult { private float score; private Collection<Artist> matches; ComparisonResult(float score, Collection<Artist> matches) { this.score = score; this.matches = matches; }
/** * Get a Tasteometer score from two inputs, along with a list of shared artists. * * @param type1 Type of the first input * @param value1 First input value * @param type2 Type of the second input * @param value2 Second input value * @param apiKey The Last.fm API key * @return result of Tasteometer comparison */
Get a Tasteometer score from two inputs, along with a list of shared artists
compare
{ "repo_name": "dubenju/javay", "path": "src/java/de/umass/lastfm/Tasteometer.java", "license": "apache-2.0", "size": 3713 }
[ "de.umass.xml.DomElement", "java.util.ArrayList", "java.util.Collection", "java.util.List" ]
import de.umass.xml.DomElement; import java.util.ArrayList; import java.util.Collection; import java.util.List;
import de.umass.xml.*; import java.util.*;
[ "de.umass.xml", "java.util" ]
de.umass.xml; java.util;
1,439,791
protected void addBrandPropertyDescriptor(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Tire_brand_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Tire_brand_feature", "_UI_Tire_type"), ModelPackage.Literals.TIRE__BRAND, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), ModelPackage.Literals.TIRE__BRAND, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); }
/** * This adds a property descriptor for the Brand feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds a property descriptor for the Brand feature.
addBrandPropertyDescriptor
{ "repo_name": "CarlAtComputer/tracker", "path": "playground/other_gef/graphical.edit/src/model/provider/TireItemProvider.java", "license": "gpl-2.0", "size": 4399 }
[ "org.eclipse.emf.edit.provider.ComposeableAdapterFactory", "org.eclipse.emf.edit.provider.ItemPropertyDescriptor" ]
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,274,657
public boolean accepts(NorthboundAlarm alarm) { if (getFilter() != null) { StandardEvaluationContext context = new StandardEvaluationContext(alarm); ExpressionParser parser = new SpelExpressionParser(); Expression exp = parser.parseExpression(m_filter); boolean passed = false; try { passed = (Boolean)exp.getValue(context, Boolean.class); } catch (Exception e) { LOG.warn("accepts: can't evaluate expression {} for alarm {} because: {}", getFilter(), alarm.getUei(), e.getMessage()); } LOG.debug("accepts: checking {} ? {}", m_filter, passed); return passed; } return true; }
boolean function(NorthboundAlarm alarm) { if (getFilter() != null) { StandardEvaluationContext context = new StandardEvaluationContext(alarm); ExpressionParser parser = new SpelExpressionParser(); Expression exp = parser.parseExpression(m_filter); boolean passed = false; try { passed = (Boolean)exp.getValue(context, Boolean.class); } catch (Exception e) { LOG.warn(STR, getFilter(), alarm.getUei(), e.getMessage()); } LOG.debug(STR, m_filter, passed); return passed; } return true; }
/** * Accepts. * <p>If the engine doesn't have filter, the method will return true.</p> * <p>If the method has a filter, it will be evaluated.</p> * * @param alarm the alarm * @return true, if successful */
Accepts. If the engine doesn't have filter, the method will return true. If the method has a filter, it will be evaluated
accepts
{ "repo_name": "aihua/opennms", "path": "opennms-alarms/bsf-northbounder/src/main/java/org/opennms/netmgt/alarmd/northbounder/bsf/BSFEngineHandler.java", "license": "agpl-3.0", "size": 7338 }
[ "org.opennms.netmgt.alarmd.api.NorthboundAlarm", "org.springframework.expression.Expression", "org.springframework.expression.ExpressionParser", "org.springframework.expression.spel.standard.SpelExpressionParser", "org.springframework.expression.spel.support.StandardEvaluationContext" ]
import org.opennms.netmgt.alarmd.api.NorthboundAlarm; import org.springframework.expression.Expression; import org.springframework.expression.ExpressionParser; import org.springframework.expression.spel.standard.SpelExpressionParser; import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.opennms.netmgt.alarmd.api.*; import org.springframework.expression.*; import org.springframework.expression.spel.standard.*; import org.springframework.expression.spel.support.*;
[ "org.opennms.netmgt", "org.springframework.expression" ]
org.opennms.netmgt; org.springframework.expression;
2,786,843
private void normal(Key key) { if (limitReached()) { return; } // If delete comes through don't print it out! if (key.getCharacter() == 127) { return; } TextGrid.DataGridCel cel = grid.getCel(currentRow + rowOffset, currentCol + colOffset); if (cel != null && cel.getBufferIndex() != -1) { grid.insertChar(cel.getBufferIndex(), key.getCharacter()); } else { grid.appendChar(key.getCharacter()); } if (currentCol == numberOfCols - 1) { colOffset++; } else { currentCol++; } }
void function(Key key) { if (limitReached()) { return; } if (key.getCharacter() == 127) { return; } TextGrid.DataGridCel cel = grid.getCel(currentRow + rowOffset, currentCol + colOffset); if (cel != null && cel.getBufferIndex() != -1) { grid.insertChar(cel.getBufferIndex(), key.getCharacter()); } else { grid.appendChar(key.getCharacter()); } if (currentCol == numberOfCols - 1) { colOffset++; } else { currentCol++; } }
/** * Action for "normal" key (a-z, 0-9, and symbols). * */
Action for "normal" key (a-z, 0-9, and symbols)
normal
{ "repo_name": "kba/lanterna-old", "path": "src/main/java/com/googlecode/lanterna/gui/component/EditArea.java", "license": "lgpl-3.0", "size": 16288 }
[ "com.googlecode.lanterna.gui.component.TextGrid", "com.googlecode.lanterna.input.Key" ]
import com.googlecode.lanterna.gui.component.TextGrid; import com.googlecode.lanterna.input.Key;
import com.googlecode.lanterna.gui.component.*; import com.googlecode.lanterna.input.*;
[ "com.googlecode.lanterna" ]
com.googlecode.lanterna;
2,434,934
public void destroy(AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(this.destroy().render().toString()); }
void function(AjaxRequestTarget ajaxRequestTarget) { ajaxRequestTarget.appendJavaScript(this.destroy().render().toString()); }
/** * Method to destroy the accordion within the ajax request * * @param ajaxRequestTarget */
Method to destroy the accordion within the ajax request
destroy
{ "repo_name": "downloadsha3by/wiquery", "path": "wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/accordion/Accordion.java", "license": "mit", "size": 15611 }
[ "org.apache.wicket.ajax.AjaxRequestTarget" ]
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.*;
[ "org.apache.wicket" ]
org.apache.wicket;
681,640
public static ims.therapies.treatment.domain.objects.Thermal extractThermal(ims.domain.ILightweightDomainFactory domainFactory, ims.therapies.vo.ThermalShortVo valueObject) { return extractThermal(domainFactory, valueObject, new HashMap()); }
static ims.therapies.treatment.domain.objects.Thermal function(ims.domain.ILightweightDomainFactory domainFactory, ims.therapies.vo.ThermalShortVo valueObject) { return extractThermal(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractThermal
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/therapies/vo/domain/ThermalShortVoAssembler.java", "license": "agpl-3.0", "size": 17633 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,274,391
public TextBlock getLabel() { return this.label; }
TextBlock function() { return this.label; }
/** * Returns the label. * * @return The label. */
Returns the label
getLabel
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/jfreechart0921/source/org/jfree/chart/axis/CategoryTick.java", "license": "lgpl-3.0", "size": 4056 }
[ "org.jfree.text.TextBlock" ]
import org.jfree.text.TextBlock;
import org.jfree.text.*;
[ "org.jfree.text" ]
org.jfree.text;
1,116,484
public List<String> listProcessModels() throws WorkflowException;
List<String> function() throws WorkflowException;
/** * List all the ProcessModels that are stored in the process model directory Retrieves all the * files in the directory tree below the process model directory. * @return list of strings containing ProcesModel XML descriptor filenames with relative paths. * @throws WorkflowException when something goes wrong */
List all the ProcessModels that are stored in the process model directory Retrieves all the files in the directory tree below the process model directory
listProcessModels
{ "repo_name": "CecileBONIN/Silverpeas-Core", "path": "ejb-core/formtemplate/src/main/java/com/silverpeas/workflow/api/ProcessModelManager.java", "license": "agpl-3.0", "size": 4688 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,947,444
public Timestamp getCreated(); public static final String COLUMNNAME_CreatedBy = "CreatedBy";
Timestamp function(); public static final String COLUMNNAME_CreatedBy = STR;
/** Get Erstellt. * Datum, an dem dieser Eintrag erstellt wurde */
Get Erstellt. Datum, an dem dieser Eintrag erstellt wurde
getCreated
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.adempiere.adempiere/base/src/main/java-gen/org/compiere/model/I_AD_Val_Rule_Included.java", "license": "gpl-2.0", "size": 5528 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
676,582
public Set<SystemStream> getAllInputStreams() { Set<SystemStream> allInputSS = new HashSet<>(); TaskConfig taskConfig = TaskConfig.Config2Task(this); allInputSS.addAll((Set<? extends SystemStream>) JavaConverters.setAsJavaSetConverter(taskConfig.getInputStreams()).asJava()); allInputSS.addAll(getBroadcastSystemStreams()); return Collections.unmodifiableSet(allInputSS); } /** * Returns a value indicating how long to wait for the tasks to shutdown * If the value is not defined in the config or if does not parse correctly, we return the default value - * {@value #DEFAULT_TASK_SHUTDOWN_MS}
Set<SystemStream> function() { Set<SystemStream> allInputSS = new HashSet<>(); TaskConfig taskConfig = TaskConfig.Config2Task(this); allInputSS.addAll((Set<? extends SystemStream>) JavaConverters.setAsJavaSetConverter(taskConfig.getInputStreams()).asJava()); allInputSS.addAll(getBroadcastSystemStreams()); return Collections.unmodifiableSet(allInputSS); } /** * Returns a value indicating how long to wait for the tasks to shutdown * If the value is not defined in the config or if does not parse correctly, we return the default value - * {@value #DEFAULT_TASK_SHUTDOWN_MS}
/** * Get the SystemStreams for the configured input and broadcast streams. * * @return the set of SystemStreams for both standard inputs and broadcast stream inputs. */
Get the SystemStreams for the configured input and broadcast streams
getAllInputStreams
{ "repo_name": "fredji97/samza", "path": "samza-core/src/main/java/org/apache/samza/config/TaskConfigJava.java", "license": "apache-2.0", "size": 7571 }
[ "java.util.Collections", "java.util.HashSet", "java.util.Set", "org.apache.samza.system.SystemStream" ]
import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.apache.samza.system.SystemStream;
import java.util.*; import org.apache.samza.system.*;
[ "java.util", "org.apache.samza" ]
java.util; org.apache.samza;
2,263,949
@Test public void testRemove() { assertNotNull(dao.get(INTERFACE_ID)); dao.remove(INTERFACE_ID); assertNull(dao.get(INTERFACE_ID)); }
void function() { assertNotNull(dao.get(INTERFACE_ID)); dao.remove(INTERFACE_ID); assertNull(dao.get(INTERFACE_ID)); }
/** * Ensures that the specified VM's interfaces are deleted. */
Ensures that the specified VM's interfaces are deleted
testRemove
{ "repo_name": "jbeecham/ovirt-engine", "path": "backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmNetworkInterfaceDAOTest.java", "license": "apache-2.0", "size": 8337 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,778,876
public void onTrade(final Player player) { getAndCheckAchievementsInCategory(player, Category.COMMERCE); }
void function(final Player player) { getAndCheckAchievementsInCategory(player, Category.COMMERCE); }
/** * Check all achievements for player that beling to the commerce category. * * @param player * Player to check. */
Check all achievements for player that beling to the commerce category
onTrade
{ "repo_name": "AntumDeluge/arianne-stendhal", "path": "src/games/stendhal/server/core/rp/achievement/AchievementNotifier.java", "license": "gpl-2.0", "size": 15477 }
[ "games.stendhal.server.entity.player.Player" ]
import games.stendhal.server.entity.player.Player;
import games.stendhal.server.entity.player.*;
[ "games.stendhal.server" ]
games.stendhal.server;
2,062,570
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<Response<TriggerRunsQueryResponseInner>> queryByFactoryWithResponseAsync( String resourceGroupName, String factoryName, RunFilterParameters filterParameters) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (factoryName == null) { return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null.")); } if (filterParameters == null) { return Mono .error(new IllegalArgumentException("Parameter filterParameters is required and cannot be null.")); } else { filterParameters.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .queryByFactory( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, factoryName, this.client.getApiVersion(), filterParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<TriggerRunsQueryResponseInner>> function( String resourceGroupName, String factoryName, RunFilterParameters filterParameters) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (factoryName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (filterParameters == null) { return Mono .error(new IllegalArgumentException(STR)); } else { filterParameters.validate(); } final String accept = STR; return FluxUtil .withContext( context -> service .queryByFactory( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, factoryName, this.client.getApiVersion(), filterParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); }
/** * Query trigger runs. * * @param resourceGroupName The resource group name. * @param factoryName The factory name. * @param filterParameters Parameters to filter the pipeline run. * @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 list of trigger runs along with {@link Response} on successful completion of {@link Mono}. */
Query trigger runs
queryByFactoryWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/implementation/TriggerRunsClientImpl.java", "license": "mit", "size": 29171 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.FluxUtil", "com.azure.resourcemanager.datafactory.fluent.models.TriggerRunsQueryResponseInner", "com.azure.resourcemanager.datafactory.models.RunFilterParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.datafactory.fluent.models.TriggerRunsQueryResponseInner; import com.azure.resourcemanager.datafactory.models.RunFilterParameters;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.datafactory.fluent.models.*; import com.azure.resourcemanager.datafactory.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
780,846
protected static Double[] getDoubleArray(Number[] input){ return Arrays.copyOf(input, input.length, Double[].class); }
static Double[] function(Number[] input){ return Arrays.copyOf(input, input.length, Double[].class); }
/** * No equivalent in python. Help method. * * @param input * @return */
No equivalent in python. Help method
getDoubleArray
{ "repo_name": "ScottPJones/beaker-notebook", "path": "kernel/base/src/main/java/com/twosigma/beaker/widgets/InteractiveBase.java", "license": "apache-2.0", "size": 10312 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,006,190
if (operator == null) { throw new IllegalArgumentException("operator must not be null!"); } if (xmlStream == null) { LogService.getRoot().finer("Failed to load documentation, using online fallback. Reason: xmlStream is null."); return createFallbackDocumentation(operator); } Source xmlSource = new StreamSource(xmlStream); try { return applyXSLTTransformation(xmlSource); } catch (TransformerException e) { LogService.getRoot().log(Level.WARNING, "Failed to load documentation, using online fallback.", e); return createFallbackDocumentation(operator); } }
if (operator == null) { throw new IllegalArgumentException(STR); } if (xmlStream == null) { LogService.getRoot().finer(STR); return createFallbackDocumentation(operator); } Source xmlSource = new StreamSource(xmlStream); try { return applyXSLTTransformation(xmlSource); } catch (TransformerException e) { LogService.getRoot().log(Level.WARNING, STR, e); return createFallbackDocumentation(operator); } }
/** * Tries to convert the given XML file into an HTML file using the given XSLT stylesheet. If * this fails (probably because the given XML file doesn't exist), * {@link #createOfflineFallbackDocumentation(Operator)} will be used to generate a String from * the old local operator description resources. * * @param xmlStream * @param operator * @return * @throws MalformedURLException * @throws IOException */
Tries to convert the given XML file into an HTML file using the given XSLT stylesheet. If this fails (probably because the given XML file doesn't exist), <code>#createOfflineFallbackDocumentation(Operator)</code> will be used to generate a String from the old local operator description resources
convert
{ "repo_name": "transwarpio/rapidminer", "path": "rapidMiner/rapidminer-studio-core/src/main/java/com/rapidminer/gui/OperatorDocToHtmlConverter.java", "license": "gpl-3.0", "size": 27560 }
[ "com.rapidminer.tools.LogService", "java.util.logging.Level", "javax.xml.transform.Source", "javax.xml.transform.TransformerException", "javax.xml.transform.stream.StreamSource" ]
import com.rapidminer.tools.LogService; import java.util.logging.Level; import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.stream.StreamSource;
import com.rapidminer.tools.*; import java.util.logging.*; import javax.xml.transform.*; import javax.xml.transform.stream.*;
[ "com.rapidminer.tools", "java.util", "javax.xml" ]
com.rapidminer.tools; java.util; javax.xml;
1,223,335
private void parRateTest(InstrumentDerivative ins, MulticurveProviderDiscount multicurve, double prExpected, String msg) { double prComputed = ins.accept(PRDC, multicurve); assertEquals(msg, prExpected, prComputed, TOLERANCE_RATE); }
void function(InstrumentDerivative ins, MulticurveProviderDiscount multicurve, double prExpected, String msg) { double prComputed = ins.accept(PRDC, multicurve); assertEquals(msg, prExpected, prComputed, TOLERANCE_RATE); }
/** * Test the parrate versus a hard-coded number. * @param ins The instrument to test. * @param multicurve The multi-curve provider. * @param ccy The currency of the expected PV. * @param expectedPv The expected PV amount. * @param msg The assert message. */
Test the parrate versus a hard-coded number
parRateTest
{ "repo_name": "nssales/OG-Platform", "path": "projects/OG-Analytics/src/test/java/com/opengamma/analytics/financial/interestrate/swap/provider/SwapCalculatorE2ETest.java", "license": "apache-2.0", "size": 28235 }
[ "com.opengamma.analytics.financial.interestrate.InstrumentDerivative", "com.opengamma.analytics.financial.provider.description.interestrate.MulticurveProviderDiscount", "org.testng.AssertJUnit" ]
import com.opengamma.analytics.financial.interestrate.InstrumentDerivative; import com.opengamma.analytics.financial.provider.description.interestrate.MulticurveProviderDiscount; import org.testng.AssertJUnit;
import com.opengamma.analytics.financial.interestrate.*; import com.opengamma.analytics.financial.provider.description.interestrate.*; import org.testng.*;
[ "com.opengamma.analytics", "org.testng" ]
com.opengamma.analytics; org.testng;
2,723,487
public HealthCheckRegistry healthChecks() { return healthCheckRegistry; }
HealthCheckRegistry function() { return healthCheckRegistry; }
/** * Returns the application's {@link HealthCheckRegistry}. */
Returns the application's <code>HealthCheckRegistry</code>
healthChecks
{ "repo_name": "phambryan/dropwizard", "path": "dropwizard-core/src/main/java/io/dropwizard/setup/Environment.java", "license": "apache-2.0", "size": 8077 }
[ "com.codahale.metrics.health.HealthCheckRegistry" ]
import com.codahale.metrics.health.HealthCheckRegistry;
import com.codahale.metrics.health.*;
[ "com.codahale.metrics" ]
com.codahale.metrics;
2,795,646
private String getAbsoluteGroup(final String index, final int groupCount) { boolean startsWithPlus = index.charAt(0) == '+'; int groupIndex = parseInt(startsWithPlus ? index.substring(1) : index); if (startsWithPlus) { groupIndex += groupCount; } else if (groupIndex < 0) { groupIndex = getAbsoluteGroupIndex(groupIndex, groupCount); if (groupIndex == -1) { return RefactorUtility.neverUsedMappingName(); } if (this.has(DOTNET_NUMBERING)) { return this.getPerlGroup(groupIndex); } } // System.out.println(index + ":" + groupCount + " -> " + groupIndex); return getMappingName(groupIndex, 0); } /* * private StringBuffer appendWith(String str) * { * differences.insert(result.length(), str); * result.append(str); * * return result; * }
String function(final String index, final int groupCount) { boolean startsWithPlus = index.charAt(0) == '+'; int groupIndex = parseInt(startsWithPlus ? index.substring(1) : index); if (startsWithPlus) { groupIndex += groupCount; } else if (groupIndex < 0) { groupIndex = getAbsoluteGroupIndex(groupIndex, groupCount); if (groupIndex == -1) { return RefactorUtility.neverUsedMappingName(); } if (this.has(DOTNET_NUMBERING)) { return this.getPerlGroup(groupIndex); } } return getMappingName(groupIndex, 0); } /* * private StringBuffer appendWith(String str) * { * differences.insert(result.length(), str); * result.append(str); * * return result; * }
/** * <p> * Returns the absolute group number associated with the match. * </p> * * <p> * If the group number is relative, then it is converted to an absolute * occurrence * </p> * * TODO: modify function name * * @param index * the index * @param groupCount * the group count * @return the absolute group number associated with the match */
Returns the absolute group number associated with the match. If the group number is relative, then it is converted to an absolute occurrence
getAbsoluteGroup
{ "repo_name": "codesaway/regexplus", "path": "RegExPlus/src/main/java/info/codesaway/util/regex/Refactor.java", "license": "bsd-3-clause", "size": 111762 }
[ "info.codesaway.util.regex.Matcher", "info.codesaway.util.regex.Pattern", "info.codesaway.util.regex.RefactorUtility" ]
import info.codesaway.util.regex.Matcher; import info.codesaway.util.regex.Pattern; import info.codesaway.util.regex.RefactorUtility;
import info.codesaway.util.regex.*;
[ "info.codesaway.util" ]
info.codesaway.util;
1,886,154
public String getDisplayName( Locale locale, TextWidth width ) { CalendarText names = CalendarText.getInstance("juche", locale); return names.getEras(width).print(this); }
String function( Locale locale, TextWidth width ) { CalendarText names = CalendarText.getInstance("juche", locale); return names.getEras(width).print(this); }
/** * <p>Gets the description text dependent on the locale and style parameters. </p> * * <p>The second argument controls the width of description. </p> * * @param locale language setting * @param width text width * @return descriptive text for given locale and style (never {@code null}) */
Gets the description text dependent on the locale and style parameters. The second argument controls the width of description.
getDisplayName
{ "repo_name": "MenoData/Time4J", "path": "base/src/main/java/net/time4j/calendar/JucheEra.java", "license": "lgpl-2.1", "size": 3928 }
[ "java.util.Locale", "net.time4j.format.CalendarText", "net.time4j.format.TextWidth" ]
import java.util.Locale; import net.time4j.format.CalendarText; import net.time4j.format.TextWidth;
import java.util.*; import net.time4j.format.*;
[ "java.util", "net.time4j.format" ]
java.util; net.time4j.format;
2,071,735
public java.util.List<fr.lip6.move.pnml.hlpn.multisets.hlapi.EmptyHLAPI> getSubterm_multisets_EmptyHLAPI(){ java.util.List<fr.lip6.move.pnml.hlpn.multisets.hlapi.EmptyHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.multisets.hlapi.EmptyHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.multisets.impl.EmptyImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.multisets.hlapi.EmptyHLAPI( (fr.lip6.move.pnml.hlpn.multisets.Empty)elemnt )); } } return retour; }
java.util.List<fr.lip6.move.pnml.hlpn.multisets.hlapi.EmptyHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.multisets.hlapi.EmptyHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.multisets.hlapi.EmptyHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.multisets.impl.EmptyImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.multisets.hlapi.EmptyHLAPI( (fr.lip6.move.pnml.hlpn.multisets.Empty)elemnt )); } } return retour; }
/** * This accessor return a list of encapsulated subelement, only of EmptyHLAPI kind. * WARNING : this method can creates a lot of new object in memory. */
This accessor return a list of encapsulated subelement, only of EmptyHLAPI kind. WARNING : this method can creates a lot of new object in memory
getSubterm_multisets_EmptyHLAPI
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/booleans/hlapi/InequalityHLAPI.java", "license": "epl-1.0", "size": 108490 }
[ "fr.lip6.move.pnml.hlpn.terms.Term", "java.util.ArrayList", "java.util.List" ]
import fr.lip6.move.pnml.hlpn.terms.Term; import java.util.ArrayList; import java.util.List;
import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*;
[ "fr.lip6.move", "java.util" ]
fr.lip6.move; java.util;
1,910,175
public double[] getForwards(final AnalyticModel model, final double[] fixingTimes) { final double[] values = new double[fixingTimes.length]; for(int i=0; i<fixingTimes.length; i++) { values[i] = getForward(model, fixingTimes[i]); } return values; }
double[] function(final AnalyticModel model, final double[] fixingTimes) { final double[] values = new double[fixingTimes.length]; for(int i=0; i<fixingTimes.length; i++) { values[i] = getForward(model, fixingTimes[i]); } return values; }
/** * Returns the forwards for a given vector fixing times. * * @param model An analytic model providing a context. The discount curve (if needed) is obtained from this model. * @param fixingTimes The given fixing times. * @return The forward rates. */
Returns the forwards for a given vector fixing times
getForwards
{ "repo_name": "finmath/finmath-lib", "path": "src/main/java8/net/finmath/marketdata/model/curves/ForwardCurveWithFixings.java", "license": "apache-2.0", "size": 3203 }
[ "net.finmath.marketdata.model.AnalyticModel" ]
import net.finmath.marketdata.model.AnalyticModel;
import net.finmath.marketdata.model.*;
[ "net.finmath.marketdata" ]
net.finmath.marketdata;
2,714,056
void write16bitLE(int b) throws EOFException;
void write16bitLE(int b) throws EOFException;
/** * Write 16 bits Little Endian. * * @param b 16 bits * @throws EOFException if end of file */
Write 16 bits Little Endian
write16bitLE
{ "repo_name": "bubulemaster/openjill", "path": "abstractfile-api/src/main/java/org/jill/file/FileAbstractByte.java", "license": "mpl-2.0", "size": 4983 }
[ "java.io.EOFException" ]
import java.io.EOFException;
import java.io.*;
[ "java.io" ]
java.io;
589,934
public String getBaseUrl() { String url = getContextBaseUrl() + "/configuration/strongbox/baseUrl"; WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); return resource.request(MediaType.TEXT_PLAIN).get(String.class); }
String function() { String url = getContextBaseUrl() + STR; WebTarget resource = getClientInstance().target(url); setupAuthentication(resource); return resource.request(MediaType.TEXT_PLAIN).get(String.class); }
/** * Gets the base URL of the server. * * @return The response code. */
Gets the base URL of the server
getBaseUrl
{ "repo_name": "ivanursul/strongbox", "path": "strongbox-rest-client/src/main/java/org/carlspring/strongbox/client/RestClient.java", "license": "apache-2.0", "size": 18274 }
[ "javax.ws.rs.client.WebTarget", "javax.ws.rs.core.MediaType" ]
import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType;
import javax.ws.rs.client.*; import javax.ws.rs.core.*;
[ "javax.ws" ]
javax.ws;
721,339
public Map<WellDouble, Double> set(WellSetDouble set, int begin, int length) { Preconditions.checkNotNull(set, "The well set cannot be null."); Map<WellDouble, Double> result = new TreeMap<WellDouble, Double>(); for (WellDouble well : set) { WellDouble clone = new WellDouble(well); result.put(clone, well(well, begin, length)); } return result; }
Map<WellDouble, Double> function(WellSetDouble set, int begin, int length) { Preconditions.checkNotNull(set, STR); Map<WellDouble, Double> result = new TreeMap<WellDouble, Double>(); for (WellDouble well : set) { WellDouble clone = new WellDouble(well); result.put(clone, well(well, begin, length)); } return result; }
/** * Returns the statistic of each well in the well set using the values between * the beginning and ending indices. * @param WellSetDouble the well set * @param int beginning index of subset * @param int length of subset * @return map of wells and results */
Returns the statistic of each well in the well set using the values between the beginning and ending indices
set
{ "repo_name": "jessemull/MicroFlex", "path": "src/main/java/com/github/jessemull/microflex/doubleflex/stat/DescriptiveStatisticDouble.java", "license": "apache-2.0", "size": 21699 }
[ "com.github.jessemull.microflex.doubleflex.plate.WellDouble", "com.github.jessemull.microflex.doubleflex.plate.WellSetDouble", "com.google.common.base.Preconditions", "java.util.Map", "java.util.TreeMap" ]
import com.github.jessemull.microflex.doubleflex.plate.WellDouble; import com.github.jessemull.microflex.doubleflex.plate.WellSetDouble; import com.google.common.base.Preconditions; import java.util.Map; import java.util.TreeMap;
import com.github.jessemull.microflex.doubleflex.plate.*; import com.google.common.base.*; import java.util.*;
[ "com.github.jessemull", "com.google.common", "java.util" ]
com.github.jessemull; com.google.common; java.util;
597,389
@Nullable ITextComponent getResponseResult(final ITextComponent response);
ITextComponent getResponseResult(final ITextComponent response);
/** * Get possible further interaction from the GUI on response. * * @param response the response given to the GUI. * @return an instance of ICitizenInquiry if existent, else null. */
Get possible further interaction from the GUI on response
getResponseResult
{ "repo_name": "Minecolonies/minecolonies", "path": "src/api/java/com/minecolonies/api/colony/interactionhandling/IInteractionResponseHandler.java", "license": "gpl-3.0", "size": 3936 }
[ "net.minecraft.util.text.ITextComponent" ]
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.*;
[ "net.minecraft.util" ]
net.minecraft.util;
2,876,091
Object convertToBinaryStringStorageType( Object object ) throws KettleValueException;
Object convertToBinaryStringStorageType( Object object ) throws KettleValueException;
/** * Converts the specified data object to the binary string storage type. * * @param object * the data object to convert * @return the data in a binary string storage type * @throws KettleValueException * In case there is a data conversion error. */
Converts the specified data object to the binary string storage type
convertToBinaryStringStorageType
{ "repo_name": "matthewtckr/pentaho-kettle", "path": "core/src/main/java/org/pentaho/di/core/row/ValueMetaInterface.java", "license": "apache-2.0", "size": 38578 }
[ "org.pentaho.di.core.exception.KettleValueException" ]
import org.pentaho.di.core.exception.KettleValueException;
import org.pentaho.di.core.exception.*;
[ "org.pentaho.di" ]
org.pentaho.di;
2,738,318
public void setStartIconOnLongClickListener( @Nullable OnLongClickListener startIconOnLongClickListener) { startLayout.setStartIconOnLongClickListener(startIconOnLongClickListener); }
void function( @Nullable OnLongClickListener startIconOnLongClickListener) { startLayout.setStartIconOnLongClickListener(startIconOnLongClickListener); }
/** * Sets the start icon's functionality that is performed when the start icon is long clicked. The * icon will not be clickable if its click and long click listeners are null. * * @param startIconOnLongClickListener the {@link android.view.View.OnLongClickListener} the start * icon view will have, or null to clear it. */
Sets the start icon's functionality that is performed when the start icon is long clicked. The icon will not be clickable if its click and long click listeners are null
setStartIconOnLongClickListener
{ "repo_name": "material-components/material-components-android", "path": "lib/java/com/google/android/material/textfield/TextInputLayout.java", "license": "apache-2.0", "size": 171507 }
[ "androidx.annotation.Nullable" ]
import androidx.annotation.Nullable;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
1,858,301
@Deprecated public void setPasswordVisibilityToggleTintMode(@Nullable PorterDuff.Mode mode) { endIconTintMode = mode; applyIconTint(this, endIconView, endIconTintList, endIconTintMode); } /** * Handles visibility for a password toggle icon when changing obfuscation in a password edit * text. Public so that clients can override this method for custom UI changes when toggling the * display of password text * * @param shouldSkipAnimations true if the password toggle indicator icon should not animate * changes * @deprecated The password toggle will show as checked or unchecked depending on whether the * {@link EditText}'s {@link android.text.method.TransformationMethod} is of type {@link * android.text.method.PasswordTransformationMethod}
void function(@Nullable PorterDuff.Mode mode) { endIconTintMode = mode; applyIconTint(this, endIconView, endIconTintList, endIconTintMode); } /** * Handles visibility for a password toggle icon when changing obfuscation in a password edit * text. Public so that clients can override this method for custom UI changes when toggling the * display of password text * * @param shouldSkipAnimations true if the password toggle indicator icon should not animate * changes * @deprecated The password toggle will show as checked or unchecked depending on whether the * {@link EditText}'s {@link android.text.method.TransformationMethod} is of type { * android.text.method.PasswordTransformationMethod}
/** * Specifies the blending mode used to apply the tint specified by {@link * #setPasswordVisibilityToggleTintList(ColorStateList)} to the password visibility toggle * drawable. The default mode is {@link PorterDuff.Mode#SRC_IN}. * * @param mode the blending mode used to apply the tint, may be null to clear tint * @attr ref com.google.android.material.R.styleable#TextInputLayout_passwordToggleTintMode * @deprecated Use {@link #setEndIconTintMode(PorterDuff.Mode)} instead. */
Specifies the blending mode used to apply the tint specified by <code>#setPasswordVisibilityToggleTintList(ColorStateList)</code> to the password visibility toggle drawable. The default mode is <code>PorterDuff.Mode#SRC_IN</code>
setPasswordVisibilityToggleTintMode
{ "repo_name": "material-components/material-components-android", "path": "lib/java/com/google/android/material/textfield/TextInputLayout.java", "license": "apache-2.0", "size": 171507 }
[ "android.graphics.PorterDuff", "android.widget.EditText", "androidx.annotation.Nullable", "com.google.android.material.textfield.IconHelper" ]
import android.graphics.PorterDuff; import android.widget.EditText; import androidx.annotation.Nullable; import com.google.android.material.textfield.IconHelper;
import android.graphics.*; import android.widget.*; import androidx.annotation.*; import com.google.android.material.textfield.*;
[ "android.graphics", "android.widget", "androidx.annotation", "com.google.android" ]
android.graphics; android.widget; androidx.annotation; com.google.android;
1,858,331
public boolean isReservedWord( String word ) { String[] reserved = getReservedWords(); if ( Const.indexOfString( word, reserved ) >= 0 ) { return true; } return false; }
boolean function( String word ) { String[] reserved = getReservedWords(); if ( Const.indexOfString( word, reserved ) >= 0 ) { return true; } return false; }
/** * Returns true if the string specified is a reserved word on this database type. * * @param word * The word to check * @return true if word is a reserved word on this database. */
Returns true if the string specified is a reserved word on this database type
isReservedWord
{ "repo_name": "rfellows/pentaho-kettle", "path": "core/src/org/pentaho/di/core/database/DatabaseMeta.java", "license": "apache-2.0", "size": 88336 }
[ "org.pentaho.di.core.Const" ]
import org.pentaho.di.core.Const;
import org.pentaho.di.core.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,666,739
@Override public CompletableFuture<Void> deleteForcefully() { return delete(false, true, false); }
CompletableFuture<Void> function() { return delete(false, true, false); }
/** * Forcefully close all producers/consumers/replicators and deletes the topic. * * @return */
Forcefully close all producers/consumers/replicators and deletes the topic
deleteForcefully
{ "repo_name": "merlimat/pulsar", "path": "pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java", "license": "apache-2.0", "size": 39416 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,545,618
protected Map<String, String> getExtraExecutionInfo(RuleContext ruleContext, String command) { return ImmutableMap.of(); }
Map<String, String> function(RuleContext ruleContext, String command) { return ImmutableMap.of(); }
/** * Returns a {@link Map} of execution info, which will be used in later processing to construct * the actual command line that will be executed. * * <p>GenRule implementations can override this method to include additional specific information * needed. */
Returns a <code>Map</code> of execution info, which will be used in later processing to construct the actual command line that will be executed. GenRule implementations can override this method to include additional specific information needed
getExtraExecutionInfo
{ "repo_name": "kchodorow/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBase.java", "license": "apache-2.0", "size": 16199 }
[ "com.google.common.collect.ImmutableMap", "com.google.devtools.build.lib.analysis.RuleContext", "java.util.Map" ]
import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.analysis.RuleContext; import java.util.Map;
import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.*; import java.util.*;
[ "com.google.common", "com.google.devtools", "java.util" ]
com.google.common; com.google.devtools; java.util;
1,969,761
public void draw(DrawingPanel panel, Graphics g) { if(!visible) { return; } if(image==null) { panel.setMessage(DisplayRes.getString("MeasuredImage.NoImage")); //$NON-NLS-1$ return; } Graphics2D g2 = (Graphics2D) g; AffineTransform gat = g2.getTransform(); // save graphics transform RenderingHints hints = g2.getRenderingHints(); if (!OSPRuntime.isMac()) { //Rendering hint bug in Mac Snow Leopard g2.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); } double sx = (xmax-xmin)*panel.xPixPerUnit/image.getWidth(); double sy = (ymax-ymin)*panel.yPixPerUnit/image.getHeight(); g2.transform(AffineTransform.getTranslateInstance(panel.leftGutter+panel.xPixPerUnit*(xmin-panel.xmin), panel.topGutter+panel.yPixPerUnit*(panel.ymax-ymax))); g2.transform(AffineTransform.getScaleInstance(sx, sy)); g2.drawImage(image, 0, 0, panel); g2.setTransform(gat); // restore graphics transform g2.setRenderingHints(hints); // restore the hints }
void function(DrawingPanel panel, Graphics g) { if(!visible) { return; } if(image==null) { panel.setMessage(DisplayRes.getString(STR)); return; } Graphics2D g2 = (Graphics2D) g; AffineTransform gat = g2.getTransform(); RenderingHints hints = g2.getRenderingHints(); if (!OSPRuntime.isMac()) { g2.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE); g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); } double sx = (xmax-xmin)*panel.xPixPerUnit/image.getWidth(); double sy = (ymax-ymin)*panel.yPixPerUnit/image.getHeight(); g2.transform(AffineTransform.getTranslateInstance(panel.leftGutter+panel.xPixPerUnit*(xmin-panel.xmin), panel.topGutter+panel.yPixPerUnit*(panel.ymax-ymax))); g2.transform(AffineTransform.getScaleInstance(sx, sy)); g2.drawImage(image, 0, 0, panel); g2.setTransform(gat); g2.setRenderingHints(hints); }
/** * Draws the image on the panel. * * @param panel * @param g */
Draws the image on the panel
draw
{ "repo_name": "dobrown/tracker-mvn", "path": "src/main/java/org/opensourcephysics/display/MeasuredImage.java", "license": "gpl-3.0", "size": 4926 }
[ "java.awt.Graphics", "java.awt.Graphics2D", "java.awt.RenderingHints", "java.awt.geom.AffineTransform" ]
import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.geom.AffineTransform;
import java.awt.*; import java.awt.geom.*;
[ "java.awt" ]
java.awt;
640,814
@Override protected void doActionPerformed(ActionEvent e) { m_State.getCurrentPanel().redraw(); }
void function(ActionEvent e) { m_State.getCurrentPanel().redraw(); }
/** * Invoked when an action occurs. */
Invoked when an action occurs
doActionPerformed
{ "repo_name": "automenta/adams-core", "path": "src/main/java/adams/gui/flow/menu/ViewRedraw.java", "license": "gpl-3.0", "size": 1616 }
[ "java.awt.event.ActionEvent" ]
import java.awt.event.ActionEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
2,899,053
public void checkPersonExists(int personId) throws PersonNotFoundException { if (personRepository.getById(personId) == null) { throw new PersonNotFoundException(); } }
void function(int personId) throws PersonNotFoundException { if (personRepository.getById(personId) == null) { throw new PersonNotFoundException(); } }
/** * Checks whether a Person exists. * * @param personId Id of the Person * @throws PersonNotFoundException Person does not exist */
Checks whether a Person exists
checkPersonExists
{ "repo_name": "teiler/api.teiler.io", "path": "src/main/java/io/teiler/server/services/util/PersonUtil.java", "license": "mit", "size": 3221 }
[ "io.teiler.server.util.exceptions.PersonNotFoundException" ]
import io.teiler.server.util.exceptions.PersonNotFoundException;
import io.teiler.server.util.exceptions.*;
[ "io.teiler.server" ]
io.teiler.server;
969,169
public static final InputStream getPlainPasswordStream(final String path, final String user, final String password) throws Exception { return new ByteArrayInputStream( getPlainPasswordMessageContent(path, user, password) .getBytes("UTF-8")); }
static final InputStream function(final String path, final String user, final String password) throws Exception { return new ByteArrayInputStream( getPlainPasswordMessageContent(path, user, password) .getBytes("UTF-8")); }
/** * Creates a SOAP message with a plain password and username. * <p> * A freemarker template should be provided, it will be used to generate the * final message from the received parameters. * * @param path * path to the freemarker template * @param user * user to include in the message * @param password * password to include in the message * @return a SOAP message with a plain password and username * @throws Exception * if any error occurs during the message creation */
Creates a SOAP message with a plain password and username. A freemarker template should be provided, it will be used to generate the final message from the received parameters
getPlainPasswordStream
{ "repo_name": "Bernardo-MG/spring-soap-ws-security-example", "path": "src/test/java/com/bernardomg/example/swss/test/util/factory/SecureSoapMessages.java", "license": "mit", "size": 19631 }
[ "java.io.ByteArrayInputStream", "java.io.InputStream" ]
import java.io.ByteArrayInputStream; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
440,226
void delete(String workspaceId, String path, AsyncRequestCallback<Void> callback);
void delete(String workspaceId, String path, AsyncRequestCallback<Void> callback);
/** * Delete item. * * @param workspaceId * id of current workspace * @param path * path to item to delete * @param callback * the callback to use for the response */
Delete item
delete
{ "repo_name": "dhuebner/che", "path": "core/platform-api-client-gwt/che-core-client-gwt-project/src/main/java/org/eclipse/che/api/project/gwt/client/ProjectServiceClient.java", "license": "epl-1.0", "size": 13264 }
[ "org.eclipse.che.ide.rest.AsyncRequestCallback" ]
import org.eclipse.che.ide.rest.AsyncRequestCallback;
import org.eclipse.che.ide.rest.*;
[ "org.eclipse.che" ]
org.eclipse.che;
28,073
public void addRowBatch(Object[][] rowBatch, int size) throws CarbonSortKeyAndGroupByException { // if record holder list size is equal to sort buffer size then it will // sort the list and then write current list data to file synchronized (addRowsLock) { int sizeLeft = 0; if (entryCount + size >= sortBufferSize) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("************ Writing to temp file ********** "); } intermediateFileMerger.startMergingIfPossible(); Object[][] recordHolderListLocal = recordHolderList; sizeLeft = sortBufferSize - entryCount; if (sizeLeft > 0) { System.arraycopy(rowBatch, 0, recordHolderListLocal, entryCount, sizeLeft); } try { semaphore.acquire(); dataSorterAndWriterExecutorService .execute(new DataSorterAndWriter(recordHolderListLocal)); } catch (Exception e) { LOGGER.error( "exception occurred while trying to acquire a semaphore lock: " + e.getMessage()); throw new CarbonSortKeyAndGroupByException(e); } // create the new holder Array this.recordHolderList = new Object[this.sortBufferSize][]; this.entryCount = 0; size = size - sizeLeft; if (size == 0) { return; } } System.arraycopy(rowBatch, sizeLeft, recordHolderList, entryCount, size); entryCount += size; } }
void function(Object[][] rowBatch, int size) throws CarbonSortKeyAndGroupByException { synchronized (addRowsLock) { int sizeLeft = 0; if (entryCount + size >= sortBufferSize) { if (LOGGER.isDebugEnabled()) { LOGGER.debug(STR); } intermediateFileMerger.startMergingIfPossible(); Object[][] recordHolderListLocal = recordHolderList; sizeLeft = sortBufferSize - entryCount; if (sizeLeft > 0) { System.arraycopy(rowBatch, 0, recordHolderListLocal, entryCount, sizeLeft); } try { semaphore.acquire(); dataSorterAndWriterExecutorService .execute(new DataSorterAndWriter(recordHolderListLocal)); } catch (Exception e) { LOGGER.error( STR + e.getMessage()); throw new CarbonSortKeyAndGroupByException(e); } this.recordHolderList = new Object[this.sortBufferSize][]; this.entryCount = 0; size = size - sizeLeft; if (size == 0) { return; } } System.arraycopy(rowBatch, sizeLeft, recordHolderList, entryCount, size); entryCount += size; } }
/** * This method will be used to add new row * * @param rowBatch new rowBatch * @throws CarbonSortKeyAndGroupByException problem while writing */
This method will be used to add new row
addRowBatch
{ "repo_name": "sgururajshetty/carbondata", "path": "processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SortDataRows.java", "license": "apache-2.0", "size": 13661 }
[ "org.apache.carbondata.processing.sort.exception.CarbonSortKeyAndGroupByException" ]
import org.apache.carbondata.processing.sort.exception.CarbonSortKeyAndGroupByException;
import org.apache.carbondata.processing.sort.exception.*;
[ "org.apache.carbondata" ]
org.apache.carbondata;
2,294,732
public void setKeepaliveConnectionTimeMax(Period period) { _keepaliveTimeMax = period.getPeriod(); }
void function(Period period) { _keepaliveTimeMax = period.getPeriod(); }
/** * Sets the keepalive max. */
Sets the keepalive max
setKeepaliveConnectionTimeMax
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/network/listen/TcpPort.java", "license": "gpl-2.0", "size": 43907 }
[ "com.caucho.config.types.Period" ]
import com.caucho.config.types.Period;
import com.caucho.config.types.*;
[ "com.caucho.config" ]
com.caucho.config;
2,618,955
public final void add(Matrix2d matrix1, Matrix2d matrix2) { assert matrix1 != null : AssertMessages.notNullParameter(0); assert matrix2 != null : AssertMessages.notNullParameter(1); this.m00 = matrix1.m00 + matrix2.m00; this.m01 = matrix1.m01 + matrix2.m01; this.m10 = matrix1.m10 + matrix2.m10; this.m11 = matrix1.m11 + matrix2.m11; this.isIdentity = null; }
final void function(Matrix2d matrix1, Matrix2d matrix2) { assert matrix1 != null : AssertMessages.notNullParameter(0); assert matrix2 != null : AssertMessages.notNullParameter(1); this.m00 = matrix1.m00 + matrix2.m00; this.m01 = matrix1.m01 + matrix2.m01; this.m10 = matrix1.m10 + matrix2.m10; this.m11 = matrix1.m11 + matrix2.m11; this.isIdentity = null; }
/** * Sets the value of this matrix to the matrix sum of matrices m1 and m2. * * @param matrix1 * the first matrix * @param matrix2 * the second matrix */
Sets the value of this matrix to the matrix sum of matrices m1 and m2
add
{ "repo_name": "gallandarakhneorg/afc", "path": "core/maths/mathgeom/src/main/java/org/arakhne/afc/math/matrix/Matrix2d.java", "license": "apache-2.0", "size": 55348 }
[ "org.arakhne.afc.vmutil.asserts.AssertMessages" ]
import org.arakhne.afc.vmutil.asserts.AssertMessages;
import org.arakhne.afc.vmutil.asserts.*;
[ "org.arakhne.afc" ]
org.arakhne.afc;
19,308
public void select(AjaxRequestTarget target, T object) { T selectedObject = selectedObjectModel.getObject(); modelChanging(); selectedObjectModel.setObject(object); modelChanged(); updateBranch(selectedObject, target); updateBranch(object, target); for (ISelectListener<T> selectListener : selectListeners) { selectListener.onSelect(target, object); } }
void function(AjaxRequestTarget target, T object) { T selectedObject = selectedObjectModel.getObject(); modelChanging(); selectedObjectModel.setObject(object); modelChanged(); updateBranch(selectedObject, target); updateBranch(object, target); for (ISelectListener<T> selectListener : selectListeners) { selectListener.onSelect(target, object); } }
/** * Sets a given object as selected. * * @param target target that produces an Ajax response * @param object a given object */
Sets a given object as selected
select
{ "repo_name": "mhusar/lemming", "path": "src/main/java/lemming/tree/AbstractNestedTree.java", "license": "apache-2.0", "size": 7806 }
[ "org.apache.wicket.ajax.AjaxRequestTarget" ]
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.*;
[ "org.apache.wicket" ]
org.apache.wicket;
181,712
public AnnotationType getAnnotationType(AnnotationMirror annotationMirror) { Name key = getName( annotationMirror.getAnnotationType() ); AnnotationType annotationType = annotationTypeCache.get( key ); if ( annotationType != null ) { return annotationType; } if ( isConstraintAnnotation( annotationMirror ) ) { annotationType = AnnotationType.CONSTRAINT_ANNOTATION; } else if ( isMultiValuedConstraint( annotationMirror ) ) { annotationType = AnnotationType.MULTI_VALUED_CONSTRAINT_ANNOTATION; } else if ( isGraphValidationAnnotation( annotationMirror ) ) { annotationType = AnnotationType.GRAPH_VALIDATION_ANNOTATION; } else if ( isConstraintMetaAnnotation( annotationMirror ) ) { annotationType = AnnotationType.CONSTRAINT_META_ANNOTATION; } else if ( isGroupSequenceProviderAnnotation( annotationMirror ) ) { annotationType = AnnotationType.GROUP_SEQUENCE_PROVIDER_ANNOTATION; } else { annotationType = AnnotationType.NO_CONSTRAINT_ANNOTATION; } annotationTypeCache.put( key, annotationType ); return annotationType; }
AnnotationType function(AnnotationMirror annotationMirror) { Name key = getName( annotationMirror.getAnnotationType() ); AnnotationType annotationType = annotationTypeCache.get( key ); if ( annotationType != null ) { return annotationType; } if ( isConstraintAnnotation( annotationMirror ) ) { annotationType = AnnotationType.CONSTRAINT_ANNOTATION; } else if ( isMultiValuedConstraint( annotationMirror ) ) { annotationType = AnnotationType.MULTI_VALUED_CONSTRAINT_ANNOTATION; } else if ( isGraphValidationAnnotation( annotationMirror ) ) { annotationType = AnnotationType.GRAPH_VALIDATION_ANNOTATION; } else if ( isConstraintMetaAnnotation( annotationMirror ) ) { annotationType = AnnotationType.CONSTRAINT_META_ANNOTATION; } else if ( isGroupSequenceProviderAnnotation( annotationMirror ) ) { annotationType = AnnotationType.GROUP_SEQUENCE_PROVIDER_ANNOTATION; } else { annotationType = AnnotationType.NO_CONSTRAINT_ANNOTATION; } annotationTypeCache.put( key, annotationType ); return annotationType; }
/** * Returns the {@link AnnotationType} of the given annotation. * * @param annotationMirror The annotation mirror of interest. * * @return The given mirror's annotation type. */
Returns the <code>AnnotationType</code> of the given annotation
getAnnotationType
{ "repo_name": "jmartisk/hibernate-validator", "path": "annotation-processor/src/main/java/org/hibernate/validator/ap/util/ConstraintHelper.java", "license": "apache-2.0", "size": 26495 }
[ "javax.lang.model.element.AnnotationMirror", "javax.lang.model.element.Name" ]
import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Name;
import javax.lang.model.element.*;
[ "javax.lang" ]
javax.lang;
2,102,224
public static void setVersionIncremental(String versionIncremental) { ReflectionHelpers.setStaticField(Build.VERSION.class, "INCREMENTAL", versionIncremental); }
static void function(String versionIncremental) { ReflectionHelpers.setStaticField(Build.VERSION.class, STR, versionIncremental); }
/** * Sets the value of the {@link Build.VERSION#INCREMENTAL} field. * * It will be reset for the next test. */
Sets the value of the <code>Build.VERSION#INCREMENTAL</code> field. It will be reset for the next test
setVersionIncremental
{ "repo_name": "jongerrish/robolectric", "path": "shadows/framework/src/main/java/org/robolectric/shadows/ShadowBuild.java", "license": "mit", "size": 4227 }
[ "android.os.Build", "org.robolectric.util.ReflectionHelpers" ]
import android.os.Build; import org.robolectric.util.ReflectionHelpers;
import android.os.*; import org.robolectric.util.*;
[ "android.os", "org.robolectric.util" ]
android.os; org.robolectric.util;
2,864,634
public ActionForward saveManualEntry(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { LOG.debug("saveManualEdit() started"); LaborCorrectionForm laborCorrectionForm = (LaborCorrectionForm) form; LaborCorrectionDocument document = laborCorrectionForm.getLaborCorrectionDocument(); if (validLaborOriginEntry(laborCorrectionForm)) { int entryId = laborCorrectionForm.getLaborEntryForManualEdit().getEntryId(); // Find it and replace it with the one from the edit spot for (Iterator<OriginEntryFull> iter = laborCorrectionForm.getAllEntries().iterator(); iter.hasNext();) { OriginEntryFull element = iter.next(); if (element.getEntryId() == entryId) { iter.remove(); } } laborCorrectionForm.updateLaborEntryForManualEdit(); laborCorrectionForm.getAllEntries().add(laborCorrectionForm.getLaborEntryForManualEdit()); // we've modified the list of all entries, so repersist it SpringContext.getBean(GlCorrectionProcessOriginEntryService.class).persistAllEntries(laborCorrectionForm.getGlcpSearchResultsSequenceNumber(), laborCorrectionForm.getAllEntries()); // laborCorrectionForm.setDisplayEntries(null); laborCorrectionForm.setDisplayEntries(laborCorrectionForm.getAllEntries()); if (laborCorrectionForm.getShowOutputFlag()) { removeNonMatchingEntries(laborCorrectionForm.getDisplayEntries(), document.getCorrectionChangeGroup()); } // Clear out the additional row laborCorrectionForm.clearLaborEntryForManualEdit(); } // Calculate the debit/credit/row count updateDocumentSummary(document, laborCorrectionForm.getAllEntries(), laborCorrectionForm.isRestrictedFunctionalityMode()); // list has changed, we'll need to repage and resort applyPagingAndSortingFromPreviousPageView(laborCorrectionForm); return mapping.findForward(KFSConstants.MAPPING_BASIC); }
ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { LOG.debug(STR); LaborCorrectionForm laborCorrectionForm = (LaborCorrectionForm) form; LaborCorrectionDocument document = laborCorrectionForm.getLaborCorrectionDocument(); if (validLaborOriginEntry(laborCorrectionForm)) { int entryId = laborCorrectionForm.getLaborEntryForManualEdit().getEntryId(); for (Iterator<OriginEntryFull> iter = laborCorrectionForm.getAllEntries().iterator(); iter.hasNext();) { OriginEntryFull element = iter.next(); if (element.getEntryId() == entryId) { iter.remove(); } } laborCorrectionForm.updateLaborEntryForManualEdit(); laborCorrectionForm.getAllEntries().add(laborCorrectionForm.getLaborEntryForManualEdit()); SpringContext.getBean(GlCorrectionProcessOriginEntryService.class).persistAllEntries(laborCorrectionForm.getGlcpSearchResultsSequenceNumber(), laborCorrectionForm.getAllEntries()); laborCorrectionForm.setDisplayEntries(laborCorrectionForm.getAllEntries()); if (laborCorrectionForm.getShowOutputFlag()) { removeNonMatchingEntries(laborCorrectionForm.getDisplayEntries(), document.getCorrectionChangeGroup()); } laborCorrectionForm.clearLaborEntryForManualEdit(); } updateDocumentSummary(document, laborCorrectionForm.getAllEntries(), laborCorrectionForm.isRestrictedFunctionalityMode()); applyPagingAndSortingFromPreviousPageView(laborCorrectionForm); return mapping.findForward(KFSConstants.MAPPING_BASIC); }
/** * Save a changed row in the group * * @see org.kuali.kfs.gl.document.web.struts.CorrectionAction#saveManualEntry(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */
Save a changed row in the group
saveManualEntry
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/module/ld/document/web/struts/LaborCorrectionAction.java", "license": "agpl-3.0", "size": 74380 }
[ "java.util.Iterator", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.struts.action.ActionForm", "org.apache.struts.action.ActionForward", "org.apache.struts.action.ActionMapping", "org.kuali.kfs.gl.businessobject.OriginEntryFull", "org.kuali.kfs.gl.service.GlCorrectionProcessOriginEntryService", "org.kuali.kfs.module.ld.document.LaborCorrectionDocument", "org.kuali.kfs.sys.KFSConstants", "org.kuali.kfs.sys.context.SpringContext" ]
import java.util.Iterator; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.kfs.gl.businessobject.OriginEntryFull; import org.kuali.kfs.gl.service.GlCorrectionProcessOriginEntryService; import org.kuali.kfs.module.ld.document.LaborCorrectionDocument; import org.kuali.kfs.sys.KFSConstants; import org.kuali.kfs.sys.context.SpringContext;
import java.util.*; import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.kfs.gl.businessobject.*; import org.kuali.kfs.gl.service.*; import org.kuali.kfs.module.ld.document.*; import org.kuali.kfs.sys.*; import org.kuali.kfs.sys.context.*;
[ "java.util", "javax.servlet", "org.apache.struts", "org.kuali.kfs" ]
java.util; javax.servlet; org.apache.struts; org.kuali.kfs;
2,487,451
void responseDouble(String scenario) throws ErrorException, IOException, IllegalArgumentException;
void responseDouble(String scenario) throws ErrorException, IOException, IllegalArgumentException;
/** * Get a response with header value "value": 7e120 or -3.0. * * @param scenario Send a post request with header values "scenario": "positive" or "negative" * @throws ErrorException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters */
Get a response with header value "value": 7e120 or -3.0
responseDouble
{ "repo_name": "tbombach/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/header/Headers.java", "license": "mit", "size": 62060 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,232,782
private void addResultTime(OMObservationType xbObs, OmObservation sosObservation) throws OwsExceptionReport { TimeInstant resultTime = sosObservation.getResultTime(); Time phenomenonTime = sosObservation.getPhenomenonTime(); // get result time from SOS result time representation if (sosObservation.getResultTime() != null) { if (resultTime.equals(phenomenonTime)) { xbObs.addNewResultTime().setHref("#" + phenomenonTime.getGmlId()); } else { addResultTime(xbObs, resultTime); } } // if result time is not set, get result time from phenomenon time // representation else { if (phenomenonTime instanceof TimeInstant) { xbObs.addNewResultTime().setHref("#" + phenomenonTime.getGmlId()); } else if (phenomenonTime instanceof TimePeriod) { TimeInstant rsTime = new TimeInstant(((TimePeriod) sosObservation.getPhenomenonTime()).getEnd()); addResultTime(xbObs, rsTime); } } }
void function(OMObservationType xbObs, OmObservation sosObservation) throws OwsExceptionReport { TimeInstant resultTime = sosObservation.getResultTime(); Time phenomenonTime = sosObservation.getPhenomenonTime(); if (sosObservation.getResultTime() != null) { if (resultTime.equals(phenomenonTime)) { xbObs.addNewResultTime().setHref("#" + phenomenonTime.getGmlId()); } else { addResultTime(xbObs, resultTime); } } else { if (phenomenonTime instanceof TimeInstant) { xbObs.addNewResultTime().setHref("#" + phenomenonTime.getGmlId()); } else if (phenomenonTime instanceof TimePeriod) { TimeInstant rsTime = new TimeInstant(((TimePeriod) sosObservation.getPhenomenonTime()).getEnd()); addResultTime(xbObs, rsTime); } } }
/** * Method to add the result time to the XML observation object * * @param xbObs * XML observation object * @param sosObservation * SOS observation object * @throws OwsExceptionReport * If an error occurs. */
Method to add the result time to the XML observation object
addResultTime
{ "repo_name": "geomatico/52n-sos-4.0", "path": "coding/sos-v20/src/main/java/org/n52/sos/encode/AbstractOmEncoderv20.java", "license": "gpl-2.0", "size": 21388 }
[ "net.opengis.om.x20.OMObservationType", "org.n52.sos.ogc.gml.time.Time", "org.n52.sos.ogc.gml.time.TimeInstant", "org.n52.sos.ogc.gml.time.TimePeriod", "org.n52.sos.ogc.om.OmObservation", "org.n52.sos.ogc.ows.OwsExceptionReport" ]
import net.opengis.om.x20.OMObservationType; import org.n52.sos.ogc.gml.time.Time; import org.n52.sos.ogc.gml.time.TimeInstant; import org.n52.sos.ogc.gml.time.TimePeriod; import org.n52.sos.ogc.om.OmObservation; import org.n52.sos.ogc.ows.OwsExceptionReport;
import net.opengis.om.x20.*; import org.n52.sos.ogc.gml.time.*; import org.n52.sos.ogc.om.*; import org.n52.sos.ogc.ows.*;
[ "net.opengis.om", "org.n52.sos" ]
net.opengis.om; org.n52.sos;
2,536,124
public Metadata getMetaForOutlink(String targetURL, String sourceURL, Metadata parentMD) { Metadata md = filter(parentMD); // keep the path? if (trackPath) { md.addValue(urlPathKeyName, sourceURL); } // track depth if (trackDepth) { String existingDepth = md.getFirstValue(depthKeyName); int depth = 0; try { depth = Integer.parseInt(existingDepth); } catch (Exception e) { depth = 0; } md.setValue(depthKeyName, Integer.toString(++depth)); } return md; }
Metadata function(String targetURL, String sourceURL, Metadata parentMD) { Metadata md = filter(parentMD); if (trackPath) { md.addValue(urlPathKeyName, sourceURL); } if (trackDepth) { String existingDepth = md.getFirstValue(depthKeyName); int depth = 0; try { depth = Integer.parseInt(existingDepth); } catch (Exception e) { depth = 0; } md.setValue(depthKeyName, Integer.toString(++depth)); } return md; }
/** * Determine which metadata should be transfered to an outlink. Adds * additional metadata like the URL path. **/
Determine which metadata should be transfered to an outlink. Adds additional metadata like the URL path
getMetaForOutlink
{ "repo_name": "xujun10110/storm-crawler", "path": "core/src/main/java/com/digitalpebble/storm/crawler/util/MetadataTransfer.java", "license": "apache-2.0", "size": 5768 }
[ "com.digitalpebble.storm.crawler.Metadata" ]
import com.digitalpebble.storm.crawler.Metadata;
import com.digitalpebble.storm.crawler.*;
[ "com.digitalpebble.storm" ]
com.digitalpebble.storm;
2,179,536
public Type getComponent(int number) throws DataTypeException { try { return this.data[number]; } catch (ArrayIndexOutOfBoundsException e) { throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)"); } }
Type function(int number) throws DataTypeException { try { return this.data[number]; } catch (ArrayIndexOutOfBoundsException e) { throw new DataTypeException(STR + number + STR + getClass().getName() + STR + this.data.length + STR); } }
/** * Returns an individual data component. * * @param number The component number (0-indexed) * @throws DataTypeException if the given element number is out of range. */
Returns an individual data component
getComponent
{ "repo_name": "PapenfussLab/PathOS", "path": "Tools/Hl7Tools/src/main/java/org/petermac/hl7/model/v251/datatype/RMC.java", "license": "gpl-3.0", "size": 5274 }
[ "ca.uhn.hl7v2.model.DataTypeException", "ca.uhn.hl7v2.model.Type" ]
import ca.uhn.hl7v2.model.DataTypeException; import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.*;
[ "ca.uhn.hl7v2" ]
ca.uhn.hl7v2;
2,790,612
@see org.hl7.rim.QueryAck#setQueryResponseCode */ public void setQueryResponseCode(CS queryResponseCode) { if(queryResponseCode instanceof org.hl7.hibernate.ClonableCollection) queryResponseCode = ((org.hl7.hibernate.ClonableCollection<CS>) queryResponseCode).cloneHibernateCollectionIfNecessary(); _queryResponseCode = queryResponseCode; }
@see org.hl7.rim.QueryAck#setQueryResponseCode */ void function(CS queryResponseCode) { if(queryResponseCode instanceof org.hl7.hibernate.ClonableCollection) queryResponseCode = ((org.hl7.hibernate.ClonableCollection<CS>) queryResponseCode).cloneHibernateCollectionIfNecessary(); _queryResponseCode = queryResponseCode; }
/** Sets the property queryResponseCode. @see org.hl7.rim.QueryAck#setQueryResponseCode */
Sets the property queryResponseCode
setQueryResponseCode
{ "repo_name": "markusgumbel/dshl7", "path": "hl7-javasig/gencode/org/hl7/rim/impl/QueryAckImpl.java", "license": "apache-2.0", "size": 5431 }
[ "org.hl7.rim.QueryAck" ]
import org.hl7.rim.QueryAck;
import org.hl7.rim.*;
[ "org.hl7.rim" ]
org.hl7.rim;
148,336
public Principal authenticate(X509Certificate certs[]);
Principal function(X509Certificate certs[]);
/** * Return the Principal associated with the specified chain of X509 * client certificates. If there is none, return <code>null</code>. * * @param certs Array of client certificates, with the first one in * the array being the certificate of the client itself. */
Return the Principal associated with the specified chain of X509 client certificates. If there is none, return <code>null</code>
authenticate
{ "repo_name": "nrgaway/qubes-tools", "path": "experimental/tomcat/apache-tomcat-8.0.15-src/java/org/apache/catalina/Realm.java", "license": "gpl-2.0", "size": 7449 }
[ "java.security.Principal", "java.security.cert.X509Certificate" ]
import java.security.Principal; import java.security.cert.X509Certificate;
import java.security.*; import java.security.cert.*;
[ "java.security" ]
java.security;
773,631
public Analyzer getAnalyzer(Locale locale) throws CmsSearchException { Analyzer analyzer = null; String className = null; CmsSearchAnalyzer analyzerConf = m_analyzers.get(locale); if (analyzerConf == null) { throw new CmsSearchException(Messages.get().container(Messages.ERR_ANALYZER_NOT_FOUND_1, locale)); } try { analyzer = getAnalyzer(analyzerConf.getClassName()); } catch (Exception e) { throw new CmsSearchException(Messages.get().container(Messages.ERR_LOAD_ANALYZER_1, className), e); } return analyzer; }
Analyzer function(Locale locale) throws CmsSearchException { Analyzer analyzer = null; String className = null; CmsSearchAnalyzer analyzerConf = m_analyzers.get(locale); if (analyzerConf == null) { throw new CmsSearchException(Messages.get().container(Messages.ERR_ANALYZER_NOT_FOUND_1, locale)); } try { analyzer = getAnalyzer(analyzerConf.getClassName()); } catch (Exception e) { throw new CmsSearchException(Messages.get().container(Messages.ERR_LOAD_ANALYZER_1, className), e); } return analyzer; }
/** * Returns an analyzer for the given language.<p> * * The analyzer is selected according to the analyzer configuration.<p> * * @param locale the locale to get the analyzer for * @return the appropriate lucene analyzer * * @throws CmsSearchException if something goes wrong */
Returns an analyzer for the given language. The analyzer is selected according to the analyzer configuration
getAnalyzer
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/search/CmsSearchManager.java", "license": "lgpl-2.1", "size": 124143 }
[ "java.util.Locale", "org.apache.lucene.analysis.Analyzer" ]
import java.util.Locale; import org.apache.lucene.analysis.Analyzer;
import java.util.*; import org.apache.lucene.analysis.*;
[ "java.util", "org.apache.lucene" ]
java.util; org.apache.lucene;
2,471,683
@Test public void testGetOwnedProperty3() { if (interface1 != null) { String msg; msg = "The adaptation of Type.getOwnedProperty() seems to be wrong for Interfaces."; assertEquals(msg, 0, interface1.getOwnedProperty().size()); } // no else. }
void function() { if (interface1 != null) { String msg; msg = STR; assertEquals(msg, 0, interface1.getOwnedProperty().size()); } }
/** * <p> * A test case testing the operation {@link Type#getOwnedProperty()}. * </p> */
A test case testing the operation <code>Type#getOwnedProperty()</code>.
testGetOwnedProperty3
{ "repo_name": "dresden-ocl/dresdenocl", "path": "tests/org.dresdenocl.metamodels.test/src/org/dresdenocl/metamodels/test/tests/TestType.java", "license": "lgpl-3.0", "size": 23886 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,969,459
public void testNewFixedThreadPool1() { ExecutorService e = Executors.newFixedThreadPool(2); e.execute(new NoOpRunnable()); e.execute(new NoOpRunnable()); e.execute(new NoOpRunnable()); joinPool(e); }
void function() { ExecutorService e = Executors.newFixedThreadPool(2); e.execute(new NoOpRunnable()); e.execute(new NoOpRunnable()); e.execute(new NoOpRunnable()); joinPool(e); }
/** * A new newFixedThreadPool can execute runnables */
A new newFixedThreadPool can execute runnables
testNewFixedThreadPool1
{ "repo_name": "AdmireTheDistance/android_libcore", "path": "jsr166-tests/src/test/java/jsr166/ExecutorsTest.java", "license": "gpl-2.0", "size": 22307 }
[ "java.util.concurrent.ExecutorService", "java.util.concurrent.Executors" ]
import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,340,103
protected final void initialize(final boolean reverse, final int start) { Condition.INSTANCE.ensureAtLeast(start, -1, "The start must be at least -1"); this.reverse = reverse; this.previous = null; this.index = start != -1 ? start : (reverse ? getCount() - 1 : 0); int previousIndex = reverse ? this.index + 1 : this.index - 1; if (previousIndex >= 0 && previousIndex < getCount()) { this.current = getItem(previousIndex); } else { this.current = null; } }
final void function(final boolean reverse, final int start) { Condition.INSTANCE.ensureAtLeast(start, -1, STR); this.reverse = reverse; this.previous = null; this.index = start != -1 ? start : (reverse ? getCount() - 1 : 0); int previousIndex = reverse ? this.index + 1 : this.index - 1; if (previousIndex >= 0 && previousIndex < getCount()) { this.current = getItem(previousIndex); } else { this.current = null; } }
/** * Initializes the iterator. * * @param reverse * True, if the items should be iterated in reverse order, false otherwise * @param start * The index of the first item, which should be iterated, as an {@link Integer} value or * -1, if all items should be iterated */
Initializes the iterator
initialize
{ "repo_name": "michael-rapp/ChromeLikeTabSwitcher", "path": "library/src/main/java/de/mrapp/android/tabswitcher/iterator/AbstractItemIterator.java", "license": "apache-2.0", "size": 7360 }
[ "de.mrapp.util.Condition" ]
import de.mrapp.util.Condition;
import de.mrapp.util.*;
[ "de.mrapp.util" ]
de.mrapp.util;
514,700
private static boolean validateSyntax(List<String> parts) { final int lastIndex = parts.size() - 1; // Validate the last part specially, as it has different syntax rules. if (!validatePart(parts.get(lastIndex), true)) { return false; } for (int i = 0; i < lastIndex; i++) { String part = parts.get(i); if (!validatePart(part, false)) { return false; } } return true; } private static final CharMatcher DASH_MATCHER = CharMatcher.anyOf("-_"); private static final CharMatcher PART_CHAR_MATCHER = CharMatcher.JAVA_LETTER_OR_DIGIT.or(DASH_MATCHER);
static boolean function(List<String> parts) { final int lastIndex = parts.size() - 1; if (!validatePart(parts.get(lastIndex), true)) { return false; } for (int i = 0; i < lastIndex; i++) { String part = parts.get(i); if (!validatePart(part, false)) { return false; } } return true; } private static final CharMatcher DASH_MATCHER = CharMatcher.anyOf("-_"); private static final CharMatcher PART_CHAR_MATCHER = CharMatcher.JAVA_LETTER_OR_DIGIT.or(DASH_MATCHER);
/** * Validation method used by {@from} to ensure that the domain name is * syntactically valid according to RFC 1035. * * @return Is the domain name syntactically valid? */
Validation method used by to ensure that the domain name is syntactically valid according to RFC 1035
validateSyntax
{ "repo_name": "hambroperks/j2objc", "path": "guava/sources/com/google/common/net/InternetDomainName.java", "license": "apache-2.0", "size": 19519 }
[ "com.google.common.base.CharMatcher", "java.util.List" ]
import com.google.common.base.CharMatcher; import java.util.List;
import com.google.common.base.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,877,480
public static Attack getAutoAttack(Character character) throws SlickException, IOException, FontFormatException { // return attacksMap.get("autoA").make(character, gc); List<Requirement> reqs = new ArrayList<Requirement>(); return new Attack( character, "autoA", "autoAttack.png", EffectType.NORMAL, AttackType.MELEE, 0, reqs, true, 0, 2000, 40, new ArrayList<String>(), gc); }
static Attack function(Character character) throws SlickException, IOException, FontFormatException { List<Requirement> reqs = new ArrayList<Requirement>(); return new Attack( character, "autoA", STR, EffectType.NORMAL, AttackType.MELEE, 0, reqs, true, 0, 2000, 40, new ArrayList<String>(), gc); }
/** * Returns auto attack skill from base * * @param character Game character for skill * @return Auto attack skill * @throws SlickException * @throws IOException * @throws FontFormatException */
Returns auto attack skill from base
getAutoAttack
{ "repo_name": "Isangeles/Senlin", "path": "src/main/java/pl/isangeles/senlin/data/SkillsBase.java", "license": "gpl-2.0", "size": 5459 }
[ "java.awt.FontFormatException", "java.io.IOException", "java.util.ArrayList", "java.util.List", "org.newdawn.slick.SlickException", "pl.isangeles.senlin.core.character.Character", "pl.isangeles.senlin.core.effect.EffectType", "pl.isangeles.senlin.core.req.Requirement", "pl.isangeles.senlin.core.skill.Attack", "pl.isangeles.senlin.core.skill.AttackType" ]
import java.awt.FontFormatException; import java.io.IOException; import java.util.ArrayList; import java.util.List; import org.newdawn.slick.SlickException; import pl.isangeles.senlin.core.character.Character; import pl.isangeles.senlin.core.effect.EffectType; import pl.isangeles.senlin.core.req.Requirement; import pl.isangeles.senlin.core.skill.Attack; import pl.isangeles.senlin.core.skill.AttackType;
import java.awt.*; import java.io.*; import java.util.*; import org.newdawn.slick.*; import pl.isangeles.senlin.core.character.*; import pl.isangeles.senlin.core.effect.*; import pl.isangeles.senlin.core.req.*; import pl.isangeles.senlin.core.skill.*;
[ "java.awt", "java.io", "java.util", "org.newdawn.slick", "pl.isangeles.senlin" ]
java.awt; java.io; java.util; org.newdawn.slick; pl.isangeles.senlin;
1,053,456
@Override public void enterElementValue(@NotNull JavaParser.ElementValueContext ctx) { }
@Override public void enterElementValue(@NotNull JavaParser.ElementValueContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitArrayInitializer
{ "repo_name": "martinaguero/deep", "path": "src/org/trimatek/deep/lexer/JavaBaseListener.java", "license": "apache-2.0", "size": 39286 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
1,030,616
@Override public boolean onPrepareOptionsMenu(Menu menu) { if (RWGService.isRunning()) { menu.findItem(R.id.rwg_start).setEnabled(false); menu.findItem(R.id.rwg_end).setEnabled(true); } else { menu.findItem(R.id.rwg_start).setEnabled(true); menu.findItem(R.id.rwg_end).setEnabled(false); } SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); int trackerState = sp.getInt(BackgroundTrackerActivity.SHARED_STATE, -1); // Log.i(TAG, " Preferences= " + sp.getAll().toString()); // Log.i(TAG, "onPrepareOptionsMenu trackerState = " + trackerState); // if (trackerState != BackgroundTrackerActivity.RUNNING && // trackerState != BackgroundTrackerActivity.PAUSED) { // menu.findItem(R.id.track_menu_item).setEnabled(true); // } else { // menu.findItem(R.id.track_menu_item).setEnabled(false); // } return super.onPrepareOptionsMenu(menu); }
boolean function(Menu menu) { if (RWGService.isRunning()) { menu.findItem(R.id.rwg_start).setEnabled(false); menu.findItem(R.id.rwg_end).setEnabled(true); } else { menu.findItem(R.id.rwg_start).setEnabled(true); menu.findItem(R.id.rwg_end).setEnabled(false); } SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this); int trackerState = sp.getInt(BackgroundTrackerActivity.SHARED_STATE, -1); return super.onPrepareOptionsMenu(menu); }
/** * Updates the RWG Start/End menus based on whether RWG is running or not. * @see android.app.Activity#onPrepareOptionsMenu(android.view.Menu) */
Updates the RWG Start/End menus based on whether RWG is running or not
onPrepareOptionsMenu
{ "repo_name": "google-code-export/posit-mobile", "path": "android/src/org/hfoss/posit/PositMain.java", "license": "lgpl-2.1", "size": 10433 }
[ "android.content.SharedPreferences", "android.preference.PreferenceManager", "android.view.Menu", "org.hfoss.posit.adhoc.RWGService" ]
import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.view.Menu; import org.hfoss.posit.adhoc.RWGService;
import android.content.*; import android.preference.*; import android.view.*; import org.hfoss.posit.adhoc.*;
[ "android.content", "android.preference", "android.view", "org.hfoss.posit" ]
android.content; android.preference; android.view; org.hfoss.posit;
2,416,353
public static String askForPassword(final Frame topframe) { PanelBuilder builder = new PanelBuilder(new FormLayout("p,2px,p", "p,2px,p")); //$NON-NLS-1$ //$NON-NLS-2$ CellConstraints cc = new CellConstraints(); JLabel label = createI18NFormLabel("EMailHelper.PASSWORD"); //$NON-NLS-1$ //$NON-NLS-2$ JPasswordField passField = createPasswordField(25); JCheckBox savePassword = createCheckBox(getResourceString("EMailHelper.SAVE_PASSWORD")); //$NON-NLS-1$ builder.add(label, cc.xy(1,1)); builder.add(passField, cc.xy(3,1)); builder.add(savePassword, cc.xy(3,3)); JOptionPane.showConfirmDialog(topframe, builder.getPanel(), getResourceString("EMailHelper.PASSWORD_TITLE"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); //$NON-NLS-1$ String passwordText = new String(passField.getPassword()); if (savePassword.isSelected()) { AppPreferences appPrefs = AppPreferences.getRemote(); if (StringUtils.isNotEmpty(passwordText)) { appPrefs.put("settings.email.password", Encryption.encrypt(passwordText)); //$NON-NLS-1$ } } return passwordText; }
static String function(final Frame topframe) { PanelBuilder builder = new PanelBuilder(new FormLayout(STR, STR)); CellConstraints cc = new CellConstraints(); JLabel label = createI18NFormLabel(STR); JPasswordField passField = createPasswordField(25); JCheckBox savePassword = createCheckBox(getResourceString(STR)); builder.add(label, cc.xy(1,1)); builder.add(passField, cc.xy(3,1)); builder.add(savePassword, cc.xy(3,3)); JOptionPane.showConfirmDialog(topframe, builder.getPanel(), getResourceString(STR), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); String passwordText = new String(passField.getPassword()); if (savePassword.isSelected()) { AppPreferences appPrefs = AppPreferences.getRemote(); if (StringUtils.isNotEmpty(passwordText)) { appPrefs.put(STR, Encryption.encrypt(passwordText)); } } return passwordText; }
/** * Asks for a password. * @param topframe the parent frame * @return the password */
Asks for a password
askForPassword
{ "repo_name": "specify/specify6", "path": "src/edu/ku/brc/helpers/EMailHelper.java", "license": "gpl-2.0", "size": 41845 }
[ "com.jgoodies.forms.builder.PanelBuilder", "com.jgoodies.forms.layout.CellConstraints", "com.jgoodies.forms.layout.FormLayout", "edu.ku.brc.af.prefs.AppPreferences", "edu.ku.brc.ui.UIHelper", "edu.ku.brc.ui.UIRegistry", "java.awt.Frame", "javax.swing.JCheckBox", "javax.swing.JLabel", "javax.swing.JOptionPane", "javax.swing.JPasswordField", "org.apache.commons.lang.StringUtils" ]
import com.jgoodies.forms.builder.PanelBuilder; import com.jgoodies.forms.layout.CellConstraints; import com.jgoodies.forms.layout.FormLayout; import edu.ku.brc.af.prefs.AppPreferences; import edu.ku.brc.ui.UIHelper; import edu.ku.brc.ui.UIRegistry; import java.awt.Frame; import javax.swing.JCheckBox; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPasswordField; import org.apache.commons.lang.StringUtils;
import com.jgoodies.forms.builder.*; import com.jgoodies.forms.layout.*; import edu.ku.brc.af.prefs.*; import edu.ku.brc.ui.*; import java.awt.*; import javax.swing.*; import org.apache.commons.lang.*;
[ "com.jgoodies.forms", "edu.ku.brc", "java.awt", "javax.swing", "org.apache.commons" ]
com.jgoodies.forms; edu.ku.brc; java.awt; javax.swing; org.apache.commons;
522,973
public static void saveHttpCacheToStream(OutputStream os, HttpCache cache) throws IllegalArgumentException, IOException { if (os == null) { throw new IllegalArgumentException("Output stream must be not null"); } if (cache == null) { throw new IllegalArgumentException("Cache must be not null"); } ArrayList<HttpCacheEntry> entryList = new ArrayList<>(); Collection<String> cacheKeys = cache.keySet(); for (String key : cacheKeys) { HttpCacheEntry entry = cache.get(key); if (entry != null) { if (entry.isExpired()) { LOG.info("Cached entry \"" + entry.getKey() + "\" is obsolete and will be removed"); continue; } entryList.add(entry); if (LOG.isTraceEnabled()) { LOG.trace("Submitted cache entry with key[" + entry.getKey() + "]"); } } } try (ObjectOutputStream oos = new ObjectOutputStream(os)) { oos.writeObject(entryList); } }
static void function(OutputStream os, HttpCache cache) throws IllegalArgumentException, IOException { if (os == null) { throw new IllegalArgumentException(STR); } if (cache == null) { throw new IllegalArgumentException(STR); } ArrayList<HttpCacheEntry> entryList = new ArrayList<>(); Collection<String> cacheKeys = cache.keySet(); for (String key : cacheKeys) { HttpCacheEntry entry = cache.get(key); if (entry != null) { if (entry.isExpired()) { LOG.info(STRSTR\STR); continue; } entryList.add(entry); if (LOG.isTraceEnabled()) { LOG.trace("Submitted cache entry with key[STR]"); } } } try (ObjectOutputStream oos = new ObjectOutputStream(os)) { oos.writeObject(entryList); } }
/** * Saves the current state of the given cache (entries) to the specified * output stream. * * @param os The data output stream. * @param cache Cache instance to store. * @throws IllegalArgumentException if the given output steam or cache is * <code>null</code>. * @throws IOException if an I/O error occurs while writing stream header. * * @see #saveHttpCacheToFile(java.io.File, io.pictura.servlet.HttpCache) * * @since 1.2 */
Saves the current state of the given cache (entries) to the specified output stream
saveHttpCacheToStream
{ "repo_name": "skremp/pictura-io", "path": "servlet/src/main/java/io/pictura/servlet/HttpCacheServlet.java", "license": "apache-2.0", "size": 24827 }
[ "java.io.IOException", "java.io.ObjectOutputStream", "java.io.OutputStream", "java.util.ArrayList", "java.util.Collection" ]
import java.io.IOException; import java.io.ObjectOutputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Collection;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,874,751
public AzureMySqlLinkedService withPassword(AzureKeyVaultSecretReference password) { if (this.innerTypeProperties() == null) { this.innerTypeProperties = new AzureMySqlLinkedServiceTypeProperties(); } this.innerTypeProperties().withPassword(password); return this; }
AzureMySqlLinkedService function(AzureKeyVaultSecretReference password) { if (this.innerTypeProperties() == null) { this.innerTypeProperties = new AzureMySqlLinkedServiceTypeProperties(); } this.innerTypeProperties().withPassword(password); return this; }
/** * Set the password property: The Azure key vault secret reference of password in connection string. * * @param password the password value to set. * @return the AzureMySqlLinkedService object itself. */
Set the password property: The Azure key vault secret reference of password in connection string
withPassword
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/models/AzureMySqlLinkedService.java", "license": "mit", "size": 5890 }
[ "com.azure.resourcemanager.datafactory.fluent.models.AzureMySqlLinkedServiceTypeProperties" ]
import com.azure.resourcemanager.datafactory.fluent.models.AzureMySqlLinkedServiceTypeProperties;
import com.azure.resourcemanager.datafactory.fluent.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
876,134
public static double cpc(List<Double> u, List<Double> v, double median) { if (Lists.isEmpty(u) || Lists.isEmpty(v)) return Double.NaN; double sumNum = 0.0, sumDen1 = 0.0, sumDen2 = 0.0; for (int i = 0; i < u.size(); i++) { double ui = u.get(i) - median; double vi = v.get(i) - median; sumNum += ui * vi; sumDen1 += Math.pow(ui, 2); sumDen2 += Math.pow(vi, 2); } return sumNum / (Math.sqrt(sumDen1) * Math.sqrt(sumDen2)); }
static double function(List<Double> u, List<Double> v, double median) { if (Lists.isEmpty(u) Lists.isEmpty(v)) return Double.NaN; double sumNum = 0.0, sumDen1 = 0.0, sumDen2 = 0.0; for (int i = 0; i < u.size(); i++) { double ui = u.get(i) - median; double vi = v.get(i) - median; sumNum += ui * vi; sumDen1 += Math.pow(ui, 2); sumDen2 += Math.pow(vi, 2); } return sumNum / (Math.sqrt(sumDen1) * Math.sqrt(sumDen2)); }
/** * Calculate Constrained Pearson Correlation (CPC) * * @param u * user u's ratings * @param v * user v's ratings * @param median * median rating in a rating range * * @return Constrained PCC Correlation (CPC) */
Calculate Constrained Pearson Correlation (CPC)
cpc
{ "repo_name": "guoguibing/HappyCoding", "path": "happycoding/src/main/java/happy/coding/math/Sims.java", "license": "gpl-3.0", "size": 5035 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,427,363
public boolean isEmpty() { return ((this.financialDocumentHundredCentAmount == null || this.financialDocumentHundredCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentFiftyCentAmount == null || this.financialDocumentFiftyCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentTwentyFiveCentAmount == null || this.financialDocumentTwentyFiveCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentTenCentAmount == null || this.financialDocumentTenCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentFiveCentAmount == null || this.financialDocumentFiveCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentOneCentAmount == null || this.financialDocumentOneCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentOtherCentAmount == null || this.financialDocumentOtherCentAmount.equals(KualiDecimal.ZERO))); }
boolean function() { return ((this.financialDocumentHundredCentAmount == null this.financialDocumentHundredCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentFiftyCentAmount == null this.financialDocumentFiftyCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentTwentyFiveCentAmount == null this.financialDocumentTwentyFiveCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentTenCentAmount == null this.financialDocumentTenCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentFiveCentAmount == null this.financialDocumentFiveCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentOneCentAmount == null this.financialDocumentOneCentAmount.equals(KualiDecimal.ZERO)) && (this.financialDocumentOtherCentAmount == null this.financialDocumentOtherCentAmount.equals(KualiDecimal.ZERO))); }
/** * Is this coin detail empty of any value? * * @return true if any field at all is neither null nor the amount is zero */
Is this coin detail empty of any value
isEmpty
{ "repo_name": "ua-eas/kfs-devops-automation-fork", "path": "kfs-core/src/main/java/org/kuali/kfs/fp/businessobject/CoinDetail.java", "license": "agpl-3.0", "size": 28331 }
[ "org.kuali.rice.core.api.util.type.KualiDecimal" ]
import org.kuali.rice.core.api.util.type.KualiDecimal;
import org.kuali.rice.core.api.util.type.*;
[ "org.kuali.rice" ]
org.kuali.rice;
2,174,984
public void removeAlarms( @Nonnull String[] alarmNames ) throws InternalException, CloudException;
void function( @Nonnull String[] alarmNames ) throws InternalException, CloudException;
/** * Removes the provided alarms. * * @param alarmNames the alarm names to remove * @throws InternalException * @throws CloudException */
Removes the provided alarms
removeAlarms
{ "repo_name": "OSS-TheWeatherCompany/dasein-cloud-core", "path": "src/main/java/org/dasein/cloud/platform/MonitoringSupport.java", "license": "apache-2.0", "size": 4269 }
[ "javax.annotation.Nonnull", "org.dasein.cloud.CloudException", "org.dasein.cloud.InternalException" ]
import javax.annotation.Nonnull; import org.dasein.cloud.CloudException; import org.dasein.cloud.InternalException;
import javax.annotation.*; import org.dasein.cloud.*;
[ "javax.annotation", "org.dasein.cloud" ]
javax.annotation; org.dasein.cloud;
2,029,773
void setInputStream(InputStream in);
void setInputStream(InputStream in);
/** * Set the input stream that can be used by the shell to read input. * @param in */
Set the input stream that can be used by the shell to read input
setInputStream
{ "repo_name": "cagney/mina-sshd-service", "path": "sshd-core/src/main/java/org/apache/sshd/server/Command.java", "license": "apache-2.0", "size": 2608 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
541,211
@Override public void processIncoming(DistributionManager dm, String adviseePath, boolean removeProfile, boolean exchangeProfiles, final List<Profile> replyProfiles, LogWriterI18n logger) { try { Assert.assertTrue(adviseePath != null, "adviseePath was null"); LocalRegion lclRgn; int oldLevel = LocalRegion .setThreadInitLevelRequirement(LocalRegion.ANY_INIT); try { lclRgn = LocalRegion.getRegionFromPath(dm.getSystem(), adviseePath); } finally { LocalRegion.setThreadInitLevelRequirement(oldLevel); } // remove failed event handling for GemFireXD if (lclRgn != null && this.regionInitialized && (lclRgn instanceof DistributedRegion)) { ((DistributedRegion)lclRgn) .clearFailedEventsForMember(getDistributedMember()); } if (lclRgn instanceof CacheDistributionAdvisee) { if (lclRgn.isUsedForPartitionedRegionBucket()) { if (!((BucketRegion)lclRgn).isPartitionedRegionOpen()) { return; } } handleCacheDistributionAdvisee((CacheDistributionAdvisee)lclRgn, adviseePath, removeProfile, exchangeProfiles, true, replyProfiles, logger); } else { if (lclRgn == null) { handleCacheDistributionAdvisee(PartitionedRegionHelper .getProxyBucketRegion(GemFireCacheImpl.getInstance(), adviseePath, false), adviseePath, removeProfile, exchangeProfiles, false, replyProfiles, logger); } else { if (logger.fineEnabled()) logger.fine("While processing UpdateAttributes message, " + "region has local scope: " + adviseePath); } } } catch (PRLocallyDestroyedException fre) { if (logger.fineEnabled()) { logger.fine("<Region Locally destroyed> /// " + this); } } catch (RegionDestroyedException e) { if (logger.fineEnabled()) logger.fine("<region destroyed> /// " + this); } }
void function(DistributionManager dm, String adviseePath, boolean removeProfile, boolean exchangeProfiles, final List<Profile> replyProfiles, LogWriterI18n logger) { try { Assert.assertTrue(adviseePath != null, STR); LocalRegion lclRgn; int oldLevel = LocalRegion .setThreadInitLevelRequirement(LocalRegion.ANY_INIT); try { lclRgn = LocalRegion.getRegionFromPath(dm.getSystem(), adviseePath); } finally { LocalRegion.setThreadInitLevelRequirement(oldLevel); } if (lclRgn != null && this.regionInitialized && (lclRgn instanceof DistributedRegion)) { ((DistributedRegion)lclRgn) .clearFailedEventsForMember(getDistributedMember()); } if (lclRgn instanceof CacheDistributionAdvisee) { if (lclRgn.isUsedForPartitionedRegionBucket()) { if (!((BucketRegion)lclRgn).isPartitionedRegionOpen()) { return; } } handleCacheDistributionAdvisee((CacheDistributionAdvisee)lclRgn, adviseePath, removeProfile, exchangeProfiles, true, replyProfiles, logger); } else { if (lclRgn == null) { handleCacheDistributionAdvisee(PartitionedRegionHelper .getProxyBucketRegion(GemFireCacheImpl.getInstance(), adviseePath, false), adviseePath, removeProfile, exchangeProfiles, false, replyProfiles, logger); } else { if (logger.fineEnabled()) logger.fine(STR + STR + adviseePath); } } } catch (PRLocallyDestroyedException fre) { if (logger.fineEnabled()) { logger.fine(STR<region destroyed> } }
/** * Used to process an incoming cache profile. */
Used to process an incoming cache profile
processIncoming
{ "repo_name": "SnappyDataInc/snappy-store", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/CacheDistributionAdvisor.java", "license": "apache-2.0", "size": 46007 }
[ "com.gemstone.gemfire.distributed.internal.DistributionManager", "com.gemstone.gemfire.i18n.LogWriterI18n", "com.gemstone.gemfire.internal.Assert", "com.gemstone.gemfire.internal.cache.partitioned.PRLocallyDestroyedException", "java.util.List" ]
import com.gemstone.gemfire.distributed.internal.DistributionManager; import com.gemstone.gemfire.i18n.LogWriterI18n; import com.gemstone.gemfire.internal.Assert; import com.gemstone.gemfire.internal.cache.partitioned.PRLocallyDestroyedException; import java.util.List;
import com.gemstone.gemfire.distributed.internal.*; import com.gemstone.gemfire.i18n.*; import com.gemstone.gemfire.internal.*; import com.gemstone.gemfire.internal.cache.partitioned.*; import java.util.*;
[ "com.gemstone.gemfire", "java.util" ]
com.gemstone.gemfire; java.util;
2,788,235
public static String checkForRestrictedValue(final DBTableInfo tblInfo) { if (tblInfo != null) { PermissionSettings perm = tblInfo.getPermissions(); if (perm != null) { if (!perm.canView()) { return UIRegistry.getResourceString("RESTRICTED"); } } } return null; }
static String function(final DBTableInfo tblInfo) { if (tblInfo != null) { PermissionSettings perm = tblInfo.getPermissions(); if (perm != null) { if (!perm.canView()) { return UIRegistry.getResourceString(STR); } } } return null; }
/** * Checks to see if a DBTableInfo is restricted or not and returns the "Restricted" sring or null. * @param tblInfo the table info * @return a localized string "(Resticted)" or null */
Checks to see if a DBTableInfo is restricted or not and returns the "Restricted" sring or null
checkForRestrictedValue
{ "repo_name": "specify/specify6", "path": "src/edu/ku/brc/af/ui/forms/FormHelper.java", "license": "gpl-2.0", "size": 31436 }
[ "edu.ku.brc.af.auth.PermissionSettings", "edu.ku.brc.af.core.db.DBTableInfo", "edu.ku.brc.ui.UIRegistry" ]
import edu.ku.brc.af.auth.PermissionSettings; import edu.ku.brc.af.core.db.DBTableInfo; import edu.ku.brc.ui.UIRegistry;
import edu.ku.brc.af.auth.*; import edu.ku.brc.af.core.db.*; import edu.ku.brc.ui.*;
[ "edu.ku.brc" ]
edu.ku.brc;
2,135,878
public void setListener(SyncListener listener) { this.listener = listener; }
void function(SyncListener listener) { this.listener = listener; }
/** * Set a sync listener. * * @param listener the listener or null to remove it */
Set a sync listener
setListener
{ "repo_name": "zhangdakun/funasyn", "path": "externals/java-sdk/sync/src/main/java/com/funambol/sync/client/BaseSyncSource.java", "license": "agpl-3.0", "size": 27040 }
[ "com.funambol.sync.SyncListener" ]
import com.funambol.sync.SyncListener;
import com.funambol.sync.*;
[ "com.funambol.sync" ]
com.funambol.sync;
1,704,830
Date getDateUpdated();
Date getDateUpdated();
/** * Returns the date when the record was last updated * * @return the dateUpdated */
Returns the date when the record was last updated
getDateUpdated
{ "repo_name": "bullhorn/starter-kit-spring-maven", "path": "src/main/java/com/client/core/base/model/jpa/JpaEntity.java", "license": "mit", "size": 769 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
1,919,138
@Test public void putSignature() throws SignatureException { final Credentials credentials = new Credentials("AKIAIOSFODNN7EXAMPLE", "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"); final SignatureDetails details = new SignatureDetails(HttpVerb.PUT, "", "image/jpeg", "Tue, 27 Mar 2007 21:15:45 +0000", "", "/johnsmith/photos/puppy.jpg", credentials); assertThat(Signature.signature(details), is("MyyxeRY7whkBe+bq8fHCL/2kKUg=")); }
void function() throws SignatureException { final Credentials credentials = new Credentials(STR, STR); final SignatureDetails details = new SignatureDetails(HttpVerb.PUT, STRimage/jpegSTRTue, 27 Mar 2007 21:15:45 +0000", STR/johnsmith/photos/puppy.jpgSTRMyyxeRY7whkBe+bq8fHCL/2kKUg=")); }
/** * Example taken from the AWS S3 documentation site: http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheAuthenticationHeader */
Example taken from the AWS S3 documentation site: HREF
putSignature
{ "repo_name": "DenverM80/ds3_java_sdk", "path": "ds3-sdk/src/test/java/com/spectralogic/ds3client/utils/Signature_Test.java", "license": "apache-2.0", "size": 4047 }
[ "com.spectralogic.ds3client.models.common.Credentials", "com.spectralogic.ds3client.models.common.SignatureDetails", "com.spectralogic.ds3client.networking.HttpVerb", "java.security.SignatureException" ]
import com.spectralogic.ds3client.models.common.Credentials; import com.spectralogic.ds3client.models.common.SignatureDetails; import com.spectralogic.ds3client.networking.HttpVerb; import java.security.SignatureException;
import com.spectralogic.ds3client.models.common.*; import com.spectralogic.ds3client.networking.*; import java.security.*;
[ "com.spectralogic.ds3client", "java.security" ]
com.spectralogic.ds3client; java.security;
1,606,937
private void runExpansion(SkylarkRuleContext ruleContext, String command, String expectedPattern) throws Exception { assertMatches( "Expanded string", expectedPattern, (String) evalRuleContextCode( ruleContext, String.format("ruleContext.expand_location('$(%s)')", command))); }
void function(SkylarkRuleContext ruleContext, String command, String expectedPattern) throws Exception { assertMatches( STR, expectedPattern, (String) evalRuleContextCode( ruleContext, String.format(STR, command))); }
/** * Invokes ctx.expand_location() with the given parameters and checks whether this led to the * expected result * @param ruleContext The rule context * @param command Either "location" or "locations". This only matters when the label has multiple * targets * @param expectedPattern Regex pattern that matches the expected result */
Invokes ctx.expand_location() with the given parameters and checks whether this led to the expected result
runExpansion
{ "repo_name": "anupcshan/bazel", "path": "src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleImplementationFunctionsTest.java", "license": "apache-2.0", "size": 41587 }
[ "com.google.devtools.build.lib.rules.SkylarkRuleContext" ]
import com.google.devtools.build.lib.rules.SkylarkRuleContext;
import com.google.devtools.build.lib.rules.*;
[ "com.google.devtools" ]
com.google.devtools;
779,688
protected Validator createValidator(FaceletContext ctx) { return ctx.getFacesContext().getApplication().createValidator(this.getValidatorId(ctx)); }
Validator function(FaceletContext ctx) { return ctx.getFacesContext().getApplication().createValidator(this.getValidatorId(ctx)); }
/** * Uses the specified "validatorId" to get a new Validator instance from the Application. * * @see javax.faces.application.Application#createValidator(java.lang.String) * @see javax.faces.view.facelets.ValidatorHandler#createValidator(javax.faces.view.facelets.FaceletContext) */
Uses the specified "validatorId" to get a new Validator instance from the Application
createValidator
{ "repo_name": "kulinski/myfaces", "path": "impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/core/ValidateDelegateHandler.java", "license": "apache-2.0", "size": 3078 }
[ "javax.faces.validator.Validator", "javax.faces.view.facelets.FaceletContext" ]
import javax.faces.validator.Validator; import javax.faces.view.facelets.FaceletContext;
import javax.faces.validator.*; import javax.faces.view.facelets.*;
[ "javax.faces" ]
javax.faces;
130,043
protected static void writeUnsupportedTypeMessage (final UnsupportedVariantTypeException ex) { if (isLogUnsupportedTypes()) { if (unsupportedMessage == null) unsupportedMessage = new LinkedList(); Long vt = new Long(ex.getVariantType()); if (!unsupportedMessage.contains(vt)) { System.err.println(ex.getMessage()); unsupportedMessage.add(vt); } } }
static void function (final UnsupportedVariantTypeException ex) { if (isLogUnsupportedTypes()) { if (unsupportedMessage == null) unsupportedMessage = new LinkedList(); Long vt = new Long(ex.getVariantType()); if (!unsupportedMessage.contains(vt)) { System.err.println(ex.getMessage()); unsupportedMessage.add(vt); } } }
/** * <p>Writes a warning to <code>System.err</code> that a variant type is * unsupported by HPSF. Such a warning is written only once for each variant * type. Log messages can be turned on or off by </p> * * @param ex The exception to log */
Writes a warning to <code>System.err</code> that a variant type is unsupported by HPSF. Such a warning is written only once for each variant type. Log messages can be turned on or off by
writeUnsupportedTypeMessage
{ "repo_name": "dgault/bioformats", "path": "components/forks/poi/src/loci/poi/hpsf/VariantSupport.java", "license": "gpl-2.0", "size": 21542 }
[ "java.util.LinkedList" ]
import java.util.LinkedList;
import java.util.*;
[ "java.util" ]
java.util;
352,535
public Socket createSocket() throws RemoteException { Socket s; try { s = DefaultRMISocketFactory.getNonNullClientFactory(csf) .createSocket(host, port); } catch (java.net.UnknownHostException uhe) { // rmi.80=Unable to connect to server {0} throw new java.rmi.UnknownHostException( Messages.getString("rmi.80", toString()), uhe); //$NON-NLS-1$ } catch (java.net.ConnectException ce) { throw new java.rmi.ConnectException( Messages.getString("rmi.80", toString()), ce); //$NON-NLS-1$ } catch (IOException ioe) { throw new ConnectIOException( Messages.getString("rmi.80", toString()), ioe); //$NON-NLS-1$ } return s; }
Socket function() throws RemoteException { Socket s; try { s = DefaultRMISocketFactory.getNonNullClientFactory(csf) .createSocket(host, port); } catch (java.net.UnknownHostException uhe) { throw new java.rmi.UnknownHostException( Messages.getString(STR, toString()), uhe); } catch (java.net.ConnectException ce) { throw new java.rmi.ConnectException( Messages.getString(STR, toString()), ce); } catch (IOException ioe) { throw new ConnectIOException( Messages.getString(STR, toString()), ioe); } return s; }
/** * Creates and returns socket. * * @return created socket */
Creates and returns socket
createSocket
{ "repo_name": "freeVM/freeVM", "path": "enhanced/archive/classlib/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/transport/Endpoint.java", "license": "apache-2.0", "size": 13464 }
[ "java.io.IOException", "java.net.Socket", "java.net.UnknownHostException", "java.rmi.ConnectIOException", "java.rmi.RemoteException", "org.apache.harmony.rmi.internal.nls.Messages" ]
import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; import java.rmi.ConnectIOException; import java.rmi.RemoteException; import org.apache.harmony.rmi.internal.nls.Messages;
import java.io.*; import java.net.*; import java.rmi.*; import org.apache.harmony.rmi.internal.nls.*;
[ "java.io", "java.net", "java.rmi", "org.apache.harmony" ]
java.io; java.net; java.rmi; org.apache.harmony;
1,641,373
public static void deleteEmptyParents(File file, File rootDir) { try { deleteEmptyParents(file, rootDir.getCanonicalPath()); } catch (IOException e) { String msg = "Unable to convert rootDir to canonical form [rootDir=" + rootDir + "]"; throw new RuntimeException(msg, e); } }
static void function(File file, File rootDir) { try { deleteEmptyParents(file, rootDir.getCanonicalPath()); } catch (IOException e) { String msg = STR + rootDir + "]"; throw new RuntimeException(msg, e); } }
/** * Same behaviour as for {@link Deleter#deleteEmptyParents(File, String)} but with the * <code>rootDir</code> parameter specified as a {@link java.io.File} object. * * @see Deleter#deleteEmptyParents(File, String) * @param file * @param rootDir */
Same behaviour as for <code>Deleter#deleteEmptyParents(File, String)</code> but with the <code>rootDir</code> parameter specified as a <code>java.io.File</code> object
deleteEmptyParents
{ "repo_name": "loftuxab/community-edition-old", "path": "projects/core/source/java/org/alfresco/util/Deleter.java", "license": "lgpl-3.0", "size": 3861 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,345,315
public int doStartTag() throws JspException { evaluateExpressions(); return(super.doStartTag()); }
int function() throws JspException { evaluateExpressions(); return(super.doStartTag()); }
/** * Process the start tag. * * @exception JspException if a JSP exception has occurred */
Process the start tag
doStartTag
{ "repo_name": "codelibs/cl-struts", "path": "contrib/el/src/share/org/apache/strutsel/taglib/logic/ELIterateTag.java", "license": "apache-2.0", "size": 8948 }
[ "javax.servlet.jsp.JspException" ]
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.*;
[ "javax.servlet" ]
javax.servlet;
1,869,685
public void renderAppendBuffer(AbstractShape s) { long totaltime = System.nanoTime(); int elementCountU = 100; int elementCountV = 100; int antialias = 1; boolean antialiasXonly = false; int width = 640 * antialias; int height = 480 * antialias; float density = 1.06f; Configuration.loadConfiguration(); CLBuffer<FloatBuffer> samplingPoints = generateSamplingPoints( elementCountV, elementCountU); System.out.println("LocalMemSize " + device.getLocalMemSize()); if (antialiasXonly) { height = 480; } CLBuffer<FloatBuffer> screenBuffer = generateScreenBuffer(width, height); CLBuffer<IntBuffer> priorities = context.createIntBuffer(1 + 1, Mem.READ_ONLY); priorities.getBuffer().put(0); priorities.getBuffer().put(10); priorities.getBuffer().rewind(); device.createCommandQueue().putWriteBuffer(priorities, false).finish(); CLBuffer<FloatBuffer> mu = context.createFloatBuffer(1 + 1, Mem.READ_ONLY); mu.getBuffer().put((float) MaterialsDB.getMaterial("Air").getDensity()); mu.getBuffer().put((float) density); mu.getBuffer().rewind(); device.createCommandQueue().putWriteBuffer(mu, false).finish(); SimpleMatrix proj = new SimpleMatrix( "[[-446.54410228325054 -511.663331416319 -3.105016244120407E-13 -224000.0]; [-233.8488155484563 53.98825304252766 599.0000000000002 -168000.00000000003]; [-0.9743700647852351 0.2249510543438652 0.0 -700.0]]"); OpenCLAppendBufferRenderer render = new OpenCLAppendBufferRenderer( device); render.init(width, height); OpenCLEvaluatable clSpline; clSpline = OpenCLUtil.getOpenCLEvaluatableSubclass(s, device); ((OpenCLUniformTextureSurfaceBSpline) clSpline).setClockwise(false); // TODO: // check // why // this // is // not // set // correctly // automatically CLBuffer<FloatBuffer> outputBuffer = context.createFloatBuffer( elementCountU * elementCountV * 3, Mem.READ_WRITE); render.setProjectionMatrix(proj); double timePoints = Configuration.getGlobalConfiguration() .getGeometry().getProjectionMatrices().length; ImageStack stack; if (antialiasXonly) { stack = new ImageStack(width / antialias, height, (int) timePoints); } else { stack = new ImageStack(width / antialias, height / antialias, (int) timePoints); } for (int k = 0; k < timePoints; k++) { SimpleMatrix matrix = Configuration.getGlobalConfiguration() .getGeometry().getProjectionMatrices()[k].computeP(); for (int i = 0; i < 4; i++) { matrix.setElementValue(0, i, matrix.getElement(0, i) * antialias); if (!antialiasXonly) matrix.setElementValue(1, i, matrix.getElement(1, i) * antialias); } render.setProjectionMatrix(matrix); samplingPoints.release(); samplingPoints = generateSamplingPoints(elementCountV, elementCountU); long time = System.nanoTime(); clSpline.evaluate(samplingPoints, outputBuffer); // // project points render.project(outputBuffer); // draw on the screen if (clSpline.isClockwise()) { render.drawTrianglesGlobal(outputBuffer, screenBuffer, 1, elementCountU, elementCountV, -1); } else { render.drawTrianglesGlobal(outputBuffer, screenBuffer, 1, elementCountU, elementCountV, 1); } time = System.nanoTime() - time; System.out.println("Open CL computation for projection " + k + " global took: " + (time / 1000000) + "ms "); // evaluate absorption model time = System.nanoTime(); render.drawScreenMonochromatic(screenBuffer, mu, priorities); time = System.nanoTime() - time; System.out.println("monochromatic screen buffer drawing took: " + (time / 1000000) + "ms "); CLCommandQueue clc = device.createCommandQueue(); clc.putReadBuffer(screenBuffer, true).finish(); clc.release(); float[] array = new float[width * height]; for (int j = 0; j < height; j++) { for (int i = 0; i < width; i++) { array[(j * width) + i] = screenBuffer.getBuffer().get(); } } screenBuffer.getBuffer().rewind(); ImageProcessor fl = new FloatProcessor(width, height); fl.setPixels(array); if (antialias > 1) { fl.setInterpolationMethod(ImageProcessor.BILINEAR); if (antialiasXonly) { fl = fl.resize(width / antialias, height); } else { fl = fl.resize(width / antialias, height / antialias); } } stack.setPixels(fl.getPixels(), k + 1); render.resetBuffers(); screenBuffer.release(); screenBuffer = generateScreenBuffer(width, height); } totaltime = System.nanoTime() - totaltime; System.out.println("Open CL computation for all projections took: " + (totaltime / 1000000) + "ms "); ImagePlus image = new ImagePlus("GPU Projections", stack); image.show(); render.resetBuffers(); long time = System.nanoTime(); time = System.nanoTime(); render.drawScreen(screenBuffer); time = System.nanoTime() - time; System.out.println("screen buffer drawing took: " + (time / 1000000) + "ms "); }
void function(AbstractShape s) { long totaltime = System.nanoTime(); int elementCountU = 100; int elementCountV = 100; int antialias = 1; boolean antialiasXonly = false; int width = 640 * antialias; int height = 480 * antialias; float density = 1.06f; Configuration.loadConfiguration(); CLBuffer<FloatBuffer> samplingPoints = generateSamplingPoints( elementCountV, elementCountU); System.out.println(STR + device.getLocalMemSize()); if (antialiasXonly) { height = 480; } CLBuffer<FloatBuffer> screenBuffer = generateScreenBuffer(width, height); CLBuffer<IntBuffer> priorities = context.createIntBuffer(1 + 1, Mem.READ_ONLY); priorities.getBuffer().put(0); priorities.getBuffer().put(10); priorities.getBuffer().rewind(); device.createCommandQueue().putWriteBuffer(priorities, false).finish(); CLBuffer<FloatBuffer> mu = context.createFloatBuffer(1 + 1, Mem.READ_ONLY); mu.getBuffer().put((float) MaterialsDB.getMaterial("Air").getDensity()); mu.getBuffer().put((float) density); mu.getBuffer().rewind(); device.createCommandQueue().putWriteBuffer(mu, false).finish(); SimpleMatrix proj = new SimpleMatrix( STR); OpenCLAppendBufferRenderer render = new OpenCLAppendBufferRenderer( device); render.init(width, height); OpenCLEvaluatable clSpline; clSpline = OpenCLUtil.getOpenCLEvaluatableSubclass(s, device); ((OpenCLUniformTextureSurfaceBSpline) clSpline).setClockwise(false); CLBuffer<FloatBuffer> outputBuffer = context.createFloatBuffer( elementCountU * elementCountV * 3, Mem.READ_WRITE); render.setProjectionMatrix(proj); double timePoints = Configuration.getGlobalConfiguration() .getGeometry().getProjectionMatrices().length; ImageStack stack; if (antialiasXonly) { stack = new ImageStack(width / antialias, height, (int) timePoints); } else { stack = new ImageStack(width / antialias, height / antialias, (int) timePoints); } for (int k = 0; k < timePoints; k++) { SimpleMatrix matrix = Configuration.getGlobalConfiguration() .getGeometry().getProjectionMatrices()[k].computeP(); for (int i = 0; i < 4; i++) { matrix.setElementValue(0, i, matrix.getElement(0, i) * antialias); if (!antialiasXonly) matrix.setElementValue(1, i, matrix.getElement(1, i) * antialias); } render.setProjectionMatrix(matrix); samplingPoints.release(); samplingPoints = generateSamplingPoints(elementCountV, elementCountU); long time = System.nanoTime(); clSpline.evaluate(samplingPoints, outputBuffer); render.project(outputBuffer); if (clSpline.isClockwise()) { render.drawTrianglesGlobal(outputBuffer, screenBuffer, 1, elementCountU, elementCountV, -1); } else { render.drawTrianglesGlobal(outputBuffer, screenBuffer, 1, elementCountU, elementCountV, 1); } time = System.nanoTime() - time; System.out.println(STR + k + STR + (time / 1000000) + STR); time = System.nanoTime(); render.drawScreenMonochromatic(screenBuffer, mu, priorities); time = System.nanoTime() - time; System.out.println(STR + (time / 1000000) + STR); CLCommandQueue clc = device.createCommandQueue(); clc.putReadBuffer(screenBuffer, true).finish(); clc.release(); float[] array = new float[width * height]; for (int j = 0; j < height; j++) { for (int i = 0; i < width; i++) { array[(j * width) + i] = screenBuffer.getBuffer().get(); } } screenBuffer.getBuffer().rewind(); ImageProcessor fl = new FloatProcessor(width, height); fl.setPixels(array); if (antialias > 1) { fl.setInterpolationMethod(ImageProcessor.BILINEAR); if (antialiasXonly) { fl = fl.resize(width / antialias, height); } else { fl = fl.resize(width / antialias, height / antialias); } } stack.setPixels(fl.getPixels(), k + 1); render.resetBuffers(); screenBuffer.release(); screenBuffer = generateScreenBuffer(width, height); } totaltime = System.nanoTime() - totaltime; System.out.println(STR + (totaltime / 1000000) + STR); ImagePlus image = new ImagePlus(STR, stack); image.show(); render.resetBuffers(); long time = System.nanoTime(); time = System.nanoTime(); render.drawScreen(screenBuffer); time = System.nanoTime() - time; System.out.println(STR + (time / 1000000) + STR); }
/** * This method renders a Spline and displays it in an imagej window * * @param s * Spline */
This method renders a Spline and displays it in an imagej window
renderAppendBuffer
{ "repo_name": "PhilippSchlieper/CONRAD", "path": "src/edu/stanford/rsl/tutorial/motion/estimation/OpenCLSplineRenderer.java", "license": "gpl-3.0", "size": 27925 }
[ "com.jogamp.opencl.CLBuffer", "com.jogamp.opencl.CLCommandQueue", "com.jogamp.opencl.CLMemory", "edu.stanford.rsl.conrad.geometry.AbstractShape", "edu.stanford.rsl.conrad.numerics.SimpleMatrix", "edu.stanford.rsl.conrad.opencl.OpenCLAppendBufferRenderer", "edu.stanford.rsl.conrad.opencl.OpenCLEvaluatable", "edu.stanford.rsl.conrad.opencl.OpenCLUtil", "edu.stanford.rsl.conrad.opencl.shapes.OpenCLUniformTextureSurfaceBSpline", "edu.stanford.rsl.conrad.physics.materials.database.MaterialsDB", "edu.stanford.rsl.conrad.utils.Configuration", "java.nio.FloatBuffer", "java.nio.IntBuffer" ]
import com.jogamp.opencl.CLBuffer; import com.jogamp.opencl.CLCommandQueue; import com.jogamp.opencl.CLMemory; import edu.stanford.rsl.conrad.geometry.AbstractShape; import edu.stanford.rsl.conrad.numerics.SimpleMatrix; import edu.stanford.rsl.conrad.opencl.OpenCLAppendBufferRenderer; import edu.stanford.rsl.conrad.opencl.OpenCLEvaluatable; import edu.stanford.rsl.conrad.opencl.OpenCLUtil; import edu.stanford.rsl.conrad.opencl.shapes.OpenCLUniformTextureSurfaceBSpline; import edu.stanford.rsl.conrad.physics.materials.database.MaterialsDB; import edu.stanford.rsl.conrad.utils.Configuration; import java.nio.FloatBuffer; import java.nio.IntBuffer;
import com.jogamp.opencl.*; import edu.stanford.rsl.conrad.geometry.*; import edu.stanford.rsl.conrad.numerics.*; import edu.stanford.rsl.conrad.opencl.*; import edu.stanford.rsl.conrad.opencl.shapes.*; import edu.stanford.rsl.conrad.physics.materials.database.*; import edu.stanford.rsl.conrad.utils.*; import java.nio.*;
[ "com.jogamp.opencl", "edu.stanford.rsl", "java.nio" ]
com.jogamp.opencl; edu.stanford.rsl; java.nio;
1,190,569
public ContextMapping<?> get(String name) { ContextMapping<?> contextMapping = contextNameMap.get(name); if (contextMapping == null) { List<String> keys = new ArrayList<>(contextNameMap.keySet()); Collections.sort(keys); throw new IllegalArgumentException("Unknown context name [" + name + "], must be one of " + keys.toString()); } return contextMapping; } /** * Adds a context-enabled field for all the defined mappings to <code>document</code> * see {@link org.elasticsearch.search.suggest.completion.context.ContextMappings.TypedContextField}
ContextMapping<?> function(String name) { ContextMapping<?> contextMapping = contextNameMap.get(name); if (contextMapping == null) { List<String> keys = new ArrayList<>(contextNameMap.keySet()); Collections.sort(keys); throw new IllegalArgumentException(STR + name + STR + keys.toString()); } return contextMapping; } /** * Adds a context-enabled field for all the defined mappings to <code>document</code> * see {@link org.elasticsearch.search.suggest.completion.context.ContextMappings.TypedContextField}
/** * Returns a context mapping by its name */
Returns a context mapping by its name
get
{ "repo_name": "robin13/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/suggest/completion/context/ContextMappings.java", "license": "apache-2.0", "size": 12305 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
959,532
public static KnownAmountSwapPaymentPeriod.Builder builder() { return new KnownAmountSwapPaymentPeriod.Builder(); } private KnownAmountSwapPaymentPeriod( Payment payment, LocalDate startDate, LocalDate endDate, LocalDate unadjustedStartDate, LocalDate unadjustedEndDate) { JodaBeanUtils.notNull(payment, "payment"); JodaBeanUtils.notNull(startDate, "startDate"); JodaBeanUtils.notNull(endDate, "endDate"); JodaBeanUtils.notNull(unadjustedStartDate, "unadjustedStartDate"); JodaBeanUtils.notNull(unadjustedEndDate, "unadjustedEndDate"); this.payment = payment; this.startDate = startDate; this.endDate = endDate; this.unadjustedStartDate = unadjustedStartDate; this.unadjustedEndDate = unadjustedEndDate; validate(); }
static KnownAmountSwapPaymentPeriod.Builder function() { return new KnownAmountSwapPaymentPeriod.Builder(); } private KnownAmountSwapPaymentPeriod( Payment payment, LocalDate startDate, LocalDate endDate, LocalDate unadjustedStartDate, LocalDate unadjustedEndDate) { JodaBeanUtils.notNull(payment, STR); JodaBeanUtils.notNull(startDate, STR); JodaBeanUtils.notNull(endDate, STR); JodaBeanUtils.notNull(unadjustedStartDate, STR); JodaBeanUtils.notNull(unadjustedEndDate, STR); this.payment = payment; this.startDate = startDate; this.endDate = endDate; this.unadjustedStartDate = unadjustedStartDate; this.unadjustedEndDate = unadjustedEndDate; validate(); }
/** * Returns a builder used to create an instance of the bean. * @return the builder, not null */
Returns a builder used to create an instance of the bean
builder
{ "repo_name": "OpenGamma/Strata", "path": "modules/product/src/main/java/com/opengamma/strata/product/swap/KnownAmountSwapPaymentPeriod.java", "license": "apache-2.0", "size": 22020 }
[ "com.opengamma.strata.basics.currency.Payment", "java.time.LocalDate", "org.joda.beans.JodaBeanUtils" ]
import com.opengamma.strata.basics.currency.Payment; import java.time.LocalDate; import org.joda.beans.JodaBeanUtils;
import com.opengamma.strata.basics.currency.*; import java.time.*; import org.joda.beans.*;
[ "com.opengamma.strata", "java.time", "org.joda.beans" ]
com.opengamma.strata; java.time; org.joda.beans;
917,715
public static AddressFilter notEquals(AddressField field, String value) { return new AddressFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); } } class SnapshotFilter extends ListFilter { private static final long serialVersionUID = 8757711630092406747L; private SnapshotFilter(SnapshotField field, ComparisonOperator operator, Object value) { super(field.getSelector(), operator, value); }
static AddressFilter function(AddressField field, String value) { return new AddressFilter(checkNotNull(field), ComparisonOperator.NE, checkNotNull(value)); } } class SnapshotFilter extends ListFilter { private static final long serialVersionUID = 8757711630092406747L; private SnapshotFilter(SnapshotField field, ComparisonOperator operator, Object value) { super(field.getSelector(), operator, value); }
/** * Returns a not-equals filter for the given field and string value. For string fields, * {@code value} is interpreted as a regular expression using RE2 syntax. {@code value} must * match the entire field. * * @see <a href="https://github.com/google/re2/wiki/Syntax">RE2</a> */
Returns a not-equals filter for the given field and string value. For string fields, value is interpreted as a regular expression using RE2 syntax. value must match the entire field
notEquals
{ "repo_name": "jabubake/google-cloud-java", "path": "google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java", "license": "apache-2.0", "size": 93984 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,569,135
IParameterList<IParameterExecution> getProcessedParameters();
IParameterList<IParameterExecution> getProcessedParameters();
/** * Returns the list of the processed execution parameters. * <hr> * @return List of processed execution parameters. */
Returns the list of the processed execution parameters.
getProcessedParameters
{ "repo_name": "ressec/demeter", "path": "demeter-base/src/main/java/com/heliosphere/demeter/base/runner/result/IExecutionResult.java", "license": "apache-2.0", "size": 3722 }
[ "com.heliosphere.demeter.base.runner.parameter.execution.IParameterExecution", "com.heliosphere.demeter.base.runner.parameter.list.IParameterList" ]
import com.heliosphere.demeter.base.runner.parameter.execution.IParameterExecution; import com.heliosphere.demeter.base.runner.parameter.list.IParameterList;
import com.heliosphere.demeter.base.runner.parameter.execution.*; import com.heliosphere.demeter.base.runner.parameter.list.*;
[ "com.heliosphere.demeter" ]
com.heliosphere.demeter;
1,351,388