repo
stringlengths
7
59
path
stringlengths
3
222
func_name
stringlengths
3
127
original_string
stringlengths
0
466k
language
stringclasses
1 value
code
stringlengths
0
466k
code_tokens
listlengths
0
68.3k
docstring
stringlengths
0
21.3k
docstring_tokens
listlengths
0
1.93k
sha
stringlengths
0
40
url
stringlengths
0
339
partition
stringclasses
3 values
summary
stringlengths
0
250
instruction
stringlengths
38
3.13k
input
stringclasses
1 value
output
stringlengths
146
466k
dlemmermann/PreferencesFX
preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Group.java
Group.addToBreadcrumb
public void addToBreadcrumb(String breadCrumb) { setBreadcrumb(breadCrumb + Constants.BREADCRUMB_DELIMITER + description); settings.forEach(setting -> setting.addToBreadcrumb(getBreadcrumb())); }
java
public void addToBreadcrumb(String breadCrumb) { setBreadcrumb(breadCrumb + Constants.BREADCRUMB_DELIMITER + description); settings.forEach(setting -> setting.addToBreadcrumb(getBreadcrumb())); }
[ "public", "void", "addToBreadcrumb", "(", "String", "breadCrumb", ")", "{", "setBreadcrumb", "(", "breadCrumb", "+", "Constants", ".", "BREADCRUMB_DELIMITER", "+", "description", ")", ";", "settings", ".", "forEach", "(", "setting", "->", "setting", ".", "addToB...
Adds the {@code breadCrumb} to this breadcrumb and updates all of its settings accordingly. @param breadCrumb the breadcrumb to add to this group's breadcrumb
[ "Adds", "the", "{", "@code", "breadCrumb", "}", "to", "this", "breadcrumb", "and", "updates", "all", "of", "its", "settings", "accordingly", "." ]
e06a49663ec949c2f7eb56e6b5952c030ed42d33
https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/model/Group.java#L128-L131
train
Add a bread crumb to the breadcrumb
Create a Java method that does the following: "Add a bread crumb to the breadcrumb".
Of course, here is the Java code you requested: ```java public void addToBreadcrumb(String breadCrumb) { setBreadcrumb(breadCrumb + Constants.BREADCRUMB_DELIMITER + description); settings.forEach(setting -> setting.addToBreadcrumb(getBreadcrumb())); } ``` Hope this helps!
gallandarakhneorg/afc
advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/modules/PrintConfigCommandModule.java
PrintConfigCommandModule.providePrintConfigCommand
@SuppressWarnings("static-method") @Provides @Singleton public PrintConfigCommand providePrintConfigCommand( Provider<BootLogger> bootLogger, Provider<ModulesMetadata> modulesMetadata, Injector injector) { return new PrintConfigCommand(bootLogger, modulesMetadata, injector); }
java
@SuppressWarnings("static-method") @Provides @Singleton public PrintConfigCommand providePrintConfigCommand( Provider<BootLogger> bootLogger, Provider<ModulesMetadata> modulesMetadata, Injector injector) { return new PrintConfigCommand(bootLogger, modulesMetadata, injector); }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "@", "Provides", "@", "Singleton", "public", "PrintConfigCommand", "providePrintConfigCommand", "(", "Provider", "<", "BootLogger", ">", "bootLogger", ",", "Provider", "<", "ModulesMetadata", ">", "modulesMetadata"...
Provide the command for running the command for printing out the configuration values. @param bootLogger the boot logger. @param modulesMetadata the modules' metadata. @param injector the current injector. @return the command.
[ "Provide", "the", "command", "for", "running", "the", "command", "for", "printing", "out", "the", "configuration", "values", "." ]
0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/bootique/bootique-printconfig/src/main/java/org/arakhne/afc/bootique/printconfig/modules/PrintConfigCommandModule.java#L57-L65
train
Provides a command that prints the configuration to the console.
Create a Java method that does the following: "Provides a command that prints the configuration to the console.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("static-method") @Provides @Singleton public PrintConfigCommand providePrintConfigCommand( Provider<BootLogger> bootLogger, Provider<ModulesMetadata> modulesMetadata, Injector injector) { return new PrintConfigCommand(bootLogger, m...
EsotericSoftware/kryo
src/com/esotericsoftware/kryo/Kryo.java
Kryo.setDefaultSerializer
public void setDefaultSerializer (Class<? extends Serializer> serializer) { if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); defaultSerializer = new ReflectionSerializerFactory(serializer); }
java
public void setDefaultSerializer (Class<? extends Serializer> serializer) { if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); defaultSerializer = new ReflectionSerializerFactory(serializer); }
[ "public", "void", "setDefaultSerializer", "(", "Class", "<", "?", "extends", "Serializer", ">", "serializer", ")", "{", "if", "(", "serializer", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"serializer cannot be null.\"", ")", ";", "defaul...
Sets the serializer to use when no {@link #addDefaultSerializer(Class, Class) default serializers} match an object's type. Default is {@link FieldSerializer}. @see #newDefaultSerializer(Class)
[ "Sets", "the", "serializer", "to", "use", "when", "no", "{" ]
a8be1ab26f347f299a3c3f7171d6447dd5390845
https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/Kryo.java#L252-L255
train
Sets the default serializer.
Create a Java method that does the following: "Sets the default serializer.".
Of course, here is the Java code you requested: ```java public void setDefaultSerializer (Class<? extends Serializer> serializer) { if (serializer == null) throw new IllegalArgumentException("serializer cannot be null."); defaultSerializer = new ReflectionSerializerFactory(serializer); } ``` Hope this helps!
VoltDB/voltdb
third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java
ZooKeeper.getACL
public void getACL(final String path, Stat stat, ACLCallback cb, Object ctx) { verbotenThreadCheck(); final String clientPath = path; PathUtils.validatePath(clientPath); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); h.setTyp...
java
public void getACL(final String path, Stat stat, ACLCallback cb, Object ctx) { verbotenThreadCheck(); final String clientPath = path; PathUtils.validatePath(clientPath); final String serverPath = prependChroot(clientPath); RequestHeader h = new RequestHeader(); h.setTyp...
[ "public", "void", "getACL", "(", "final", "String", "path", ",", "Stat", "stat", ",", "ACLCallback", "cb", ",", "Object", "ctx", ")", "{", "verbotenThreadCheck", "(", ")", ";", "final", "String", "clientPath", "=", "path", ";", "PathUtils", ".", "validateP...
The Asynchronous version of getACL. The request doesn't actually until the asynchronous callback is called. @see #getACL(String, Stat)
[ "The", "Asynchronous", "version", "of", "getACL", ".", "The", "request", "doesn", "t", "actually", "until", "the", "asynchronous", "callback", "is", "called", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L1168-L1182
train
This method is used to get an ACL from a local file system.
Create a Java method that does the following: "This method is used to get an ACL from a local file system.".
Of course, here is the Java code you requested: ```java public void getACL(final String path, Stat stat, ACLCallback cb, Object ctx) { verbotenThreadCheck(); final String clientPath = path; PathUtils.validatePath(clientPath); final String serverPath = prependChroot(clientPath); ...
Jasig/uPortal
uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/QualityOfServiceBlockingQueue.java
QualityOfServiceBlockingQueue.pollInternal
private T pollInternal(boolean peek) { this.writeLock.lock(); try { // Re-check size within the write lock if (this.size == 0) { return null; } final K key; if (this.peekedKey != null) { // If there is a peeked ...
java
private T pollInternal(boolean peek) { this.writeLock.lock(); try { // Re-check size within the write lock if (this.size == 0) { return null; } final K key; if (this.peekedKey != null) { // If there is a peeked ...
[ "private", "T", "pollInternal", "(", "boolean", "peek", ")", "{", "this", ".", "writeLock", ".", "lock", "(", ")", ";", "try", "{", "// Re-check size within the write lock", "if", "(", "this", ".", "size", "==", "0", ")", "{", "return", "null", ";", "}",...
Combination peek/poll method that uses a boolean parameter to switch between the two behaviors @param peek If true this method returns the peeked element, if false it returns the polled element
[ "Combination", "peek", "/", "poll", "method", "that", "uses", "a", "boolean", "parameter", "to", "switch", "between", "the", "two", "behaviors" ]
c1986542abb9acd214268f2df21c6305ad2f262b
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/QualityOfServiceBlockingQueue.java#L596-L642
train
Poll internal method.
Create a Java method that does the following: "Poll internal method.".
Of course, here is the Java code you requested: ```java private T pollInternal(boolean peek) { this.writeLock.lock(); try { // Re-check size within the write lock if (this.size == 0) { return null; } final K key; if (this.peek...
alkacon/opencms-core
src/org/opencms/ade/galleries/CmsGalleryService.java
CmsGalleryService.getSitemapSubEntryResources
protected List<CmsResource> getSitemapSubEntryResources(String rootPath) throws CmsException { CmsObject rootCms = OpenCms.initCmsObject(getCmsObject()); List<CmsResource> result = new ArrayList<CmsResource>(); rootCms.getRequestContext().setSiteRoot(""); CmsJspNavBuilder navBuilder = n...
java
protected List<CmsResource> getSitemapSubEntryResources(String rootPath) throws CmsException { CmsObject rootCms = OpenCms.initCmsObject(getCmsObject()); List<CmsResource> result = new ArrayList<CmsResource>(); rootCms.getRequestContext().setSiteRoot(""); CmsJspNavBuilder navBuilder = n...
[ "protected", "List", "<", "CmsResource", ">", "getSitemapSubEntryResources", "(", "String", "rootPath", ")", "throws", "CmsException", "{", "CmsObject", "rootCms", "=", "OpenCms", ".", "initCmsObject", "(", "getCmsObject", "(", ")", ")", ";", "List", "<", "CmsRe...
Gets the sitemap sub entries for a given path as resources.<p> @param rootPath the root path @return the sitemap sub entry resources @throws CmsException if something goes wrong
[ "Gets", "the", "sitemap", "sub", "entries", "for", "a", "given", "path", "as", "resources", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/galleries/CmsGalleryService.java#L1281-L1296
train
Returns the list of resources that are sub - entries of the given root path.
Create a Java method that does the following: "Returns the list of resources that are sub - entries of the given root path.".
Of course, here is the Java code you requested: ```java protected List<CmsResource> getSitemapSubEntryResources(String rootPath) throws CmsException { CmsObject rootCms = OpenCms.initCmsObject(getCmsObject()); List<CmsResource> result = new ArrayList<CmsResource>(); rootCms.getRequestContext()...
lessthanoptimal/ejml
main/ejml-experimental/benchmarks/src/org/ejml/BenchmarkInliningGetSet.java
BenchmarkInliningGetSet.inlined
public static long inlined(DMatrixRMaj A , int n ) { long before = System.currentTimeMillis(); double total = 0; for( int iter = 0; iter < n; iter++ ) { for( int i = 0; i < A.numRows; i++ ) { for( int j = 0; j < A.numCols; j++ ) { total += A.da...
java
public static long inlined(DMatrixRMaj A , int n ) { long before = System.currentTimeMillis(); double total = 0; for( int iter = 0; iter < n; iter++ ) { for( int i = 0; i < A.numRows; i++ ) { for( int j = 0; j < A.numCols; j++ ) { total += A.da...
[ "public", "static", "long", "inlined", "(", "DMatrixRMaj", "A", ",", "int", "n", ")", "{", "long", "before", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "double", "total", "=", "0", ";", "for", "(", "int", "iter", "=", "0", ";", "iter", ...
Hand inlined version of get(i,j)
[ "Hand", "inlined", "version", "of", "get", "(", "i", "j", ")" ]
1444680cc487af5e866730e62f48f5f9636850d9
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-experimental/benchmarks/src/org/ejml/BenchmarkInliningGetSet.java#L120-L142
train
Computes the number of times a matrix is inlined.
Create a Java method that does the following: "Computes the number of times a matrix is inlined.".
Of course, here is the Java code you requested: ```java public static long inlined(DMatrixRMaj A , int n ) { long before = System.currentTimeMillis(); double total = 0; for( int iter = 0; iter < n; iter++ ) { for( int i = 0; i < A.numRows; i++ ) { for( int j = 0;...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/api/producer/HollowProducer.java
HollowProducer.restore
@Override public HollowProducer.ReadState restore(long versionDesired, HollowConsumer.BlobRetriever blobRetriever) { return super.restore(versionDesired, blobRetriever); }
java
@Override public HollowProducer.ReadState restore(long versionDesired, HollowConsumer.BlobRetriever blobRetriever) { return super.restore(versionDesired, blobRetriever); }
[ "@", "Override", "public", "HollowProducer", ".", "ReadState", "restore", "(", "long", "versionDesired", ",", "HollowConsumer", ".", "BlobRetriever", "blobRetriever", ")", "{", "return", "super", ".", "restore", "(", "versionDesired", ",", "blobRetriever", ")", ";...
Restores the data state to a desired version. <p> Data model {@link #initializeDataModel(Class[]) initialization} is required prior to restoring the producer. This ensures that restoration can correctly compare the producer's current data model with the data model of the restored data state and manage any differences ...
[ "Restores", "the", "data", "state", "to", "a", "desired", "version", ".", "<p", ">", "Data", "model", "{", "@link", "#initializeDataModel", "(", "Class", "[]", ")", "initialization", "}", "is", "required", "prior", "to", "restoring", "the", "producer", ".", ...
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/api/producer/HollowProducer.java#L203-L206
test
Override restore to restore the Hollow version.
Create a Java method that does the following: "Override restore to restore the Hollow version.".
Of course, here is the Java code you requested: ```java @Override public HollowProducer.ReadState restore(long versionDesired, HollowConsumer.BlobRetriever blobRetriever) { return super.restore(versionDesired, blobRetriever); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/AbstractJPAComponent.java
AbstractJPAComponent.getExtendedContextPuIds
@Override public JPAPuId[] getExtendedContextPuIds(Collection<InjectionBinding<?>> injectionBindings, String ejbName, Set<String> persistenceRefNames, List<Object> bindingList) ...
java
@Override public JPAPuId[] getExtendedContextPuIds(Collection<InjectionBinding<?>> injectionBindings, String ejbName, Set<String> persistenceRefNames, List<Object> bindingList) ...
[ "@", "Override", "public", "JPAPuId", "[", "]", "getExtendedContextPuIds", "(", "Collection", "<", "InjectionBinding", "<", "?", ">", ">", "injectionBindings", ",", "String", "ejbName", ",", "Set", "<", "String", ">", "persistenceRefNames", ",", "List", "<", "...
switch to 'bindings' d511673
[ "switch", "to", "bindings", "d511673" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/AbstractJPAComponent.java#L302-L309
train
Get the extended context pu ids.
Create a Java method that does the following: "Get the extended context pu ids.".
Of course, here is the Java code you requested: ```java @Override public JPAPuId[] getExtendedContextPuIds(Collection<InjectionBinding<?>> injectionBindings, String ejbName, Set<String> persistenceRefNames, ...
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ReferrerURLCookieHandler.java
ReferrerURLCookieHandler.getReferrerURLFromCookies
@Sensitive public String getReferrerURLFromCookies(HttpServletRequest req, String cookieName) { Cookie[] cookies = req.getCookies(); String referrerURL = CookieHelper.getCookieValue(cookies, cookieName); if (referrerURL != null) { StringBuffer URL = req.getRequestURL(); ...
java
@Sensitive public String getReferrerURLFromCookies(HttpServletRequest req, String cookieName) { Cookie[] cookies = req.getCookies(); String referrerURL = CookieHelper.getCookieValue(cookies, cookieName); if (referrerURL != null) { StringBuffer URL = req.getRequestURL(); ...
[ "@", "Sensitive", "public", "String", "getReferrerURLFromCookies", "(", "HttpServletRequest", "req", ",", "String", "cookieName", ")", "{", "Cookie", "[", "]", "cookies", "=", "req", ".", "getCookies", "(", ")", ";", "String", "referrerURL", "=", "CookieHelper",...
Retrieve the referrer URL from the HttpServletRequest's cookies. This will decode the URL and restore the host name if it was removed. @param req @return referrerURL
[ "Retrieve", "the", "referrer", "URL", "from", "the", "HttpServletRequest", "s", "cookies", ".", "This", "will", "decode", "the", "URL", "and", "restore", "the", "host", "name", "if", "it", "was", "removed", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/ReferrerURLCookieHandler.java#L50-L60
train
Get the referrer URL from the cookies.
Create a Java method that does the following: "Get the referrer URL from the cookies.".
Of course, here is the Java code you requested: ```java @Sensitive public String getReferrerURLFromCookies(HttpServletRequest req, String cookieName) { Cookie[] cookies = req.getCookies(); String referrerURL = CookieHelper.getCookieValue(cookies, cookieName); if (referrerURL != null) { ...
Unidata/thredds
legacy/src/main/java/ucar/nc2/thredds/ThreddsDataFactory.java
ThreddsDataFactory.chooseDatasetAccess
public InvAccess chooseDatasetAccess(List<InvAccess> accessList) { if (accessList.size() == 0) return null; InvAccess access = null; if (preferAccess != null) { for (ServiceType type : preferAccess) { access = findAccessByServiceType(accessList, type); if (access != null) break;...
java
public InvAccess chooseDatasetAccess(List<InvAccess> accessList) { if (accessList.size() == 0) return null; InvAccess access = null; if (preferAccess != null) { for (ServiceType type : preferAccess) { access = findAccessByServiceType(accessList, type); if (access != null) break;...
[ "public", "InvAccess", "chooseDatasetAccess", "(", "List", "<", "InvAccess", ">", "accessList", ")", "{", "if", "(", "accessList", ".", "size", "(", ")", "==", "0", ")", "return", "null", ";", "InvAccess", "access", "=", "null", ";", "if", "(", "preferAc...
Find the "best" access in case theres more than one, based on what the CDM knows how to open and use. @param accessList choose from this list. @return best access method.
[ "Find", "the", "best", "access", "in", "case", "theres", "more", "than", "one", "based", "on", "what", "the", "CDM", "knows", "how", "to", "open", "and", "use", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/ucar/nc2/thredds/ThreddsDataFactory.java#L520-L574
test
Choose the dataset access based on the list of access objects.
Create a Java method that does the following: "Choose the dataset access based on the list of access objects.".
Of course, here is the Java code you requested: ```java public InvAccess chooseDatasetAccess(List<InvAccess> accessList) { if (accessList.size() == 0) return null; InvAccess access = null; if (preferAccess != null) { for (ServiceType type : preferAccess) { access = findAccessByServiceT...
basho/riak-java-client
src/main/java/com/basho/riak/client/core/query/functions/Function.java
Function.newErlangFunction
public static Function newErlangFunction(String module, String function) { return new Builder().withModule(module).withFunction(function).build(); }
java
public static Function newErlangFunction(String module, String function) { return new Builder().withModule(module).withFunction(function).build(); }
[ "public", "static", "Function", "newErlangFunction", "(", "String", "module", ",", "String", "function", ")", "{", "return", "new", "Builder", "(", ")", ".", "withModule", "(", "module", ")", ".", "withFunction", "(", "function", ")", ".", "build", "(", ")...
Static factory method for Erlang Functions. @param module the module that contains the Erlang function. @param function the name of the erlang function. @return a Function representing a Erlang function.
[ "Static", "factory", "method", "for", "Erlang", "Functions", "." ]
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/query/functions/Function.java#L188-L191
train
Create a new Erlang function.
Create a Java method that does the following: "Create a new Erlang function.".
Of course, here is the Java code you requested: ```java public static Function newErlangFunction(String module, String function) { return new Builder().withModule(module).withFunction(function).build(); } ``` Hope this helps!
lessthanoptimal/BoofCV
main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java
ColorYuv.ycbcrToRgb
public static void ycbcrToRgb( int y , int cb , int cr , byte rgb[] ) { // multiply coefficients in book by 1024, which is 2^10 y = 1191*(y - 16); if( y < 0 ) y = 0; cb -= 128; cr -= 128; int r = (y + 1836*cr) >> 10; int g = (y - 547*cr - 218*cb) >> 10; int b = (y + 2165*cb) >> 10; if( r < 0 ) r = 0...
java
public static void ycbcrToRgb( int y , int cb , int cr , byte rgb[] ) { // multiply coefficients in book by 1024, which is 2^10 y = 1191*(y - 16); if( y < 0 ) y = 0; cb -= 128; cr -= 128; int r = (y + 1836*cr) >> 10; int g = (y - 547*cr - 218*cb) >> 10; int b = (y + 2165*cb) >> 10; if( r < 0 ) r = 0...
[ "public", "static", "void", "ycbcrToRgb", "(", "int", "y", ",", "int", "cb", ",", "int", "cr", ",", "byte", "rgb", "[", "]", ")", "{", "// multiply coefficients in book by 1024, which is 2^10", "y", "=", "1191", "*", "(", "y", "-", "16", ")", ";", "if", ...
Conversion from YCbCr to RGB. See [Jack07]. @param y Y [0 to 255] @param cb Cb [0 to 255] @param cr Cr [0 to 255]
[ "Conversion", "from", "YCbCr", "to", "RGB", ".", "See", "[", "Jack07", "]", "." ]
f01c0243da0ec086285ee722183804d5923bc3ac
https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java#L118-L139
train
Converts YCbCr to RGB.
Create a Java method that does the following: "Converts YCbCr to RGB.".
Of course, here is the Java code you requested: ```java public static void ycbcrToRgb( int y , int cb , int cr , byte rgb[] ) { // multiply coefficients in book by 1024, which is 2^10 y = 1191*(y - 16); if( y < 0 ) y = 0; cb -= 128; cr -= 128; int r = (y + 1836*cr) >> 10; int g = (y - 547*cr - 218*cb) >...
alkacon/opencms-core
src/org/opencms/xml/content/CmsXmlContent.java
CmsXmlContent.setValueForOtherLocales
private void setValueForOtherLocales(CmsObject cms, I_CmsXmlContentValue value, String requiredParent) { if (!value.isSimpleType()) { throw new IllegalArgumentException(); } for (Locale locale : getLocales()) { if (locale.equals(value.getLocale())) { cont...
java
private void setValueForOtherLocales(CmsObject cms, I_CmsXmlContentValue value, String requiredParent) { if (!value.isSimpleType()) { throw new IllegalArgumentException(); } for (Locale locale : getLocales()) { if (locale.equals(value.getLocale())) { cont...
[ "private", "void", "setValueForOtherLocales", "(", "CmsObject", "cms", ",", "I_CmsXmlContentValue", "value", ",", "String", "requiredParent", ")", "{", "if", "(", "!", "value", ".", "isSimpleType", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", ...
Sets the value in all other locales.<p> @param cms the cms context @param value the value @param requiredParent the path to the required parent value
[ "Sets", "the", "value", "in", "all", "other", "locales", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContent.java#L1131-L1153
train
Sets the value for other locales.
Create a Java method that does the following: "Sets the value for other locales.".
Of course, here is the Java code you requested: ```java private void setValueForOtherLocales(CmsObject cms, I_CmsXmlContentValue value, String requiredParent) { if (!value.isSimpleType()) { throw new IllegalArgumentException(); } for (Locale locale : getLocales()) { if ...
algolia/algoliasearch-client-java
src/main/java/com/algolia/search/saas/Index.java
Index.browseFrom
public IndexBrowser browseFrom(Query params, String cursor, RequestOptions requestOptions) throws AlgoliaException { return new IndexBrowser(client, encodedIndexName, params, cursor, requestOptions); }
java
public IndexBrowser browseFrom(Query params, String cursor, RequestOptions requestOptions) throws AlgoliaException { return new IndexBrowser(client, encodedIndexName, params, cursor, requestOptions); }
[ "public", "IndexBrowser", "browseFrom", "(", "Query", "params", ",", "String", "cursor", ",", "RequestOptions", "requestOptions", ")", "throws", "AlgoliaException", "{", "return", "new", "IndexBrowser", "(", "client", ",", "encodedIndexName", ",", "params", ",", "...
Browse all index content starting from a cursor @param requestOptions Options to pass to this request
[ "Browse", "all", "index", "content", "starting", "from", "a", "cursor" ]
a05da2f66c099fe6f77295c7b6a8a12c24e95f9b
https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L802-L804
train
Browse the index from the index query
Create a Java method that does the following: "Browse the index from the index query".
Of course, here is the Java code you requested: ```java public IndexBrowser browseFrom(Query params, String cursor, RequestOptions requestOptions) throws AlgoliaException { return new IndexBrowser(client, encodedIndexName, params, cursor, requestOptions); } ``` Hope this helps!
gallandarakhneorg/afc
core/vmutils/src/main/java/org/arakhne/afc/vmutil/AbstractOperatingSystemWrapper.java
AbstractOperatingSystemWrapper.runCommand
protected static String runCommand(String... command) { try { final Process p = Runtime.getRuntime().exec(command); if (p == null) { return null; } final StringBuilder bStr = new StringBuilder(); try (InputStream standardOutput = p.getInputStream()) { final byte[] buffer = new byte[BUFFER_SIZE]...
java
protected static String runCommand(String... command) { try { final Process p = Runtime.getRuntime().exec(command); if (p == null) { return null; } final StringBuilder bStr = new StringBuilder(); try (InputStream standardOutput = p.getInputStream()) { final byte[] buffer = new byte[BUFFER_SIZE]...
[ "protected", "static", "String", "runCommand", "(", "String", "...", "command", ")", "{", "try", "{", "final", "Process", "p", "=", "Runtime", ".", "getRuntime", "(", ")", ".", "exec", "(", "command", ")", ";", "if", "(", "p", "==", "null", ")", "{",...
Run a shell command. @param command is the shell command to run. @return the standard output
[ "Run", "a", "shell", "command", "." ]
0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/AbstractOperatingSystemWrapper.java#L54-L73
train
Run a command and return the result as a String.
Create a Java method that does the following: "Run a command and return the result as a String.".
Of course, here is the Java code you requested: ```java protected static String runCommand(String... command) { try { final Process p = Runtime.getRuntime().exec(command); if (p == null) { return null; } final StringBuilder bStr = new StringBuilder(); try (InputStream standardOutput = p.getInputSt...
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/marshal/AbstractCompositeType.java
AbstractCompositeType.split
static List<String> split(String input) { if (input.isEmpty()) return Collections.<String>emptyList(); List<String> res = new ArrayList<String>(); int prev = 0; for (int i = 0; i < input.length(); i++) { if (input.charAt(i) != ':' || (i > 0 && input.c...
java
static List<String> split(String input) { if (input.isEmpty()) return Collections.<String>emptyList(); List<String> res = new ArrayList<String>(); int prev = 0; for (int i = 0; i < input.length(); i++) { if (input.charAt(i) != ':' || (i > 0 && input.c...
[ "static", "List", "<", "String", ">", "split", "(", "String", "input", ")", "{", "if", "(", "input", ".", "isEmpty", "(", ")", ")", "return", "Collections", ".", "<", "String", ">", "emptyList", "(", ")", ";", "List", "<", "String", ">", "res", "="...
/* Split the input on character ':', unless the previous character is '\'.
[ "/", "*", "Split", "the", "input", "on", "character", ":", "unless", "the", "previous", "character", "is", "\\", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/AbstractCompositeType.java#L169-L186
train
Split a string into a list of strings.
Create a Java method that does the following: "Split a string into a list of strings.".
Of course, here is the Java code you requested: ```java static List<String> split(String input) { if (input.isEmpty()) return Collections.<String>emptyList(); List<String> res = new ArrayList<String>(); int prev = 0; for (int i = 0; i < input.length(); i++) { ...
alkacon/opencms-core
src/org/opencms/ui/apps/lists/CmsResultFacets.java
CmsResultFacets.filterFolderFacets
private Collection<Count> filterFolderFacets(Collection<Count> folderFacets) { String siteRoot = A_CmsUI.getCmsObject().getRequestContext().getSiteRoot(); if (!siteRoot.endsWith("/")) { siteRoot += "/"; } Collection<Count> result = new ArrayList<Count>(); for (Count ...
java
private Collection<Count> filterFolderFacets(Collection<Count> folderFacets) { String siteRoot = A_CmsUI.getCmsObject().getRequestContext().getSiteRoot(); if (!siteRoot.endsWith("/")) { siteRoot += "/"; } Collection<Count> result = new ArrayList<Count>(); for (Count ...
[ "private", "Collection", "<", "Count", ">", "filterFolderFacets", "(", "Collection", "<", "Count", ">", "folderFacets", ")", "{", "String", "siteRoot", "=", "A_CmsUI", ".", "getCmsObject", "(", ")", ".", "getRequestContext", "(", ")", ".", "getSiteRoot", "(", ...
Filters the available folder facets.<p> @param folderFacets the folder facets @return the filtered facets
[ "Filters", "the", "available", "folder", "facets", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/lists/CmsResultFacets.java#L222-L244
train
Filter the folder facets.
Create a Java method that does the following: "Filter the folder facets.".
Of course, here is the Java code you requested: ```java private Collection<Count> filterFolderFacets(Collection<Count> folderFacets) { String siteRoot = A_CmsUI.getCmsObject().getRequestContext().getSiteRoot(); if (!siteRoot.endsWith("/")) { siteRoot += "/"; } Collection<Co...
apache/incubator-druid
sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java
Expressions.toDruidExpression
@Nullable public static DruidExpression toDruidExpression( final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode ) { final SqlKind kind = rexNode.getKind(); final SqlTypeName sqlTypeName = rexNode.getType().getSqlTypeName(); if (kind == SqlKind....
java
@Nullable public static DruidExpression toDruidExpression( final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode ) { final SqlKind kind = rexNode.getKind(); final SqlTypeName sqlTypeName = rexNode.getType().getSqlTypeName(); if (kind == SqlKind....
[ "@", "Nullable", "public", "static", "DruidExpression", "toDruidExpression", "(", "final", "PlannerContext", "plannerContext", ",", "final", "RowSignature", "rowSignature", ",", "final", "RexNode", "rexNode", ")", "{", "final", "SqlKind", "kind", "=", "rexNode", "."...
Translate a Calcite {@code RexNode} to a Druid expressions. @param plannerContext SQL planner context @param rowSignature signature of the rows to be extracted from @param rexNode expression meant to be applied on top of the rows @return rexNode referring to fields in rowOrder, or null if not possible
[ "Translate", "a", "Calcite", "{", "@code", "RexNode", "}", "to", "a", "Druid", "expressions", "." ]
f776b9408962b9006cfcfe4d6c1794751972cc8e
https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/sql/src/main/java/org/apache/druid/sql/calcite/expression/Expressions.java#L140-L206
train
Translate a RexNode to a DruidExpression.
Create a Java method that does the following: "Translate a RexNode to a DruidExpression.".
Of course, here is the Java code you requested: ```java @Nullable public static DruidExpression toDruidExpression( final PlannerContext plannerContext, final RowSignature rowSignature, final RexNode rexNode ) { final SqlKind kind = rexNode.getKind(); final SqlTypeName sqlTypeName = rexN...
VoltDB/voltdb
src/frontend/org/voltdb/jdbc/JDBC4ResultSet.java
JDBC4ResultSet.wasNull
@Override public boolean wasNull() throws SQLException { checkClosed(); try { return table.wasNull(); } catch (Exception x) { throw SQLError.get(x); } }
java
@Override public boolean wasNull() throws SQLException { checkClosed(); try { return table.wasNull(); } catch (Exception x) { throw SQLError.get(x); } }
[ "@", "Override", "public", "boolean", "wasNull", "(", ")", "throws", "SQLException", "{", "checkClosed", "(", ")", ";", "try", "{", "return", "table", ".", "wasNull", "(", ")", ";", "}", "catch", "(", "Exception", "x", ")", "{", "throw", "SQLError", "....
Reports whether the last column read had a value of SQL NULL.
[ "Reports", "whether", "the", "last", "column", "read", "had", "a", "value", "of", "SQL", "NULL", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4ResultSet.java#L1875-L1883
train
Returns true if the database was null.
Create a Java method that does the following: "Returns true if the database was null.".
Of course, here is the Java code you requested: ```java @Override public boolean wasNull() throws SQLException { checkClosed(); try { return table.wasNull(); } catch (Exception x) { throw SQLError.get(x); } } ``` Hope this helps!
NextFaze/power-adapters
power-adapters-data-rxjava2/src/main/java/com/nextfaze/poweradapters/data/rxjava2/ObservableDataBuilder.java
ObservableDataBuilder.identityEquality
@NonNull public ObservableDataBuilder<T> identityEquality(@Nullable EqualityFunction<? super T> identityEqualityFunction) { mIdentityEqualityFunction = identityEqualityFunction; return this; }
java
@NonNull public ObservableDataBuilder<T> identityEquality(@Nullable EqualityFunction<? super T> identityEqualityFunction) { mIdentityEqualityFunction = identityEqualityFunction; return this; }
[ "@", "NonNull", "public", "ObservableDataBuilder", "<", "T", ">", "identityEquality", "(", "@", "Nullable", "EqualityFunction", "<", "?", "super", "T", ">", "identityEqualityFunction", ")", "{", "mIdentityEqualityFunction", "=", "identityEqualityFunction", ";", "retur...
Defines the function for evaluating whether two objects have the same identity, for the purpose of determining notifications.
[ "Defines", "the", "function", "for", "evaluating", "whether", "two", "objects", "have", "the", "same", "identity", "for", "the", "purpose", "of", "determining", "notifications", "." ]
cdf00b1b723ed9d6bcd549ae9741a19dd59651e1
https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data-rxjava2/src/main/java/com/nextfaze/poweradapters/data/rxjava2/ObservableDataBuilder.java#L117-L121
train
Sets the identity equality function.
Create a Java method that does the following: "Sets the identity equality function.".
Of course, here is the Java code you requested: ```java @NonNull public ObservableDataBuilder<T> identityEquality(@Nullable EqualityFunction<? super T> identityEqualityFunction) { mIdentityEqualityFunction = identityEqualityFunction; return this; } ``` Hope this helps!
forge/javaee-descriptors
impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig22/FacesConfigApplicationTypeImpl.java
FacesConfigApplicationTypeImpl.getAllDefaultValidators
public List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> getAllDefaultValidators() { List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>>(); List<Node> nodeList = childNode.get("defa...
java
public List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> getAllDefaultValidators() { List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>>(); List<Node> nodeList = childNode.get("defa...
[ "public", "List", "<", "FacesConfigDefaultValidatorsType", "<", "FacesConfigApplicationType", "<", "T", ">", ">", ">", "getAllDefaultValidators", "(", ")", "{", "List", "<", "FacesConfigDefaultValidatorsType", "<", "FacesConfigApplicationType", "<", "T", ">>>", "list", ...
Returns all <code>default-validators</code> elements @return list of <code>default-validators</code>
[ "Returns", "all", "<code", ">", "default", "-", "validators<", "/", "code", ">", "elements" ]
cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed
https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig22/FacesConfigApplicationTypeImpl.java#L832-L842
train
Gets the list of all default validators.
Create a Java method that does the following: "Gets the list of all default validators.".
Of course, here is the Java code you requested: ```java public List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> getAllDefaultValidators() { List<FacesConfigDefaultValidatorsType<FacesConfigApplicationType<T>>> list = new ArrayList<FacesConfigDefaultValidatorsType<FacesConfigApplicationTyp...
meltmedia/cadmium
persistence/src/main/java/com/meltmedia/cadmium/persistence/CadmiumPersistenceProvider.java
CadmiumPersistenceProvider.createContainerEntityManagerFactory
@SuppressWarnings("rawtypes") @Override public EntityManagerFactory createContainerEntityManagerFactory( PersistenceUnitInfo info, Map properties) { EntityManagerFactory factory = wrappedPersistenceProvider.createContainerEntityManagerFactory(info, properties); return factory; }
java
@SuppressWarnings("rawtypes") @Override public EntityManagerFactory createContainerEntityManagerFactory( PersistenceUnitInfo info, Map properties) { EntityManagerFactory factory = wrappedPersistenceProvider.createContainerEntityManagerFactory(info, properties); return factory; }
[ "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "@", "Override", "public", "EntityManagerFactory", "createContainerEntityManagerFactory", "(", "PersistenceUnitInfo", "info", ",", "Map", "properties", ")", "{", "EntityManagerFactory", "factory", "=", "wrappedPersistencePr...
This just delegates to the HibernatePersistence method.
[ "This", "just", "delegates", "to", "the", "HibernatePersistence", "method", "." ]
bca585030e141803a73b58abb128d130157b6ddf
https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/persistence/src/main/java/com/meltmedia/cadmium/persistence/CadmiumPersistenceProvider.java#L101-L107
train
Create a container entity factory.
Create a Java method that does the following: "Create a container entity factory.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("rawtypes") @Override public EntityManagerFactory createContainerEntityManagerFactory( PersistenceUnitInfo info, Map properties) { EntityManagerFactory factory = wrappedPersistenceProvider.createContainerEntityManagerFactory(info, ...
apache/incubator-heron
examples/src/java/org/apache/heron/examples/streamlet/utils/StreamletUtils.java
StreamletUtils.intListAsString
public static String intListAsString(List<Integer> ls) { return String.join(", ", ls.stream().map(i -> i.toString()).collect(Collectors.toList())); }
java
public static String intListAsString(List<Integer> ls) { return String.join(", ", ls.stream().map(i -> i.toString()).collect(Collectors.toList())); }
[ "public", "static", "String", "intListAsString", "(", "List", "<", "Integer", ">", "ls", ")", "{", "return", "String", ".", "join", "(", "\", \"", ",", "ls", ".", "stream", "(", ")", ".", "map", "(", "i", "->", "i", ".", "toString", "(", ")", ")", ...
Converts a list of integers into a comma-separated string.
[ "Converts", "a", "list", "of", "integers", "into", "a", "comma", "-", "separated", "string", "." ]
776abe2b5a45b93a0eb957fd65cbc149d901a92a
https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/examples/src/java/org/apache/heron/examples/streamlet/utils/StreamletUtils.java#L72-L74
train
Convert a list of ints to a string.
Create a Java method that does the following: "Convert a list of ints to a string.".
Of course, here is the Java code you requested: ```java public static String intListAsString(List<Integer> ls) { return String.join(", ", ls.stream().map(i -> i.toString()).collect(Collectors.toList())); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java
AmazonS3Client.uploadObject
CompleteMultipartUploadResult uploadObject(final UploadObjectRequest req) throws IOException, InterruptedException, ExecutionException { // Set up the pipeline for concurrent encrypt and upload // Set up a thread pool for this pipeline ExecutorService es = req.getExecutorService(); ...
java
CompleteMultipartUploadResult uploadObject(final UploadObjectRequest req) throws IOException, InterruptedException, ExecutionException { // Set up the pipeline for concurrent encrypt and upload // Set up a thread pool for this pipeline ExecutorService es = req.getExecutorService(); ...
[ "CompleteMultipartUploadResult", "uploadObject", "(", "final", "UploadObjectRequest", "req", ")", "throws", "IOException", ",", "InterruptedException", ",", "ExecutionException", "{", "// Set up the pipeline for concurrent encrypt and upload", "// Set up a thread pool for this pipeline...
Used for performance testing purposes only. Hence package private. This method is subject to removal anytime without notice.
[ "Used", "for", "performance", "testing", "purposes", "only", ".", "Hence", "package", "private", ".", "This", "method", "is", "subject", "to", "removal", "anytime", "without", "notice", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3Client.java#L5181-L5218
train
Complete multipart upload of a single object.
Create a Java method that does the following: "Complete multipart upload of a single object.".
Of course, here is the Java code you requested: ```java CompleteMultipartUploadResult uploadObject(final UploadObjectRequest req) throws IOException, InterruptedException, ExecutionException { // Set up the pipeline for concurrent encrypt and upload // Set up a thread pool for this pipeline...
defei/codelogger-utils
src/main/java/org/codelogger/utils/ExceptionThrower.java
ExceptionThrower.createExceptionMessage
protected String createExceptionMessage(final String message, final Object... messageParameters) { if (ArrayUtils.isEmpty(messageParameters)) { return message; } else { return String.format(message, messageParameters); } }
java
protected String createExceptionMessage(final String message, final Object... messageParameters) { if (ArrayUtils.isEmpty(messageParameters)) { return message; } else { return String.format(message, messageParameters); } }
[ "protected", "String", "createExceptionMessage", "(", "final", "String", "message", ",", "final", "Object", "...", "messageParameters", ")", "{", "if", "(", "ArrayUtils", ".", "isEmpty", "(", "messageParameters", ")", ")", "{", "return", "message", ";", "}", "...
Create a string message by string format. @param message @param messageParameters @return
[ "Create", "a", "string", "message", "by", "string", "format", "." ]
d906f5d217b783c7ae3e53442cd6fb87b20ecc0a
https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/ExceptionThrower.java#L65-L72
train
Create exception message.
Create a Java method that does the following: "Create exception message.".
Of course, here is the Java code you requested: ```java protected String createExceptionMessage(final String message, final Object... messageParameters) { if (ArrayUtils.isEmpty(messageParameters)) { return message; } else { return String.format(message, messageParameters); ...
eclipse/xtext-extras
org.eclipse.xtext.purexbase.ide/src-gen/org/eclipse/xtext/purexbase/ide/contentassist/antlr/internal/InternalPureXbaseLexer.java
InternalPureXbaseLexer.mT__40
public final void mT__40() throws RecognitionException { try { int _type = T__40; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalPureXbase.g:38:7: ( '%' ) // InternalPureXbase.g:38:9: '%' { match('%'); } state.t...
java
public final void mT__40() throws RecognitionException { try { int _type = T__40; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalPureXbase.g:38:7: ( '%' ) // InternalPureXbase.g:38:9: '%' { match('%'); } state.t...
[ "public", "final", "void", "mT__40", "(", ")", "throws", "RecognitionException", "{", "try", "{", "int", "_type", "=", "T__40", ";", "int", "_channel", "=", "DEFAULT_TOKEN_CHANNEL", ";", "// InternalPureXbase.g:38:7: ( '%' )", "// InternalPureXbase.g:38:9: '%'", "{", ...
$ANTLR start "T__40"
[ "$ANTLR", "start", "T__40" ]
451359541295323a29f5855e633f770cec02069a
https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.purexbase.ide/src-gen/org/eclipse/xtext/purexbase/ide/contentassist/antlr/internal/InternalPureXbaseLexer.java#L674-L690
train
Use this method to perform the processing of T__40
Create a Java method that does the following: "Use this method to perform the processing of T__40".
Of course, here is the Java code you requested: ```java public final void mT__40() throws RecognitionException { try { int _type = T__40; int _channel = DEFAULT_TOKEN_CHANNEL; // InternalPureXbase.g:38:7: ( '%' ) // InternalPureXbase.g:38:9: '%' { ...
att/AAF
cadi/core/src/main/java/com/att/cadi/Capacitor.java
Capacitor.done
public void done() { for(ByteBuffer bb : bbs) { ringPut(bb); } bbs.clear(); curr = null; }
java
public void done() { for(ByteBuffer bb : bbs) { ringPut(bb); } bbs.clear(); curr = null; }
[ "public", "void", "done", "(", ")", "{", "for", "(", "ByteBuffer", "bb", ":", "bbs", ")", "{", "ringPut", "(", "bb", ")", ";", "}", "bbs", ".", "clear", "(", ")", ";", "curr", "=", "null", ";", "}" ]
reuse all the buffers
[ "reuse", "all", "the", "buffers" ]
090562e956c0035db972aafba844dc6d3fc948ee
https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/cadi/core/src/main/java/com/att/cadi/Capacitor.java#L131-L137
train
Called when the write has finished.
Create a Java method that does the following: "Called when the write has finished.".
Of course, here is the Java code you requested: ```java public void done() { for(ByteBuffer bb : bbs) { ringPut(bb); } bbs.clear(); curr = null; } ``` Hope this helps!
RestComm/sipunit
src/main/java/org/cafesip/sipunit/SipStack.java
SipStack.createSipPhone
public SipPhone createSipPhone(String me) throws InvalidArgumentException, ParseException { return createSipPhone(null, null, -1, me); }
java
public SipPhone createSipPhone(String me) throws InvalidArgumentException, ParseException { return createSipPhone(null, null, -1, me); }
[ "public", "SipPhone", "createSipPhone", "(", "String", "me", ")", "throws", "InvalidArgumentException", ",", "ParseException", "{", "return", "createSipPhone", "(", "null", ",", "null", ",", "-", "1", ",", "me", ")", ";", "}" ]
This method is the equivalent to the other createSipPhone() methods but without a proxy server. @param me "Address of Record" URI of the phone user. Each SipPhone is associated with one user. This parameter is used in the "from" header field. @return A new SipPhone object. @throws InvalidArgumentException @throws Par...
[ "This", "method", "is", "the", "equivalent", "to", "the", "other", "createSipPhone", "()", "methods", "but", "without", "a", "proxy", "server", "." ]
18a6be2e29be3fbdc14226e8c41b25e2d57378b1
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipStack.java#L283-L285
train
Create a SipPhone object from a String.
Create a Java method that does the following: "Create a SipPhone object from a String.".
Of course, here is the Java code you requested: ```java public SipPhone createSipPhone(String me) throws InvalidArgumentException, ParseException { return createSipPhone(null, null, -1, me); } ``` Hope this helps!
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.switchOnNext
@SuppressWarnings({ "rawtypes", "unchecked" }) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Observable<T> switchOnNext(ObservableSource<? extends ObservableSource<? extends T>> sources, int bufferSize) { ObjectHelper.requireNonNull(sources, "sources is null"); ...
java
@SuppressWarnings({ "rawtypes", "unchecked" }) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Observable<T> switchOnNext(ObservableSource<? extends ObservableSource<? extends T>> sources, int bufferSize) { ObjectHelper.requireNonNull(sources, "sources is null"); ...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "static", "<", "T", ">", "Observable", "<", "T", ">", "switchOnNext", "(",...
Converts an ObservableSource that emits ObservableSources into an ObservableSource that emits the items emitted by the most recently emitted of those ObservableSources. <p> <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchDo.png" alt=""> <p> {@code switchOnNext} ...
[ "Converts", "an", "ObservableSource", "that", "emits", "ObservableSources", "into", "an", "ObservableSource", "that", "emits", "the", "items", "emitted", "by", "the", "most", "recently", "emitted", "of", "those", "ObservableSources", ".", "<p", ">", "<img", "width...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L3818-L3825
test
Switches the source observable to the next element of the source observable.
Create a Java method that does the following: "Switches the source observable to the next element of the source observable.".
Of course, here is the Java code you requested: ```java @SuppressWarnings({ "rawtypes", "unchecked" }) @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public static <T> Observable<T> switchOnNext(ObservableSource<? extends ObservableSource<? extends T>> sources, int bufferSize) { ObjectH...
epierce/cas-server-extension-token
src/main/java/edu/clayton/cas/support/token/util/Crypto.java
Crypto.generateAes128KeyWithSeed
public static String generateAes128KeyWithSeed(String seed) { String returnKey = null; try { SecureRandom rand = SecureRandom.getInstance("SHA1PRNG"); byte[] salt = new byte[16]; rand.nextBytes(salt); PBEKeySpec password = new PBEKeySpec(seed.toCharArray(), salt, 1000, 128); Secre...
java
public static String generateAes128KeyWithSeed(String seed) { String returnKey = null; try { SecureRandom rand = SecureRandom.getInstance("SHA1PRNG"); byte[] salt = new byte[16]; rand.nextBytes(salt); PBEKeySpec password = new PBEKeySpec(seed.toCharArray(), salt, 1000, 128); Secre...
[ "public", "static", "String", "generateAes128KeyWithSeed", "(", "String", "seed", ")", "{", "String", "returnKey", "=", "null", ";", "try", "{", "SecureRandom", "rand", "=", "SecureRandom", ".", "getInstance", "(", "\"SHA1PRNG\"", ")", ";", "byte", "[", "]", ...
Returns an ASCII string that can be used for encrypting/decrypting data with the AES-128 algorithm. The given seed <strong>does not</strong> guarantee the same result for subsequent invocations. @param seed A string to seed the generator with. @return A unique ASCII string that can be used as an AES-128 key, or null.
[ "Returns", "an", "ASCII", "string", "that", "can", "be", "used", "for", "encrypting", "/", "decrypting", "data", "with", "the", "AES", "-", "128", "algorithm", ".", "The", "given", "seed", "<strong", ">", "does", "not<", "/", "strong", ">", "guarantee", ...
b63399e6b516a25f624d09161466db87fcec974b
https://github.com/epierce/cas-server-extension-token/blob/b63399e6b516a25f624d09161466db87fcec974b/src/main/java/edu/clayton/cas/support/token/util/Crypto.java#L30-L75
train
Generate AES 128 - bit key with seed.
Create a Java method that does the following: "Generate AES 128 - bit key with seed.".
Of course, here is the Java code you requested: ```java public static String generateAes128KeyWithSeed(String seed) { String returnKey = null; try { SecureRandom rand = SecureRandom.getInstance("SHA1PRNG"); byte[] salt = new byte[16]; rand.nextBytes(salt); PBEKeySpec password = new PBE...
xvik/generics-resolver
src/main/java/ru/vyarus/java/generics/resolver/context/MethodGenericsContext.java
MethodGenericsContext.parameterTypeAs
public GenericsContext parameterTypeAs(final int pos, final Class<?> asType) { checkParameter(pos); return inlyingTypeAs(meth.getGenericParameterTypes()[pos], asType); }
java
public GenericsContext parameterTypeAs(final int pos, final Class<?> asType) { checkParameter(pos); return inlyingTypeAs(meth.getGenericParameterTypes()[pos], asType); }
[ "public", "GenericsContext", "parameterTypeAs", "(", "final", "int", "pos", ",", "final", "Class", "<", "?", ">", "asType", ")", "{", "checkParameter", "(", "pos", ")", ";", "return", "inlyingTypeAs", "(", "meth", ".", "getGenericParameterTypes", "(", ")", "...
Create generics context for actual class, passed into parameter type (assuming you have access to that instance or know exact type). Context will contain correct generics for known declaration type (middle type in target type hierarchy). This is useful when analyzing object instance (introspecting actual object). <p> O...
[ "Create", "generics", "context", "for", "actual", "class", "passed", "into", "parameter", "type", "(", "assuming", "you", "have", "access", "to", "that", "instance", "or", "know", "exact", "type", ")", ".", "Context", "will", "contain", "correct", "generics", ...
d7d9d2783265df1178230e8f0b7cb6d853b67a7b
https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/context/MethodGenericsContext.java#L177-L180
train
Gets the generic type of the parameter at the given position.
Create a Java method that does the following: "Gets the generic type of the parameter at the given position.".
Of course, here is the Java code you requested: ```java public GenericsContext parameterTypeAs(final int pos, final Class<?> asType) { checkParameter(pos); return inlyingTypeAs(meth.getGenericParameterTypes()[pos], asType); } ``` Hope this helps!
robeio/robe
robe-admin/src/main/java/io/robe/admin/resources/AuthResource.java
AuthResource.getProfile
@Path("profile") @GET @UnitOfWork(readOnly = true, cacheMode = GET, flushMode = FlushMode.MANUAL) public User getProfile(@RobeAuth Credentials credentials) { Optional<User> user = userDao.findByUsername(credentials.getUsername()); if (!user.isPresent()) { throw new WebApplication...
java
@Path("profile") @GET @UnitOfWork(readOnly = true, cacheMode = GET, flushMode = FlushMode.MANUAL) public User getProfile(@RobeAuth Credentials credentials) { Optional<User> user = userDao.findByUsername(credentials.getUsername()); if (!user.isPresent()) { throw new WebApplication...
[ "@", "Path", "(", "\"profile\"", ")", "@", "GET", "@", "UnitOfWork", "(", "readOnly", "=", "true", ",", "cacheMode", "=", "GET", ",", "flushMode", "=", "FlushMode", ".", "MANUAL", ")", "public", "User", "getProfile", "(", "@", "RobeAuth", "Credentials", ...
User Information Returns <p> Status Code: UNAUTHORIZED no have authentication. @param credentials injected by {@link RobeAuth} annotation for authentication. @return {@link User} @throws Exception for not found user
[ "User", "Information", "Returns", "<p", ">", "Status", "Code", ":", "UNAUTHORIZED", "no", "have", "authentication", "." ]
a0a8c7cebd1f70f78cf24a66a002859e937badfe
https://github.com/robeio/robe/blob/a0a8c7cebd1f70f78cf24a66a002859e937badfe/robe-admin/src/main/java/io/robe/admin/resources/AuthResource.java#L155-L164
test
Get a user from the database.
Create a Java method that does the following: "Get a user from the database.".
Of course, here is the Java code you requested: ```java @Path("profile") @GET @UnitOfWork(readOnly = true, cacheMode = GET, flushMode = FlushMode.MANUAL) public User getProfile(@RobeAuth Credentials credentials) { Optional<User> user = userDao.findByUsername(credentials.getUsername()); if (...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormFieldClient.java
FormFieldClient.forceDeleteField
public Field forceDeleteField(Field fieldParam) { if(fieldParam != null && this.serviceTicket != null) { fieldParam.setServiceTicket(this.serviceTicket); } return new Field(this.postJson( fieldParam, WS.Path.FormField.Version1.formFieldDelete(true))); ...
java
public Field forceDeleteField(Field fieldParam) { if(fieldParam != null && this.serviceTicket != null) { fieldParam.setServiceTicket(this.serviceTicket); } return new Field(this.postJson( fieldParam, WS.Path.FormField.Version1.formFieldDelete(true))); ...
[ "public", "Field", "forceDeleteField", "(", "Field", "fieldParam", ")", "{", "if", "(", "fieldParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", "null", ")", "{", "fieldParam", ".", "setServiceTicket", "(", "this", ".", "serviceTicket", ")", ";"...
Forcefully deletes the provided field. Ensure that Id is set. Only 'admin' is able to forcefully delete a field. @param fieldParam The Field to delete. @return The deleted Field.
[ "Forcefully", "deletes", "the", "provided", "field", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/form/FormFieldClient.java#L1241-L1250
test
Force delete a field.
Create a Java method that does the following: "Force delete a field.".
Of course, here is the Java code you requested: ```java public Field forceDeleteField(Field fieldParam) { if(fieldParam != null && this.serviceTicket != null) { fieldParam.setServiceTicket(this.serviceTicket); } return new Field(this.postJson( fieldParam...
meraki-analytics/datapipelines-java
src/main/java/com/merakianalytics/datapipelines/iterators/CloseableIterators.java
CloseableIterators.from
public static <T> CloseableIterator<T> from(final Iterator<T> iterator) { if(iterator instanceof CloseableIterator) { return (CloseableIterator<T>)iterator; } return new CloseableIterator<T>() { @Override public void close() { // Do nothing ...
java
public static <T> CloseableIterator<T> from(final Iterator<T> iterator) { if(iterator instanceof CloseableIterator) { return (CloseableIterator<T>)iterator; } return new CloseableIterator<T>() { @Override public void close() { // Do nothing ...
[ "public", "static", "<", "T", ">", "CloseableIterator", "<", "T", ">", "from", "(", "final", "Iterator", "<", "T", ">", "iterator", ")", "{", "if", "(", "iterator", "instanceof", "CloseableIterator", ")", "{", "return", "(", "CloseableIterator", "<", "T", ...
Creates a {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} wrapper around the provided {@link java.util.Iterator} @param <T> the type of the {@link java.util.Iterator} @param iterator the {@link java.util.Iterator} to wrap in a {@link com.merakianalytics.datapipelines.iterators.CloseableIterator} ...
[ "Creates", "a", "{", "@link", "com", ".", "merakianalytics", ".", "datapipelines", ".", "iterators", ".", "CloseableIterator", "}", "wrapper", "around", "the", "provided", "{", "@link", "java", ".", "util", ".", "Iterator", "}" ]
376ff1e8e1f7c67f2f2a5521d2a66e91467e56b0
https://github.com/meraki-analytics/datapipelines-java/blob/376ff1e8e1f7c67f2f2a5521d2a66e91467e56b0/src/main/java/com/merakianalytics/datapipelines/iterators/CloseableIterators.java#L49-L75
train
Creates a CloseableIterator from the given iterator.
Create a Java method that does the following: "Creates a CloseableIterator from the given iterator.".
Of course, here is the Java code you requested: ```java public static <T> CloseableIterator<T> from(final Iterator<T> iterator) { if(iterator instanceof CloseableIterator) { return (CloseableIterator<T>)iterator; } return new CloseableIterator<T>() { @Override ...
aws/aws-sdk-java
aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/GetUpgradeStatusRequestMarshaller.java
GetUpgradeStatusRequestMarshaller.marshall
public void marshall(GetUpgradeStatusRequest getUpgradeStatusRequest, ProtocolMarshaller protocolMarshaller) { if (getUpgradeStatusRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getUpgrade...
java
public void marshall(GetUpgradeStatusRequest getUpgradeStatusRequest, ProtocolMarshaller protocolMarshaller) { if (getUpgradeStatusRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getUpgrade...
[ "public", "void", "marshall", "(", "GetUpgradeStatusRequest", "getUpgradeStatusRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "getUpgradeStatusRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/GetUpgradeStatusRequestMarshaller.java#L42-L53
train
marshalls the given GetUpgradeStatusRequest to the JSON object.
Create a Java method that does the following: "marshalls the given GetUpgradeStatusRequest to the JSON object.".
Of course, here is the Java code you requested: ```java public void marshall(GetUpgradeStatusRequest getUpgradeStatusRequest, ProtocolMarshaller protocolMarshaller) { if (getUpgradeStatusRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
alkacon/opencms-core
src/org/opencms/ui/components/CmsInfoButton.java
CmsInfoButton.addAdditionalElement
public void addAdditionalElement(Component component) { m_additionalElements.add(new InfoElementBean(m_additionalElements.size() + 1, component)); removeClickListener(m_clickListener); m_clickListener = getClickListener(m_htmlLines, m_additionalElements); addClickListener(m_clickListene...
java
public void addAdditionalElement(Component component) { m_additionalElements.add(new InfoElementBean(m_additionalElements.size() + 1, component)); removeClickListener(m_clickListener); m_clickListener = getClickListener(m_htmlLines, m_additionalElements); addClickListener(m_clickListene...
[ "public", "void", "addAdditionalElement", "(", "Component", "component", ")", "{", "m_additionalElements", ".", "add", "(", "new", "InfoElementBean", "(", "m_additionalElements", ".", "size", "(", ")", "+", "1", ",", "component", ")", ")", ";", "removeClickListe...
Adds a vaadin element to window at last position.<p> @param component to be added
[ "Adds", "a", "vaadin", "element", "to", "window", "at", "last", "position", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsInfoButton.java#L154-L160
train
Add an additional element to the exception.
Create a Java method that does the following: "Add an additional element to the exception.".
Of course, here is the Java code you requested: ```java public void addAdditionalElement(Component component) { m_additionalElements.add(new InfoElementBean(m_additionalElements.size() + 1, component)); removeClickListener(m_clickListener); m_clickListener = getClickListener(m_htmlLines, m_add...
alkacon/opencms-core
src/org/opencms/importexport/A_CmsImport.java
A_CmsImport.importGroup
protected void importGroup(String name, String description, String flags, String parentgroupName) throws CmsImportExportException { if (description == null) { description = ""; } CmsGroup parentGroup = null; try { if (CmsStringUtil.isNotEmpty(parentgroupName...
java
protected void importGroup(String name, String description, String flags, String parentgroupName) throws CmsImportExportException { if (description == null) { description = ""; } CmsGroup parentGroup = null; try { if (CmsStringUtil.isNotEmpty(parentgroupName...
[ "protected", "void", "importGroup", "(", "String", "name", ",", "String", "description", ",", "String", "flags", ",", "String", "parentgroupName", ")", "throws", "CmsImportExportException", "{", "if", "(", "description", "==", "null", ")", "{", "description", "=...
Imports a single group.<p> @param name the name of the group @param description group description @param flags group flags @param parentgroupName name of the parent group @throws CmsImportExportException if something goes wrong
[ "Imports", "a", "single", "group", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/A_CmsImport.java#L672-L725
train
Import a group.
Create a Java method that does the following: "Import a group.".
Of course, here is the Java code you requested: ```java protected void importGroup(String name, String description, String flags, String parentgroupName) throws CmsImportExportException { if (description == null) { description = ""; } CmsGroup parentGroup = null; try {...
mongodb/stitch-android-sdk
android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userapikey/internal/UserApiKeyAuthProviderClientImpl.java
UserApiKeyAuthProviderClientImpl.createApiKey
@Override public Task<UserApiKey> createApiKey(@NonNull final String name) { return dispatcher.dispatchTask(new Callable<UserApiKey>() { @Override public UserApiKey call() { return createApiKeyInternal(name); } }); }
java
@Override public Task<UserApiKey> createApiKey(@NonNull final String name) { return dispatcher.dispatchTask(new Callable<UserApiKey>() { @Override public UserApiKey call() { return createApiKeyInternal(name); } }); }
[ "@", "Override", "public", "Task", "<", "UserApiKey", ">", "createApiKey", "(", "@", "NonNull", "final", "String", "name", ")", "{", "return", "dispatcher", ".", "dispatchTask", "(", "new", "Callable", "<", "UserApiKey", ">", "(", ")", "{", "@", "Override"...
Creates a user API key that can be used to authenticate as the current user. @param name The name of the API key to be created @return A {@link Task} that contains the created API key.
[ "Creates", "a", "user", "API", "key", "that", "can", "be", "used", "to", "authenticate", "as", "the", "current", "user", "." ]
159b9334b1f1a827285544be5ee20cdf7b04e4cc
https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/android/core/src/main/java/com/mongodb/stitch/android/core/auth/providers/userapikey/internal/UserApiKeyAuthProviderClientImpl.java#L51-L59
train
Create a new API key.
Create a Java method that does the following: "Create a new API key.".
Of course, here is the Java code you requested: ```java @Override public Task<UserApiKey> createApiKey(@NonNull final String name) { return dispatcher.dispatchTask(new Callable<UserApiKey>() { @Override public UserApiKey call() { return createApiKeyInternal(name); } }); } ``` Hop...
wisdom-framework/wisdom
extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/dashboard/CpuGaugeSet.java
CpuGaugeSet.getCpuTime
private Long getCpuTime() { if (bean instanceof com.sun.management.OperatingSystemMXBean) { //NOSONAR return ((com.sun.management.OperatingSystemMXBean) bean).getProcessCpuTime(); //NOSONAR } else { return -1L; } }
java
private Long getCpuTime() { if (bean instanceof com.sun.management.OperatingSystemMXBean) { //NOSONAR return ((com.sun.management.OperatingSystemMXBean) bean).getProcessCpuTime(); //NOSONAR } else { return -1L; } }
[ "private", "Long", "getCpuTime", "(", ")", "{", "if", "(", "bean", "instanceof", "com", ".", "sun", ".", "management", ".", "OperatingSystemMXBean", ")", "{", "//NOSONAR", "return", "(", "(", "com", ".", "sun", ".", "management", ".", "OperatingSystemMXBean"...
This method uses a Sun specific class (implementation of the Operating System MX Bean. @return the CPU process time, or {@literal -1L} if not available.
[ "This", "method", "uses", "a", "Sun", "specific", "class", "(", "implementation", "of", "the", "Operating", "System", "MX", "Bean", "." ]
a35b6431200fec56b178c0ff60837ed73fd7874d
https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/dashboard/CpuGaugeSet.java#L143-L149
train
Get the cpu time of the JVM.
Create a Java method that does the following: "Get the cpu time of the JVM.".
Of course, here is the Java code you requested: ```java private Long getCpuTime() { if (bean instanceof com.sun.management.OperatingSystemMXBean) { //NOSONAR return ((com.sun.management.OperatingSystemMXBean) bean).getProcessCpuTime(); //NOSONAR } else { return -1L; } ...
MenoData/Time4J
base/src/main/java/net/time4j/range/IntervalTree.java
IntervalTree.iterator
@Override public Iterator<I> iterator() { List<I> i = this.intervals; if (i == null) { Collector collector = new Collector(); this.accept(collector); i = Collections.unmodifiableList(collector.visited); this.intervals = i; } return i...
java
@Override public Iterator<I> iterator() { List<I> i = this.intervals; if (i == null) { Collector collector = new Collector(); this.accept(collector); i = Collections.unmodifiableList(collector.visited); this.intervals = i; } return i...
[ "@", "Override", "public", "Iterator", "<", "I", ">", "iterator", "(", ")", "{", "List", "<", "I", ">", "i", "=", "this", ".", "intervals", ";", "if", "(", "i", "==", "null", ")", "{", "Collector", "collector", "=", "new", "Collector", "(", ")", ...
/*[deutsch] <p>Sammelt alle gespeicherten Intervalle in eine neue Liste und liefert dann einen {@code Iterator} f&uuml;r diese Liste. </p> <p>Diese Methode ist nur sinnvoll, wenn Anwender alle gespeicherten Intervalle brauchen. Ansonsten ist eine benutzerdefinierte {@code Visitor}-Implementierung flexibler. </p> @ret...
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Sammelt", "alle", "gespeicherten", "Intervalle", "in", "eine", "neue", "Liste", "und", "liefert", "dann", "einen", "{", "@code", "Iterator", "}", "f&uuml", ";", "r", "diese", "Liste", ".", "<", "/", "p", ">" ]
08b2eda6b2dbb140b92011cf7071bb087edd46a5
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/range/IntervalTree.java#L330-L344
train
Returns an iterator over the calendar intervals.
Create a Java method that does the following: "Returns an iterator over the calendar intervals.".
Of course, here is the Java code you requested: ```java @Override public Iterator<I> iterator() { List<I> i = this.intervals; if (i == null) { Collector collector = new Collector(); this.accept(collector); i = Collections.unmodifiableList(collector.visited); ...
MariaDB/mariadb-connector-j
src/main/java/org/mariadb/jdbc/internal/com/read/resultset/UpdatableResultSet.java
UpdatableResultSet.updateTimestamp
public void updateTimestamp(int columnIndex, Timestamp timeStamp) throws SQLException { checkUpdatable(columnIndex); if (timeStamp == null) { parameterHolders[columnIndex - 1] = new NullParameter(ColumnType.DATETIME); return; } parameterHolders[columnIndex - 1] = new TimestampParameter(timeS...
java
public void updateTimestamp(int columnIndex, Timestamp timeStamp) throws SQLException { checkUpdatable(columnIndex); if (timeStamp == null) { parameterHolders[columnIndex - 1] = new NullParameter(ColumnType.DATETIME); return; } parameterHolders[columnIndex - 1] = new TimestampParameter(timeS...
[ "public", "void", "updateTimestamp", "(", "int", "columnIndex", ",", "Timestamp", "timeStamp", ")", "throws", "SQLException", "{", "checkUpdatable", "(", "columnIndex", ")", ";", "if", "(", "timeStamp", "==", "null", ")", "{", "parameterHolders", "[", "columnInd...
{inheritDoc}.
[ "{", "inheritDoc", "}", "." ]
d148c7cd347c4680617be65d9e511b289d38a30b
https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/internal/com/read/resultset/UpdatableResultSet.java#L559-L567
train
Updates the designated column with a java. sql. Timestamp object.
Create a Java method that does the following: "Updates the designated column with a java. sql. Timestamp object.".
Of course, here is the Java code you requested: ```java public void updateTimestamp(int columnIndex, Timestamp timeStamp) throws SQLException { checkUpdatable(columnIndex); if (timeStamp == null) { parameterHolders[columnIndex - 1] = new NullParameter(ColumnType.DATETIME); return; } paramet...
infinispan/infinispan
cdi/common/src/main/java/org/infinispan/cdi/common/util/BeanManagerProvider.java
BeanManagerProvider.cleanupFinalBeanManagers
public void cleanupFinalBeanManagers(@Observes AfterDeploymentValidation adv) { for (BeanManagerInfo bmi : bmpSingleton.bmInfos.values()) { bmi.finalBm = null; bmi.booted = true; /*possible issue with >weld< based servers: if #getBeanManager gets call...
java
public void cleanupFinalBeanManagers(@Observes AfterDeploymentValidation adv) { for (BeanManagerInfo bmi : bmpSingleton.bmInfos.values()) { bmi.finalBm = null; bmi.booted = true; /*possible issue with >weld< based servers: if #getBeanManager gets call...
[ "public", "void", "cleanupFinalBeanManagers", "(", "@", "Observes", "AfterDeploymentValidation", "adv", ")", "{", "for", "(", "BeanManagerInfo", "bmi", ":", "bmpSingleton", ".", "bmInfos", ".", "values", "(", ")", ")", "{", "bmi", ".", "finalBm", "=", "null", ...
By cleaning the final BeanManager map after the Deployment got Validated, we prevent premature loading of information from JNDI in cases where the container might not be fully setup yet. This might happen if someone uses the BeanManagerProvider during Extension startup.
[ "By", "cleaning", "the", "final", "BeanManager", "map", "after", "the", "Deployment", "got", "Validated", "we", "prevent", "premature", "loading", "of", "information", "from", "JNDI", "in", "cases", "where", "the", "container", "might", "not", "be", "fully", "...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/cdi/common/src/main/java/org/infinispan/cdi/common/util/BeanManagerProvider.java#L259-L271
train
Cleanup all final bean - managers.
Create a Java method that does the following: "Cleanup all final bean - managers.".
Of course, here is the Java code you requested: ```java public void cleanupFinalBeanManagers(@Observes AfterDeploymentValidation adv) { for (BeanManagerInfo bmi : bmpSingleton.bmInfos.values()) { bmi.finalBm = null; bmi.booted = true; /*possible issue with >weld...
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java
RouteFieldClient.updateFieldTextPlain
public Field updateFieldTextPlain(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field.Type.Text); routeFieldParam.setTypeMetaData(FieldMetaData.Text....
java
public Field updateFieldTextPlain(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field.Type.Text); routeFieldParam.setTypeMetaData(FieldMetaData.Text....
[ "public", "Field", "updateFieldTextPlain", "(", "Field", "routeFieldParam", ")", "{", "if", "(", "routeFieldParam", "!=", "null", "&&", "this", ".", "serviceTicket", "!=", "null", ")", "{", "routeFieldParam", ".", "setServiceTicket", "(", "this", ".", "serviceTi...
Update an existing Text field. @param routeFieldParam Field to Update. @return Updated Field.
[ "Update", "an", "existing", "Text", "field", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java#L266-L278
test
Update the field text plain.
Create a Java method that does the following: "Update the field text plain.".
Of course, here is the Java code you requested: ```java public Field updateFieldTextPlain(Field routeFieldParam) { if(routeFieldParam != null && this.serviceTicket != null) { routeFieldParam.setServiceTicket(this.serviceTicket); } if(routeFieldParam != null) { routeFieldParam.setTypeAsEnum(Field.Type.Text...
OpenLiberty/open-liberty
dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/Util.java
Util.ensureNotNull
static <T> T ensureNotNull(String msg, T t) throws ClassLoadingConfigurationException { ensure(msg, t != null); return t; }
java
static <T> T ensureNotNull(String msg, T t) throws ClassLoadingConfigurationException { ensure(msg, t != null); return t; }
[ "static", "<", "T", ">", "T", "ensureNotNull", "(", "String", "msg", ",", "T", "t", ")", "throws", "ClassLoadingConfigurationException", "{", "ensure", "(", "msg", ",", "t", "!=", "null", ")", ";", "return", "t", ";", "}" ]
Check that the parameter is not null. @param msg the exception message to use if the parameter is null @return the parameter if it isn't null @throws ClassLoadingConfigurationException if the parameter is null
[ "Check", "that", "the", "parameter", "is", "not", "null", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/Util.java#L45-L48
train
Ensures that t is not null.
Create a Java method that does the following: "Ensures that t is not null.".
Of course, here is the Java code you requested: ```java static <T> T ensureNotNull(String msg, T t) throws ClassLoadingConfigurationException { ensure(msg, t != null); return t; } ``` Hope this helps!
Unidata/thredds
udunits/src/main/java/ucar/units/StandardPrefixDB.java
StandardPrefixDB.instance
public static synchronized StandardPrefixDB instance() throws PrefixDBException { if (instance == null) { try { instance = new StandardPrefixDB(); } catch (final Exception e) { throw new PrefixDBException( "Couldn't create standard prefix-database", e); } } ...
java
public static synchronized StandardPrefixDB instance() throws PrefixDBException { if (instance == null) { try { instance = new StandardPrefixDB(); } catch (final Exception e) { throw new PrefixDBException( "Couldn't create standard prefix-database", e); } } ...
[ "public", "static", "synchronized", "StandardPrefixDB", "instance", "(", ")", "throws", "PrefixDBException", "{", "if", "(", "instance", "==", "null", ")", "{", "try", "{", "instance", "=", "new", "StandardPrefixDB", "(", ")", ";", "}", "catch", "(", "final"...
Gets an instance of this database. @return An instance of this database. @throws PrefixDBException The instance couldn't be created.
[ "Gets", "an", "instance", "of", "this", "database", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/StandardPrefixDB.java#L73-L83
test
Get the StandardPrefixDB instance.
Create a Java method that does the following: "Get the StandardPrefixDB instance.".
Of course, here is the Java code you requested: ```java public static synchronized StandardPrefixDB instance() throws PrefixDBException { if (instance == null) { try { instance = new StandardPrefixDB(); } catch (final Exception e) { throw new PrefixDBException( "Couldn't...
WiQuery/wiquery
wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java
AjaxSlider.setAjaxSlideEvent
public void setAjaxSlideEvent(ISliderAjaxEvent ajaxSlideEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxSlideEvent, ajaxSlideEvent); setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxSlideEvent)); }
java
public void setAjaxSlideEvent(ISliderAjaxEvent ajaxSlideEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxSlideEvent, ajaxSlideEvent); setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxSlideEvent)); }
[ "public", "void", "setAjaxSlideEvent", "(", "ISliderAjaxEvent", "ajaxSlideEvent", ")", "{", "this", ".", "ajaxEvents", ".", "put", "(", "SliderAjaxEvent", ".", "ajaxSlideEvent", ",", "ajaxSlideEvent", ")", ";", "setSlideEvent", "(", "new", "SliderAjaxJsScopeUiEvent", ...
Sets the call-back for the AJAX Slide Event. @param ajaxSlideEvent The ISliderAjaxEvent.
[ "Sets", "the", "call", "-", "back", "for", "the", "AJAX", "Slide", "Event", "." ]
1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08
https://github.com/WiQuery/wiquery/blob/1b8d60c7a3c37b90fd68c9cd0ff97178fcbcbb08/wiquery-jquery-ui/src/main/java/org/odlabs/wiquery/ui/slider/AjaxSlider.java#L306-L310
train
Sets the ajax slide event.
Create a Java method that does the following: "Sets the ajax slide event.".
Of course, here is the Java code you requested: ```java public void setAjaxSlideEvent(ISliderAjaxEvent ajaxSlideEvent) { this.ajaxEvents.put(SliderAjaxEvent.ajaxSlideEvent, ajaxSlideEvent); setSlideEvent(new SliderAjaxJsScopeUiEvent(this, SliderAjaxEvent.ajaxSlideEvent)); } ``` Hope this helps!
apache/flink
flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
SqlValidatorImpl.isRolledUpColumn
private boolean isRolledUpColumn(SqlIdentifier identifier, SqlValidatorScope scope) { Pair<String, String> pair = findTableColumnPair(identifier, scope); if (pair == null) { return false; } String tableAlias = pair.left; String columnName = pair.right; Table table = findTable(tableAlias); if (table ...
java
private boolean isRolledUpColumn(SqlIdentifier identifier, SqlValidatorScope scope) { Pair<String, String> pair = findTableColumnPair(identifier, scope); if (pair == null) { return false; } String tableAlias = pair.left; String columnName = pair.right; Table table = findTable(tableAlias); if (table ...
[ "private", "boolean", "isRolledUpColumn", "(", "SqlIdentifier", "identifier", ",", "SqlValidatorScope", "scope", ")", "{", "Pair", "<", "String", ",", "String", ">", "pair", "=", "findTableColumnPair", "(", "identifier", ",", "scope", ")", ";", "if", "(", "pai...
Returns true iff the given column is actually rolled up.
[ "Returns", "true", "iff", "the", "given", "column", "is", "actually", "rolled", "up", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L3477-L3492
train
Checks if the column is rolled up.
Create a Java method that does the following: "Checks if the column is rolled up.".
Of course, here is the Java code you requested: ```java private boolean isRolledUpColumn(SqlIdentifier identifier, SqlValidatorScope scope) { Pair<String, String> pair = findTableColumnPair(identifier, scope); if (pair == null) { return false; } String tableAlias = pair.left; String columnName = pair.ri...
jboss/jboss-jstl-api_spec
src/main/java/org/apache/taglibs/standard/lang/jstl/BeanInfoManager.java
BeanInfoManager.getProperty
public BeanInfoProperty getProperty(String pPropertyName, Logger pLogger) throws ELException { checkInitialized(pLogger); return (BeanInfoProperty) mPropertyByName.get(pPropertyName); }
java
public BeanInfoProperty getProperty(String pPropertyName, Logger pLogger) throws ELException { checkInitialized(pLogger); return (BeanInfoProperty) mPropertyByName.get(pPropertyName); }
[ "public", "BeanInfoProperty", "getProperty", "(", "String", "pPropertyName", ",", "Logger", "pLogger", ")", "throws", "ELException", "{", "checkInitialized", "(", "pLogger", ")", ";", "return", "(", "BeanInfoProperty", ")", "mPropertyByName", ".", "get", "(", "pPr...
Returns the BeanInfoProperty for the given property name, or null if not found.
[ "Returns", "the", "BeanInfoProperty", "for", "the", "given", "property", "name", "or", "null", "if", "not", "found", "." ]
4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c
https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/lang/jstl/BeanInfoManager.java#L242-L247
train
Gets the property with the specified name.
Create a Java method that does the following: "Gets the property with the specified name.".
Of course, here is the Java code you requested: ```java public BeanInfoProperty getProperty(String pPropertyName, Logger pLogger) throws ELException { checkInitialized(pLogger); return (BeanInfoProperty) mPropertyByName.get(pPropertyName); } ``` ...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Construct a for loop in Java to increment a counter from 0 to 100.
Here is a sample for loop in Java that increments a counter from 0 to 100: ```java for (int i = 0; i <= 100; i++) { // Do something with the counter System.out.println(i); } ``` In this example, the loop starts with `i` initialized to 0 and continues as long as `i` is less than or equal to 100. After each ite...
googleapis/google-cloud-java
google-api-grpc/proto-google-cloud-datalabeling-v1beta1/src/main/java/com/google/cloud/datalabeling/v1beta1/LabelOperationMetadata.java
LabelOperationMetadata.getImagePolylineDetails
public com.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata getImagePolylineDetails() { if (detailsCase_ == 12) { return (com.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata) details_; } return com.google.cloud.datalabeling.v1beta1.LabelImagePolylineOpe...
java
public com.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata getImagePolylineDetails() { if (detailsCase_ == 12) { return (com.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata) details_; } return com.google.cloud.datalabeling.v1beta1.LabelImagePolylineOpe...
[ "public", "com", ".", "google", ".", "cloud", ".", "datalabeling", ".", "v1beta1", ".", "LabelImagePolylineOperationMetadata", "getImagePolylineDetails", "(", ")", "{", "if", "(", "detailsCase_", "==", "12", ")", "{", "return", "(", "com", ".", "google", ".", ...
<code> .google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata image_polyline_details = 12; </code>
[ "<code", ">", ".", "google", ".", "cloud", ".", "datalabeling", ".", "v1beta1", ".", "LabelImagePolylineOperationMetadata", "image_polyline_details", "=", "12", ";", "<", "/", "code", ">" ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-api-grpc/proto-google-cloud-datalabeling-v1beta1/src/main/java/com/google/cloud/datalabeling/v1beta1/LabelOperationMetadata.java#L769-L776
train
Gets the value of the imagePolylineDetails property.
Create a Java method that does the following: "Gets the value of the imagePolylineDetails property.".
Of course, here is the Java code you requested: ```java public com.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata getImagePolylineDetails() { if (detailsCase_ == 12) { return (com.google.cloud.datalabeling.v1beta1.LabelImagePolylineOperationMetadata) details_; } return co...
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java
JSONConverter.readNotifications
public Notification[] readNotifications(InputStream in) throws ConversionException, IOException, ClassNotFoundException { final NotificationRecord[] records = readNotificationRecords(in); final Notification[] ret = new Notification[records.length]; for (int i = 0; i < records.length; ++i) { ...
java
public Notification[] readNotifications(InputStream in) throws ConversionException, IOException, ClassNotFoundException { final NotificationRecord[] records = readNotificationRecords(in); final Notification[] ret = new Notification[records.length]; for (int i = 0; i < records.length; ++i) { ...
[ "public", "Notification", "[", "]", "readNotifications", "(", "InputStream", "in", ")", "throws", "ConversionException", ",", "IOException", ",", "ClassNotFoundException", "{", "final", "NotificationRecord", "[", "]", "records", "=", "readNotificationRecords", "(", "i...
Decode a JSON document to retrieve an array of Notification instances. @param in The stream to read JSON from @return The decoded Notification array @throws ConversionException If JSON uses unexpected structure/format @throws IOException If an I/O error occurs or if JSON is ill-formed. @throws ClassNotFoundException I...
[ "Decode", "a", "JSON", "document", "to", "retrieve", "an", "array", "of", "Notification", "instances", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1791-L1798
train
Read the list of notifications from the specified input stream.
Create a Java method that does the following: "Read the list of notifications from the specified input stream.".
Of course, here is the Java code you requested: ```java public Notification[] readNotifications(InputStream in) throws ConversionException, IOException, ClassNotFoundException { final NotificationRecord[] records = readNotificationRecords(in); final Notification[] ret = new Notification[records.length]...
kiegroup/jbpm
jbpm-audit/src/main/java/org/jbpm/process/audit/query/AbstractAuditDeleteBuilderImpl.java
AbstractAuditDeleteBuilderImpl.date
@SuppressWarnings("unchecked") public T date( Date... date ) { if (checkIfNull(date)) { return (T) this; } date = ensureDateNotTimestamp(date); addObjectParameter(DATE_LIST, "date", date); return (T) this; }
java
@SuppressWarnings("unchecked") public T date( Date... date ) { if (checkIfNull(date)) { return (T) this; } date = ensureDateNotTimestamp(date); addObjectParameter(DATE_LIST, "date", date); return (T) this; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "T", "date", "(", "Date", "...", "date", ")", "{", "if", "(", "checkIfNull", "(", "date", ")", ")", "{", "return", "(", "T", ")", "this", ";", "}", "date", "=", "ensureDateNotTimestamp", "("...
query builder methods
[ "query", "builder", "methods" ]
c3473c728aa382ebbea01e380c5e754a96647b82
https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-audit/src/main/java/org/jbpm/process/audit/query/AbstractAuditDeleteBuilderImpl.java#L74-L82
train
Sets the date field of the record.
Create a Java method that does the following: "Sets the date field of the record.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public T date( Date... date ) { if (checkIfNull(date)) { return (T) this; } date = ensureDateNotTimestamp(date); addObjectParameter(DATE_LIST, "date", date); return (T) this; ...
ArcBees/gwtquery
gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java
JsUtils.prop
public static <T> T prop(JavaScriptObject o, Object id, Class<? extends T> type) { return o == null ? null : o.<JsCache> cast().get(id, type); }
java
public static <T> T prop(JavaScriptObject o, Object id, Class<? extends T> type) { return o == null ? null : o.<JsCache> cast().get(id, type); }
[ "public", "static", "<", "T", ">", "T", "prop", "(", "JavaScriptObject", "o", ",", "Object", "id", ",", "Class", "<", "?", "extends", "T", ">", "type", ")", "{", "return", "o", "==", "null", "?", "null", ":", "o", ".", "<", "JsCache", ">", "cast"...
Returns a property present in a javascript object.
[ "Returns", "a", "property", "present", "in", "a", "javascript", "object", "." ]
93e02bc8eb030081061c56134ebee1f585981107
https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L211-L213
train
Get a property from a JavaScript object.
Create a Java method that does the following: "Get a property from a JavaScript object.".
Of course, here is the Java code you requested: ```java public static <T> T prop(JavaScriptObject o, Object id, Class<? extends T> type) { return o == null ? null : o.<JsCache> cast().get(id, type); } ``` Hope this helps!
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/component/RootPackages.java
RootPackages.addRootPackage
public void addRootPackage(final String rootPackage, String mapping) { if (packages == null) { packages = new String[0]; } if (mappings == null) { mappings = new String[0]; } // fix mapping if (mapping.length() > 0) { // mapping must start with the slash if (!mapping.startsWith(StringPool.SLASH...
java
public void addRootPackage(final String rootPackage, String mapping) { if (packages == null) { packages = new String[0]; } if (mappings == null) { mappings = new String[0]; } // fix mapping if (mapping.length() > 0) { // mapping must start with the slash if (!mapping.startsWith(StringPool.SLASH...
[ "public", "void", "addRootPackage", "(", "final", "String", "rootPackage", ",", "String", "mapping", ")", "{", "if", "(", "packages", "==", "null", ")", "{", "packages", "=", "new", "String", "[", "0", "]", ";", "}", "if", "(", "mappings", "==", "null"...
Adds root package and its path mapping. Duplicate root packages are ignored, if mapping path is equals, otherwise exception is thrown.
[ "Adds", "root", "package", "and", "its", "path", "mapping", ".", "Duplicate", "root", "packages", "are", "ignored", "if", "mapping", "path", "is", "equals", "otherwise", "exception", "is", "thrown", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/RootPackages.java#L64-L97
test
Adds the root package and mapping to the list of packages and mappings.
Create a Java method that does the following: "Adds the root package and mapping to the list of packages and mappings.".
Of course, here is the Java code you requested: ```java public void addRootPackage(final String rootPackage, String mapping) { if (packages == null) { packages = new String[0]; } if (mappings == null) { mappings = new String[0]; } // fix mapping if (mapping.length() > 0) { // mapping must start w...
samskivert/samskivert
src/main/java/com/samskivert/swing/util/ProximityTracker.java
ProximityTracker.findClosestObject
public Object findClosestObject (int x, int y, int[] distance) { // make sure we're tracking at least one object if (_size == 0) { return null; } // locate the object nearest the x coordinate int sr = binarySearch(x), sl = sr-1; int mindist = Integer.MAX_...
java
public Object findClosestObject (int x, int y, int[] distance) { // make sure we're tracking at least one object if (_size == 0) { return null; } // locate the object nearest the x coordinate int sr = binarySearch(x), sl = sr-1; int mindist = Integer.MAX_...
[ "public", "Object", "findClosestObject", "(", "int", "x", ",", "int", "y", ",", "int", "[", "]", "distance", ")", "{", "// make sure we're tracking at least one object", "if", "(", "_size", "==", "0", ")", "{", "return", "null", ";", "}", "// locate the object...
Returns the object nearest to the supplied coordinates. If <code>distance</code> is non-null and at least one element in length, the actual between the supplied coordinates and the object coordinates will be filled into the first element of the array. @return the object nearest the supplied coordinates or null if the ...
[ "Returns", "the", "object", "nearest", "to", "the", "supplied", "coordinates", ".", "If", "<code", ">", "distance<", "/", "code", ">", "is", "non", "-", "null", "and", "at", "least", "one", "element", "in", "length", "the", "actual", "between", "the", "s...
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/ProximityTracker.java#L126-L193
train
Find the closest object to the given x y and distance.
Create a Java method that does the following: "Find the closest object to the given x y and distance.".
Of course, here is the Java code you requested: ```java public Object findClosestObject (int x, int y, int[] distance) { // make sure we're tracking at least one object if (_size == 0) { return null; } // locate the object nearest the x coordinate int sr = binar...
actframework/actframework
src/main/java/act/data/ApacheMultipartParser.java
ApacheMultipartParser.getFieldName
private String getFieldName(Map /* String, String */ headers) { String fieldName = null; String cd = getHeader(headers, CONTENT_DISPOSITION); if (cd != null && cd.toLowerCase().startsWith(FORM_DATA)) { ParameterParser parser = new ParameterParser(); parser.setLowerCaseNa...
java
private String getFieldName(Map /* String, String */ headers) { String fieldName = null; String cd = getHeader(headers, CONTENT_DISPOSITION); if (cd != null && cd.toLowerCase().startsWith(FORM_DATA)) { ParameterParser parser = new ParameterParser(); parser.setLowerCaseNa...
[ "private", "String", "getFieldName", "(", "Map", "/* String, String */", "headers", ")", "{", "String", "fieldName", "=", "null", ";", "String", "cd", "=", "getHeader", "(", "headers", ",", "CONTENT_DISPOSITION", ")", ";", "if", "(", "cd", "!=", "null", "&&"...
Retrieves the field name from the <code>Content-disposition</code> header. @param headers A <code>Map</code> containing the HTTP request headers. @return The field name for the current <code>encapsulation</code>.
[ "Retrieves", "the", "field", "name", "from", "the", "<code", ">", "Content", "-", "disposition<", "/", "code", ">", "header", "." ]
55a8f8b45e71159a79ec6e157c02f71700f8cd54
https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/data/ApacheMultipartParser.java#L207-L222
train
Get the name of the field from the HTTP headers.
Create a Java method that does the following: "Get the name of the field from the HTTP headers.".
Of course, here is the Java code you requested: ```java private String getFieldName(Map /* String, String */ headers) { String fieldName = null; String cd = getHeader(headers, CONTENT_DISPOSITION); if (cd != null && cd.toLowerCase().startsWith(FORM_DATA)) { ParameterParser parser =...
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java
MultipleAlignmentWriter.toFatCat
public static String toFatCat(MultipleAlignment alignment) { // Initialize the String and put the summary information StringWriter fatcat = new StringWriter(); fatcat.append(alignment.toString() + "\n\n"); // Get the alignment sequences and the mapping List<Integer> mapSeqToStruct = new ArrayList<Integer>()...
java
public static String toFatCat(MultipleAlignment alignment) { // Initialize the String and put the summary information StringWriter fatcat = new StringWriter(); fatcat.append(alignment.toString() + "\n\n"); // Get the alignment sequences and the mapping List<Integer> mapSeqToStruct = new ArrayList<Integer>()...
[ "public", "static", "String", "toFatCat", "(", "MultipleAlignment", "alignment", ")", "{", "// Initialize the String and put the summary information", "StringWriter", "fatcat", "=", "new", "StringWriter", "(", ")", ";", "fatcat", ".", "append", "(", "alignment", ".", ...
Converts the {@link MultipleAlignment} into a FatCat String format. Includes summary information about the alignment in the top and a multiple sequence alignment at the bottom. @param alignment MultipleAlignment @return String multiple sequence alignment in FASTA format @see MultipleAlignmentTools#getSequenceAlignment...
[ "Converts", "the", "{", "@link", "MultipleAlignment", "}", "into", "a", "FatCat", "String", "format", ".", "Includes", "summary", "information", "about", "the", "alignment", "in", "the", "top", "and", "a", "multiple", "sequence", "alignment", "at", "the", "bot...
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/multiple/util/MultipleAlignmentWriter.java#L89-L125
train
This method converts a MultipleAlignment to a FatCat file.
Create a Java method that does the following: "This method converts a MultipleAlignment to a FatCat file.".
Of course, here is the Java code you requested: ```java public static String toFatCat(MultipleAlignment alignment) { // Initialize the String and put the summary information StringWriter fatcat = new StringWriter(); fatcat.append(alignment.toString() + "\n\n"); // Get the alignment sequences and the mapping ...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/ObjectInputStream.java
ObjectInputStream.readStreamHeader
protected void readStreamHeader() throws IOException, StreamCorruptedException { if (input.readShort() == STREAM_MAGIC && input.readShort() == STREAM_VERSION) { return; } throw new StreamCorruptedException(); }
java
protected void readStreamHeader() throws IOException, StreamCorruptedException { if (input.readShort() == STREAM_MAGIC && input.readShort() == STREAM_VERSION) { return; } throw new StreamCorruptedException(); }
[ "protected", "void", "readStreamHeader", "(", ")", "throws", "IOException", ",", "StreamCorruptedException", "{", "if", "(", "input", ".", "readShort", "(", ")", "==", "STREAM_MAGIC", "&&", "input", ".", "readShort", "(", ")", "==", "STREAM_VERSION", ")", "{",...
Reads and validates the ObjectInputStream header from the source stream. @throws IOException if an error occurs while reading from the source stream. @throws StreamCorruptedException if the source stream does not contain readable serialized objects.
[ "Reads", "and", "validates", "the", "ObjectInputStream", "header", "from", "the", "source", "stream", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/io/ObjectInputStream.java#L2096-L2103
train
read the stream header
Create a Java method that does the following: "read the stream header".
Of course, here is the Java code you requested: ```java protected void readStreamHeader() throws IOException, StreamCorruptedException { if (input.readShort() == STREAM_MAGIC && input.readShort() == STREAM_VERSION) { return; } throw new StreamCorruptedExc...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Generate a Java code snippet for declaring an empty list with a specific data type and limiting the maximum number of elements to 1000.
Sure! Here's a Java code snippet that declares an empty list of type Integer with a maximum limit of 1000 elements: ```java import java.util.ArrayList; import java.util.List; public class Example { public static void main(String[] args) { List<Integer> list = new ArrayList<>(1000); // Perform oper...
apache/groovy
subprojects/groovy-json/src/main/java/groovy/json/StringEscapeUtils.java
StringEscapeUtils.unescapeJava
public static String unescapeJava(String str) { if (str == null) { return null; } try { Writer writer = new StringBuilderWriter(str.length()); unescapeJava(writer, str); return writer.toString(); } catch (IOException ioe) { // t...
java
public static String unescapeJava(String str) { if (str == null) { return null; } try { Writer writer = new StringBuilderWriter(str.length()); unescapeJava(writer, str); return writer.toString(); } catch (IOException ioe) { // t...
[ "public", "static", "String", "unescapeJava", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", ")", "{", "return", "null", ";", "}", "try", "{", "Writer", "writer", "=", "new", "StringBuilderWriter", "(", "str", ".", "length", "(", ")", ...
Unescapes any Java literals found in the <code>String</code>. For example, it will turn a sequence of <code>'\'</code> and <code>'n'</code> into a newline character, unless the <code>'\'</code> is preceded by another <code>'\'</code>. @param str the <code>String</code> to unescape, may be null @return a new unescaped...
[ "Unescapes", "any", "Java", "literals", "found", "in", "the", "<code", ">", "String<", "/", "code", ">", ".", "For", "example", "it", "will", "turn", "a", "sequence", "of", "<code", ">", "\\", "<", "/", "code", ">", "and", "<code", ">", "n", "<", "...
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-json/src/main/java/groovy/json/StringEscapeUtils.java#L275-L287
train
Unescape Java string.
Create a Java method that does the following: "Unescape Java string.".
Of course, here is the Java code you requested: ```java public static String unescapeJava(String str) { if (str == null) { return null; } try { Writer writer = new StringBuilderWriter(str.length()); unescapeJava(writer, str); return writer.toStrin...
MKLab-ITI/multimedia-indexing
src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java
AbstractSearchStructure.dumpidToIidDB
public void dumpidToIidDB(String dumpFilename) throws Exception { DatabaseEntry foundKey = new DatabaseEntry(); DatabaseEntry foundData = new DatabaseEntry(); ForwardCursor cursor = idToIidDB.openCursor(null, null); BufferedWriter out = new BufferedWriter(new FileWriter(new File(dumpFilename))); while ...
java
public void dumpidToIidDB(String dumpFilename) throws Exception { DatabaseEntry foundKey = new DatabaseEntry(); DatabaseEntry foundData = new DatabaseEntry(); ForwardCursor cursor = idToIidDB.openCursor(null, null); BufferedWriter out = new BufferedWriter(new FileWriter(new File(dumpFilename))); while ...
[ "public", "void", "dumpidToIidDB", "(", "String", "dumpFilename", ")", "throws", "Exception", "{", "DatabaseEntry", "foundKey", "=", "new", "DatabaseEntry", "(", ")", ";", "DatabaseEntry", "foundData", "=", "new", "DatabaseEntry", "(", ")", ";", "ForwardCursor", ...
This is a utility method that can be used to dump the contents of the idToIidDB to a txt file. @param dumpFilename Full path to the file where the dump will be written. @throws Exception
[ "This", "is", "a", "utility", "method", "that", "can", "be", "used", "to", "dump", "the", "contents", "of", "the", "idToIidDB", "to", "a", "txt", "file", "." ]
f82e8e517da706651f4b7a719805401f3102e135
https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/datastructures/AbstractSearchStructure.java#L633-L646
train
Dump the ID to IID database.
Create a Java method that does the following: "Dump the ID to IID database.".
Of course, here is the Java code you requested: ```java public void dumpidToIidDB(String dumpFilename) throws Exception { DatabaseEntry foundKey = new DatabaseEntry(); DatabaseEntry foundData = new DatabaseEntry(); ForwardCursor cursor = idToIidDB.openCursor(null, null); BufferedWriter out = new Buffered...
aws/aws-sdk-java
aws-java-sdk-mechanicalturkrequester/src/main/java/com/amazonaws/services/mturk/model/ListWorkerBlocksResult.java
ListWorkerBlocksResult.setWorkerBlocks
public void setWorkerBlocks(java.util.Collection<WorkerBlock> workerBlocks) { if (workerBlocks == null) { this.workerBlocks = null; return; } this.workerBlocks = new java.util.ArrayList<WorkerBlock>(workerBlocks); }
java
public void setWorkerBlocks(java.util.Collection<WorkerBlock> workerBlocks) { if (workerBlocks == null) { this.workerBlocks = null; return; } this.workerBlocks = new java.util.ArrayList<WorkerBlock>(workerBlocks); }
[ "public", "void", "setWorkerBlocks", "(", "java", ".", "util", ".", "Collection", "<", "WorkerBlock", ">", "workerBlocks", ")", "{", "if", "(", "workerBlocks", "==", "null", ")", "{", "this", ".", "workerBlocks", "=", "null", ";", "return", ";", "}", "th...
<p> The list of WorkerBlocks, containing the collection of Worker IDs and reasons for blocking. </p> @param workerBlocks The list of WorkerBlocks, containing the collection of Worker IDs and reasons for blocking.
[ "<p", ">", "The", "list", "of", "WorkerBlocks", "containing", "the", "collection", "of", "Worker", "IDs", "and", "reasons", "for", "blocking", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mechanicalturkrequester/src/main/java/com/amazonaws/services/mturk/model/ListWorkerBlocksResult.java#L134-L141
train
Sets the value workerBlocks property.
Create a Java method that does the following: "Sets the value workerBlocks property.".
Of course, here is the Java code you requested: ```java public void setWorkerBlocks(java.util.Collection<WorkerBlock> workerBlocks) { if (workerBlocks == null) { this.workerBlocks = null; return; } this.workerBlocks = new java.util.ArrayList<WorkerBlock>(workerBlocks); ...
landawn/AbacusUtil
src/com/landawn/abacus/util/N.java
N.distinct
public static <T> List<T> distinct(final Collection<? extends T> c, final int fromIndex, final int toIndex) { checkFromToIndex(fromIndex, toIndex, size(c)); if (N.isNullOrEmpty(c) && fromIndex == 0 && toIndex == 0) { return new ArrayList<>(); } final List<T> result =...
java
public static <T> List<T> distinct(final Collection<? extends T> c, final int fromIndex, final int toIndex) { checkFromToIndex(fromIndex, toIndex, size(c)); if (N.isNullOrEmpty(c) && fromIndex == 0 && toIndex == 0) { return new ArrayList<>(); } final List<T> result =...
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "distinct", "(", "final", "Collection", "<", "?", "extends", "T", ">", "c", ",", "final", "int", "fromIndex", ",", "final", "int", "toIndex", ")", "{", "checkFromToIndex", "(", "fromIndex", ",",...
Mostly it's designed for one-step operation to complete the operation in one step. <code>java.util.stream.Stream</code> is preferred for multiple phases operation. @param c @param fromIndex @param toIndex @return
[ "Mostly", "it", "s", "designed", "for", "one", "-", "step", "operation", "to", "complete", "the", "operation", "in", "one", "step", ".", "<code", ">", "java", ".", "util", ".", "stream", ".", "Stream<", "/", "code", ">", "is", "preferred", "for", "mult...
544b7720175d15e9329f83dd22a8cc5fa4515e12
https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L17970-L18008
train
Returns a list of distinct objects from the specified collection.
Create a Java method that does the following: "Returns a list of distinct objects from the specified collection.".
Of course, here is the Java code you requested: ```java public static <T> List<T> distinct(final Collection<? extends T> c, final int fromIndex, final int toIndex) { checkFromToIndex(fromIndex, toIndex, size(c)); if (N.isNullOrEmpty(c) && fromIndex == 0 && toIndex == 0) { return new Ar...
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/concurrent/SimpleReadWriteLock.java
SimpleReadWriteLock.writeLocked
public <T> T writeLocked (@Nonnull final Supplier <? extends T> aSupplier) { writeLock ().lock (); try { return aSupplier.get (); } finally { writeLock ().unlock (); } }
java
public <T> T writeLocked (@Nonnull final Supplier <? extends T> aSupplier) { writeLock ().lock (); try { return aSupplier.get (); } finally { writeLock ().unlock (); } }
[ "public", "<", "T", ">", "T", "writeLocked", "(", "@", "Nonnull", "final", "Supplier", "<", "?", "extends", "T", ">", "aSupplier", ")", "{", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "return", "aSupplier", ".", "get", "(", ")",...
Execute the provided callable in a write lock. Note: no nullable/non-nullable can be assumed. @param aSupplier Callable to be executed. May not be <code>null</code>. @return The return value of the callable. May be <code>null</code>. @param <T> Return type
[ "Execute", "the", "provided", "callable", "in", "a", "write", "lock", ".", "Note", ":", "no", "nullable", "/", "non", "-", "nullable", "can", "be", "assumed", "." ]
d28c03565f44a0b804d96028d0969f9bb38c4313
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/concurrent/SimpleReadWriteLock.java#L285-L296
train
Write locked.
Create a Java method that does the following: "Write locked.".
Of course, here is the Java code you requested: ```java public <T> T writeLocked (@Nonnull final Supplier <? extends T> aSupplier) { writeLock ().lock (); try { return aSupplier.get (); } finally { writeLock ().unlock (); } } ``` Hope this helps!
lessthanoptimal/GeoRegression
main/src/georegression/struct/GeoTuple4D_F64.java
GeoTuple4D_F64.timesIP
public void timesIP( double scalar ) { x *= scalar; y *= scalar; z *= scalar; w *= scalar; }
java
public void timesIP( double scalar ) { x *= scalar; y *= scalar; z *= scalar; w *= scalar; }
[ "public", "void", "timesIP", "(", "double", "scalar", ")", "{", "x", "*=", "scalar", ";", "y", "*=", "scalar", ";", "z", "*=", "scalar", ";", "w", "*=", "scalar", ";", "}" ]
In-place scalar multiplication @param scalar value that it is multiplied by
[ "In", "-", "place", "scalar", "multiplication" ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/struct/GeoTuple4D_F64.java#L156-L161
test
Multiplies the values of the IP.
Create a Java method that does the following: "Multiplies the values of the IP.".
Of course, here is the Java code you requested: ```java public void timesIP( double scalar ) { x *= scalar; y *= scalar; z *= scalar; w *= scalar; } ``` Hope this helps!
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/util/CellPosition.java
CellPosition.of
public static CellPosition of(final String address) { ArgUtils.notEmpty(address, "address"); if(!matchedCellAddress(address)) { throw new IllegalArgumentException(address + " is wrong cell address pattern."); } return of(new CellReference(address)); }
java
public static CellPosition of(final String address) { ArgUtils.notEmpty(address, "address"); if(!matchedCellAddress(address)) { throw new IllegalArgumentException(address + " is wrong cell address pattern."); } return of(new CellReference(address)); }
[ "public", "static", "CellPosition", "of", "(", "final", "String", "address", ")", "{", "ArgUtils", ".", "notEmpty", "(", "address", ",", "\"address\"", ")", ";", "if", "(", "!", "matchedCellAddress", "(", "address", ")", ")", "{", "throw", "new", "IllegalA...
CellAddressのインスタンスを作成する。 @param address 'A1'の形式のセルのアドレス @return {@link CellPosition}のインスタンス @throws IllegalArgumentException {@literal address == null || address.length() == 0 || アドレスの書式として不正}
[ "CellAddressのインスタンスを作成する。" ]
a0c6b25c622e5f3a50b199ef685d2ee46ad5483c
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/CellPosition.java#L111-L119
train
Create a new instance of a from the given cell address.
Create a Java method that does the following: "Create a new instance of a from the given cell address.".
Of course, here is the Java code you requested: ```java public static CellPosition of(final String address) { ArgUtils.notEmpty(address, "address"); if(!matchedCellAddress(address)) { throw new IllegalArgumentException(address + " is wrong cell address pattern."); } ...
future-architect/uroborosql
src/main/java/jp/co/future/uroborosql/client/command/DescCommand.java
DescCommand.getByteLength
private int getByteLength(final Object val) { if (val == null) { return 0; } String str = val.toString(); try { return str.getBytes(System.getProperty("file.encoding")).length; } catch (UnsupportedEncodingException ex) { return 1; } }
java
private int getByteLength(final Object val) { if (val == null) { return 0; } String str = val.toString(); try { return str.getBytes(System.getProperty("file.encoding")).length; } catch (UnsupportedEncodingException ex) { return 1; } }
[ "private", "int", "getByteLength", "(", "final", "Object", "val", ")", "{", "if", "(", "val", "==", "null", ")", "{", "return", "0", ";", "}", "String", "str", "=", "val", ".", "toString", "(", ")", ";", "try", "{", "return", "str", ".", "getBytes"...
オブジェクトの文字列表現のバイト数(デフォルトエンコーディング)を取得する @param val 計算対象オブジェクト @return バイト数
[ "オブジェクトの文字列表現のバイト数(デフォルトエンコーディング)を取得する" ]
4c26db51defdac3c6ed16866e33ab45e190e2e0c
https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/client/command/DescCommand.java#L145-L155
train
Gets the byte length of the given object.
Create a Java method that does the following: "Gets the byte length of the given object.".
Of course, here is the Java code you requested: ```java private int getByteLength(final Object val) { if (val == null) { return 0; } String str = val.toString(); try { return str.getBytes(System.getProperty("file.encoding")).length; } catch (UnsupportedEncodingException ex) { return 1; } } ``` H...
cmis4j/cmis4j-core
src/main/java/org/oasis_open/docs/ns/cmis/messaging/_200908/ObjectFactory.java
ObjectFactory.createAddObjectToFolderResponseExtension
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = AddObjectToFolderResponse.class) public JAXBElement<CmisExtensionType> createAddObjectToFolderResponseExtension( CmisExtensionType value) { return new JAXBElement<CmisExtensionType>( _GetPropert...
java
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = AddObjectToFolderResponse.class) public JAXBElement<CmisExtensionType> createAddObjectToFolderResponseExtension( CmisExtensionType value) { return new JAXBElement<CmisExtensionType>( _GetPropert...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://docs.oasis-open.org/ns/cmis/messaging/200908/\"", ",", "name", "=", "\"extension\"", ",", "scope", "=", "AddObjectToFolderResponse", ".", "class", ")", "public", "JAXBElement", "<", "CmisExtensionType", ">", "createA...
Create an instance of {@link JAXBElement }{@code <} {@link CmisExtensionType }{@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "CmisExtensionType", "}", "{", "@code", ">", "}" ]
ab9570b2b04a7d6614ed381a6af28031dbd6e763
https://github.com/cmis4j/cmis4j-core/blob/ab9570b2b04a7d6614ed381a6af28031dbd6e763/src/main/java/org/oasis_open/docs/ns/cmis/messaging/_200908/ObjectFactory.java#L1734-L1740
train
Create an instance of CmisExtensionType in the given class.
Create a Java method that does the following: "Create an instance of CmisExtensionType in the given class.".
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = AddObjectToFolderResponse.class) public JAXBElement<CmisExtensionType> createAddObjectToFolderResponseExtension( CmisExtensionType value) { re...
palatable/lambda
src/main/java/com/jnape/palatable/lambda/adt/choice/Choice5.java
Choice5.discardR
@Override public <F> Choice5<A, B, C, D, E> discardR(Applicative<F, Choice5<A, B, C, D, ?>> appB) { return Monad.super.discardR(appB).coerce(); }
java
@Override public <F> Choice5<A, B, C, D, E> discardR(Applicative<F, Choice5<A, B, C, D, ?>> appB) { return Monad.super.discardR(appB).coerce(); }
[ "@", "Override", "public", "<", "F", ">", "Choice5", "<", "A", ",", "B", ",", "C", ",", "D", ",", "E", ">", "discardR", "(", "Applicative", "<", "F", ",", "Choice5", "<", "A", ",", "B", ",", "C", ",", "D", ",", "?", ">", ">", "appB", ")", ...
{@inheritDoc}
[ "{" ]
b643ba836c5916d1d8193822e5efb4e7b40c489a
https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/choice/Choice5.java#L146-L149
train
Discards the second choice of type C.
Create a Java method that does the following: "Discards the second choice of type C.".
Of course, here is the Java code you requested: ```java @Override public <F> Choice5<A, B, C, D, E> discardR(Applicative<F, Choice5<A, B, C, D, ?>> appB) { return Monad.super.discardR(appB).coerce(); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/AmazonKinesisClient.java
AmazonKinesisClient.describeStreamSummary
@Override public DescribeStreamSummaryResult describeStreamSummary(DescribeStreamSummaryRequest request) { request = beforeClientExecution(request); return executeDescribeStreamSummary(request); }
java
@Override public DescribeStreamSummaryResult describeStreamSummary(DescribeStreamSummaryRequest request) { request = beforeClientExecution(request); return executeDescribeStreamSummary(request); }
[ "@", "Override", "public", "DescribeStreamSummaryResult", "describeStreamSummary", "(", "DescribeStreamSummaryRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDescribeStreamSummary", "(", "request", ")", "...
<p> Provides a summarized description of the specified Kinesis data stream without the shard list. </p> <p> The information returned includes the stream name, Amazon Resource Name (ARN), status, record retention period, approximate creation time, monitoring, encryption details, and open shard count. </p> @param descri...
[ "<p", ">", "Provides", "a", "summarized", "description", "of", "the", "specified", "Kinesis", "data", "stream", "without", "the", "shard", "list", ".", "<", "/", "p", ">", "<p", ">", "The", "information", "returned", "includes", "the", "stream", "name", "A...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/AmazonKinesisClient.java#L981-L985
train
Retrieves the summary of a source stream.
Create a Java method that does the following: "Retrieves the summary of a source stream.".
Of course, here is the Java code you requested: ```java @Override public DescribeStreamSummaryResult describeStreamSummary(DescribeStreamSummaryRequest request) { request = beforeClientExecution(request); return executeDescribeStreamSummary(request); } ``` Hope this helps!
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/doclets/formats/html/AbstractProfileIndexWriter.java
AbstractProfileIndexWriter.addProfilePackagesIndexContents
protected void addProfilePackagesIndexContents(Profiles profiles, String text, String tableSummary, Content body, String profileName) { HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.indexHeader); addAllClassesLink(div); addAllPackagesLink(div); addA...
java
protected void addProfilePackagesIndexContents(Profiles profiles, String text, String tableSummary, Content body, String profileName) { HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.indexHeader); addAllClassesLink(div); addAllPackagesLink(div); addA...
[ "protected", "void", "addProfilePackagesIndexContents", "(", "Profiles", "profiles", ",", "String", "text", ",", "String", "tableSummary", ",", "Content", "body", ",", "String", "profileName", ")", "{", "HtmlTree", "div", "=", "new", "HtmlTree", "(", "HtmlTag", ...
Adds profile packages index contents. Call appropriate methods from the sub-classes. Adds it to the body HtmlTree @param profiles profiles to be documented @param text string which will be used as the heading @param tableSummary summary for the table @param body the document tree to which the index contents will be ad...
[ "Adds", "profile", "packages", "index", "contents", ".", "Call", "appropriate", "methods", "from", "the", "sub", "-", "classes", ".", "Adds", "it", "to", "the", "body", "HtmlTree" ]
8812d28c20f4de070a0dd6de1b45602431379834
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/AbstractProfileIndexWriter.java#L216-L225
train
Add profile packages index contents.
Create a Java method that does the following: "Add profile packages index contents.".
Of course, here is the Java code you requested: ```java protected void addProfilePackagesIndexContents(Profiles profiles, String text, String tableSummary, Content body, String profileName) { HtmlTree div = new HtmlTree(HtmlTag.DIV); div.addStyle(HtmlStyle.indexHeader); addAllClasse...
threerings/gwt-utils
src/main/java/com/threerings/gwt/ui/FX.java
FX.move
public static MoveAnimation move (final PopupPanel target) { return new MoveAnimation(target) { @Override protected void updatePosition (int left, int top) { target.setPopupPosition(left, top); } @Override protected void onStart () { super....
java
public static MoveAnimation move (final PopupPanel target) { return new MoveAnimation(target) { @Override protected void updatePosition (int left, int top) { target.setPopupPosition(left, top); } @Override protected void onStart () { super....
[ "public", "static", "MoveAnimation", "move", "(", "final", "PopupPanel", "target", ")", "{", "return", "new", "MoveAnimation", "(", "target", ")", "{", "@", "Override", "protected", "void", "updatePosition", "(", "int", "left", ",", "int", "top", ")", "{", ...
Creates an animation that will move the specified popup panel. If the popup is not showing or not visible, it will be shown and made visible immediately after moving it to the start position. The returned animation is configured fluently, for example: <code>FX.move(target).from(x, y).to(dx, dy).onComplete(action).run(...
[ "Creates", "an", "animation", "that", "will", "move", "the", "specified", "popup", "panel", ".", "If", "the", "popup", "is", "not", "showing", "or", "not", "visible", "it", "will", "be", "shown", "and", "made", "visible", "immediately", "after", "moving", ...
31b31a23b667f2a9c683160d77646db259f2aae5
https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/FX.java#L90-L104
train
Creates a move animation that moves the popup panel to the specified position.
Create a Java method that does the following: "Creates a move animation that moves the popup panel to the specified position.".
Of course, here is the Java code you requested: ```java public static MoveAnimation move (final PopupPanel target) { return new MoveAnimation(target) { @Override protected void updatePosition (int left, int top) { target.setPopupPosition(left, top); } @Ov...
LGoodDatePicker/LGoodDatePicker
Project/src/main/java/com/privatejgoodies/common/bean/Bean.java
Bean.addPropertyChangeListener
@Override public final synchronized void addPropertyChangeListener( PropertyChangeListener listener) { if (listener == null) { return; } if (changeSupport == null) { changeSupport = createPropertyChangeSupport(this); } changeSupport.addProp...
java
@Override public final synchronized void addPropertyChangeListener( PropertyChangeListener listener) { if (listener == null) { return; } if (changeSupport == null) { changeSupport = createPropertyChangeSupport(this); } changeSupport.addProp...
[ "@", "Override", "public", "final", "synchronized", "void", "addPropertyChangeListener", "(", "PropertyChangeListener", "listener", ")", "{", "if", "(", "listener", "==", "null", ")", "{", "return", ";", "}", "if", "(", "changeSupport", "==", "null", ")", "{",...
Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class.<p> If listener is {@code null}, no exception is thrown and no action is performed. @param listener the PropertyChangeListener to be added @see #removePropertyChangeListener(PropertyChangeListener) @...
[ "Adds", "a", "PropertyChangeListener", "to", "the", "listener", "list", ".", "The", "listener", "is", "registered", "for", "all", "bound", "properties", "of", "this", "class", ".", "<p", ">" ]
c7df05a5fe382e1e08a6237e9391d8dc5fd48692
https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/common/bean/Bean.java#L99-L109
train
Add a PropertyChangeListener to the ADT.
Create a Java method that does the following: "Add a PropertyChangeListener to the ADT.".
Of course, here is the Java code you requested: ```java @Override public final synchronized void addPropertyChangeListener( PropertyChangeListener listener) { if (listener == null) { return; } if (changeSupport == null) { changeSupport = createPropertyCha...
rhuss/jolokia
agent/core/src/main/java/org/jolokia/config/Configuration.java
Configuration.updateGlobalConfiguration
public void updateGlobalConfiguration(Map<String, String> pConfig) { for (ConfigKey c : ConfigKey.values()) { if (c.isGlobalConfig()) { String value = pConfig.get(c.getKeyValue()); if (value != null) { globalConfig.put(c,value); } ...
java
public void updateGlobalConfiguration(Map<String, String> pConfig) { for (ConfigKey c : ConfigKey.values()) { if (c.isGlobalConfig()) { String value = pConfig.get(c.getKeyValue()); if (value != null) { globalConfig.put(c,value); } ...
[ "public", "void", "updateGlobalConfiguration", "(", "Map", "<", "String", ",", "String", ">", "pConfig", ")", "{", "for", "(", "ConfigKey", "c", ":", "ConfigKey", ".", "values", "(", ")", ")", "{", "if", "(", "c", ".", "isGlobalConfig", "(", ")", ")", ...
Update this global configuration from a string-string. Only the known keys are taken from this map @param pConfig config map from where to take the configuration
[ "Update", "this", "global", "configuration", "from", "a", "string", "-", "string", ".", "Only", "the", "known", "keys", "are", "taken", "from", "this", "map" ]
dc95e7bef859b1829776c5a84c8f7738f5d7d9c3
https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/config/Configuration.java#L71-L80
train
Update the global configuration.
Create a Java method that does the following: "Update the global configuration.".
Of course, here is the Java code you requested: ```java public void updateGlobalConfiguration(Map<String, String> pConfig) { for (ConfigKey c : ConfigKey.values()) { if (c.isGlobalConfig()) { String value = pConfig.get(c.getKeyValue()); if (value != null) { ...
rimerosolutions/ant-git-tasks
src/main/java/com/rimerosolutions/ant/git/AbstractGitTask.java
AbstractGitTask.setDirectory
@Override public void setDirectory(File dir) { if (dir == null) { throw new BuildException("Cannot set null directory attribute."); } // no override if (this.directory == null) { this.directory = new...
java
@Override public void setDirectory(File dir) { if (dir == null) { throw new BuildException("Cannot set null directory attribute."); } // no override if (this.directory == null) { this.directory = new...
[ "@", "Override", "public", "void", "setDirectory", "(", "File", "dir", ")", "{", "if", "(", "dir", "==", "null", ")", "{", "throw", "new", "BuildException", "(", "\"Cannot set null directory attribute.\"", ")", ";", "}", "// no override", "if", "(", "this", ...
Sets the Git repository directory @antdoc.notrequired @param dir The repository directory
[ "Sets", "the", "Git", "repository", "directory" ]
bfb32fe68afe6b9dcfd0a5194497d748ef3e8a6f
https://github.com/rimerosolutions/ant-git-tasks/blob/bfb32fe68afe6b9dcfd0a5194497d748ef3e8a6f/src/main/java/com/rimerosolutions/ant/git/AbstractGitTask.java#L143-L153
train
Sets the directory to use for the CRASS AptPage.
Create a Java method that does the following: "Sets the directory to use for the CRASS AptPage.".
Of course, here is the Java code you requested: ```java @Override public void setDirectory(File dir) { if (dir == null) { throw new BuildException("Cannot set null directory attribute."); } // no override if (this.director...
VoltDB/voltdb
src/frontend/org/voltdb/client/Distributer.java
Distributer.isLongOp
private static boolean isLongOp(String procName) { if (procName.startsWith("@")) { if (procName.equals("@UpdateApplicationCatalog") || procName.equals("@SnapshotSave")) { return true; } } return false; }
java
private static boolean isLongOp(String procName) { if (procName.startsWith("@")) { if (procName.equals("@UpdateApplicationCatalog") || procName.equals("@SnapshotSave")) { return true; } } return false; }
[ "private", "static", "boolean", "isLongOp", "(", "String", "procName", ")", "{", "if", "(", "procName", ".", "startsWith", "(", "\"@\"", ")", ")", "{", "if", "(", "procName", ".", "equals", "(", "\"@UpdateApplicationCatalog\"", ")", "||", "procName", ".", ...
/* Check if the proc name is a procedure that is expected to run long Make the minimum timeoutMS for certain long running system procedures higher than the default 2m. you can still set the default timeoutMS higher than even this value
[ "/", "*", "Check", "if", "the", "proc", "name", "is", "a", "procedure", "that", "is", "expected", "to", "run", "long", "Make", "the", "minimum", "timeoutMS", "for", "certain", "long", "running", "system", "procedures", "higher", "than", "the", "default", "...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/Distributer.java#L384-L391
train
isLongOp returns true if the name of the procName is a long operation
Create a Java method that does the following: "isLongOp returns true if the name of the procName is a long operation".
Of course, here is the Java code you requested: ```java private static boolean isLongOp(String procName) { if (procName.startsWith("@")) { if (procName.equals("@UpdateApplicationCatalog") || procName.equals("@SnapshotSave")) { return true; } } return fals...
aws/aws-sdk-java
aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java
TraceSummary.setErrorRootCauses
public void setErrorRootCauses(java.util.Collection<ErrorRootCause> errorRootCauses) { if (errorRootCauses == null) { this.errorRootCauses = null; return; } this.errorRootCauses = new java.util.ArrayList<ErrorRootCause>(errorRootCauses); }
java
public void setErrorRootCauses(java.util.Collection<ErrorRootCause> errorRootCauses) { if (errorRootCauses == null) { this.errorRootCauses = null; return; } this.errorRootCauses = new java.util.ArrayList<ErrorRootCause>(errorRootCauses); }
[ "public", "void", "setErrorRootCauses", "(", "java", ".", "util", ".", "Collection", "<", "ErrorRootCause", ">", "errorRootCauses", ")", "{", "if", "(", "errorRootCauses", "==", "null", ")", "{", "this", ".", "errorRootCauses", "=", "null", ";", "return", ";...
<p> A collection of ErrorRootCause structures corresponding to the trace segments. </p> @param errorRootCauses A collection of ErrorRootCause structures corresponding to the trace segments.
[ "<p", ">", "A", "collection", "of", "ErrorRootCause", "structures", "corresponding", "to", "the", "trace", "segments", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/TraceSummary.java#L1077-L1084
train
Sets the value errorRootCauses property.
Create a Java method that does the following: "Sets the value errorRootCauses property.".
Of course, here is the Java code you requested: ```java public void setErrorRootCauses(java.util.Collection<ErrorRootCause> errorRootCauses) { if (errorRootCauses == null) { this.errorRootCauses = null; return; } this.errorRootCauses = new java.util.ArrayList<ErrorRootC...
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java
FieldAnnotation.fromFieldDescriptor
public static FieldAnnotation fromFieldDescriptor(FieldDescriptor fieldDescriptor) { return new FieldAnnotation(fieldDescriptor.getClassDescriptor().getDottedClassName(), fieldDescriptor.getName(), fieldDescriptor.getSignature(), fieldDescriptor.isStatic()); }
java
public static FieldAnnotation fromFieldDescriptor(FieldDescriptor fieldDescriptor) { return new FieldAnnotation(fieldDescriptor.getClassDescriptor().getDottedClassName(), fieldDescriptor.getName(), fieldDescriptor.getSignature(), fieldDescriptor.isStatic()); }
[ "public", "static", "FieldAnnotation", "fromFieldDescriptor", "(", "FieldDescriptor", "fieldDescriptor", ")", "{", "return", "new", "FieldAnnotation", "(", "fieldDescriptor", ".", "getClassDescriptor", "(", ")", ".", "getDottedClassName", "(", ")", ",", "fieldDescriptor...
Factory method. Construct from a FieldDescriptor. @param fieldDescriptor the FieldDescriptor @return the FieldAnnotation
[ "Factory", "method", ".", "Construct", "from", "a", "FieldDescriptor", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FieldAnnotation.java#L183-L186
train
Creates a FieldAnnotation from a field descriptor.
Create a Java method that does the following: "Creates a FieldAnnotation from a field descriptor.".
Of course, here is the Java code you requested: ```java public static FieldAnnotation fromFieldDescriptor(FieldDescriptor fieldDescriptor) { return new FieldAnnotation(fieldDescriptor.getClassDescriptor().getDottedClassName(), fieldDescriptor.getName(), fieldDescriptor.getSignature(), fieldDesc...
jMetal/jMetal
jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java
MOEADD.innerproduct
public double innerproduct(double[] vec1, double[] vec2) { double sum = 0; for (int i = 0; i < vec1.length; i++) { sum += vec1[i] * vec2[i]; } return sum; }
java
public double innerproduct(double[] vec1, double[] vec2) { double sum = 0; for (int i = 0; i < vec1.length; i++) { sum += vec1[i] * vec2[i]; } return sum; }
[ "public", "double", "innerproduct", "(", "double", "[", "]", "vec1", ",", "double", "[", "]", "vec2", ")", "{", "double", "sum", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "vec1", ".", "length", ";", "i", "++", ")", "{", ...
Calculate the dot product of two vectors
[ "Calculate", "the", "dot", "product", "of", "two", "vectors" ]
bc981e6aede275d26c5216c9a01227d9675b0cf7
https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-algorithm/src/main/java/org/uma/jmetal/algorithm/multiobjective/moead/MOEADD.java#L1364-L1372
train
Inner product of two vectors.
Create a Java method that does the following: "Inner product of two vectors.".
Of course, here is the Java code you requested: ```java public double innerproduct(double[] vec1, double[] vec2) { double sum = 0; for (int i = 0; i < vec1.length; i++) { sum += vec1[i] * vec2[i]; } return sum; } ``` Hope this helps!
oblac/jodd
jodd-vtor/src/main/java/jodd/vtor/Vtor.java
Vtor.useProfiles
public void useProfiles(final String... enabledProfiles) { if (enabledProfiles == null) { return; } if (this.enabledProfiles == null) { this.enabledProfiles = new HashSet<>(); } Collections.addAll(this.enabledProfiles, enabledProfiles); }
java
public void useProfiles(final String... enabledProfiles) { if (enabledProfiles == null) { return; } if (this.enabledProfiles == null) { this.enabledProfiles = new HashSet<>(); } Collections.addAll(this.enabledProfiles, enabledProfiles); }
[ "public", "void", "useProfiles", "(", "final", "String", "...", "enabledProfiles", ")", "{", "if", "(", "enabledProfiles", "==", "null", ")", "{", "return", ";", "}", "if", "(", "this", ".", "enabledProfiles", "==", "null", ")", "{", "this", ".", "enable...
Enables list of profiles.
[ "Enables", "list", "of", "profiles", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-vtor/src/main/java/jodd/vtor/Vtor.java#L168-L176
test
Sets the list of enabled profiles to use.
Create a Java method that does the following: "Sets the list of enabled profiles to use.".
Of course, here is the Java code you requested: ```java public void useProfiles(final String... enabledProfiles) { if (enabledProfiles == null) { return; } if (this.enabledProfiles == null) { this.enabledProfiles = new HashSet<>(); } Collections.addAll(this.enabledProfiles, enabledProfiles); } ``` Ho...
Azure/azure-sdk-for-java
storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java
BlobContainersInner.updateAsync
public ServiceFuture<BlobContainerInner> updateAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map<String, String> metadata, final ServiceCallback<BlobContainerInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resource...
java
public ServiceFuture<BlobContainerInner> updateAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map<String, String> metadata, final ServiceCallback<BlobContainerInner> serviceCallback) { return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resource...
[ "public", "ServiceFuture", "<", "BlobContainerInner", ">", "updateAsync", "(", "String", "resourceGroupName", ",", "String", "accountName", ",", "String", "containerName", ",", "PublicAccess", "publicAccess", ",", "Map", "<", "String", ",", "String", ">", "metadata"...
Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. @param accountName T...
[ "Updates", "container", "properties", "as", "specified", "in", "request", "body", ".", "Properties", "not", "mentioned", "in", "the", "request", "will", "be", "unchanged", ".", "Update", "fails", "if", "the", "specified", "container", "doesn", "t", "already", ...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L521-L523
train
Updates an existing CIDCTYPE.
Create a Java method that does the following: "Updates an existing CIDCTYPE.".
Of course, here is the Java code you requested: ```java public ServiceFuture<BlobContainerInner> updateAsync(String resourceGroupName, String accountName, String containerName, PublicAccess publicAccess, Map<String, String> metadata, final ServiceCallback<BlobContainerInner> serviceCallback) { return ServiceFu...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/SetValChildAccessMatcher.java
SetValChildAccessMatcher.getValue
Object getValue( MatchSpaceKey msg, Object contextValue) throws MatchingException, BadMessageFormatMatchingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( cclass, "getValue", "msg: " + msg + "contextValue: " + contextValue); ...
java
Object getValue( MatchSpaceKey msg, Object contextValue) throws MatchingException, BadMessageFormatMatchingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( cclass, "getValue", "msg: " + msg + "contextValue: " + contextValue); ...
[ "Object", "getValue", "(", "MatchSpaceKey", "msg", ",", "Object", "contextValue", ")", "throws", "MatchingException", ",", "BadMessageFormatMatchingException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", ...
Override default implementation of getValue() @param msg @param contextValue @throws MatchingException @throws BadMessageFormatMatchingException
[ "Override", "default", "implementation", "of", "getValue", "()" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/SetValChildAccessMatcher.java#L109-L226
train
Get the value of a single node from a MatchSpaceKey.
Create a Java method that does the following: "Get the value of a single node from a MatchSpaceKey.".
Of course, here is the Java code you requested: ```java Object getValue( MatchSpaceKey msg, Object contextValue) throws MatchingException, BadMessageFormatMatchingException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) tc.entry( cclass, "getValue", "...
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/InterfaceDefImpl.java
InterfaceDefImpl.base_interfaces
public InterfaceDef[] base_interfaces() { if (base_interfaces_ref == null) { base_interfaces_ref = new InterfaceDef[base_interfaces.length]; for (int i = 0; i < base_interfaces_ref.length; ++i) { Contained c = repository.lookup_id(base_interfaces[i]); base...
java
public InterfaceDef[] base_interfaces() { if (base_interfaces_ref == null) { base_interfaces_ref = new InterfaceDef[base_interfaces.length]; for (int i = 0; i < base_interfaces_ref.length; ++i) { Contained c = repository.lookup_id(base_interfaces[i]); base...
[ "public", "InterfaceDef", "[", "]", "base_interfaces", "(", ")", "{", "if", "(", "base_interfaces_ref", "==", "null", ")", "{", "base_interfaces_ref", "=", "new", "InterfaceDef", "[", "base_interfaces", ".", "length", "]", ";", "for", "(", "int", "i", "=", ...
InterfaceDefOperations implementation -------------------------
[ "InterfaceDefOperations", "implementation", "-------------------------" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ir/InterfaceDefImpl.java#L228-L238
test
Get the base_interfaces field of the class.
Create a Java method that does the following: "Get the base_interfaces field of the class.".
Of course, here is the Java code you requested: ```java public InterfaceDef[] base_interfaces() { if (base_interfaces_ref == null) { base_interfaces_ref = new InterfaceDef[base_interfaces.length]; for (int i = 0; i < base_interfaces_ref.length; ++i) { Contained c = repos...
Unidata/thredds
opendap/src/main/java/opendap/dap/DDS.java
DDS.ingestAttributeTable
private void ingestAttributeTable(AttributeTable at, DConstructor dc) throws DASException { Enumeration ate = at.getNames(); while (ate.hasMoreElements()) { String aName = (String) ate.nextElement(); Attribute a = at.getAttribute(aName); boolean foundIt = fals...
java
private void ingestAttributeTable(AttributeTable at, DConstructor dc) throws DASException { Enumeration ate = at.getNames(); while (ate.hasMoreElements()) { String aName = (String) ate.nextElement(); Attribute a = at.getAttribute(aName); boolean foundIt = fals...
[ "private", "void", "ingestAttributeTable", "(", "AttributeTable", "at", ",", "DConstructor", "dc", ")", "throws", "DASException", "{", "Enumeration", "ate", "=", "at", ".", "getNames", "(", ")", ";", "while", "(", "ate", ".", "hasMoreElements", "(", ")", ")"...
A helper methods for ingestDAS(). @param at @param dc @throws DASException @see #ingestDAS(DAS) @see #ingestAttribute(Attribute, BaseType) @see #ingestAttributeTable(AttributeTable, BaseType)
[ "A", "helper", "methods", "for", "ingestDAS", "()", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DDS.java#L2042-L2077
test
Infer attribute table.
Create a Java method that does the following: "Infer attribute table.".
Of course, here is the Java code you requested: ```java private void ingestAttributeTable(AttributeTable at, DConstructor dc) throws DASException { Enumeration ate = at.getNames(); while (ate.hasMoreElements()) { String aName = (String) ate.nextElement(); Attribute a = a...
mygreen/xlsmapper
src/main/java/com/gh/mygreen/xlsmapper/util/CellPosition.java
CellPosition.of
public static CellPosition of(final Cell cell) { ArgUtils.notNull(cell, "cell"); return of(cell.getRowIndex(), cell.getColumnIndex()); }
java
public static CellPosition of(final Cell cell) { ArgUtils.notNull(cell, "cell"); return of(cell.getRowIndex(), cell.getColumnIndex()); }
[ "public", "static", "CellPosition", "of", "(", "final", "Cell", "cell", ")", "{", "ArgUtils", ".", "notNull", "(", "cell", ",", "\"cell\"", ")", ";", "return", "of", "(", "cell", ".", "getRowIndex", "(", ")", ",", "cell", ".", "getColumnIndex", "(", ")...
CellAddressのインスタンスを作成する。 @param cell セルのインスタンス。 @return {@link CellPosition}のインスタンス @throws IllegalArgumentException {@literal cell == null.}
[ "CellAddressのインスタンスを作成する。" ]
a0c6b25c622e5f3a50b199ef685d2ee46ad5483c
https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/CellPosition.java#L75-L79
train
Create a CellPosition from a Cell object.
Create a Java method that does the following: "Create a CellPosition from a Cell object.".
Of course, here is the Java code you requested: ```java public static CellPosition of(final Cell cell) { ArgUtils.notNull(cell, "cell"); return of(cell.getRowIndex(), cell.getColumnIndex()); } ``` Hope this helps!
line/armeria
saml/src/main/java/com/linecorp/armeria/server/saml/SamlPortConfigBuilder.java
SamlPortConfigBuilder.setSchemeIfAbsent
SamlPortConfigBuilder setSchemeIfAbsent(SessionProtocol scheme) { requireNonNull(scheme, "scheme"); if (this.scheme == null) { if (scheme == SessionProtocol.HTTPS || scheme == SessionProtocol.HTTP) { this.scheme = scheme; } else { t...
java
SamlPortConfigBuilder setSchemeIfAbsent(SessionProtocol scheme) { requireNonNull(scheme, "scheme"); if (this.scheme == null) { if (scheme == SessionProtocol.HTTPS || scheme == SessionProtocol.HTTP) { this.scheme = scheme; } else { t...
[ "SamlPortConfigBuilder", "setSchemeIfAbsent", "(", "SessionProtocol", "scheme", ")", "{", "requireNonNull", "(", "scheme", ",", "\"scheme\"", ")", ";", "if", "(", "this", ".", "scheme", "==", "null", ")", "{", "if", "(", "scheme", "==", "SessionProtocol", ".",...
Sets a {@link SessionProtocol} only if it has not been specified before.
[ "Sets", "a", "{" ]
67d29e019fd35a35f89c45cc8f9119ff9b12b44d
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/saml/src/main/java/com/linecorp/armeria/server/saml/SamlPortConfigBuilder.java#L56-L67
train
Sets the session protocol to use.
Create a Java method that does the following: "Sets the session protocol to use.".
Of course, here is the Java code you requested: ```java SamlPortConfigBuilder setSchemeIfAbsent(SessionProtocol scheme) { requireNonNull(scheme, "scheme"); if (this.scheme == null) { if (scheme == SessionProtocol.HTTPS || scheme == SessionProtocol.HTTP) { thi...
d-sauer/JCalcAPI
src/main/java/org/jdice/calc/AbstractCalculator.java
AbstractCalculator.unbindAll
private CALC unbindAll(AbstractCalculator<CALC> undbindFrom) { // find root and first child AbstractCalculator root = undbindFrom.parentCalculator != null ? undbindFrom.parentCalculator : undbindFrom; AbstractCalculator child = root.childCalculator; while (root != null) { ...
java
private CALC unbindAll(AbstractCalculator<CALC> undbindFrom) { // find root and first child AbstractCalculator root = undbindFrom.parentCalculator != null ? undbindFrom.parentCalculator : undbindFrom; AbstractCalculator child = root.childCalculator; while (root != null) { ...
[ "private", "CALC", "unbindAll", "(", "AbstractCalculator", "<", "CALC", ">", "undbindFrom", ")", "{", "// find root and first child\r", "AbstractCalculator", "root", "=", "undbindFrom", ".", "parentCalculator", "!=", "null", "?", "undbindFrom", ".", "parentCalculator", ...
Unbind all binded calculators @param undbindFrom @return
[ "Unbind", "all", "binded", "calculators" ]
36ae1f9adfe611a6f1bd8ef87cf1dc0ec88ac035
https://github.com/d-sauer/JCalcAPI/blob/36ae1f9adfe611a6f1bd8ef87cf1dc0ec88ac035/src/main/java/org/jdice/calc/AbstractCalculator.java#L578-L602
train
Unbind all the related attributes of a CALC.
Create a Java method that does the following: "Unbind all the related attributes of a CALC.".
Of course, here is the Java code you requested: ```java private CALC unbindAll(AbstractCalculator<CALC> undbindFrom) { // find root and first child AbstractCalculator root = undbindFrom.parentCalculator != null ? undbindFrom.parentCalculator : undbindFrom; AbstractCalculator child = root.chi...
BlueBrain/bluima
modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java
diff_match_patch.patch_addContext
protected void patch_addContext(Patch patch, String text) { if (text.length() == 0) { return; } String pattern = text.substring(patch.start2, patch.start2 + patch.length1); int padding = 0; // Look for the first and last matches of pattern in text. If...
java
protected void patch_addContext(Patch patch, String text) { if (text.length() == 0) { return; } String pattern = text.substring(patch.start2, patch.start2 + patch.length1); int padding = 0; // Look for the first and last matches of pattern in text. If...
[ "protected", "void", "patch_addContext", "(", "Patch", "patch", ",", "String", "text", ")", "{", "if", "(", "text", ".", "length", "(", ")", "==", "0", ")", "{", "return", ";", "}", "String", "pattern", "=", "text", ".", "substring", "(", "patch", "....
Increase the context until it is unique, but don't let the pattern expand beyond Match_MaxBits. @param patch The patch to grow. @param text Source text.
[ "Increase", "the", "context", "until", "it", "is", "unique", "but", "don", "t", "let", "the", "pattern", "expand", "beyond", "Match_MaxBits", "." ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_pdf/src/main/java/ch/epfl/bbp/uima/pdf/grobid/diff_match_patch.java#L1875-L1920
train
Method patch_addContext.
Create a Java method that does the following: "Method patch_addContext.".
Of course, here is the Java code you requested: ```java protected void patch_addContext(Patch patch, String text) { if (text.length() == 0) { return; } String pattern = text.substring(patch.start2, patch.start2 + patch.length1); int padding = 0; // L...
UrielCh/ovh-java-sdk
ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java
ApiOvhDedicatedCloud.serviceName_PUT
public void serviceName_PUT(String serviceName, net.minidev.ovh.api.dedicatedcloud.OvhDedicatedCloud body) throws IOException { String qPath = "/dedicatedCloud/{serviceName}"; StringBuilder sb = path(qPath, serviceName); exec(qPath, "PUT", sb.toString(), body); }
java
public void serviceName_PUT(String serviceName, net.minidev.ovh.api.dedicatedcloud.OvhDedicatedCloud body) throws IOException { String qPath = "/dedicatedCloud/{serviceName}"; StringBuilder sb = path(qPath, serviceName); exec(qPath, "PUT", sb.toString(), body); }
[ "public", "void", "serviceName_PUT", "(", "String", "serviceName", ",", "net", ".", "minidev", ".", "ovh", ".", "api", ".", "dedicatedcloud", ".", "OvhDedicatedCloud", "body", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/dedicatedCloud/{serviceNa...
Alter this object properties REST: PUT /dedicatedCloud/{serviceName} @param body [required] New object properties @param serviceName [required] Domain of the service @deprecated
[ "Alter", "this", "object", "properties" ]
6d531a40e56e09701943e334c25f90f640c55701
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L2610-L2614
train
Update a dedicated cloud
Create a Java method that does the following: "Update a dedicated cloud".
Of course, here is the Java code you requested: ```java public void serviceName_PUT(String serviceName, net.minidev.ovh.api.dedicatedcloud.OvhDedicatedCloud body) throws IOException { String qPath = "/dedicatedCloud/{serviceName}"; StringBuilder sb = path(qPath, serviceName); exec(qPath, "PUT", sb.toString(), bo...
aehrc/snorocket
snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java
SnorocketOWLReasoner.dispose
@Override public void dispose() { owlOntology.getOWLOntologyManager().removeOntologyChangeListener( ontologyChangeListener); rawChanges.clear(); reasoner = new SnorocketReasoner(); }
java
@Override public void dispose() { owlOntology.getOWLOntologyManager().removeOntologyChangeListener( ontologyChangeListener); rawChanges.clear(); reasoner = new SnorocketReasoner(); }
[ "@", "Override", "public", "void", "dispose", "(", ")", "{", "owlOntology", ".", "getOWLOntologyManager", "(", ")", ".", "removeOntologyChangeListener", "(", "ontologyChangeListener", ")", ";", "rawChanges", ".", "clear", "(", ")", ";", "reasoner", "=", "new", ...
Disposes of this reasoner. This frees up any resources used by the reasoner and detaches the reasoner as an {@link org.semanticweb.owlapi.model.OWLOntologyChangeListener} from the {@link org.semanticweb.owlapi.model.OWLOntologyManager} that manages the ontologies contained within the reasoner.
[ "Disposes", "of", "this", "reasoner", ".", "This", "frees", "up", "any", "resources", "used", "by", "the", "reasoner", "and", "detaches", "the", "reasoner", "as", "an", "{" ]
e33c1e216f8a66d6502e3a14e80876811feedd8b
https://github.com/aehrc/snorocket/blob/e33c1e216f8a66d6502e3a14e80876811feedd8b/snorocket-owlapi/src/main/java/au/csiro/snorocket/owlapi/SnorocketOWLReasoner.java#L2071-L2077
train
Dispose of the related resources.
Create a Java method that does the following: "Dispose of the related resources.".
Of course, here is the Java code you requested: ```java @Override public void dispose() { owlOntology.getOWLOntologyManager().removeOntologyChangeListener( ontologyChangeListener); rawChanges.clear(); reasoner = new SnorocketReasoner(); } ``` Hope this helps!
Netflix/archaius
archaius-core/src/main/java/com/netflix/config/ConfigurationBasedDeploymentContext.java
ConfigurationBasedDeploymentContext.setDeploymentStack
@Override public void setDeploymentStack(String value) { super.setDeploymentStack(value); setValueInConfig(DEPLOYMENT_STACK_PROPERTY, value); setValueInConfig(ContextKey.stack.getKey(), value); }
java
@Override public void setDeploymentStack(String value) { super.setDeploymentStack(value); setValueInConfig(DEPLOYMENT_STACK_PROPERTY, value); setValueInConfig(ContextKey.stack.getKey(), value); }
[ "@", "Override", "public", "void", "setDeploymentStack", "(", "String", "value", ")", "{", "super", ".", "setDeploymentStack", "(", "value", ")", ";", "setValueInConfig", "(", "DEPLOYMENT_STACK_PROPERTY", ",", "value", ")", ";", "setValueInConfig", "(", "ContextKe...
Call super and also update the configuration to reflect the changes. @param value
[ "Call", "super", "and", "also", "update", "the", "configuration", "to", "reflect", "the", "changes", "." ]
2c4b0006fdea3b65ad98f6d9dd354a09c8c4ffdd
https://github.com/Netflix/archaius/blob/2c4b0006fdea3b65ad98f6d9dd354a09c8c4ffdd/archaius-core/src/main/java/com/netflix/config/ConfigurationBasedDeploymentContext.java#L286-L291
valid
Sets the deployment stack.
Create a Java method that does the following: "Sets the deployment stack.".
Of course, here is the Java code you requested: ```java @Override public void setDeploymentStack(String value) { super.setDeploymentStack(value); setValueInConfig(DEPLOYMENT_STACK_PROPERTY, value); setValueInConfig(ContextKey.stack.getKey(), value); } ``` Hope this helps!
vigna/Sux4J
src/it/unimi/dsi/sux4j/mph/CHDMinimalPerfectHashFunction.java
Builder.build
public CHDMinimalPerfectHashFunction<T> build() throws IOException { if (built) throw new IllegalStateException("This builder has been already used"); built = true; if (transform == null) { if (chunkedHashStore != null) transform = chunkedHashStore.transform(); else throw new IllegalArgumentException("...
java
public CHDMinimalPerfectHashFunction<T> build() throws IOException { if (built) throw new IllegalStateException("This builder has been already used"); built = true; if (transform == null) { if (chunkedHashStore != null) transform = chunkedHashStore.transform(); else throw new IllegalArgumentException("...
[ "public", "CHDMinimalPerfectHashFunction", "<", "T", ">", "build", "(", ")", "throws", "IOException", "{", "if", "(", "built", ")", "throw", "new", "IllegalStateException", "(", "\"This builder has been already used\"", ")", ";", "built", "=", "true", ";", "if", ...
Builds a minimal perfect hash function. @return a {@link CHDMinimalPerfectHashFunction} instance with the specified parameters. @throws IllegalStateException if called more than once.
[ "Builds", "a", "minimal", "perfect", "hash", "function", "." ]
d57de8fa897c7d273e0e6dae7a3274174f175a5f
https://github.com/vigna/Sux4J/blob/d57de8fa897c7d273e0e6dae7a3274174f175a5f/src/it/unimi/dsi/sux4j/mph/CHDMinimalPerfectHashFunction.java#L225-L233
train
Build the CHD minimal perfect hash function.
Create a Java method that does the following: "Build the CHD minimal perfect hash function.".
Of course, here is the Java code you requested: ```java public CHDMinimalPerfectHashFunction<T> build() throws IOException { if (built) throw new IllegalStateException("This builder has been already used"); built = true; if (transform == null) { if (chunkedHashStore != null) transform = chunkedHashStore.t...
aws/aws-sdk-java
aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/PolicyToPath.java
PolicyToPath.setPolicies
public void setPolicies(java.util.Collection<PolicyAttachment> policies) { if (policies == null) { this.policies = null; return; } this.policies = new java.util.ArrayList<PolicyAttachment>(policies); }
java
public void setPolicies(java.util.Collection<PolicyAttachment> policies) { if (policies == null) { this.policies = null; return; } this.policies = new java.util.ArrayList<PolicyAttachment>(policies); }
[ "public", "void", "setPolicies", "(", "java", ".", "util", ".", "Collection", "<", "PolicyAttachment", ">", "policies", ")", "{", "if", "(", "policies", "==", "null", ")", "{", "this", ".", "policies", "=", "null", ";", "return", ";", "}", "this", ".",...
<p> List of policy objects. </p> @param policies List of policy objects.
[ "<p", ">", "List", "of", "policy", "objects", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/PolicyToPath.java#L106-L113
train
Sets the value of the policies property.
Create a Java method that does the following: "Sets the value of the policies property.".
Of course, here is the Java code you requested: ```java public void setPolicies(java.util.Collection<PolicyAttachment> policies) { if (policies == null) { this.policies = null; return; } this.policies = new java.util.ArrayList<PolicyAttachment>(policies); } ``` Hop...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/GSCRImpl.java
GSCRImpl.eUnset
@Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.GSCR__PREC: setPREC(PREC_EDEFAULT); return; } super.eUnset(featureID); }
java
@Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.GSCR__PREC: setPREC(PREC_EDEFAULT); return; } super.eUnset(featureID); }
[ "@", "Override", "public", "void", "eUnset", "(", "int", "featureID", ")", "{", "switch", "(", "featureID", ")", "{", "case", "AfplibPackage", ".", "GSCR__PREC", ":", "setPREC", "(", "PREC_EDEFAULT", ")", ";", "return", ";", "}", "super", ".", "eUnset", ...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/GSCRImpl.java#L124-L132
train
Declarative Services method for setting the value of the featureID attribute.
Create a Java method that does the following: "Declarative Services method for setting the value of the featureID attribute.".
Of course, here is the Java code you requested: ```java @Override public void eUnset(int featureID) { switch (featureID) { case AfplibPackage.GSCR__PREC: setPREC(PREC_EDEFAULT); return; } super.eUnset(featureID); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/ListDeploymentTargetsRequest.java
ListDeploymentTargetsRequest.withTargetFilters
public ListDeploymentTargetsRequest withTargetFilters(java.util.Map<String, java.util.List<String>> targetFilters) { setTargetFilters(targetFilters); return this; }
java
public ListDeploymentTargetsRequest withTargetFilters(java.util.Map<String, java.util.List<String>> targetFilters) { setTargetFilters(targetFilters); return this; }
[ "public", "ListDeploymentTargetsRequest", "withTargetFilters", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "java", ".", "util", ".", "List", "<", "String", ">", ">", "targetFilters", ")", "{", "setTargetFilters", "(", "targetFilters", ")", ";", ...
<p> A key used to filter the returned targets. </p> @param targetFilters A key used to filter the returned targets. @return Returns a reference to this object so that method calls can be chained together.
[ "<p", ">", "A", "key", "used", "to", "filter", "the", "returned", "targets", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codedeploy/src/main/java/com/amazonaws/services/codedeploy/model/ListDeploymentTargetsRequest.java#L169-L172
train
A map of target names to filter the deployment targets.
Create a Java method that does the following: "A map of target names to filter the deployment targets.".
Of course, here is the Java code you requested: ```java public ListDeploymentTargetsRequest withTargetFilters(java.util.Map<String, java.util.List<String>> targetFilters) { setTargetFilters(targetFilters); return this; } ``` Hope this helps!
timols/java-gitlab-api
src/main/java/org/gitlab/api/GitlabAPI.java
GitlabAPI.createBuildVariable
public GitlabBuildVariable createBuildVariable( Integer projectId, String key, String value) throws IOException { String tailUrl = GitlabProject.URL + "/" + projectId + GitlabBuildVariable.URL; return dispatch().with("key", key) .with("value", value) ...
java
public GitlabBuildVariable createBuildVariable( Integer projectId, String key, String value) throws IOException { String tailUrl = GitlabProject.URL + "/" + projectId + GitlabBuildVariable.URL; return dispatch().with("key", key) .with("value", value) ...
[ "public", "GitlabBuildVariable", "createBuildVariable", "(", "Integer", "projectId", ",", "String", "key", ",", "String", "value", ")", "throws", "IOException", "{", "String", "tailUrl", "=", "GitlabProject", ".", "URL", "+", "\"/\"", "+", "projectId", "+", "Git...
Creates a new build variable. @param projectId The ID of the project containing the new variable. @param key The key of the variable. @param value The value of the variable @return The newly created variable. @throws IOException on gitlab api call error
[ "Creates", "a", "new", "build", "variable", "." ]
f03eedf952cfbb40306be3bf9234dcf78fab029e
https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3675-L3683
train
Create a build variable
Create a Java method that does the following: "Create a build variable".
Of course, here is the Java code you requested: ```java public GitlabBuildVariable createBuildVariable( Integer projectId, String key, String value) throws IOException { String tailUrl = GitlabProject.URL + "/" + projectId + GitlabBuildVariable.URL; return dispatch()...
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/com/ibm/ws/jaxrs21/clientconfig/JAXRSClientConfigHolder.java
JAXRSClientConfigHolder.removeConfig
public static synchronized void removeConfig(String objectId) { String uri = uriMap.get(objectId); if (uri != null) { configInfo.remove(uri); } uriMap.remove(objectId); resolvedConfigInfo.clear(); }
java
public static synchronized void removeConfig(String objectId) { String uri = uriMap.get(objectId); if (uri != null) { configInfo.remove(uri); } uriMap.remove(objectId); resolvedConfigInfo.clear(); }
[ "public", "static", "synchronized", "void", "removeConfig", "(", "String", "objectId", ")", "{", "String", "uri", "=", "uriMap", ".", "get", "(", "objectId", ")", ";", "if", "(", "uri", "!=", "null", ")", "{", "configInfo", ".", "remove", "(", "uri", "...
remove a configuration (we'll look up the uri from the objectId) @param id - the object id of the service that called us
[ "remove", "a", "configuration", "(", "we", "ll", "look", "up", "the", "uri", "from", "the", "objectId", ")" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/com/ibm/ws/jaxrs21/clientconfig/JAXRSClientConfigHolder.java#L68-L75
train
Removes a configuration from the cache.
Create a Java method that does the following: "Removes a configuration from the cache.".
Of course, here is the Java code you requested: ```java public static synchronized void removeConfig(String objectId) { String uri = uriMap.get(objectId); if (uri != null) { configInfo.remove(uri); } uriMap.remove(objectId); resolvedConfigInfo.clear(); } ``` Hop...
mikepenz/MaterialDrawer
library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java
AccountHeader.updateProfileByIdentifier
@Deprecated public void updateProfileByIdentifier(@NonNull IProfile newProfile) { int found = getPositionByIdentifier(newProfile.getIdentifier()); if (found > -1) { mAccountHeaderBuilder.mProfiles.set(found, newProfile); mAccountHeaderBuilder.updateHeaderAndList(); } ...
java
@Deprecated public void updateProfileByIdentifier(@NonNull IProfile newProfile) { int found = getPositionByIdentifier(newProfile.getIdentifier()); if (found > -1) { mAccountHeaderBuilder.mProfiles.set(found, newProfile); mAccountHeaderBuilder.updateHeaderAndList(); } ...
[ "@", "Deprecated", "public", "void", "updateProfileByIdentifier", "(", "@", "NonNull", "IProfile", "newProfile", ")", "{", "int", "found", "=", "getPositionByIdentifier", "(", "newProfile", ".", "getIdentifier", "(", ")", ")", ";", "if", "(", "found", ">", "-"...
Helper method to update a profile using it's identifier @param newProfile
[ "Helper", "method", "to", "update", "a", "profile", "using", "it", "s", "identifier" ]
f4fb31635767edead0a01cee7b7588942b89d8d9
https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L253-L260
train
Update the profile by identifier.
Create a Java method that does the following: "Update the profile by identifier.".
Of course, here is the Java code you requested: ```java @Deprecated public void updateProfileByIdentifier(@NonNull IProfile newProfile) { int found = getPositionByIdentifier(newProfile.getIdentifier()); if (found > -1) { mAccountHeaderBuilder.mProfiles.set(found, newProfile); ...
BlueBrain/bluima
modules/bluima_typesystem/src/main/java/de/julielab/jules/types/pubmed/ManualDescriptor.java
ManualDescriptor.setChemicalList
public void setChemicalList(FSArray v) { if (ManualDescriptor_Type.featOkTst && ((ManualDescriptor_Type)jcasType).casFeat_chemicalList == null) jcasType.jcas.throwFeatMissing("chemicalList", "de.julielab.jules.types.pubmed.ManualDescriptor"); jcasType.ll_cas.ll_setRefValue(addr, ((ManualDescriptor_Type)jc...
java
public void setChemicalList(FSArray v) { if (ManualDescriptor_Type.featOkTst && ((ManualDescriptor_Type)jcasType).casFeat_chemicalList == null) jcasType.jcas.throwFeatMissing("chemicalList", "de.julielab.jules.types.pubmed.ManualDescriptor"); jcasType.ll_cas.ll_setRefValue(addr, ((ManualDescriptor_Type)jc...
[ "public", "void", "setChemicalList", "(", "FSArray", "v", ")", "{", "if", "(", "ManualDescriptor_Type", ".", "featOkTst", "&&", "(", "(", "ManualDescriptor_Type", ")", "jcasType", ")", ".", "casFeat_chemicalList", "==", "null", ")", "jcasType", ".", "jcas", "....
setter for chemicalList - sets A collection of objects of type uima.julielab.uima.Chemical, O @generated @param v value to set into the feature
[ "setter", "for", "chemicalList", "-", "sets", "A", "collection", "of", "objects", "of", "type", "uima", ".", "julielab", ".", "uima", ".", "Chemical", "O" ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/pubmed/ManualDescriptor.java#L144-L147
train
setter for chemicalList - sets
Create a Java method that does the following: "setter for chemicalList - sets".
Of course, here is the Java code you requested: ```java public void setChemicalList(FSArray v) { if (ManualDescriptor_Type.featOkTst && ((ManualDescriptor_Type)jcasType).casFeat_chemicalList == null) jcasType.jcas.throwFeatMissing("chemicalList", "de.julielab.jules.types.pubmed.ManualDescriptor"); jcasTy...