repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
facebookarchive/hadoop-20
src/contrib/raid/src/java/org/apache/hadoop/raid/JobMonitor.java
JobMonitor.getRunningJobs
public List<DistRaid> getRunningJobs() { List<DistRaid> list = new LinkedList<DistRaid>(); synchronized(jobs) { for (List<DistRaid> jobList : jobs.values()) { synchronized(jobList) { list.addAll(jobList); } } } return list; }
java
public List<DistRaid> getRunningJobs() { List<DistRaid> list = new LinkedList<DistRaid>(); synchronized(jobs) { for (List<DistRaid> jobList : jobs.values()) { synchronized(jobList) { list.addAll(jobList); } } } return list; }
[ "public", "List", "<", "DistRaid", ">", "getRunningJobs", "(", ")", "{", "List", "<", "DistRaid", ">", "list", "=", "new", "LinkedList", "<", "DistRaid", ">", "(", ")", ";", "synchronized", "(", "jobs", ")", "{", "for", "(", "List", "<", "DistRaid", ...
for test
[ "for", "test" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/JobMonitor.java#L203-L213
train
Get the running jobs.
Of course, here is the Java code you requested: ```java public List<DistRaid> getRunningJobs() { List<DistRaid> list = new LinkedList<DistRaid>(); synchronized(jobs) { for (List<DistRaid> jobList : jobs.values()) { synchronized(jobList) { list.addAll(jobList); } } } ...
actorapp/actor-platform
actor-sdk/sdk-core-android/android-app/src/main/java/im/actor/tour/VerticalViewPager.java
VerticalViewPager.setInternalPageChangeListener
ViewPager.OnPageChangeListener setInternalPageChangeListener(ViewPager.OnPageChangeListener listener) { ViewPager.OnPageChangeListener oldListener = mInternalPageChangeListener; mInternalPageChangeListener = listener; return oldListener; }
java
ViewPager.OnPageChangeListener setInternalPageChangeListener(ViewPager.OnPageChangeListener listener) { ViewPager.OnPageChangeListener oldListener = mInternalPageChangeListener; mInternalPageChangeListener = listener; return oldListener; }
[ "ViewPager", ".", "OnPageChangeListener", "setInternalPageChangeListener", "(", "ViewPager", ".", "OnPageChangeListener", "listener", ")", "{", "ViewPager", ".", "OnPageChangeListener", "oldListener", "=", "mInternalPageChangeListener", ";", "mInternalPageChangeListener", "=", ...
Set a separate OnPageChangeListener for internal use by the support library. @param listener Listener to set @return The old listener that was set, if any.
[ "Set", "a", "separate", "OnPageChangeListener", "for", "internal", "use", "by", "the", "support", "library", "." ]
5123c1584757c6eeea0ed2a0e7e043629871a0c6
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core-android/android-app/src/main/java/im/actor/tour/VerticalViewPager.java#L518-L522
train
Set the internal page change listener.
Of course, here is the Java code you requested: ```java ViewPager.OnPageChangeListener setInternalPageChangeListener(ViewPager.OnPageChangeListener listener) { ViewPager.OnPageChangeListener oldListener = mInternalPageChangeListener; mInternalPageChangeListener = listener; return oldListener; ...
liferay/com-liferay-commerce
commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java
CPDefinitionOptionRelPersistenceImpl.findByCPDefinitionId
@Override public List<CPDefinitionOptionRel> findByCPDefinitionId( long CPDefinitionId, int start, int end, OrderByComparator<CPDefinitionOptionRel> orderByComparator) { return findByCPDefinitionId(CPDefinitionId, start, end, orderByComparator, true); }
java
@Override public List<CPDefinitionOptionRel> findByCPDefinitionId( long CPDefinitionId, int start, int end, OrderByComparator<CPDefinitionOptionRel> orderByComparator) { return findByCPDefinitionId(CPDefinitionId, start, end, orderByComparator, true); }
[ "@", "Override", "public", "List", "<", "CPDefinitionOptionRel", ">", "findByCPDefinitionId", "(", "long", "CPDefinitionId", ",", "int", "start", ",", "int", "end", ",", "OrderByComparator", "<", "CPDefinitionOptionRel", ">", "orderByComparator", ")", "{", "return",...
Returns an ordered range of all the cp definition option rels where CPDefinitionId = &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the f...
[ "Returns", "an", "ordered", "range", "of", "all", "the", "cp", "definition", "option", "rels", "where", "CPDefinitionId", "=", "&#63", ";", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionRelPersistenceImpl.java#L2585-L2591
train
Returns a range of cp definition option rels from the database.
Of course, here is the Java code you requested: ```java @Override public List<CPDefinitionOptionRel> findByCPDefinitionId( long CPDefinitionId, int start, int end, OrderByComparator<CPDefinitionOptionRel> orderByComparator) { return findByCPDefinitionId(CPDefinitionId, start, end, orderByComparator, true); ...
thorntail/thorntail
fractions/microprofile/microprofile-openapi/src/main/java/org/wildfly/swarm/microprofile/openapi/deployment/OpenApiServletContextListener.java
OpenApiServletContextListener.getFilter
private OASFilter getFilter() { ClassLoader cl = getContextClassLoader(); if (cl == null) { cl = OpenApiServletContextListener.class.getClassLoader(); } return OpenApiProcessor.getFilter(config, cl); }
java
private OASFilter getFilter() { ClassLoader cl = getContextClassLoader(); if (cl == null) { cl = OpenApiServletContextListener.class.getClassLoader(); } return OpenApiProcessor.getFilter(config, cl); }
[ "private", "OASFilter", "getFilter", "(", ")", "{", "ClassLoader", "cl", "=", "getContextClassLoader", "(", ")", ";", "if", "(", "cl", "==", "null", ")", "{", "cl", "=", "OpenApiServletContextListener", ".", "class", ".", "getClassLoader", "(", ")", ";", "...
Instantiate the {@link OASFilter} configured by the app.
[ "Instantiate", "the", "{" ]
4a391b68ffae98c6e66d30a3bfb99dadc9509f14
https://github.com/thorntail/thorntail/blob/4a391b68ffae98c6e66d30a3bfb99dadc9509f14/fractions/microprofile/microprofile-openapi/src/main/java/org/wildfly/swarm/microprofile/openapi/deployment/OpenApiServletContextListener.java#L81-L87
train
Get the filter
Of course, here is the Java code you requested: ```java private OASFilter getFilter() { ClassLoader cl = getContextClassLoader(); if (cl == null) { cl = OpenApiServletContextListener.class.getClassLoader(); } return OpenApiProcessor.getFilter(config, cl); } ``` Hope thi...
webmetrics/browsermob-proxy
src/main/java/org/java_bandwidthlimiter/StreamManager.java
StreamManager.setPayloadPercentage
public void setPayloadPercentage(int payloadPercentage) { if( !(payloadPercentage > 0 && payloadPercentage <= 100) ) { //if an invalid percentage is given payloadPercentage = 95; } this.actualPayloadPercentage = (double) payloadPercentage/100; setMaxBps(this.downS...
java
public void setPayloadPercentage(int payloadPercentage) { if( !(payloadPercentage > 0 && payloadPercentage <= 100) ) { //if an invalid percentage is given payloadPercentage = 95; } this.actualPayloadPercentage = (double) payloadPercentage/100; setMaxBps(this.downS...
[ "public", "void", "setPayloadPercentage", "(", "int", "payloadPercentage", ")", "{", "if", "(", "!", "(", "payloadPercentage", ">", "0", "&&", "payloadPercentage", "<=", "100", ")", ")", "{", "//if an invalid percentage is given", "payloadPercentage", "=", "95", "...
To take into account overhead due to underlying protocols (e.g. TCP/IP) @param payloadPercentage a ] 0 , 100] value. where 100 means that the required downstream/upstream bandwidth will be full used for sending payload. Default value is 95%. The default value is applied if an out of boundaries value is passed in.
[ "To", "take", "into", "account", "overhead", "due", "to", "underlying", "protocols", "(", "e", ".", "g", ".", "TCP", "/", "IP", ")" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/java_bandwidthlimiter/StreamManager.java#L166-L174
train
Sets the payload percentage.
Of course, here is the Java code you requested: ```java public void setPayloadPercentage(int payloadPercentage) { if( !(payloadPercentage > 0 && payloadPercentage <= 100) ) { //if an invalid percentage is given payloadPercentage = 95; } this.actualPayloadPercentage = (do...
lessthanoptimal/ejml
main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java
CommonOps_DDRM.setIdentity
public static void setIdentity( DMatrix1Row mat ) { int width = mat.numRows < mat.numCols ? mat.numRows : mat.numCols; Arrays.fill(mat.data,0,mat.getNumElements(),0); int index = 0; for( int i = 0; i < width; i++ , index += mat.numCols + 1) { mat.data[index] = 1; ...
java
public static void setIdentity( DMatrix1Row mat ) { int width = mat.numRows < mat.numCols ? mat.numRows : mat.numCols; Arrays.fill(mat.data,0,mat.getNumElements(),0); int index = 0; for( int i = 0; i < width; i++ , index += mat.numCols + 1) { mat.data[index] = 1; ...
[ "public", "static", "void", "setIdentity", "(", "DMatrix1Row", "mat", ")", "{", "int", "width", "=", "mat", ".", "numRows", "<", "mat", ".", "numCols", "?", "mat", ".", "numRows", ":", "mat", ".", "numCols", ";", "Arrays", ".", "fill", "(", "mat", "....
Sets all the diagonal elements equal to one and everything else equal to zero. If this is a square matrix then it will be an identity matrix. @see #identity(int) @param mat A square matrix.
[ "Sets", "all", "the", "diagonal", "elements", "equal", "to", "one", "and", "everything", "else", "equal", "to", "zero", ".", "If", "this", "is", "a", "square", "matrix", "then", "it", "will", "be", "an", "identity", "matrix", "." ]
1444680cc487af5e866730e62f48f5f9636850d9
https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L946-L956
train
Sets the identity matrix to 1.
Of course, here is the Java code you requested: ```java public static void setIdentity( DMatrix1Row mat ) { int width = mat.numRows < mat.numCols ? mat.numRows : mat.numCols; Arrays.fill(mat.data,0,mat.getNumElements(),0); int index = 0; for( int i = 0; i < width; i++ , index += m...
msgpack/msgpack-java
msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java
MessagePacker.writePayload
public MessagePacker writePayload(byte[] src, int off, int len) throws IOException { if (buffer == null || buffer.size() - position < len || len > bufferFlushThreshold) { flush(); // call flush before write // Directly write payload to the output without using the buffer...
java
public MessagePacker writePayload(byte[] src, int off, int len) throws IOException { if (buffer == null || buffer.size() - position < len || len > bufferFlushThreshold) { flush(); // call flush before write // Directly write payload to the output without using the buffer...
[ "public", "MessagePacker", "writePayload", "(", "byte", "[", "]", "src", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "buffer", "==", "null", "||", "buffer", ".", "size", "(", ")", "-", "position", "<", "len", "...
Writes a byte array to the output. <p> This method is used with {@link #packRawStringHeader(int)} or {@link #packBinaryHeader(int)} methods. @param src the data to add @param off the start offset in the data @param len the number of bytes to add @return this @throws IOException when underlying output throws IOExceptio...
[ "Writes", "a", "byte", "array", "to", "the", "output", ".", "<p", ">", "This", "method", "is", "used", "with", "{", "@link", "#packRawStringHeader", "(", "int", ")", "}", "or", "{", "@link", "#packBinaryHeader", "(", "int", ")", "}", "methods", "." ]
16e370e348215a72a14c210b42d448d513aee015
https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/MessagePacker.java#L1009-L1023
train
Write a payload to the message packer.
Of course, here is the Java code you requested: ```java public MessagePacker writePayload(byte[] src, int off, int len) throws IOException { if (buffer == null || buffer.size() - position < len || len > bufferFlushThreshold) { flush(); // call flush before write // Dire...
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/io/async/Timer.java
Timer.removeSlot
public void removeSlot(TimeSlot oldSlot) { if (oldSlot.nextEntry != null) { oldSlot.nextEntry.prevEntry = oldSlot.prevEntry; } else { // old slot was tail. this.lastSlot = oldSlot.prevEntry; } if (oldSlot.prevEntry != null) { oldSlot.prev...
java
public void removeSlot(TimeSlot oldSlot) { if (oldSlot.nextEntry != null) { oldSlot.nextEntry.prevEntry = oldSlot.prevEntry; } else { // old slot was tail. this.lastSlot = oldSlot.prevEntry; } if (oldSlot.prevEntry != null) { oldSlot.prev...
[ "public", "void", "removeSlot", "(", "TimeSlot", "oldSlot", ")", "{", "if", "(", "oldSlot", ".", "nextEntry", "!=", "null", ")", "{", "oldSlot", ".", "nextEntry", ".", "prevEntry", "=", "oldSlot", ".", "prevEntry", ";", "}", "else", "{", "// old slot was t...
Remove a time slot from the list. @param oldSlot
[ "Remove", "a", "time", "slot", "from", "the", "list", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/io/async/Timer.java#L360-L376
train
Removes a time slot from this time slot list.
Of course, here is the Java code you requested: ```java public void removeSlot(TimeSlot oldSlot) { if (oldSlot.nextEntry != null) { oldSlot.nextEntry.prevEntry = oldSlot.prevEntry; } else { // old slot was tail. this.lastSlot = oldSlot.prevEntry; } ...
ben-manes/caffeine
simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/Registry.java
Registry.policies
public static Set<Policy> policies(BasicSettings settings) { return settings.policies().stream() .flatMap(name -> policy(settings, name).stream()) .collect(toSet()); }
java
public static Set<Policy> policies(BasicSettings settings) { return settings.policies().stream() .flatMap(name -> policy(settings, name).stream()) .collect(toSet()); }
[ "public", "static", "Set", "<", "Policy", ">", "policies", "(", "BasicSettings", "settings", ")", "{", "return", "settings", ".", "policies", "(", ")", ".", "stream", "(", ")", ".", "flatMap", "(", "name", "->", "policy", "(", "settings", ",", "name", ...
Returns all of the policies that have been configured for simulation.
[ "Returns", "all", "of", "the", "policies", "that", "have", "been", "configured", "for", "simulation", "." ]
4cf6d6e6a18ea2e8088f166261e5949343b0f2eb
https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/simulator/src/main/java/com/github/benmanes/caffeine/cache/simulator/policy/Registry.java#L96-L100
train
Get the policies from a set of basic settings.
Of course, here is the Java code you requested: ```java public static Set<Policy> policies(BasicSettings settings) { return settings.policies().stream() .flatMap(name -> policy(settings, name).stream()) .collect(toSet()); } ``` Hope this helps!
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/value/basic/BasicPath.java
BasicPath.writeObject
private void writeObject( ObjectOutputStream aStream ) throws IOException { aStream.writeBoolean(absolute); aStream.writeBoolean(normalized); aStream.writeObject(Collections.unmodifiableList(new ArrayList<Path.Segment>(segments))); // make a copy! }
java
private void writeObject( ObjectOutputStream aStream ) throws IOException { aStream.writeBoolean(absolute); aStream.writeBoolean(normalized); aStream.writeObject(Collections.unmodifiableList(new ArrayList<Path.Segment>(segments))); // make a copy! }
[ "private", "void", "writeObject", "(", "ObjectOutputStream", "aStream", ")", "throws", "IOException", "{", "aStream", ".", "writeBoolean", "(", "absolute", ")", ";", "aStream", ".", "writeBoolean", "(", "normalized", ")", ";", "aStream", ".", "writeObject", "(",...
Custom serialization is needed, since the 'segments' list may not be serializable (e.g., java.util.RandomAccessSubList). @param aStream the input stream to which this object should be serialized; never null @throws IOException if there is a problem writing to the stream
[ "Custom", "serialization", "is", "needed", "since", "the", "segments", "list", "may", "not", "be", "serializable", "(", "e", ".", "g", ".", "java", ".", "util", ".", "RandomAccessSubList", ")", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/basic/BasicPath.java#L132-L136
train
Write the object.
Of course, here is the Java code you requested: ```java private void writeObject( ObjectOutputStream aStream ) throws IOException { aStream.writeBoolean(absolute); aStream.writeBoolean(normalized); aStream.writeObject(Collections.unmodifiableList(new ArrayList<Path.Segment>(segments))); // make...
Azure/azure-sdk-for-java
servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/TransactionContext.java
TransactionContext.rollback
public void rollback() throws ServiceBusException, InterruptedException { if (this.messagingFactory == null) { throw new ServiceBusException(false, "MessagingFactory should not be null"); } this.messagingFactory.endTransaction(this, false); }
java
public void rollback() throws ServiceBusException, InterruptedException { if (this.messagingFactory == null) { throw new ServiceBusException(false, "MessagingFactory should not be null"); } this.messagingFactory.endTransaction(this, false); }
[ "public", "void", "rollback", "(", ")", "throws", "ServiceBusException", ",", "InterruptedException", "{", "if", "(", "this", ".", "messagingFactory", "==", "null", ")", "{", "throw", "new", "ServiceBusException", "(", "false", ",", "\"MessagingFactory should not be...
Rollback the transaction @throws ServiceBusException if rollback failed @throws InterruptedException if the current thread was interrupted while waiting
[ "Rollback", "the", "transaction" ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/TransactionContext.java#L71-L77
train
Rollback the transaction.
Of course, here is the Java code you requested: ```java public void rollback() throws ServiceBusException, InterruptedException { if (this.messagingFactory == null) { throw new ServiceBusException(false, "MessagingFactory should not be null"); } this.messagingFactory.endTransaction...
joniles/mpxj
src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileReader.java
PrimaveraPMFileReader.readActivityCodes
private void readActivityCodes(Task task, List<CodeAssignmentType> codes) { for (CodeAssignmentType assignment : codes) { ActivityCodeValue code = m_activityCodeMap.get(Integer.valueOf(assignment.getValueObjectId())); if (code != null) { task.addActivityCode(code); ...
java
private void readActivityCodes(Task task, List<CodeAssignmentType> codes) { for (CodeAssignmentType assignment : codes) { ActivityCodeValue code = m_activityCodeMap.get(Integer.valueOf(assignment.getValueObjectId())); if (code != null) { task.addActivityCode(code); ...
[ "private", "void", "readActivityCodes", "(", "Task", "task", ",", "List", "<", "CodeAssignmentType", ">", "codes", ")", "{", "for", "(", "CodeAssignmentType", "assignment", ":", "codes", ")", "{", "ActivityCodeValue", "code", "=", "m_activityCodeMap", ".", "get"...
Read details of any activity codes assigned to this task. @param task parent task @param codes activity code assignments
[ "Read", "details", "of", "any", "activity", "codes", "assigned", "to", "this", "task", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/PrimaveraPMFileReader.java#L1115-L1125
train
Read activity codes.
Of course, here is the Java code you requested: ```java private void readActivityCodes(Task task, List<CodeAssignmentType> codes) { for (CodeAssignmentType assignment : codes) { ActivityCodeValue code = m_activityCodeMap.get(Integer.valueOf(assignment.getValueObjectId())); if (code != ...
OpenLiberty/open-liberty
dev/com.ibm.ws.session/src/com/ibm/ws/session/store/memory/MemoryStore.java
MemoryStore.removeSession
@Override public void removeSession(String id) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { String s = id + appNameForLogging; LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "removeSession",...
java
@Override public void removeSession(String id) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { String s = id + appNameForLogging; LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "removeSession",...
[ "@", "Override", "public", "void", "removeSession", "(", "String", "id", ")", "{", "if", "(", "com", ".", "ibm", ".", "ejs", ".", "ras", ".", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "LoggingUtil", ".", "SESSION_LOGGER_CORE", ".", "isL...
/* removeSessions removes session from HashMap for in-memory overridden for persistent stores @see com.ibm.wsspi.session.IStore#removeSession(java.lang.String)
[ "/", "*", "removeSessions", "removes", "session", "from", "HashMap", "for", "in", "-", "memory", "overridden", "for", "persistent", "stores" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/session/store/memory/MemoryStore.java#L391-L401
train
Removes a session from the Session Store
Of course, here is the Java code you requested: ```java @Override public void removeSession(String id) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { String s = id + appNameForLogging; LoggingUtil.SESSION_LOGGE...
alkacon/opencms-core
src/org/opencms/ade/configuration/CmsConfigurationCache.java
CmsConfigurationCache.performUpdate
protected void performUpdate() { // Wrap a try-catch around everything, because an escaping exception would cancel the task from which this is called List<CmsWaitHandle> waitHandles = new ArrayList<>(); try { ArrayList<Object> work = new ArrayList<>(); m_workQueue....
java
protected void performUpdate() { // Wrap a try-catch around everything, because an escaping exception would cancel the task from which this is called List<CmsWaitHandle> waitHandles = new ArrayList<>(); try { ArrayList<Object> work = new ArrayList<>(); m_workQueue....
[ "protected", "void", "performUpdate", "(", ")", "{", "// Wrap a try-catch around everything, because an escaping exception would cancel the task from which this is called\r", "List", "<", "CmsWaitHandle", ">", "waitHandles", "=", "new", "ArrayList", "<>", "(", ")", ";", "try", ...
Checks if any configuration updates are required, and performs them if necessary.<p> This should only be called from the scheduled update task.<p>
[ "Checks", "if", "any", "configuration", "updates", "are", "required", "and", "performs", "them", "if", "necessary", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsConfigurationCache.java#L528-L586
train
Updates the cache with the latest configuration.
Of course, here is the Java code you requested: ```java protected void performUpdate() { // Wrap a try-catch around everything, because an escaping exception would cancel the task from which this is called List<CmsWaitHandle> waitHandles = new ArrayList<>(); try { ArrayList<Ob...
OpenTSDB/opentsdb
src/tsd/AbstractHttpQuery.java
AbstractHttpQuery.internalError
public void internalError(final Exception cause) { logError("Internal Server Error on " + request().getUri(), cause); sendBuffer(HttpResponseStatus.INTERNAL_SERVER_ERROR, ChannelBuffers.wrappedBuffer( cause.toString().getBytes(Const.UTF8_CHARSET)), "text/plain"); }
java
public void internalError(final Exception cause) { logError("Internal Server Error on " + request().getUri(), cause); sendBuffer(HttpResponseStatus.INTERNAL_SERVER_ERROR, ChannelBuffers.wrappedBuffer( cause.toString().getBytes(Const.UTF8_CHARSET)), "text/plain"); }
[ "public", "void", "internalError", "(", "final", "Exception", "cause", ")", "{", "logError", "(", "\"Internal Server Error on \"", "+", "request", "(", ")", ".", "getUri", "(", ")", ",", "cause", ")", ";", "sendBuffer", "(", "HttpResponseStatus", ".", "INTERNA...
Sends <code>500/Internal Server Error</code> to the client. @param cause The unexpected exception that caused this error.
[ "Sends", "<code", ">", "500", "/", "Internal", "Server", "Error<", "/", "code", ">", "to", "the", "client", "." ]
3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3
https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/AbstractHttpQuery.java#L373-L379
train
Sends an internal error response to the client.
Of course, here is the Java code you requested: ```java public void internalError(final Exception cause) { logError("Internal Server Error on " + request().getUri(), cause); sendBuffer(HttpResponseStatus.INTERNAL_SERVER_ERROR, ChannelBuffers.wrappedBuffer( cause.toString().getBytes(Const.UT...
datasift/datasift-java
src/main/java/com/datasift/client/push/connectors/MongoDB.java
MongoDB.format
public MongoDB format(MongoDBFormat format) { String strFormat; switch (format) { case BASIC_INTERACTION_META: strFormat = "basic_interaction_meta"; break; case FULL_INTERACTION_META_DATE: strFormat = "full_interaction_meta_date"; ...
java
public MongoDB format(MongoDBFormat format) { String strFormat; switch (format) { case BASIC_INTERACTION_META: strFormat = "basic_interaction_meta"; break; case FULL_INTERACTION_META_DATE: strFormat = "full_interaction_meta_date"; ...
[ "public", "MongoDB", "format", "(", "MongoDBFormat", "format", ")", "{", "String", "strFormat", ";", "switch", "(", "format", ")", "{", "case", "BASIC_INTERACTION_META", ":", "strFormat", "=", "\"basic_interaction_meta\"", ";", "break", ";", "case", "FULL_INTERACT...
/* The output format for your data: basic_interaction_meta - The current default format, where each payload contains only basic interaction JSON document. full_interaction_meta - The payload is a full interaction with augmentations. Take a look at our Sample Output for Database Connectors page. @return this
[ "/", "*", "The", "output", "format", "for", "your", "data", ":", "basic_interaction_meta", "-", "The", "current", "default", "format", "where", "each", "payload", "contains", "only", "basic", "interaction", "JSON", "document", ".", "full_interaction_meta", "-", ...
09de124f2a1a507ff6181e59875c6f325290850e
https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/push/connectors/MongoDB.java#L97-L112
train
Set the format to use.
Of course, here is the Java code you requested: ```java public MongoDB format(MongoDBFormat format) { String strFormat; switch (format) { case BASIC_INTERACTION_META: strFormat = "basic_interaction_meta"; break; case FULL_INTERACTION_META_DATE: ...
astrapi69/jaulp-wicket
jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/dataprotection/DataProtectionPanel.java
DataProtectionPanel.newListComponent
@Override protected Component newListComponent(final String id, final ListItem<ResourceBundleKey> item) { return new Label(id, newContentResourceModel(item.getModel())) .add(new JQueryJsAppenderBehavior("wrap", "<p></p>")); }
java
@Override protected Component newListComponent(final String id, final ListItem<ResourceBundleKey> item) { return new Label(id, newContentResourceModel(item.getModel())) .add(new JQueryJsAppenderBehavior("wrap", "<p></p>")); }
[ "@", "Override", "protected", "Component", "newListComponent", "(", "final", "String", "id", ",", "final", "ListItem", "<", "ResourceBundleKey", ">", "item", ")", "{", "return", "new", "Label", "(", "id", ",", "newContentResourceModel", "(", "item", ".", "getM...
{@inheritDoc}
[ "{" ]
85d74368d00abd9bb97659b5794e38c0f8a013d4
https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/termofuse/dataprotection/DataProtectionPanel.java#L74-L79
train
New list component.
Of course, here is the Java code you requested: ```java @Override protected Component newListComponent(final String id, final ListItem<ResourceBundleKey> item) { return new Label(id, newContentResourceModel(item.getModel())) .add(new JQueryJsAppenderBehavior("wrap", "<p></p>")); } ``` Hope this helps!
moparisthebest/beehive
beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/rendering/CellModel.java
CellModel.addFormatter
public void addFormatter(Formatter formatter) { if(_formatters == null) _formatters = new ArrayList/*<Formatter>*/(); _formatters.add(formatter); }
java
public void addFormatter(Formatter formatter) { if(_formatters == null) _formatters = new ArrayList/*<Formatter>*/(); _formatters.add(formatter); }
[ "public", "void", "addFormatter", "(", "Formatter", "formatter", ")", "{", "if", "(", "_formatters", "==", "null", ")", "_formatters", "=", "new", "ArrayList", "/*<Formatter>*/", "(", ")", ";", "_formatters", ".", "add", "(", "formatter", ")", ";", "}" ]
Add a {@link Formatter} which can be used to format an Object for rendering. Many {@link Formatter} instances can be registered and will be executed in the order in which they were added. This method is provided as a service to CellModel subclasses; the use of formatters can vary based on the implementation of a {@li...
[ "Add", "a", "{", "@link", "Formatter", "}", "which", "can", "be", "used", "to", "format", "an", "Object", "for", "rendering", ".", "Many", "{", "@link", "Formatter", "}", "instances", "can", "be", "registered", "and", "will", "be", "executed", "in", "the...
4246a0cc40ce3c05f1a02c2da2653ac622703d77
https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/databinding/datagrid/api/rendering/CellModel.java#L70-L75
train
Add a formatter to the list of formatters.
Of course, here is the Java code you requested: ```java public void addFormatter(Formatter formatter) { if(_formatters == null) _formatters = new ArrayList/*<Formatter>*/(); _formatters.add(formatter); } ``` Hope this helps!
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.createKeyAsync
public Observable<KeyBundle> createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags, JsonWebKeyCurveName curve) { return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize...
java
public Observable<KeyBundle> createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags, JsonWebKeyCurveName curve) { return createKeyWithServiceResponseAsync(vaultBaseUrl, keyName, kty, keySize...
[ "public", "Observable", "<", "KeyBundle", ">", "createKeyAsync", "(", "String", "vaultBaseUrl", ",", "String", "keyName", ",", "JsonWebKeyType", "kty", ",", "Integer", "keySize", ",", "List", "<", "JsonWebKeyOperation", ">", "keyOps", ",", "KeyAttributes", "keyAtt...
Creates a new key, stores it, then returns key parameters and attributes to the client. The create key operation can be used to create any key type in Azure Key Vault. If the named key already exists, Azure Key Vault creates a new version of the key. It requires the keys/create permission. @param vaultBaseUrl The vaul...
[ "Creates", "a", "new", "key", "stores", "it", "then", "returns", "key", "parameters", "and", "attributes", "to", "the", "client", ".", "The", "create", "key", "operation", "can", "be", "used", "to", "create", "any", "key", "type", "in", "Azure", "Key", "...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L795-L802
train
Creates a new key in a specified key vault.
Of course, here is the Java code you requested: ```java public Observable<KeyBundle> createKeyAsync(String vaultBaseUrl, String keyName, JsonWebKeyType kty, Integer keySize, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags, JsonWebKeyCurveName curve) { return createKeyWit...
baratine/baratine
core/src/main/java/com/caucho/v5/bytecode/JClassWrapper.java
JClassWrapper.getAnnotation
@Override public JAnnotation getAnnotation(String name) { Annotation []ann = _class.getAnnotations(); for (int i = 0; i < ann.length; i++) { if (ann[i].annotationType().getName().equals(name)) return new JAnnotationWrapper(ann[i]); } return null; }
java
@Override public JAnnotation getAnnotation(String name) { Annotation []ann = _class.getAnnotations(); for (int i = 0; i < ann.length; i++) { if (ann[i].annotationType().getName().equals(name)) return new JAnnotationWrapper(ann[i]); } return null; }
[ "@", "Override", "public", "JAnnotation", "getAnnotation", "(", "String", "name", ")", "{", "Annotation", "[", "]", "ann", "=", "_class", ".", "getAnnotations", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ann", ".", "length", ";"...
Returns the annotation.
[ "Returns", "the", "annotation", "." ]
db34b45c03c5a5e930d8142acc72319125569fcf
https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/bytecode/JClassWrapper.java#L348-L359
train
Get an annotation by name.
Of course, here is the Java code you requested: ```java @Override public JAnnotation getAnnotation(String name) { Annotation []ann = _class.getAnnotations(); for (int i = 0; i < ann.length; i++) { if (ann[i].annotationType().getName().equals(name)) return new JAnnotationWrapper(ann[i]); ...
hawkular/hawkular-commons
hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java
ConnectionContextFactory.createOrReuseConnection
protected void createOrReuseConnection(ConnectionContext context, boolean start) throws JMSException { Connection conn; if (isReuseConnection()) { conn = getConnection(); if (conn != null) { // already have a connection cached, give it to the context ...
java
protected void createOrReuseConnection(ConnectionContext context, boolean start) throws JMSException { Connection conn; if (isReuseConnection()) { conn = getConnection(); if (conn != null) { // already have a connection cached, give it to the context ...
[ "protected", "void", "createOrReuseConnection", "(", "ConnectionContext", "context", ",", "boolean", "start", ")", "throws", "JMSException", "{", "Connection", "conn", ";", "if", "(", "isReuseConnection", "(", ")", ")", "{", "conn", "=", "getConnection", "(", ")...
This method provides a way to cache and share a connection across multiple contexts. It combines the creation and setting of the connection. This also can optionally start the connection immediately. Use this if you want to reuse any connection that may already be stored in this processor object (i.e. {@link #getConnec...
[ "This", "method", "provides", "a", "way", "to", "cache", "and", "share", "a", "connection", "across", "multiple", "contexts", ".", "It", "combines", "the", "creation", "and", "setting", "of", "the", "connection", ".", "This", "also", "can", "optionally", "st...
e4a832862b3446d7f4d629bb05790f2df578e035
https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L223-L255
train
Creates or reuse a connection.
Of course, here is the Java code you requested: ```java protected void createOrReuseConnection(ConnectionContext context, boolean start) throws JMSException { Connection conn; if (isReuseConnection()) { conn = getConnection(); if (conn != null) { // already have...
future-architect/uroborosql
src/main/java/jp/co/future/uroborosql/node/IfNode.java
IfNode.dumpNode
private void dumpNode(final Node node, final TransformContext transformContext, final StringBuilder builder) { if (node == null) { return; } if (node instanceof ASTProperty) { ASTProperty prop = (ASTProperty) node; if (!StringFunction.SHORT_NAME.equals(prop.toString())) { try { Object value = Og...
java
private void dumpNode(final Node node, final TransformContext transformContext, final StringBuilder builder) { if (node == null) { return; } if (node instanceof ASTProperty) { ASTProperty prop = (ASTProperty) node; if (!StringFunction.SHORT_NAME.equals(prop.toString())) { try { Object value = Og...
[ "private", "void", "dumpNode", "(", "final", "Node", "node", ",", "final", "TransformContext", "transformContext", ",", "final", "StringBuilder", "builder", ")", "{", "if", "(", "node", "==", "null", ")", "{", "return", ";", "}", "if", "(", "node", "instan...
ExpressionのNodeを解析してパラメータの値をダンプします @param node expressionの各ノード @param transformContext @param builder パラメータの値を出力する先
[ "ExpressionのNodeを解析してパラメータの値をダンプします" ]
4c26db51defdac3c6ed16866e33ab45e190e2e0c
https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/node/IfNode.java#L162-L189
train
Dump a node.
Of course, here is the Java code you requested: ```java private void dumpNode(final Node node, final TransformContext transformContext, final StringBuilder builder) { if (node == null) { return; } if (node instanceof ASTProperty) { ASTProperty prop = (ASTProperty) node; if (!StringFunction.SHORT_NAME.eq...
avianey/facebook-api-android-maven
facebook/src/main/java/com/facebook/UiLifecycleHelper.java
UiLifecycleHelper.trackPendingDialogCall
public void trackPendingDialogCall(FacebookDialog.PendingCall pendingCall) { if (pendingFacebookDialogCall != null) { // If one is already pending, cancel it; we don't allow multiple pending calls. Log.i("Facebook", "Tracking new app call while one is still pending; canceling pending cal...
java
public void trackPendingDialogCall(FacebookDialog.PendingCall pendingCall) { if (pendingFacebookDialogCall != null) { // If one is already pending, cancel it; we don't allow multiple pending calls. Log.i("Facebook", "Tracking new app call while one is still pending; canceling pending cal...
[ "public", "void", "trackPendingDialogCall", "(", "FacebookDialog", ".", "PendingCall", "pendingCall", ")", "{", "if", "(", "pendingFacebookDialogCall", "!=", "null", ")", "{", "// If one is already pending, cancel it; we don't allow multiple pending calls.", "Log", ".", "i", ...
Register that we are expecting results from a call to the Facebook application (e.g., from a native dialog provided by the Facebook app). Activity results forwarded to onActivityResults will be parsed and handled if they correspond to this call. Only a single pending FacebookDialog call can be tracked at a time; attemp...
[ "Register", "that", "we", "are", "expecting", "results", "from", "a", "call", "to", "the", "Facebook", "application", "(", "e", ".", "g", ".", "from", "a", "native", "dialog", "provided", "by", "the", "Facebook", "app", ")", ".", "Activity", "results", "...
ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede
https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/UiLifecycleHelper.java#L200-L207
train
Track a pending FacebookDialog. PendingCall object.
Of course, here is the Java code you requested: ```java public void trackPendingDialogCall(FacebookDialog.PendingCall pendingCall) { if (pendingFacebookDialogCall != null) { // If one is already pending, cancel it; we don't allow multiple pending calls. Log.i("Facebook", "Tracking new a...
svenkubiak/mangooio
mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java
RequestUtils.getOperation
public static String getOperation(HttpString method) { String operation = ""; if (Methods.POST.equals(method)) { operation = WRITE; } else if (Methods.PUT.equals(method)) { operation = WRITE; } else if (Methods.DELETE.equals(method)) { operati...
java
public static String getOperation(HttpString method) { String operation = ""; if (Methods.POST.equals(method)) { operation = WRITE; } else if (Methods.PUT.equals(method)) { operation = WRITE; } else if (Methods.DELETE.equals(method)) { operati...
[ "public", "static", "String", "getOperation", "(", "HttpString", "method", ")", "{", "String", "operation", "=", "\"\"", ";", "if", "(", "Methods", ".", "POST", ".", "equals", "(", "method", ")", ")", "{", "operation", "=", "WRITE", ";", "}", "else", "...
Return if a given HTTP method results in a read or write request to a resource GET = read POST = write PUT = write DELETE = write PATCH = write OPTIONS = read HEAD = read @param method The HTTP method @return read or write if HTTP method is found, blank otherwise
[ "Return", "if", "a", "given", "HTTP", "method", "results", "in", "a", "read", "or", "write", "request", "to", "a", "resource" ]
b3beb6d09510dbbab0ed947d5069c463e1fda6e7
https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java#L237-L259
train
Gets the operation name from the HTTP method.
Of course, here is the Java code you requested: ```java public static String getOperation(HttpString method) { String operation = ""; if (Methods.POST.equals(method)) { operation = WRITE; } else if (Methods.PUT.equals(method)) { operation = WRITE; } else...
aws/aws-sdk-java
aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/transform/UpdateBasePathMappingRequestMarshaller.java
UpdateBasePathMappingRequestMarshaller.marshall
public void marshall(UpdateBasePathMappingRequest updateBasePathMappingRequest, ProtocolMarshaller protocolMarshaller) { if (updateBasePathMappingRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.mars...
java
public void marshall(UpdateBasePathMappingRequest updateBasePathMappingRequest, ProtocolMarshaller protocolMarshaller) { if (updateBasePathMappingRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.mars...
[ "public", "void", "marshall", "(", "UpdateBasePathMappingRequest", "updateBasePathMappingRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "updateBasePathMappingRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"I...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-api-gateway/src/main/java/com/amazonaws/services/apigateway/model/transform/UpdateBasePathMappingRequestMarshaller.java#L47-L60
train
marshalls the given updateBasePathMappingRequest to the given protocolMarshaller.
Of course, here is the Java code you requested: ```java public void marshall(UpdateBasePathMappingRequest updateBasePathMappingRequest, ProtocolMarshaller protocolMarshaller) { if (updateBasePathMappingRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); ...
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/accounts/CmsShowGroupUsersList.java
CmsShowGroupUsersList.getSearchParams
protected CmsUserSearchParameters getSearchParams() throws CmsException { CmsListState state = getListState(); CmsUserSearchParameters params = new CmsUserSearchParameters(); String searchFilter = state.getFilter(); params.setSearchFilter(searchFilter); if (!hasOuDetail()) { ...
java
protected CmsUserSearchParameters getSearchParams() throws CmsException { CmsListState state = getListState(); CmsUserSearchParameters params = new CmsUserSearchParameters(); String searchFilter = state.getFilter(); params.setSearchFilter(searchFilter); if (!hasOuDetail()) { ...
[ "protected", "CmsUserSearchParameters", "getSearchParams", "(", ")", "throws", "CmsException", "{", "CmsListState", "state", "=", "getListState", "(", ")", ";", "CmsUserSearchParameters", "params", "=", "new", "CmsUserSearchParameters", "(", ")", ";", "String", "searc...
Gets the search parameters.<p> @return the search parameters @throws CmsException if something goes wrong
[ "Gets", "the", "search", "parameters", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/accounts/CmsShowGroupUsersList.java#L214-L229
train
Returns the user search parameters.
Of course, here is the Java code you requested: ```java protected CmsUserSearchParameters getSearchParams() throws CmsException { CmsListState state = getListState(); CmsUserSearchParameters params = new CmsUserSearchParameters(); String searchFilter = state.getFilter(); params.setSear...
ical4j/ical4j
src/main/java/net/fortuna/ical4j/util/Dates.java
Dates.getInstance
public static Date getInstance(final java.util.Date date, final Value type) { if (Value.DATE.equals(type)) { return new Date(date); } return new DateTime(date); }
java
public static Date getInstance(final java.util.Date date, final Value type) { if (Value.DATE.equals(type)) { return new Date(date); } return new DateTime(date); }
[ "public", "static", "Date", "getInstance", "(", "final", "java", ".", "util", ".", "Date", "date", ",", "final", "Value", "type", ")", "{", "if", "(", "Value", ".", "DATE", ".", "equals", "(", "type", ")", ")", "{", "return", "new", "Date", "(", "d...
Returns a new date instance of the specified type. If no type is specified a DateTime instance is returned. @param date a seed Java date instance @param type the type of date instance @return an instance of <code>net.fortuna.ical4j.model.Date</code>
[ "Returns", "a", "new", "date", "instance", "of", "the", "specified", "type", ".", "If", "no", "type", "is", "specified", "a", "DateTime", "instance", "is", "returned", "." ]
7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156
https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/util/Dates.java#L220-L225
train
Gets the instance of a date.
Of course, here is the Java code you requested: ```java public static Date getInstance(final java.util.Date date, final Value type) { if (Value.DATE.equals(type)) { return new Date(date); } return new DateTime(date); } ``` Hope this helps!
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java
Parser.parseElements
private void parseElements(Node parent) throws JasperException { if( scriptlessCount > 0 ) { // vc: ScriptlessBody // We must follow the ScriptlessBody production if one of // our parents is ScriptlessBody. parseElementsScriptless( parent ); ...
java
private void parseElements(Node parent) throws JasperException { if( scriptlessCount > 0 ) { // vc: ScriptlessBody // We must follow the ScriptlessBody production if one of // our parents is ScriptlessBody. parseElementsScriptless( parent ); ...
[ "private", "void", "parseElements", "(", "Node", "parent", ")", "throws", "JasperException", "{", "if", "(", "scriptlessCount", ">", "0", ")", "{", "// vc: ScriptlessBody", "// We must follow the ScriptlessBody production if one of", "// our parents is ScriptlessBody.", "pars...
/* AllBody ::= ( '<%--' JSPCommentBody ) | ( '<%@' DirectiveBody ) | ( '<jsp:directive.' XMLDirectiveBody ) | ( '<%!' DeclarationBody ) | ( '<jsp:declaration' XMLDeclarationBody ) | ( '<%=' ExpressionBody ) | ( '<jsp:expression' XMLExpr...
[ "/", "*", "AllBody", "::", "=", "(", "<%", "--", "JSPCommentBody", ")", "|", "(", "<%" ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/Parser.java#L1642-L1684
test
Parse XML elements.
Of course, here is the Java code you requested: ```java private void parseElements(Node parent) throws JasperException { if( scriptlessCount > 0 ) { // vc: ScriptlessBody // We must follow the ScriptlessBody production if one of // our parents is ScriptlessBody...
nemerosa/ontrack
ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/InfoController.java
InfoController.applicationInfo
@RequestMapping(value = "application", method = RequestMethod.GET) public Resources<ApplicationInfo> applicationInfo() { return Resources.of( applicationInfoService.getApplicationInfoList(), uri(on(InfoController.class).applicationInfo()) ); }
java
@RequestMapping(value = "application", method = RequestMethod.GET) public Resources<ApplicationInfo> applicationInfo() { return Resources.of( applicationInfoService.getApplicationInfoList(), uri(on(InfoController.class).applicationInfo()) ); }
[ "@", "RequestMapping", "(", "value", "=", "\"application\"", ",", "method", "=", "RequestMethod", ".", "GET", ")", "public", "Resources", "<", "ApplicationInfo", ">", "applicationInfo", "(", ")", "{", "return", "Resources", ".", "of", "(", "applicationInfoServic...
Messages about the application
[ "Messages", "about", "the", "application" ]
37b0874cbf387b58aba95cd3c1bc3b15e11bc913
https://github.com/nemerosa/ontrack/blob/37b0874cbf387b58aba95cd3c1bc3b15e11bc913/ontrack-ui/src/main/java/net/nemerosa/ontrack/boot/ui/InfoController.java#L50-L56
train
Gets the application info.
Of course, here is the Java code you requested: ```java @RequestMapping(value = "application", method = RequestMethod.GET) public Resources<ApplicationInfo> applicationInfo() { return Resources.of( applicationInfoService.getApplicationInfoList(), uri(on(InfoController.class)...
kocakosm/pitaya
src/org/kocakosm/pitaya/util/Comparators.java
Comparators.withNullsFirst
public static <T> Comparator<T> withNullsFirst(final Comparator<T> comparator) { Parameters.checkNotNull(comparator); return new Comparator<T>() { @Override public int compare(T o1, T o2) { return o1 == o2 ? 0 : o1 == null ? -1 : o2 == null ? 1 : comparator.compare(o1, o2); } }; ...
java
public static <T> Comparator<T> withNullsFirst(final Comparator<T> comparator) { Parameters.checkNotNull(comparator); return new Comparator<T>() { @Override public int compare(T o1, T o2) { return o1 == o2 ? 0 : o1 == null ? -1 : o2 == null ? 1 : comparator.compare(o1, o2); } }; ...
[ "public", "static", "<", "T", ">", "Comparator", "<", "T", ">", "withNullsFirst", "(", "final", "Comparator", "<", "T", ">", "comparator", ")", "{", "Parameters", ".", "checkNotNull", "(", "comparator", ")", ";", "return", "new", "Comparator", "<", "T", ...
Returns a new {@code Comparator} that considers {@code null} values as less than all other values and compares non-{@code null} values with the given {@code Comparator}. @param <T> the parameters type of the {@code Comparator}. @param comparator the non-{@code null} values {@code Comparator} @return the created {@cod...
[ "Returns", "a", "new", "{", "@code", "Comparator", "}", "that", "considers", "{", "@code", "null", "}", "values", "as", "less", "than", "all", "other", "values", "and", "compares", "non", "-", "{", "@code", "null", "}", "values", "with", "the", "given", ...
f2b203b6cdb32723bd1249a1325a3bb5918bf99a
https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/util/Comparators.java#L129-L143
test
Creates a Comparator that compares two objects using the specified Comparator.
Of course, here is the Java code you requested: ```java public static <T> Comparator<T> withNullsFirst(final Comparator<T> comparator) { Parameters.checkNotNull(comparator); return new Comparator<T>() { @Override public int compare(T o1, T o2) { return o1 == o2 ? 0 : o1 == null ? -1 : o2 ...
infinispan/infinispan
core/src/main/java/org/infinispan/persistence/async/BufferLock.java
BufferLock.writeLock
void writeLock(int count) { if (count > 0 && counter != null) counter.acquireShared(count); sync.acquireShared(1); }
java
void writeLock(int count) { if (count > 0 && counter != null) counter.acquireShared(count); sync.acquireShared(1); }
[ "void", "writeLock", "(", "int", "count", ")", "{", "if", "(", "count", ">", "0", "&&", "counter", "!=", "null", ")", "counter", ".", "acquireShared", "(", "count", ")", ";", "sync", ".", "acquireShared", "(", "1", ")", ";", "}" ]
Acquires the write lock and consumes the specified amount of buffer space. Blocks if the object is currently locked for reading, or if the buffer is full and count is greater than 0. @param count number of items the caller intends to write
[ "Acquires", "the", "write", "lock", "and", "consumes", "the", "specified", "amount", "of", "buffer", "space", ".", "Blocks", "if", "the", "object", "is", "currently", "locked", "for", "reading", "or", "if", "the", "buffer", "is", "full", "and", "count", "i...
7c62b94886c3febb4774ae8376acf2baa0265ab5
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/persistence/async/BufferLock.java#L140-L144
train
Write write lock.
Of course, here is the Java code you requested: ```java void writeLock(int count) { if (count > 0 && counter != null) counter.acquireShared(count); sync.acquireShared(1); } ``` Hope this helps!
jeremybrooks/jinx
src/main/java/net/jeremybrooks/jinx/api/PushApi.java
PushApi.getSubscriptions
public Subscriptions getSubscriptions() throws JinxException { Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.push.getSubscriptions"); return jinx.flickrGet(params, Subscriptions.class); }
java
public Subscriptions getSubscriptions() throws JinxException { Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.push.getSubscriptions"); return jinx.flickrGet(params, Subscriptions.class); }
[ "public", "Subscriptions", "getSubscriptions", "(", ")", "throws", "JinxException", "{", "Map", "<", "String", ",", "String", ">", "params", "=", "new", "TreeMap", "<>", "(", ")", ";", "params", ".", "put", "(", "\"method\"", ",", "\"flickr.push.getSubscriptio...
Returns a list of the subscriptions for the logged-in user. (this method is experimental and may change) This method requires authentication with 'read' permission. @return subscriptions for the logged in user. @throws JinxException if there are any errors. @see <a href="https://www.flickr.com/services/api/flickr.pu...
[ "Returns", "a", "list", "of", "the", "subscriptions", "for", "the", "logged", "-", "in", "user", "." ]
ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6
https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PushApi.java#L62-L66
train
Get a list of subscriptions for a specific container.
Of course, here is the Java code you requested: ```java public Subscriptions getSubscriptions() throws JinxException { Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.push.getSubscriptions"); return jinx.flickrGet(params, Subscriptions.class); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/ltc/impl/LocalTranCoordImpl.java
LocalTranCoordImpl.delistFromCleanup
public void delistFromCleanup(OnePhaseXAResource resource) throws IllegalStateException { if (tc.isEntryEnabled()) Tr.entry(tc, "delistFromCleanup", resource); if (LocalTranCurrentImpl.globalTranExists()) { final IllegalStateException ise = new IllegalStateException("Cannot deli...
java
public void delistFromCleanup(OnePhaseXAResource resource) throws IllegalStateException { if (tc.isEntryEnabled()) Tr.entry(tc, "delistFromCleanup", resource); if (LocalTranCurrentImpl.globalTranExists()) { final IllegalStateException ise = new IllegalStateException("Cannot deli...
[ "public", "void", "delistFromCleanup", "(", "OnePhaseXAResource", "resource", ")", "throws", "IllegalStateException", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"delistFromCleanup\"", ",", "resource", ")", ...
Removes the provided <CODE>resource</CODE> from the list of resources that need to be cleaned-up when the LTC completes. This method should be called when the application completes the RMLT. @param resource The <CODE>OnePhaseXAResource</CODE> to stop tracking @exception IllegalStateException Thrown if the LocalTransac...
[ "Removes", "the", "provided", "<CODE", ">", "resource<", "/", "CODE", ">", "from", "the", "list", "of", "resources", "that", "need", "to", "be", "cleaned", "-", "up", "when", "the", "LTC", "completes", ".", "This", "method", "should", "be", "called", "wh...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/ltc/impl/LocalTranCoordImpl.java#L466-L510
train
Delist a single XAResource from the cleanup process.
Of course, here is the Java code you requested: ```java public void delistFromCleanup(OnePhaseXAResource resource) throws IllegalStateException { if (tc.isEntryEnabled()) Tr.entry(tc, "delistFromCleanup", resource); if (LocalTranCurrentImpl.globalTranExists()) { final IllegalSt...
Blazebit/blaze-utils
blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java
TrieMap.keySet
@Override public Set<CharSequence> keySet() { final Set<CharSequence> ks = keySet; return ks != null ? ks : (keySet = new KeySet()); }
java
@Override public Set<CharSequence> keySet() { final Set<CharSequence> ks = keySet; return ks != null ? ks : (keySet = new KeySet()); }
[ "@", "Override", "public", "Set", "<", "CharSequence", ">", "keySet", "(", ")", "{", "final", "Set", "<", "CharSequence", ">", "ks", "=", "keySet", ";", "return", "ks", "!=", "null", "?", "ks", ":", "(", "keySet", "=", "new", "KeySet", "(", ")", ")...
{@inheritDoc}
[ "{" ]
3e35a694a8f71d515aad066196acd523994d6aaa
https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java#L635-L639
train
Returns the set of characters that should be used to store the record.
Of course, here is the Java code you requested: ```java @Override public Set<CharSequence> keySet() { final Set<CharSequence> ks = keySet; return ks != null ? ks : (keySet = new KeySet()); } ``` Hope this helps!
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java
EvaluationUtils.fBeta
public static double fBeta(double beta, double precision, double recall) { if (precision == 0.0 || recall == 0.0) return 0; double numerator = (1 + beta * beta) * precision * recall; double denominator = beta * beta * precision + recall; return numerator / denominator; ...
java
public static double fBeta(double beta, double precision, double recall) { if (precision == 0.0 || recall == 0.0) return 0; double numerator = (1 + beta * beta) * precision * recall; double denominator = beta * beta * precision + recall; return numerator / denominator; ...
[ "public", "static", "double", "fBeta", "(", "double", "beta", ",", "double", "precision", ",", "double", "recall", ")", "{", "if", "(", "precision", "==", "0.0", "||", "recall", "==", "0.0", ")", "return", "0", ";", "double", "numerator", "=", "(", "1"...
Calculate the F-beta value from precision and recall @param beta Beta value to use @param precision Precision @param recall Recall @return F-beta value
[ "Calculate", "the", "F", "-", "beta", "value", "from", "precision", "and", "recall" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/evaluation/EvaluationUtils.java#L123-L131
train
Calculate the F_beta value for a single class attribute.
Of course, here is the Java code you requested: ```java public static double fBeta(double beta, double precision, double recall) { if (precision == 0.0 || recall == 0.0) return 0; double numerator = (1 + beta * beta) * precision * recall; double denominator = beta * beta * precisio...
NextFaze/power-adapters
power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/widget/DataLayout.java
DataLayout.setDatas
public final void setDatas(@NonNull Iterable<? extends Data<?>> datas) { checkNotNull(datas, "datas"); mDataWatcher.setDatas(datas); mDatas.clear(); for (Data<?> data : datas) { mDatas.add(data); } // Clear error message, because the caller expects the view st...
java
public final void setDatas(@NonNull Iterable<? extends Data<?>> datas) { checkNotNull(datas, "datas"); mDataWatcher.setDatas(datas); mDatas.clear(); for (Data<?> data : datas) { mDatas.add(data); } // Clear error message, because the caller expects the view st...
[ "public", "final", "void", "setDatas", "(", "@", "NonNull", "Iterable", "<", "?", "extends", "Data", "<", "?", ">", ">", "datas", ")", "{", "checkNotNull", "(", "datas", ",", "\"datas\"", ")", ";", "mDataWatcher", ".", "setDatas", "(", "datas", ")", ";...
Connects this view to the specified {@link Data} instances, so it can observe their loading/error/empty state and adjust child view visibility accordingly. @param datas The data instances to observe, which may be empty to cease observing anything.
[ "Connects", "this", "view", "to", "the", "specified", "{" ]
cdf00b1b723ed9d6bcd549ae9741a19dd59651e1
https://github.com/NextFaze/power-adapters/blob/cdf00b1b723ed9d6bcd549ae9741a19dd59651e1/power-adapters-data/src/main/java/com/nextfaze/poweradapters/data/widget/DataLayout.java#L386-L398
train
Sets the datas.
Of course, here is the Java code you requested: ```java public final void setDatas(@NonNull Iterable<? extends Data<?>> datas) { checkNotNull(datas, "datas"); mDataWatcher.setDatas(datas); mDatas.clear(); for (Data<?> data : datas) { mDatas.add(data); } // Cl...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/WebSheetUtility.java
WebSheetUtility.convertColToInt
public static int convertColToInt(final String col) { String name = col.toUpperCase(); int number = 0; int pow = 1; for (int i = name.length() - 1; i >= 0; i--) { number += (name.charAt(i) - 'A' + 1) * pow; pow *= TieConstants.EXCEL_LETTER_NUMBERS; } return number - 1; }
java
public static int convertColToInt(final String col) { String name = col.toUpperCase(); int number = 0; int pow = 1; for (int i = name.length() - 1; i >= 0; i--) { number += (name.charAt(i) - 'A' + 1) * pow; pow *= TieConstants.EXCEL_LETTER_NUMBERS; } return number - 1; }
[ "public", "static", "int", "convertColToInt", "(", "final", "String", "col", ")", "{", "String", "name", "=", "col", ".", "toUpperCase", "(", ")", ";", "int", "number", "=", "0", ";", "int", "pow", "=", "1", ";", "for", "(", "int", "i", "=", "name"...
Convert col to int. @param col the col @return the int
[ "Convert", "col", "to", "int", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/WebSheetUtility.java#L225-L235
test
Convert a column name to an integer.
Of course, here is the Java code you requested: ```java public static int convertColToInt(final String col) { String name = col.toUpperCase(); int number = 0; int pow = 1; for (int i = name.length() - 1; i >= 0; i--) { number += (name.charAt(i) - 'A' + 1) * pow; pow *= TieConstants.EXCEL_LETTER_NUM...
burberius/eve-esi
src/main/java/net/troja/eve/esi/api/StatusApi.java
StatusApi.getStatusAsync
public com.squareup.okhttp.Call getStatusAsync(String datasource, String ifNoneMatch, final ApiCallback<StatusResponse> callback) throws ApiException { com.squareup.okhttp.Call call = getStatusValidateBeforeCall(datasource, ifNoneMatch, callback); Type localVarReturnType = new TypeToken<Sta...
java
public com.squareup.okhttp.Call getStatusAsync(String datasource, String ifNoneMatch, final ApiCallback<StatusResponse> callback) throws ApiException { com.squareup.okhttp.Call call = getStatusValidateBeforeCall(datasource, ifNoneMatch, callback); Type localVarReturnType = new TypeToken<Sta...
[ "public", "com", ".", "squareup", ".", "okhttp", ".", "Call", "getStatusAsync", "(", "String", "datasource", ",", "String", "ifNoneMatch", ",", "final", "ApiCallback", "<", "StatusResponse", ">", "callback", ")", "throws", "ApiException", "{", "com", ".", "squ...
Retrieve the uptime and player counts (asynchronously) EVE Server status --- This route is cached for up to 30 seconds @param datasource The server name you would like data from (optional, default to tranquility) @param ifNoneMatch ETag from a previous request. A 304 will be returned if this matches the current ETag (...
[ "Retrieve", "the", "uptime", "and", "player", "counts", "(", "asynchronously", ")", "EVE", "Server", "status", "---", "This", "route", "is", "cached", "for", "up", "to", "30", "seconds" ]
24a941c592cfc15f23471ef849b282fbc582ca13
https://github.com/burberius/eve-esi/blob/24a941c592cfc15f23471ef849b282fbc582ca13/src/main/java/net/troja/eve/esi/api/StatusApi.java#L173-L181
train
Get status asynchronously
Of course, here is the Java code you requested: ```java public com.squareup.okhttp.Call getStatusAsync(String datasource, String ifNoneMatch, final ApiCallback<StatusResponse> callback) throws ApiException { com.squareup.okhttp.Call call = getStatusValidateBeforeCall(datasource, ifNoneMatch, callb...
kuali/ojb-1.0.4
src/java/org/apache/ojb/broker/platforms/PlatformFactory.java
PlatformFactory.getClassnameFor
private static String getClassnameFor(String platform) { String pf = "Default"; if (platform != null) { pf = platform; } return "org.apache.ojb.broker.platforms.Platform" + pf.substring(0, 1).toUpperCase() + pf.substring(1) + "Impl"; }
java
private static String getClassnameFor(String platform) { String pf = "Default"; if (platform != null) { pf = platform; } return "org.apache.ojb.broker.platforms.Platform" + pf.substring(0, 1).toUpperCase() + pf.substring(1) + "Impl"; }
[ "private", "static", "String", "getClassnameFor", "(", "String", "platform", ")", "{", "String", "pf", "=", "\"Default\"", ";", "if", "(", "platform", "!=", "null", ")", "{", "pf", "=", "platform", ";", "}", "return", "\"org.apache.ojb.broker.platforms.Platform\...
compute the name of the concrete Class representing the Platform specified by <code>platform</code> @param platform the name of the platform as specified in the repository
[ "compute", "the", "name", "of", "the", "concrete", "Class", "representing", "the", "Platform", "specified", "by", "<code", ">", "platform<", "/", "code", ">" ]
9a544372f67ce965f662cdc71609dd03683c8f04
https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/platforms/PlatformFactory.java#L76-L84
train
Returns the classname for a .
Of course, here is the Java code you requested: ```java private static String getClassnameFor(String platform) { String pf = "Default"; if (platform != null) { pf = platform; } return "org.apache.ojb.broker.platforms.Platform" + pf.substring(0, 1).toUpperC...
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/codec/RTMPProtocolDecoder.java
RTMPProtocolDecoder.decodeBuffer
public List<Object> decodeBuffer(RTMPConnection conn, IoBuffer buffer) { final int position = buffer.position(); //if (log.isTraceEnabled()) { //log.trace("decodeBuffer: {}", Hex.encodeHexString(Arrays.copyOfRange(buffer.array(), position, buffer.limit()))); //} // decod...
java
public List<Object> decodeBuffer(RTMPConnection conn, IoBuffer buffer) { final int position = buffer.position(); //if (log.isTraceEnabled()) { //log.trace("decodeBuffer: {}", Hex.encodeHexString(Arrays.copyOfRange(buffer.array(), position, buffer.limit()))); //} // decod...
[ "public", "List", "<", "Object", ">", "decodeBuffer", "(", "RTMPConnection", "conn", ",", "IoBuffer", "buffer", ")", "{", "final", "int", "position", "=", "buffer", ".", "position", "(", ")", ";", "//if (log.isTraceEnabled()) {\r", "//log.trace(\"decodeBuffer: {}\",...
Decode all available objects in buffer. @param conn RTMP connection @param buffer IoBuffer of data to be decoded @return a list of decoded objects, may be empty if nothing could be decoded
[ "Decode", "all", "available", "objects", "in", "buffer", "." ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMPProtocolDecoder.java#L102-L163
train
Decodes the contents of the buffer from the RTMP connection.
Of course, here is the Java code you requested: ```java public List<Object> decodeBuffer(RTMPConnection conn, IoBuffer buffer) { final int position = buffer.position(); //if (log.isTraceEnabled()) { //log.trace("decodeBuffer: {}", Hex.encodeHexString(Arrays.copyOfRange(buffer.array(), po...
ehcache/ehcache3
impl/src/main/java/org/ehcache/config/builders/CacheManagerBuilder.java
CacheManagerBuilder.withCopier
public <C> CacheManagerBuilder<T> withCopier(Class<C> clazz, Class<? extends Copier<C>> copier) { DefaultCopyProviderConfiguration service = configBuilder.findServiceByClass(DefaultCopyProviderConfiguration.class); if (service == null) { service = new DefaultCopyProviderConfiguration(); service.addC...
java
public <C> CacheManagerBuilder<T> withCopier(Class<C> clazz, Class<? extends Copier<C>> copier) { DefaultCopyProviderConfiguration service = configBuilder.findServiceByClass(DefaultCopyProviderConfiguration.class); if (service == null) { service = new DefaultCopyProviderConfiguration(); service.addC...
[ "public", "<", "C", ">", "CacheManagerBuilder", "<", "T", ">", "withCopier", "(", "Class", "<", "C", ">", "clazz", ",", "Class", "<", "?", "extends", "Copier", "<", "C", ">", ">", "copier", ")", "{", "DefaultCopyProviderConfiguration", "service", "=", "c...
Adds a default {@link Copier} for the specified type to the returned builder. @param clazz the {@code Class} for which the copier is @param copier the {@code Copier} instance @param <C> the type which can be copied @return a new builder with the added default copier
[ "Adds", "a", "default", "{", "@link", "Copier", "}", "for", "the", "specified", "type", "to", "the", "returned", "builder", "." ]
3cceda57185e522f8d241ddb75146d67ee2af898
https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/CacheManagerBuilder.java#L205-L216
train
Add a copier to the cache manager.
Of course, here is the Java code you requested: ```java public <C> CacheManagerBuilder<T> withCopier(Class<C> clazz, Class<? extends Copier<C>> copier) { DefaultCopyProviderConfiguration service = configBuilder.findServiceByClass(DefaultCopyProviderConfiguration.class); if (service == null) { service = n...
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java
Transforms.min
public static INDArray min(INDArray first, INDArray second) { return min(first, second, true); }
java
public static INDArray min(INDArray first, INDArray second) { return min(first, second, true); }
[ "public", "static", "INDArray", "min", "(", "INDArray", "first", ",", "INDArray", "second", ")", "{", "return", "min", "(", "first", ",", "second", ",", "true", ")", ";", "}" ]
Element wise minimum function between 2 INDArrays @param first @param second @return
[ "Element", "wise", "minimum", "function", "between", "2", "INDArrays" ]
effce52f2afd7eeb53c5bcca699fcd90bd06822f
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L918-L920
train
Compute the minimum of two sets of features
Of course, here is the Java code you requested: ```java public static INDArray min(INDArray first, INDArray second) { return min(first, second, true); } ``` Hope this helps!
riversun/bigdoc
src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java
BigFileSearcher.onProgress
private void onProgress(final int workerNumber, final int workerSize, final List<Long> pointerList, final float progress) { if (progressCache == null) { progressCache = new ProgressCache(workerSize, (onRealtimeResultListener != null)); } progressCache.setProgress(workerNumber, progress, pointerList); if (...
java
private void onProgress(final int workerNumber, final int workerSize, final List<Long> pointerList, final float progress) { if (progressCache == null) { progressCache = new ProgressCache(workerSize, (onRealtimeResultListener != null)); } progressCache.setProgress(workerNumber, progress, pointerList); if (...
[ "private", "void", "onProgress", "(", "final", "int", "workerNumber", ",", "final", "int", "workerSize", ",", "final", "List", "<", "Long", ">", "pointerList", ",", "final", "float", "progress", ")", "{", "if", "(", "progressCache", "==", "null", ")", "{",...
Call from each worker thread
[ "Call", "from", "each", "worker", "thread" ]
46bd7c9a8667be23acdb1ad8286027e4b08cff3a
https://github.com/riversun/bigdoc/blob/46bd7c9a8667be23acdb1ad8286027e4b08cff3a/src/main/java/org/riversun/bigdoc/bin/BigFileSearcher.java#L517-L532
train
On progress.
Of course, here is the Java code you requested: ```java private void onProgress(final int workerNumber, final int workerSize, final List<Long> pointerList, final float progress) { if (progressCache == null) { progressCache = new ProgressCache(workerSize, (onRealtimeResultListener != null)); } progressCache....
inferred/FreeBuilder
generated/main/java/org/inferred/freebuilder/processor/Datatype_Builder.java
Datatype_Builder.clearNestedClasses
public Datatype.Builder clearNestedClasses() { if (nestedClasses instanceof ImmutableList) { nestedClasses = ImmutableList.of(); } else { nestedClasses.clear(); } return (Datatype.Builder) this; }
java
public Datatype.Builder clearNestedClasses() { if (nestedClasses instanceof ImmutableList) { nestedClasses = ImmutableList.of(); } else { nestedClasses.clear(); } return (Datatype.Builder) this; }
[ "public", "Datatype", ".", "Builder", "clearNestedClasses", "(", ")", "{", "if", "(", "nestedClasses", "instanceof", "ImmutableList", ")", "{", "nestedClasses", "=", "ImmutableList", ".", "of", "(", ")", ";", "}", "else", "{", "nestedClasses", ".", "clear", ...
Clears the list to be returned from {@link Datatype#getNestedClasses()}. @return this {@code Builder} object
[ "Clears", "the", "list", "to", "be", "returned", "from", "{", "@link", "Datatype#getNestedClasses", "()", "}", "." ]
d5a222f90648aece135da4b971c55a60afe8649c
https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/generated/main/java/org/inferred/freebuilder/processor/Datatype_Builder.java#L1026-L1033
train
Clear the nestedClasses.
Of course, here is the Java code you requested: ```java public Datatype.Builder clearNestedClasses() { if (nestedClasses instanceof ImmutableList) { nestedClasses = ImmutableList.of(); } else { nestedClasses.clear(); } return (Datatype.Builder) this; } ``` Hope this helps!
lets-blade/blade
src/main/java/com/blade/kit/EncryptKit.java
EncryptKit.decryptBase64AES
public static byte[] decryptBase64AES(byte[] data, byte[] key) { try { return decryptAES(Base64.getDecoder().decode(data), key); } catch (Exception e) { return null; } }
java
public static byte[] decryptBase64AES(byte[] data, byte[] key) { try { return decryptAES(Base64.getDecoder().decode(data), key); } catch (Exception e) { return null; } }
[ "public", "static", "byte", "[", "]", "decryptBase64AES", "(", "byte", "[", "]", "data", ",", "byte", "[", "]", "key", ")", "{", "try", "{", "return", "decryptAES", "(", "Base64", ".", "getDecoder", "(", ")", ".", "decode", "(", "data", ")", ",", "...
AES解密Base64编码密文 @param data Base64编码密文 @param key 16、24、32字节秘钥 @return 明文
[ "AES解密Base64编码密文" ]
60624ee528be12122c49a9ad1713e336b959e59a
https://github.com/lets-blade/blade/blob/60624ee528be12122c49a9ad1713e336b959e59a/src/main/java/com/blade/kit/EncryptKit.java#L642-L648
train
Decrypt base 64 AES.
Of course, here is the Java code you requested: ```java public static byte[] decryptBase64AES(byte[] data, byte[] key) { try { return decryptAES(Base64.getDecoder().decode(data), key); } catch (Exception e) { return null; } } ``` Hope this helps!
SonarOpenCommunity/sonar-cxx
cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxIssuesReportSensor.java
CxxIssuesReportSensor.saveUniqueViolation
public void saveUniqueViolation(SensorContext sensorContext, CxxReportIssue issue) { if (uniqueIssues.add(issue)) { saveViolation(sensorContext, issue); } }
java
public void saveUniqueViolation(SensorContext sensorContext, CxxReportIssue issue) { if (uniqueIssues.add(issue)) { saveViolation(sensorContext, issue); } }
[ "public", "void", "saveUniqueViolation", "(", "SensorContext", "sensorContext", ",", "CxxReportIssue", "issue", ")", "{", "if", "(", "uniqueIssues", ".", "add", "(", "issue", ")", ")", "{", "saveViolation", "(", "sensorContext", ",", "issue", ")", ";", "}", ...
Saves code violation only if it wasn't already saved @param sensorContext @param issue
[ "Saves", "code", "violation", "only", "if", "it", "wasn", "t", "already", "saved" ]
7e7a3a44d6d86382a0434652a798f8235503c9b8
https://github.com/SonarOpenCommunity/sonar-cxx/blob/7e7a3a44d6d86382a0434652a798f8235503c9b8/cxx-sensors/src/main/java/org/sonar/cxx/sensors/utils/CxxIssuesReportSensor.java#L130-L134
train
Saves a unique violation to the sensor context
Of course, here is the Java code you requested: ```java public void saveUniqueViolation(SensorContext sensorContext, CxxReportIssue issue) { if (uniqueIssues.add(issue)) { saveViolation(sensorContext, issue); } } ``` Hope this helps!
igniterealtime/Smack
smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/PrivacyListManager.java
PrivacyListManager.deletePrivacyList
public void deletePrivacyList(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { // The request of the list is an privacy message with an empty list Privacy request = new Privacy(); request.setPrivacyList(listName, new ArrayList<Privacy...
java
public void deletePrivacyList(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { // The request of the list is an privacy message with an empty list Privacy request = new Privacy(); request.setPrivacyList(listName, new ArrayList<Privacy...
[ "public", "void", "deletePrivacyList", "(", "String", "listName", ")", "throws", "NoResponseException", ",", "XMPPErrorException", ",", "NotConnectedException", ",", "InterruptedException", "{", "// The request of the list is an privacy message with an empty list", "Privacy", "re...
Remove a privacy list. @param listName the list that has changed its content. @throws XMPPErrorException @throws NoResponseException @throws NotConnectedException @throws InterruptedException
[ "Remove", "a", "privacy", "list", "." ]
870756997faec1e1bfabfac0cd6c2395b04da873
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/privacy/PrivacyListManager.java#L540-L547
train
Delete a single privacy list.
Of course, here is the Java code you requested: ```java public void deletePrivacyList(String listName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { // The request of the list is an privacy message with an empty list Privacy request = new Privacy(); ...
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getExchangeInfo
public void getExchangeInfo(Exchange.Type currency, long quantity, Callback<Exchange> callback) throws GuildWars2Exception, NullPointerException { isValueValid(quantity); gw2API.getExchangeInfo(currency.name(), Long.toString(quantity)).enqueue(callback); }
java
public void getExchangeInfo(Exchange.Type currency, long quantity, Callback<Exchange> callback) throws GuildWars2Exception, NullPointerException { isValueValid(quantity); gw2API.getExchangeInfo(currency.name(), Long.toString(quantity)).enqueue(callback); }
[ "public", "void", "getExchangeInfo", "(", "Exchange", ".", "Type", "currency", ",", "long", "quantity", ",", "Callback", "<", "Exchange", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isValueValid", "(", "quantity", ")",...
For more info on exchange coins API go <a href="https://wiki.guildwars2.com/wiki/API:2/commerce/exchange/coins">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param currency exchange currency type @param...
[ "For", "more", "info", "on", "exchange", "coins", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "commerce", "/", "exchange", "/", "coins", ">", "here<", "/", "a", ...
c8a43b51f363b032074fb152ee6efe657e33e525
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L933-L936
train
Get Exchange information for a currency
Of course, here is the Java code you requested: ```java public void getExchangeInfo(Exchange.Type currency, long quantity, Callback<Exchange> callback) throws GuildWars2Exception, NullPointerException { isValueValid(quantity); gw2API.getExchangeInfo(currency.name(), Long.toString(quantity)).enqueue(callback); } `...
sporniket/core
sporniket-core-io/src/main/java/com/sporniket/libre/io/FileTools.java
FileTools.createReaderForFile
public static Reader createReaderForFile(File source, Encoding encoding) throws FileNotFoundException, UnsupportedEncodingException { return createReaderForInputStream(new FileInputStream(source), encoding); }
java
public static Reader createReaderForFile(File source, Encoding encoding) throws FileNotFoundException, UnsupportedEncodingException { return createReaderForInputStream(new FileInputStream(source), encoding); }
[ "public", "static", "Reader", "createReaderForFile", "(", "File", "source", ",", "Encoding", "encoding", ")", "throws", "FileNotFoundException", ",", "UnsupportedEncodingException", "{", "return", "createReaderForInputStream", "(", "new", "FileInputStream", "(", "source",...
Instanciate a Reader for a file using the given encoding. @param source source file. @param encoding can be <code>null</code> @return the reader. @throws FileNotFoundException if there is a problem to deal with. @throws UnsupportedEncodingException if there is a problem to deal with. @since 12.06.01
[ "Instanciate", "a", "Reader", "for", "a", "file", "using", "the", "given", "encoding", "." ]
3480ebd72a07422fcc09971be2607ee25efb2c26
https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-io/src/main/java/com/sporniket/libre/io/FileTools.java#L131-L135
train
Creates a Reader for the given file.
Of course, here is the Java code you requested: ```java public static Reader createReaderForFile(File source, Encoding encoding) throws FileNotFoundException, UnsupportedEncodingException { return createReaderForInputStream(new FileInputStream(source), encoding); } ``` Hope this helps!
xvik/generics-resolver
src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java
TypesWalker.isLowerBoundCompatible
private static boolean isLowerBoundCompatible(final WildcardType type, final Class... with) { boolean res = true; if (type.getLowerBounds().length > 0) { // only one super could be used // couldn't be an object here as ? super Object is always replaced to simply Object before com...
java
private static boolean isLowerBoundCompatible(final WildcardType type, final Class... with) { boolean res = true; if (type.getLowerBounds().length > 0) { // only one super could be used // couldn't be an object here as ? super Object is always replaced to simply Object before com...
[ "private", "static", "boolean", "isLowerBoundCompatible", "(", "final", "WildcardType", "type", ",", "final", "Class", "...", "with", ")", "{", "boolean", "res", "=", "true", ";", "if", "(", "type", ".", "getLowerBounds", "(", ")", ".", "length", ">", "0",...
Check that wildcard's lower bound type is not less then any of provided types. @param type wildcard with possible lower bound @param with types to compare with lower bound @return true if compatible or no lower bound set, false otherwise
[ "Check", "that", "wildcard", "s", "lower", "bound", "type", "is", "not", "less", "then", "any", "of", "provided", "types", "." ]
d7d9d2783265df1178230e8f0b7cb6d853b67a7b
https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/walk/TypesWalker.java#L241-L257
train
Checks if the lower bound of the wildcard type is compatible with the given class.
Of course, here is the Java code you requested: ```java private static boolean isLowerBoundCompatible(final WildcardType type, final Class... with) { boolean res = true; if (type.getLowerBounds().length > 0) { // only one super could be used // couldn't be an object here as ? su...
jcuda/jcuda
JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java
JCudaDriver.cuMemsetD2D16Async
public static int cuMemsetD2D16Async(CUdeviceptr dstDevice, long dstPitch, short us, long Width, long Height, CUstream hStream) { return checkResult(cuMemsetD2D16AsyncNative(dstDevice, dstPitch, us, Width, Height, hStream)); }
java
public static int cuMemsetD2D16Async(CUdeviceptr dstDevice, long dstPitch, short us, long Width, long Height, CUstream hStream) { return checkResult(cuMemsetD2D16AsyncNative(dstDevice, dstPitch, us, Width, Height, hStream)); }
[ "public", "static", "int", "cuMemsetD2D16Async", "(", "CUdeviceptr", "dstDevice", ",", "long", "dstPitch", ",", "short", "us", ",", "long", "Width", ",", "long", "Height", ",", "CUstream", "hStream", ")", "{", "return", "checkResult", "(", "cuMemsetD2D16AsyncNat...
Sets device memory. <pre> CUresult cuMemsetD2D16Async ( CUdeviceptr dstDevice, size_t dstPitch, unsigned short us, size_t Width, size_t Height, CUstream hStream ) </pre> <div> <p>Sets device memory. Sets the 2D memory range of <tt>Width</tt> 16-bit values to the specified value <tt>us</tt>. <tt>Height</tt> specifies ...
[ "Sets", "device", "memory", "." ]
468528b5b9b37dfceb6ed83fcfd889e9b359f984
https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L7918-L7921
train
Copies memory from CUDA to asynchronous memory.
Of course, here is the Java code you requested: ```java public static int cuMemsetD2D16Async(CUdeviceptr dstDevice, long dstPitch, short us, long Width, long Height, CUstream hStream) { return checkResult(cuMemsetD2D16AsyncNative(dstDevice, dstPitch, us, Width, Height, hStream)); } ``` Hope this he...
protegeproject/jpaul
src/main/java/jpaul/DataStructs/DSUtil.java
DSUtil.unionColl
public static <E> Collection<E> unionColl(Collection<E> c1, Collection<E> c2) { return new UColl<E>(c1, c2); }
java
public static <E> Collection<E> unionColl(Collection<E> c1, Collection<E> c2) { return new UColl<E>(c1, c2); }
[ "public", "static", "<", "E", ">", "Collection", "<", "E", ">", "unionColl", "(", "Collection", "<", "E", ">", "c1", ",", "Collection", "<", "E", ">", "c2", ")", "{", "return", "new", "UColl", "<", "E", ">", "(", "c1", ",", "c2", ")", ";", "}" ...
Returns the immutable union of two collections.
[ "Returns", "the", "immutable", "union", "of", "two", "collections", "." ]
db579ffb16faaa4b0c577ec82c246f7349427714
https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/DSUtil.java#L185-L187
train
Union coll.
Of course, here is the Java code you requested: ```java public static <E> Collection<E> unionColl(Collection<E> c1, Collection<E> c2) { return new UColl<E>(c1, c2); } ``` Hope this helps!
JOML-CI/JOML
src/org/joml/Planed.java
Planed.equationFromPoints
public static Vector4d equationFromPoints( Vector3d v0, Vector3d v1, Vector3d v2, Vector4d dest) { return equationFromPoints(v0.x, v0.y, v0.z, v1.x, v1.y, v1.z, v2.x, v2.y, v2.z, dest); }
java
public static Vector4d equationFromPoints( Vector3d v0, Vector3d v1, Vector3d v2, Vector4d dest) { return equationFromPoints(v0.x, v0.y, v0.z, v1.x, v1.y, v1.z, v2.x, v2.y, v2.z, dest); }
[ "public", "static", "Vector4d", "equationFromPoints", "(", "Vector3d", "v0", ",", "Vector3d", "v1", ",", "Vector3d", "v2", ",", "Vector4d", "dest", ")", "{", "return", "equationFromPoints", "(", "v0", ".", "x", ",", "v0", ".", "y", ",", "v0", ".", "z", ...
Compute the factors <code>a</code>, <code>b</code>, <code>c</code> and <code>d</code> in the plane equation <code>a*x + b*y + c*z + d = 0</code> from the given three points on the plane, and write the values to the <code>x</code>, <code>y</code>, <code>z</code> and <code>w</code> components, respectively, of the given ...
[ "Compute", "the", "factors", "<code", ">", "a<", "/", "code", ">", "<code", ">", "b<", "/", "code", ">", "<code", ">", "c<", "/", "code", ">", "and", "<code", ">", "d<", "/", "code", ">", "in", "the", "plane", "equation", "<code", ">", "a", "*", ...
ce2652fc236b42bda3875c591f8e6645048a678f
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Planed.java#L156-L160
train
Compute the equation of two vectors.
Of course, here is the Java code you requested: ```java public static Vector4d equationFromPoints( Vector3d v0, Vector3d v1, Vector3d v2, Vector4d dest) { return equationFromPoints(v0.x, v0.y, v0.z, v1.x, v1.y, v1.z, v2.x, v2.y, v2.z, dest); } ``` Hope this helps!
Talend/tesb-rt-se
sam/sam-service-soap/src/main/java/org/talend/esb/sam/service/soap/MonitoringServiceImpl.java
MonitoringServiceImpl.putEvents
public void putEvents(List<Event> events) { List<Event> filteredEvents = filterEvents(events); executeHandlers(filteredEvents); for (Event event : filteredEvents) { persistenceHandler.writeEvent(event); } }
java
public void putEvents(List<Event> events) { List<Event> filteredEvents = filterEvents(events); executeHandlers(filteredEvents); for (Event event : filteredEvents) { persistenceHandler.writeEvent(event); } }
[ "public", "void", "putEvents", "(", "List", "<", "Event", ">", "events", ")", "{", "List", "<", "Event", ">", "filteredEvents", "=", "filterEvents", "(", "events", ")", ";", "executeHandlers", "(", "filteredEvents", ")", ";", "for", "(", "Event", "event", ...
Executes all event manipulating handler and writes the event with persist handler. @param events the events
[ "Executes", "all", "event", "manipulating", "handler", "and", "writes", "the", "event", "with", "persist", "handler", "." ]
0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886
https://github.com/Talend/tesb-rt-se/blob/0a151a6d91ffff65ac4b5ee0c5b2c882ac28d886/sam/sam-service-soap/src/main/java/org/talend/esb/sam/service/soap/MonitoringServiceImpl.java#L79-L85
train
Put events into the database.
Of course, here is the Java code you requested: ```java public void putEvents(List<Event> events) { List<Event> filteredEvents = filterEvents(events); executeHandlers(filteredEvents); for (Event event : filteredEvents) { persistenceHandler.writeEvent(event); } } ``` Hop...
arnaudroger/SimpleFlatMapper
sfm-poi/src/main/java/org/simpleflatmapper/poi/impl/DynamicSheetMapper.java
DynamicSheetMapper.getPoiMapper
private SheetMapper<T> getPoiMapper(int startRow, Sheet sheet) { Row row = sheet.getRow(startRow); List<CsvColumnKey> keys = new ArrayList<CsvColumnKey>(row.getLastCellNum() - row.getFirstCellNum()); for(short i = row.getFirstCellNum(); i <= row.getLastCellNum(); i++) { Cell cell = ...
java
private SheetMapper<T> getPoiMapper(int startRow, Sheet sheet) { Row row = sheet.getRow(startRow); List<CsvColumnKey> keys = new ArrayList<CsvColumnKey>(row.getLastCellNum() - row.getFirstCellNum()); for(short i = row.getFirstCellNum(); i <= row.getLastCellNum(); i++) { Cell cell = ...
[ "private", "SheetMapper", "<", "T", ">", "getPoiMapper", "(", "int", "startRow", ",", "Sheet", "sheet", ")", "{", "Row", "row", "=", "sheet", ".", "getRow", "(", "startRow", ")", ";", "List", "<", "CsvColumnKey", ">", "keys", "=", "new", "ArrayList", "...
IFJAVA8_END
[ "IFJAVA8_END" ]
93435438c18f26c87963d5e0f3ebf0f264dcd8c2
https://github.com/arnaudroger/SimpleFlatMapper/blob/93435438c18f26c87963d5e0f3ebf0f264dcd8c2/sfm-poi/src/main/java/org/simpleflatmapper/poi/impl/DynamicSheetMapper.java#L102-L116
train
Get the poi mapper.
Of course, here is the Java code you requested: ```java private SheetMapper<T> getPoiMapper(int startRow, Sheet sheet) { Row row = sheet.getRow(startRow); List<CsvColumnKey> keys = new ArrayList<CsvColumnKey>(row.getLastCellNum() - row.getFirstCellNum()); for(short i = row.getFirstCellNum(); i...
alipay/sofa-rpc
extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistry.java
SofaRegistry.addAttributes
private void addAttributes(PublisherRegistration publisherRegistration, String group) { // if group == null; group = "DEFAULT_GROUP" if (StringUtils.isNotEmpty(group)) { publisherRegistration.setGroup(group); } }
java
private void addAttributes(PublisherRegistration publisherRegistration, String group) { // if group == null; group = "DEFAULT_GROUP" if (StringUtils.isNotEmpty(group)) { publisherRegistration.setGroup(group); } }
[ "private", "void", "addAttributes", "(", "PublisherRegistration", "publisherRegistration", ",", "String", "group", ")", "{", "// if group == null; group = \"DEFAULT_GROUP\"", "if", "(", "StringUtils", ".", "isNotEmpty", "(", "group", ")", ")", "{", "publisherRegistration"...
添加额外的属性 @param publisherRegistration 注册或者订阅对象 @param group 分组
[ "添加额外的属性" ]
a31406410291e56696185a29c3ba4bd1f54488fd
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-sofa/src/main/java/com/alipay/sofa/rpc/registry/sofa/SofaRegistry.java#L305-L311
train
Add the attributes of the resource to the publisher registration.
Of course, here is the Java code you requested: ```java private void addAttributes(PublisherRegistration publisherRegistration, String group) { // if group == null; group = "DEFAULT_GROUP" if (StringUtils.isNotEmpty(group)) { publisherRegistration.setGroup(group); } } ``` Hope...
aws/aws-sdk-java
aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/TypeUtils.java
TypeUtils.getJavaDataType
public String getJavaDataType(Map<String, Shape> shapes, String shapeName, CustomizationConfig customConfig) { if (shapeName == null || shapeName.trim().isEmpty()) { throw new IllegalArgumentException( "Cannot derive shape type. Shape name canno...
java
public String getJavaDataType(Map<String, Shape> shapes, String shapeName, CustomizationConfig customConfig) { if (shapeName == null || shapeName.trim().isEmpty()) { throw new IllegalArgumentException( "Cannot derive shape type. Shape name canno...
[ "public", "String", "getJavaDataType", "(", "Map", "<", "String", ",", "Shape", ">", "shapes", ",", "String", "shapeName", ",", "CustomizationConfig", "customConfig", ")", "{", "if", "(", "shapeName", "==", "null", "||", "shapeName", ".", "trim", "(", ")", ...
Returns the Java type of the specified shape with potential customization (such as auto-construct list or map).
[ "Returns", "the", "Java", "type", "of", "the", "specified", "shape", "with", "potential", "customization", "(", "such", "as", "auto", "-", "construct", "list", "or", "map", ")", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/TypeUtils.java#L133-L179
train
Get Java data type from shape name and shapes
Of course, here is the Java code you requested: ```java public String getJavaDataType(Map<String, Shape> shapes, String shapeName, CustomizationConfig customConfig) { if (shapeName == null || shapeName.trim().isEmpty()) { throw new IllegalArgumentException( ...
williamwebb/alogger
BillingHelper/src/main/java/com/jug6ernaut/billing/IabHelper.java
IabHelper.consumeAsync
public void consumeAsync(List<Purchase> purchases, OnConsumeMultiFinishedListener listener) { checkNotDisposed(); checkSetupDone("consume"); consumeAsyncInternal(purchases, null, listener); }
java
public void consumeAsync(List<Purchase> purchases, OnConsumeMultiFinishedListener listener) { checkNotDisposed(); checkSetupDone("consume"); consumeAsyncInternal(purchases, null, listener); }
[ "public", "void", "consumeAsync", "(", "List", "<", "Purchase", ">", "purchases", ",", "OnConsumeMultiFinishedListener", "listener", ")", "{", "checkNotDisposed", "(", ")", ";", "checkSetupDone", "(", "\"consume\"", ")", ";", "consumeAsyncInternal", "(", "purchases"...
Same as {@link consumeAsync}, but for multiple items at once. @param purchases The list of PurchaseInfo objects representing the purchases to consume. @param listener The listener to notify when the consumption operation finishes.
[ "Same", "as", "{" ]
61fca49e0b8d9c3a76c40da8883ac354b240351e
https://github.com/williamwebb/alogger/blob/61fca49e0b8d9c3a76c40da8883ac354b240351e/BillingHelper/src/main/java/com/jug6ernaut/billing/IabHelper.java#L747-L751
train
Consume the specified purchases asynchronously.
Of course, here is the Java code you requested: ```java public void consumeAsync(List<Purchase> purchases, OnConsumeMultiFinishedListener listener) { checkNotDisposed(); checkSetupDone("consume"); consumeAsyncInternal(purchases, null, listener); } ``` Hope this helps!
Jasig/uPortal
uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/MapCachingDoubleCheckedCreator.java
MapCachingDoubleCheckedCreator.create
@Override protected final T create(Object... args) { final K key = this.getKey(args); final T value = this.createInternal(key, args); this.objectCache.put(key, value); return value; }
java
@Override protected final T create(Object... args) { final K key = this.getKey(args); final T value = this.createInternal(key, args); this.objectCache.put(key, value); return value; }
[ "@", "Override", "protected", "final", "T", "create", "(", "Object", "...", "args", ")", "{", "final", "K", "key", "=", "this", ".", "getKey", "(", "args", ")", ";", "final", "T", "value", "=", "this", ".", "createInternal", "(", "key", ",", "args", ...
/* (non-Javadoc) @see org.apereo.portal.utils.threading.DoubleCheckedCreator#create(java.lang.Object[])
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
c1986542abb9acd214268f2df21c6305ad2f262b
https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/threading/MapCachingDoubleCheckedCreator.java#L86-L92
train
Create a new instance of the class.
Of course, here is the Java code you requested: ```java @Override protected final T create(Object... args) { final K key = this.getKey(args); final T value = this.createInternal(key, args); this.objectCache.put(key, value); return value; } ``` Hope this helps!
DV8FromTheWorld/JDA
src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java
PermissionUtil.getEffectivePermission
public static long getEffectivePermission(Member member) { Checks.notNull(member, "Member"); if (member.isOwner()) return Permission.ALL_PERMISSIONS; //Default to binary OR of all global permissions in this guild long permission = member.getGuild().getPublicRole().getPer...
java
public static long getEffectivePermission(Member member) { Checks.notNull(member, "Member"); if (member.isOwner()) return Permission.ALL_PERMISSIONS; //Default to binary OR of all global permissions in this guild long permission = member.getGuild().getPublicRole().getPer...
[ "public", "static", "long", "getEffectivePermission", "(", "Member", "member", ")", "{", "Checks", ".", "notNull", "(", "member", ",", "\"Member\"", ")", ";", "if", "(", "member", ".", "isOwner", "(", ")", ")", "return", "Permission", ".", "ALL_PERMISSIONS",...
Gets the {@code long} representation of the effective permissions allowed for this {@link net.dv8tion.jda.core.entities.Member Member} in this {@link net.dv8tion.jda.core.entities.Guild Guild}. This can be used in conjunction with {@link net.dv8tion.jda.core.Permission#getPermissions(long) Permission.getPermissions(int...
[ "Gets", "the", "{", "@code", "long", "}", "representation", "of", "the", "effective", "permissions", "allowed", "for", "this", "{", "@link", "net", ".", "dv8tion", ".", "jda", ".", "core", ".", "entities", ".", "Member", "Member", "}", "in", "this", "{",...
8ecbbe354d03f6bf448411bba573d0d4c268b560
https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java#L324-L340
train
Get effective permissions for a member
Of course, here is the Java code you requested: ```java public static long getEffectivePermission(Member member) { Checks.notNull(member, "Member"); if (member.isOwner()) return Permission.ALL_PERMISSIONS; //Default to binary OR of all global permissions in this guild l...
facebookarchive/hadoop-20
src/core/org/apache/hadoop/ipc/ProtocolSignature.java
ProtocolSignature.getSigFingerprint
private static ProtocolSigFingerprint getSigFingerprint( Class <? extends VersionedProtocol> protocol, long serverVersion) { String protocolName = protocol.getName(); synchronized (PROTOCOL_FINGERPRINT_CACHE) { ProtocolSigFingerprint sig = PROTOCOL_FINGERPRINT_CACHE.get(protocolName); if (sig ...
java
private static ProtocolSigFingerprint getSigFingerprint( Class <? extends VersionedProtocol> protocol, long serverVersion) { String protocolName = protocol.getName(); synchronized (PROTOCOL_FINGERPRINT_CACHE) { ProtocolSigFingerprint sig = PROTOCOL_FINGERPRINT_CACHE.get(protocolName); if (sig ...
[ "private", "static", "ProtocolSigFingerprint", "getSigFingerprint", "(", "Class", "<", "?", "extends", "VersionedProtocol", ">", "protocol", ",", "long", "serverVersion", ")", "{", "String", "protocolName", "=", "protocol", ".", "getName", "(", ")", ";", "synchron...
Return a protocol's signature and finger print from cache @param protocol a protocol class @param serverVersion protocol version @return its signature and finger print
[ "Return", "a", "protocol", "s", "signature", "and", "finger", "print", "from", "cache" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/ipc/ProtocolSignature.java#L183-L197
train
Get the ProtocolSigFingerprint object for a given protocol and server version.
Of course, here is the Java code you requested: ```java private static ProtocolSigFingerprint getSigFingerprint( Class <? extends VersionedProtocol> protocol, long serverVersion) { String protocolName = protocol.getName(); synchronized (PROTOCOL_FINGERPRINT_CACHE) { ProtocolSigFingerprint sig = PRO...
javamonkey/beetl2.0
beetl-core/src/main/java/org/beetl/core/Transformator.java
Transformator.isEscape
public boolean isEscape(StringBuilder temp, int index) { if (index != 0 && cs[index - 1] == this.ESCAPE) { if (index >= 2 && cs[index - 2] == this.ESCAPE) { // 俩个转义符号,删除一个 if (temp.length() != 0) temp.setLength(temp.length() - 1); return false; } else { // 将已经添加的转义符...
java
public boolean isEscape(StringBuilder temp, int index) { if (index != 0 && cs[index - 1] == this.ESCAPE) { if (index >= 2 && cs[index - 2] == this.ESCAPE) { // 俩个转义符号,删除一个 if (temp.length() != 0) temp.setLength(temp.length() - 1); return false; } else { // 将已经添加的转义符...
[ "public", "boolean", "isEscape", "(", "StringBuilder", "temp", ",", "int", "index", ")", "{", "if", "(", "index", "!=", "0", "&&", "cs", "[", "index", "-", "1", "]", "==", "this", ".", "ESCAPE", ")", "{", "if", "(", "index", ">=", "2", "&&", "cs"...
在match情况下,判断前面一符号是否是转义符号,如果是,则删除转义符号 2012-2-5 李bear
[ "在match情况下,判断前面一符号是否是转义符号,如果是,则删除转义符号", "2012", "-", "2", "-", "5", "李bear" ]
f32f729ad238079df5aca6e38a3c3ba0a55c78d6
https://github.com/javamonkey/beetl2.0/blob/f32f729ad238079df5aca6e38a3c3ba0a55c78d6/beetl-core/src/main/java/org/beetl/core/Transformator.java#L859-L886
train
Checks if the escape character in the StringBuilder is the same as the character in the UTF - 8 encoding.
Of course, here is the Java code you requested: ```java public boolean isEscape(StringBuilder temp, int index) { if (index != 0 && cs[index - 1] == this.ESCAPE) { if (index >= 2 && cs[index - 2] == this.ESCAPE) { // 俩个转义符号,删除一个 if (temp.length() != 0) temp.setLength(temp.length() - 1); ...
Impetus/Kundera
src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/CassQuery.java
CassQuery.onQueryOverCQL3
public String onQueryOverCQL3(EntityMetadata m, Client client, MetamodelImpl metaModel, List<String> relations) { // select column will always be of entity field only! // where clause ordering Class compoundKeyClass = m.getIdAttribute().getBindableJavaType(); EmbeddableType compoundKey ...
java
public String onQueryOverCQL3(EntityMetadata m, Client client, MetamodelImpl metaModel, List<String> relations) { // select column will always be of entity field only! // where clause ordering Class compoundKeyClass = m.getIdAttribute().getBindableJavaType(); EmbeddableType compoundKey ...
[ "public", "String", "onQueryOverCQL3", "(", "EntityMetadata", "m", ",", "Client", "client", ",", "MetamodelImpl", "metaModel", ",", "List", "<", "String", ">", "relations", ")", "{", "// select column will always be of entity field only!", "// where clause ordering", "Cla...
On query over composite columns. @param m the m @param client the client @param metaModel the meta model @param relations the relations @return the list
[ "On", "query", "over", "composite", "columns", "." ]
268958ab1ec09d14ec4d9184f0c8ded7a9158908
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/query/CassQuery.java#L613-L644
train
On query over cql3.
Of course, here is the Java code you requested: ```java public String onQueryOverCQL3(EntityMetadata m, Client client, MetamodelImpl metaModel, List<String> relations) { // select column will always be of entity field only! // where clause ordering Class compoundKeyClass = m.getIdAttribute().g...
michael-rapp/AndroidUtil
library/src/main/java/de/mrapp/android/util/ElevationUtil.java
ElevationUtil.createEdgeShadow
private static Bitmap createEdgeShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { if (elevation == 0) { return null; } else {...
java
private static Bitmap createEdgeShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { if (elevation == 0) { return null; } else {...
[ "private", "static", "Bitmap", "createEdgeShadow", "(", "@", "NonNull", "final", "Context", "context", ",", "final", "int", "elevation", ",", "@", "NonNull", "final", "Orientation", "orientation", ",", "final", "boolean", "parallelLight", ")", "{", "if", "(", ...
Creates and returns a bitmap, which can be used to emulate a shadow, which is located at a corner of an elevated view on pre-Lollipop devices. @param context The context, which should be used, as an instance of the class {@link Context}. The context may not be null @param elevation The elevation, which should be emula...
[ "Creates", "and", "returns", "a", "bitmap", "which", "can", "be", "used", "to", "emulate", "a", "shadow", "which", "is", "located", "at", "a", "corner", "of", "an", "elevated", "view", "on", "pre", "-", "Lollipop", "devices", "." ]
67ec0e5732344eeb4d946dd1f96d782939e449f4
https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ElevationUtil.java#L253-L279
train
Create edge shadow bitmap.
Of course, here is the Java code you requested: ```java private static Bitmap createEdgeShadow(@NonNull final Context context, final int elevation, @NonNull final Orientation orientation, final boolean parallelLight) { if (el...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeParseContext.java
DateTimeParseContext.addChronoChangedListener
void addChronoChangedListener(Consumer<Chronology> listener) { if (chronoListeners == null) { chronoListeners = new ArrayList<Consumer<Chronology>>(); } chronoListeners.add(listener); }
java
void addChronoChangedListener(Consumer<Chronology> listener) { if (chronoListeners == null) { chronoListeners = new ArrayList<Consumer<Chronology>>(); } chronoListeners.add(listener); }
[ "void", "addChronoChangedListener", "(", "Consumer", "<", "Chronology", ">", "listener", ")", "{", "if", "(", "chronoListeners", "==", "null", ")", "{", "chronoListeners", "=", "new", "ArrayList", "<", "Consumer", "<", "Chronology", ">", ">", "(", ")", ";", ...
Adds a Consumer<Chronology> to the list of listeners to be notified if the Chronology changes. @param listener a Consumer<Chronology> to be called when Chronology changes
[ "Adds", "a", "Consumer<Chronology", ">", "to", "the", "list", "of", "listeners", "to", "be", "notified", "if", "the", "Chronology", "changes", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeParseContext.java#L400-L405
train
Add a listener to be notified when a chronology has changed.
Of course, here is the Java code you requested: ```java void addChronoChangedListener(Consumer<Chronology> listener) { if (chronoListeners == null) { chronoListeners = new ArrayList<Consumer<Chronology>>(); } chronoListeners.add(listener); } ``` Hope this helps!
meertensinstituut/mtas
src/main/java/mtas/solr/handler/component/util/MtasSolrComponentList.java
MtasSolrComponentList.modifyRequest
public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq) { if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false) && sreq.params.getBool(PARAM_MTAS_LIST, false)) { // compute keys Set<String> keys = MtasSolrResultUtil .getIdsFromParameters...
java
public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq) { if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false) && sreq.params.getBool(PARAM_MTAS_LIST, false)) { // compute keys Set<String> keys = MtasSolrResultUtil .getIdsFromParameters...
[ "public", "void", "modifyRequest", "(", "ResponseBuilder", "rb", ",", "SearchComponent", "who", ",", "ShardRequest", "sreq", ")", "{", "if", "(", "sreq", ".", "params", ".", "getBool", "(", "MtasSolrSearchComponent", ".", "PARAM_MTAS", ",", "false", ")", "&&",...
/* (non-Javadoc) @see mtas.solr.handler.component.util.MtasSolrComponent#modifyRequest(org.apache .solr.handler.component.ResponseBuilder, org.apache.solr.handler.component.SearchComponent, org.apache.solr.handler.component.ShardRequest)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/util/MtasSolrComponentList.java#L287-L355
train
Modify request.
Of course, here is the Java code you requested: ```java public void modifyRequest(ResponseBuilder rb, SearchComponent who, ShardRequest sreq) { if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false) && sreq.params.getBool(PARAM_MTAS_LIST, false)) { // compute keys Set<String> ...
Cornutum/tcases
tcases-openapi/src/main/java/org/cornutum/tcases/openapi/io/TcasesOpenApiIO.java
TcasesOpenApiIO.getRequestInputModel
public static SystemInputDef getRequestInputModel( InputStream api, ModelOptions options) { try( OpenApiReader reader = new OpenApiReader( api)) { return TcasesOpenApi.getRequestInputModel( reader.read(), options); } }
java
public static SystemInputDef getRequestInputModel( InputStream api, ModelOptions options) { try( OpenApiReader reader = new OpenApiReader( api)) { return TcasesOpenApi.getRequestInputModel( reader.read(), options); } }
[ "public", "static", "SystemInputDef", "getRequestInputModel", "(", "InputStream", "api", ",", "ModelOptions", "options", ")", "{", "try", "(", "OpenApiReader", "reader", "=", "new", "OpenApiReader", "(", "api", ")", ")", "{", "return", "TcasesOpenApi", ".", "get...
Returns a {@link SystemInputDef system input definition} for the API requests defined by the given OpenAPI specification. Returns null if the given spec defines no API requests to model.
[ "Returns", "a", "{" ]
21e15cf107fa149620c40f4bda1829c1224fcfb1
https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-openapi/src/main/java/org/cornutum/tcases/openapi/io/TcasesOpenApiIO.java#L49-L55
train
Get the SystemInputDef from an input stream.
Of course, here is the Java code you requested: ```java public static SystemInputDef getRequestInputModel( InputStream api, ModelOptions options) { try( OpenApiReader reader = new OpenApiReader( api)) { return TcasesOpenApi.getRequestInputModel( reader.read(), options); } } ``` Hope this...
sebastiangraf/jSCSI
bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java
ProtocolDataUnit.deserializeAdditionalHeaderSegments
private final int deserializeAdditionalHeaderSegments (final ByteBuffer pdu, final int offset) throws InternetSCSIException { // parsing Additional Header Segment int off = offset; int ahsLength = basicHeaderSegment.getTotalAHSLength(); while (ahsLength != 0) { final Additio...
java
private final int deserializeAdditionalHeaderSegments (final ByteBuffer pdu, final int offset) throws InternetSCSIException { // parsing Additional Header Segment int off = offset; int ahsLength = basicHeaderSegment.getTotalAHSLength(); while (ahsLength != 0) { final Additio...
[ "private", "final", "int", "deserializeAdditionalHeaderSegments", "(", "final", "ByteBuffer", "pdu", ",", "final", "int", "offset", ")", "throws", "InternetSCSIException", "{", "// parsing Additional Header Segment", "int", "off", "=", "offset", ";", "int", "ahsLength",...
Deserializes a array (starting from the given offset) and store the informations to the <code>AdditionalHeaderSegment</code> object. @param pdu The <code>ByteBuffer</code> to read from. @param offset The offset to start from. @return The length of the written bytes. @throws InternetSCSIException If any violation of th...
[ "Deserializes", "a", "array", "(", "starting", "from", "the", "given", "offset", ")", "and", "store", "the", "informations", "to", "the", "<code", ">", "AdditionalHeaderSegment<", "/", "code", ">", "object", "." ]
6169bfe73f0b15de7d6485453555389e782ae888
https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/commons/src/main/java/org/jscsi/parser/ProtocolDataUnit.java#L224-L240
train
Deserialize Additional Header Segments.
Of course, here is the Java code you requested: ```java private final int deserializeAdditionalHeaderSegments (final ByteBuffer pdu, final int offset) throws InternetSCSIException { // parsing Additional Header Segment int off = offset; int ahsLength = basicHeaderSegment.getTotalAHSLength(); ...
datumbox/datumbox-framework
datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/common/abstracts/algorithms/AbstractBoostingBagging.java
AbstractBoostingBagging._predict
@Override protected void _predict(Dataframe newData) { //load all trainables on the bundles initBundle(); List<Double> weakClassifierWeights = knowledgeBase.getModelParameters().getWeakClassifierWeights(); //create a temporary map for the observed probabilities in training set ...
java
@Override protected void _predict(Dataframe newData) { //load all trainables on the bundles initBundle(); List<Double> weakClassifierWeights = knowledgeBase.getModelParameters().getWeakClassifierWeights(); //create a temporary map for the observed probabilities in training set ...
[ "@", "Override", "protected", "void", "_predict", "(", "Dataframe", "newData", ")", "{", "//load all trainables on the bundles", "initBundle", "(", ")", ";", "List", "<", "Double", ">", "weakClassifierWeights", "=", "knowledgeBase", ".", "getModelParameters", "(", "...
{@inheritDoc}
[ "{" ]
909dff0476e80834f05ecdde0624dd2390e9b0ca
https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/common/abstracts/algorithms/AbstractBoostingBagging.java#L154-L205
train
This method is called to predict the dataframe of the CIS model.
Of course, here is the Java code you requested: ```java @Override protected void _predict(Dataframe newData) { //load all trainables on the bundles initBundle(); List<Double> weakClassifierWeights = knowledgeBase.getModelParameters().getWeakClassifierWeights(); //create a temporar...
alexruiz/fest-assert-1.x
src/main/java/org/fest/assertions/GenericAssert.java
GenericAssert.isIn
public final @NotNull S isIn(@NotNull Collection<?> values) { checkNotNull(values); if (isActualIn(values)) { return myself(); } failIfCustomMessageIsSet(); throw failure(unexpectedNotIn(actual, values)); }
java
public final @NotNull S isIn(@NotNull Collection<?> values) { checkNotNull(values); if (isActualIn(values)) { return myself(); } failIfCustomMessageIsSet(); throw failure(unexpectedNotIn(actual, values)); }
[ "public", "final", "@", "NotNull", "S", "isIn", "(", "@", "NotNull", "Collection", "<", "?", ">", "values", ")", "{", "checkNotNull", "(", "values", ")", ";", "if", "(", "isActualIn", "(", "values", ")", ")", "{", "return", "myself", "(", ")", ";", ...
Verifies that the actual value is in the given collection. @param values the given collection to search the actual value in. must not be null. @return this assertion object. @throws AssertionError if the actual value is not in the given collection. @throws NullPointerException if the given collection is null.
[ "Verifies", "that", "the", "actual", "value", "is", "in", "the", "given", "collection", "." ]
f026c3059c8b2e40052f0388309cace819ac93a4
https://github.com/alexruiz/fest-assert-1.x/blob/f026c3059c8b2e40052f0388309cace819ac93a4/src/main/java/org/fest/assertions/GenericAssert.java#L301-L308
valid
Check if the subject is in the given collection.
Of course, here is the Java code you requested: ```java public final @NotNull S isIn(@NotNull Collection<?> values) { checkNotNull(values); if (isActualIn(values)) { return myself(); } failIfCustomMessageIsSet(); throw failure(unexpectedNotIn(actual, values)); } ``` Hope this helps!
ButterFaces/ButterFaces
components/src/main/java/org/butterfaces/model/table/json/JsonToModelConverter.java
JsonToModelConverter.convertTableColumnVisibility
public TableColumnVisibility convertTableColumnVisibility(final String tableIdentifier, final String json) { final String[] split = this.splitColumns(json); final List<String> visibleColumns = new ArrayList<>(); final List<String> invisibleColumns = new ArrayList<>(); for (String colum...
java
public TableColumnVisibility convertTableColumnVisibility(final String tableIdentifier, final String json) { final String[] split = this.splitColumns(json); final List<String> visibleColumns = new ArrayList<>(); final List<String> invisibleColumns = new ArrayList<>(); for (String colum...
[ "public", "TableColumnVisibility", "convertTableColumnVisibility", "(", "final", "String", "tableIdentifier", ",", "final", "String", "json", ")", "{", "final", "String", "[", "]", "split", "=", "this", ".", "splitColumns", "(", "json", ")", ";", "final", "List"...
Converts given json string to {@link TableColumnVisibility} used by {@link TableColumnVisibilityModel}. @param tableIdentifier an application unique table identifier. @param json string to convert to {@link TableColumnVisibility}. @return the converted {@link TableColumnVisibility}.
[ "Converts", "given", "json", "string", "to", "{", "@link", "TableColumnVisibility", "}", "used", "by", "{", "@link", "TableColumnVisibilityModel", "}", "." ]
e8c2bb340c89dcdbac409fcfc7a2a0e07f2462fc
https://github.com/ButterFaces/ButterFaces/blob/e8c2bb340c89dcdbac409fcfc7a2a0e07f2462fc/components/src/main/java/org/butterfaces/model/table/json/JsonToModelConverter.java#L25-L44
train
Converts a JSON string to a TableColumnVisibility object.
Of course, here is the Java code you requested: ```java public TableColumnVisibility convertTableColumnVisibility(final String tableIdentifier, final String json) { final String[] split = this.splitColumns(json); final List<String> visibleColumns = new ArrayList<>(); final List<String> invisib...
aws/aws-sdk-java
aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/model/CreateImageBuilderRequest.java
CreateImageBuilderRequest.withTags
public CreateImageBuilderRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
java
public CreateImageBuilderRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; }
[ "public", "CreateImageBuilderRequest", "withTags", "(", "java", ".", "util", ".", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "setTags", "(", "tags", ")", ";", "return", "this", ";", "}" ]
<p> The tags to associate with the image builder. A tag is a key-value pair, and the value is optional. For example, Environment=Test. If you do not specify a value, Environment=. </p> <p> If you do not specify a value, the value is set to an empty string. </p> <p> For more information about tags, see <a href="https://...
[ "<p", ">", "The", "tags", "to", "associate", "with", "the", "image", "builder", ".", "A", "tag", "is", "a", "key", "-", "value", "pair", "and", "the", "value", "is", "optional", ".", "For", "example", "Environment", "=", "Test", ".", "If", "you", "do...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-appstream/src/main/java/com/amazonaws/services/appstream/model/CreateImageBuilderRequest.java#L616-L619
train
Sets the tags for the image.
Of course, here is the Java code you requested: ```java public CreateImageBuilderRequest withTags(java.util.Map<String, String> tags) { setTags(tags); return this; } ``` Hope this helps!
alipay/sofa-hessian
src/main/java/com/caucho/hessian/io/HessianInput.java
HessianInput.readNode
public org.w3c.dom.Node readNode() throws IOException { int tag = read(); switch (tag) { case 'N': return null; case 'S': case 's': case 'X': case 'x': _isLastChunk = tag == 'S' || tag == 'X'; ...
java
public org.w3c.dom.Node readNode() throws IOException { int tag = read(); switch (tag) { case 'N': return null; case 'S': case 's': case 'X': case 'x': _isLastChunk = tag == 'S' || tag == 'X'; ...
[ "public", "org", ".", "w3c", ".", "dom", ".", "Node", "readNode", "(", ")", "throws", "IOException", "{", "int", "tag", "=", "read", "(", ")", ";", "switch", "(", "tag", ")", "{", "case", "'", "'", ":", "return", "null", ";", "case", "'", "'", ...
Reads an XML node. <pre> S b16 b8 string value </pre>
[ "Reads", "an", "XML", "node", "." ]
89e4f5af28602101dab7b498995018871616357b
https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/io/HessianInput.java#L831-L852
train
Reads a node from the input stream.
Of course, here is the Java code you requested: ```java public org.w3c.dom.Node readNode() throws IOException { int tag = read(); switch (tag) { case 'N': return null; case 'S': case 's': case 'X': case 'x': ...
biojava/biojava
biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java
SymmOptimizer.saveHistory
private void saveHistory(String folder) throws IOException { String name = msa.getStructureIdentifier(0).getIdentifier(); FileWriter writer = new FileWriter(folder + name + "-symm_opt.csv"); writer.append("Step,Time,RepeatLength,RMSD,TMscore,MCscore\n"); for (int i = 0; i < lengthHistory.size(); i++) { ...
java
private void saveHistory(String folder) throws IOException { String name = msa.getStructureIdentifier(0).getIdentifier(); FileWriter writer = new FileWriter(folder + name + "-symm_opt.csv"); writer.append("Step,Time,RepeatLength,RMSD,TMscore,MCscore\n"); for (int i = 0; i < lengthHistory.size(); i++) { ...
[ "private", "void", "saveHistory", "(", "String", "folder", ")", "throws", "IOException", "{", "String", "name", "=", "msa", ".", "getStructureIdentifier", "(", "0", ")", ".", "getIdentifier", "(", ")", ";", "FileWriter", "writer", "=", "new", "FileWriter", "...
Save the evolution of the optimization process as a csv file.
[ "Save", "the", "evolution", "of", "the", "optimization", "process", "as", "a", "csv", "file", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmOptimizer.java#L837-L855
train
Save the state of the structure to a file.
Of course, here is the Java code you requested: ```java private void saveHistory(String folder) throws IOException { String name = msa.getStructureIdentifier(0).getIdentifier(); FileWriter writer = new FileWriter(folder + name + "-symm_opt.csv"); writer.append("Step,Time,RepeatLength,RMSD,TMscore,MCscore\n"...
jamesagnew/hapi-fhir
hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java
ShExGenerator.genAlternativeTypes
private ST genAlternativeTypes(ElementDefinition ed, String id, String shortId) { ST shex_alt = tmplt(ALTERNATIVE_SHAPES_TEMPLATE); List<String> altEntries = new ArrayList<String>(); for(ElementDefinition.TypeRefComponent typ : ed.getType()) { altEntries.add(genAltEntry(id, typ)); } ...
java
private ST genAlternativeTypes(ElementDefinition ed, String id, String shortId) { ST shex_alt = tmplt(ALTERNATIVE_SHAPES_TEMPLATE); List<String> altEntries = new ArrayList<String>(); for(ElementDefinition.TypeRefComponent typ : ed.getType()) { altEntries.add(genAltEntry(id, typ)); } ...
[ "private", "ST", "genAlternativeTypes", "(", "ElementDefinition", "ed", ",", "String", "id", ",", "String", "shortId", ")", "{", "ST", "shex_alt", "=", "tmplt", "(", "ALTERNATIVE_SHAPES_TEMPLATE", ")", ";", "List", "<", "String", ">", "altEntries", "=", "new",...
Generate a set of alternative shapes @param ed Containing element definition @param id Element definition identifier @param shortId id to use in the actual definition @return ShEx list of alternative anonymous shapes separated by "OR"
[ "Generate", "a", "set", "of", "alternative", "shapes" ]
150a84d52fe691b7f48fcb28247c4bddb7aec352
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/conformance/ShExGenerator.java#L618-L628
train
Generate alternative types.
Of course, here is the Java code you requested: ```java private ST genAlternativeTypes(ElementDefinition ed, String id, String shortId) { ST shex_alt = tmplt(ALTERNATIVE_SHAPES_TEMPLATE); List<String> altEntries = new ArrayList<String>(); for(ElementDefinition.TypeRefComponent typ : ed.getType()) {...
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java
NavigationHandlerImpl.getViewId
public String getViewId(FacesContext context, String fromAction, String outcome) { return this.getNavigationCase(context, fromAction, outcome).getToViewId(context); }
java
public String getViewId(FacesContext context, String fromAction, String outcome) { return this.getNavigationCase(context, fromAction, outcome).getToViewId(context); }
[ "public", "String", "getViewId", "(", "FacesContext", "context", ",", "String", "fromAction", ",", "String", "outcome", ")", "{", "return", "this", ".", "getNavigationCase", "(", "context", ",", "fromAction", ",", "outcome", ")", ".", "getToViewId", "(", "cont...
Returns the view ID that would be created for the given action and outcome
[ "Returns", "the", "view", "ID", "that", "would", "be", "created", "for", "the", "given", "action", "and", "outcome" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/NavigationHandlerImpl.java#L1155-L1158
train
Gets the view id for the current navigation case.
Of course, here is the Java code you requested: ```java public String getViewId(FacesContext context, String fromAction, String outcome) { return this.getNavigationCase(context, fromAction, outcome).getToViewId(context); } ``` Hope this helps!
atomix/atomix
core/src/main/java/io/atomix/core/utils/config/PolymorphicTypeMapper.java
PolymorphicTypeMapper.getConcreteClass
@SuppressWarnings("unchecked") public Class<? extends TypedConfig<?>> getConcreteClass(AtomixRegistry registry, String typeName) { ConfiguredType type = registry.getType(typeClass, typeName); if (type == null) { return null; } return (Class<? extends TypedConfig<?>>) type.newConfig().getClass();...
java
@SuppressWarnings("unchecked") public Class<? extends TypedConfig<?>> getConcreteClass(AtomixRegistry registry, String typeName) { ConfiguredType type = registry.getType(typeClass, typeName); if (type == null) { return null; } return (Class<? extends TypedConfig<?>>) type.newConfig().getClass();...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Class", "<", "?", "extends", "TypedConfig", "<", "?", ">", ">", "getConcreteClass", "(", "AtomixRegistry", "registry", ",", "String", "typeName", ")", "{", "ConfiguredType", "type", "=", "registry", ...
Returns the concrete configuration class. @param registry the Atomix type registry @param typeName the type name @return the concrete configuration class
[ "Returns", "the", "concrete", "configuration", "class", "." ]
3a94b7c80576d762dd0d396d4645df07a0b37c31
https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/core/src/main/java/io/atomix/core/utils/config/PolymorphicTypeMapper.java#L70-L77
train
Get the concrete class for the given type name.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public Class<? extends TypedConfig<?>> getConcreteClass(AtomixRegistry registry, String typeName) { ConfiguredType type = registry.getType(typeClass, typeName); if (type == null) { return null; } return (Clas...
Azure/azure-sdk-for-java
mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LocationsInner.java
LocationsInner.checkNameAvailability
public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).toBlocking().single().body(); }
java
public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).toBlocking().single().body(); }
[ "public", "EntityNameAvailabilityCheckOutputInner", "checkNameAvailability", "(", "String", "locationName", ",", "CheckNameAvailabilityInput", "parameters", ")", "{", "return", "checkNameAvailabilityWithServiceResponseAsync", "(", "locationName", ",", "parameters", ")", ".", "t...
Check Name Availability. Checks whether the Media Service resource name is available. @param locationName the String value @param parameters The request parameters @throws IllegalArgumentException thrown if parameters fail the validation @throws ApiErrorException thrown if the request is rejected by server @throws Run...
[ "Check", "Name", "Availability", ".", "Checks", "whether", "the", "Media", "Service", "resource", "name", "is", "available", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_06_01_preview/implementation/LocationsInner.java#L74-L76
train
Checks if the entity name is available for use.
Of course, here is the Java code you requested: ```java public EntityNameAvailabilityCheckOutputInner checkNameAvailability(String locationName, CheckNameAvailabilityInput parameters) { return checkNameAvailabilityWithServiceResponseAsync(locationName, parameters).toBlocking().single().body(); } ``` Hope ...
santhosh-tekuri/jlibs
xml/src/main/java/jlibs/xml/sax/helpers/NamespaceSupportReader.java
NamespaceSupportReader.parse
public void parse(InputSource is, DefaultHandler handler) throws IOException, SAXException{ setDefaultHandler(handler); parse(is); }
java
public void parse(InputSource is, DefaultHandler handler) throws IOException, SAXException{ setDefaultHandler(handler); parse(is); }
[ "public", "void", "parse", "(", "InputSource", "is", ",", "DefaultHandler", "handler", ")", "throws", "IOException", ",", "SAXException", "{", "setDefaultHandler", "(", "handler", ")", ";", "parse", "(", "is", ")", ";", "}" ]
/*-------------------------------------------------[ Parsing ]---------------------------------------------------
[ "/", "*", "-------------------------------------------------", "[", "Parsing", "]", "---------------------------------------------------" ]
59c28719f054123cf778278154e1b92e943ad232
https://github.com/santhosh-tekuri/jlibs/blob/59c28719f054123cf778278154e1b92e943ad232/xml/src/main/java/jlibs/xml/sax/helpers/NamespaceSupportReader.java#L81-L84
train
Parse the XML document from the input source.
Of course, here is the Java code you requested: ```java public void parse(InputSource is, DefaultHandler handler) throws IOException, SAXException{ setDefaultHandler(handler); parse(is); } ``` Hope this helps!
actorapp/actor-platform
actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java
Messenger.sendPhoto
@ObjectiveCName("sendPhotoWithPeer:withName:withW:withH:withThumb:withDescriptor:") public void sendPhoto(@NotNull Peer peer, @NotNull String fileName, int w, int h, @Nullable FastThumb fastThumb, @NotNull String descriptor) { modules.getMessagesModule().s...
java
@ObjectiveCName("sendPhotoWithPeer:withName:withW:withH:withThumb:withDescriptor:") public void sendPhoto(@NotNull Peer peer, @NotNull String fileName, int w, int h, @Nullable FastThumb fastThumb, @NotNull String descriptor) { modules.getMessagesModule().s...
[ "@", "ObjectiveCName", "(", "\"sendPhotoWithPeer:withName:withW:withH:withThumb:withDescriptor:\"", ")", "public", "void", "sendPhoto", "(", "@", "NotNull", "Peer", "peer", ",", "@", "NotNull", "String", "fileName", ",", "int", "w", ",", "int", "h", ",", "@", "Nul...
Send Photo message @param peer destination peer @param fileName File name (without path) @param w photo width @param h photo height @param fastThumb Fast thumb of photo @param descriptor File Descriptor
[ "Send", "Photo", "message" ]
5123c1584757c6eeea0ed2a0e7e043629871a0c6
https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L854-L859
train
Sends a photo to a peer.
Of course, here is the Java code you requested: ```java @ObjectiveCName("sendPhotoWithPeer:withName:withW:withH:withThumb:withDescriptor:") public void sendPhoto(@NotNull Peer peer, @NotNull String fileName, int w, int h, @Nullable FastThumb fastThumb, @NotNull S...
lessthanoptimal/GeoRegression
main/src/georegression/geometry/UtilPolygons2D_F64.java
UtilPolygons2D_F64.center
public static Point2D_F64 center( Quadrilateral_F64 quad , Point2D_F64 center ) { if( center == null ) center = new Point2D_F64(); center.x = quad.a.x + quad.b.x + quad.c.x + quad.d.x; center.y = quad.a.y + quad.b.y + quad.c.y + quad.d.y; center.x /= 4.0; center.y /= 4.0; return center; }
java
public static Point2D_F64 center( Quadrilateral_F64 quad , Point2D_F64 center ) { if( center == null ) center = new Point2D_F64(); center.x = quad.a.x + quad.b.x + quad.c.x + quad.d.x; center.y = quad.a.y + quad.b.y + quad.c.y + quad.d.y; center.x /= 4.0; center.y /= 4.0; return center; }
[ "public", "static", "Point2D_F64", "center", "(", "Quadrilateral_F64", "quad", ",", "Point2D_F64", "center", ")", "{", "if", "(", "center", "==", "null", ")", "center", "=", "new", "Point2D_F64", "(", ")", ";", "center", ".", "x", "=", "quad", ".", "a", ...
Computes the center or average point in the quadrilateral. @param quad (Input) Quadrilateral @param center (output) Center point of the quadrilateral. Can be null. @return The center point.
[ "Computes", "the", "center", "or", "average", "point", "in", "the", "quadrilateral", "." ]
c067cd44a4e95bd826119f6e658bd82386ef289f
https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/geometry/UtilPolygons2D_F64.java#L222-L233
test
Computes the center of the quadrilateral.
Of course, here is the Java code you requested: ```java public static Point2D_F64 center( Quadrilateral_F64 quad , Point2D_F64 center ) { if( center == null ) center = new Point2D_F64(); center.x = quad.a.x + quad.b.x + quad.c.x + quad.d.x; center.y = quad.a.y + quad.b.y + quad.c.y + quad.d.y; center.x /=...
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/callback/exception/LoggingExceptionCallback.java
LoggingExceptionCallback.getLogMessage
@Nonnull @Nonempty @OverrideOnDemand protected String getLogMessage (@Nullable final Throwable t) { if (t == null) return "An error occurred"; return "An exception was thrown"; }
java
@Nonnull @Nonempty @OverrideOnDemand protected String getLogMessage (@Nullable final Throwable t) { if (t == null) return "An error occurred"; return "An exception was thrown"; }
[ "@", "Nonnull", "@", "Nonempty", "@", "OverrideOnDemand", "protected", "String", "getLogMessage", "(", "@", "Nullable", "final", "Throwable", "t", ")", "{", "if", "(", "t", "==", "null", ")", "return", "\"An error occurred\"", ";", "return", "\"An exception was ...
Get the text to be logged for a certain exception @param t The exception to be logged. May theoretically be <code>null</code>. @return The text to be logged. May neither be <code>null</code> nor empty.
[ "Get", "the", "text", "to", "be", "logged", "for", "a", "certain", "exception" ]
d28c03565f44a0b804d96028d0969f9bb38c4313
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/callback/exception/LoggingExceptionCallback.java#L82-L90
train
Get the log message.
Of course, here is the Java code you requested: ```java @Nonnull @Nonempty @OverrideOnDemand protected String getLogMessage (@Nullable final Throwable t) { if (t == null) return "An error occurred"; return "An exception was thrown"; } ``` Hope this helps!
ltearno/hexa.tools
hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlParser.java
hqlParser.groupByClause
public final hqlParser.groupByClause_return groupByClause() throws RecognitionException { hqlParser.groupByClause_return retval = new hqlParser.groupByClause_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token GROUP121=null; Token string_literal122=null; Token COMMA124=null; ParserRule...
java
public final hqlParser.groupByClause_return groupByClause() throws RecognitionException { hqlParser.groupByClause_return retval = new hqlParser.groupByClause_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token GROUP121=null; Token string_literal122=null; Token COMMA124=null; ParserRule...
[ "public", "final", "hqlParser", ".", "groupByClause_return", "groupByClause", "(", ")", "throws", "RecognitionException", "{", "hqlParser", ".", "groupByClause_return", "retval", "=", "new", "hqlParser", ".", "groupByClause_return", "(", ")", ";", "retval", ".", "st...
hql.g:330:1: groupByClause : GROUP ^ 'by' ! expression ( COMMA ! expression )* ;
[ "hql", ".", "g", ":", "330", ":", "1", ":", "groupByClause", ":", "GROUP", "^", "by", "!", "expression", "(", "COMMA", "!", "expression", ")", "*", ";" ]
604c804901b1bb13fe10b3823cc4a639f8993363
https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.persistence/src/main/java/fr/lteconsulting/hexa/persistence/client/hqlParser.java#L3873-L3952
train
Use this method to match a GROUP ^ by clause.
Of course, here is the Java code you requested: ```java public final hqlParser.groupByClause_return groupByClause() throws RecognitionException { hqlParser.groupByClause_return retval = new hqlParser.groupByClause_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token GROUP121=null; Token st...
kiegroup/drools
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSemanticMappings.java
CompiledFEELSemanticMappings.mult
public static Object mult(Object left, Object right) { return InfixOpNode.mult(left, right, null); }
java
public static Object mult(Object left, Object right) { return InfixOpNode.mult(left, right, null); }
[ "public", "static", "Object", "mult", "(", "Object", "left", ",", "Object", "right", ")", "{", "return", "InfixOpNode", ".", "mult", "(", "left", ",", "right", ",", "null", ")", ";", "}" ]
FEEL spec Table 45 Delegates to {@link InfixOpNode} except evaluationcontext
[ "FEEL", "spec", "Table", "45", "Delegates", "to", "{" ]
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/codegen/feel11/CompiledFEELSemanticMappings.java#L314-L316
train
Multiplies two InfixOpNodes.
Of course, here is the Java code you requested: ```java public static Object mult(Object left, Object right) { return InfixOpNode.mult(left, right, null); } ``` Hope this helps!
samskivert/samskivert
src/main/java/com/samskivert/jdbc/DataSourceConnectionProvider.java
DataSourceConnectionProvider.connectionFailed
public void connectionFailed (String ident, boolean readOnly, Connection conn, SQLException error) { try { conn.close(); } catch (Exception e) { log.warning("Failure closing failed connection", "ident", ident, "ro", re...
java
public void connectionFailed (String ident, boolean readOnly, Connection conn, SQLException error) { try { conn.close(); } catch (Exception e) { log.warning("Failure closing failed connection", "ident", ident, "ro", re...
[ "public", "void", "connectionFailed", "(", "String", "ident", ",", "boolean", "readOnly", ",", "Connection", "conn", ",", "SQLException", "error", ")", "{", "try", "{", "conn", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", ...
from ConnectionProvider
[ "from", "ConnectionProvider" ]
a64d9ef42b69819bdb2c66bddac6a64caef928b6
https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/jdbc/DataSourceConnectionProvider.java#L59-L68
train
Connection failed.
Of course, here is the Java code you requested: ```java public void connectionFailed (String ident, boolean readOnly, Connection conn, SQLException error) { try { conn.close(); } catch (Exception e) { log.warning("Failure closing failed conn...
mgm-tp/jfunk
jfunk-common/src/main/java/com/mgmtp/jfunk/common/cli/LoggingStreamConsumer.java
LoggingStreamConsumer.consumeLine
@Override public void consumeLine(final String line) { sb.append(line).append(LINE_SEPARATOR); String logMessage = logMessagePrefix != null ? logMessagePrefix + line : line; if (error) { logger.error(logMessage); } else { logger.info(logMessage); } }
java
@Override public void consumeLine(final String line) { sb.append(line).append(LINE_SEPARATOR); String logMessage = logMessagePrefix != null ? logMessagePrefix + line : line; if (error) { logger.error(logMessage); } else { logger.info(logMessage); } }
[ "@", "Override", "public", "void", "consumeLine", "(", "final", "String", "line", ")", "{", "sb", ".", "append", "(", "line", ")", ".", "append", "(", "LINE_SEPARATOR", ")", ";", "String", "logMessage", "=", "logMessagePrefix", "!=", "null", "?", "logMessa...
{@inheritDoc} Adds each line to an internal {@link StringBuffer} whose contents may be retrieved in {@link #getOutput()} and logs each line applying a non-null {@code logMessagePrefix} using error or info level depending on the {@code error} parameter passed in the constructor.
[ "{" ]
5b9fecac5778b988bb458085ded39ea9a4c7c2ae
https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/cli/LoggingStreamConsumer.java#L64-L74
train
Consume a single line of data.
Of course, here is the Java code you requested: ```java @Override public void consumeLine(final String line) { sb.append(line).append(LINE_SEPARATOR); String logMessage = logMessagePrefix != null ? logMessagePrefix + line : line; if (error) { logger.error(logMessage); } else { logger.info(logMe...
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/ImageLibrary.java
ImageLibrary.newPluginImage
private boolean newPluginImage(String name, String pluginId, String filename) { boolean success = true; ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, filename); if (id == null) { id = ImageDescriptor.getMissingImageDescriptor(); // id = getSharedByName...
java
private boolean newPluginImage(String name, String pluginId, String filename) { boolean success = true; ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, filename); if (id == null) { id = ImageDescriptor.getMissingImageDescriptor(); // id = getSharedByName...
[ "private", "boolean", "newPluginImage", "(", "String", "name", ",", "String", "pluginId", ",", "String", "filename", ")", "{", "boolean", "success", "=", "true", ";", "ImageDescriptor", "id", "=", "AbstractUIPlugin", ".", "imageDescriptorFromPlugin", "(", "pluginI...
Register an image from the workspace shared image pool. If the image resource does not exist or fails to load, a default "error" resource is supplied. @param name name of the image @param sharedName name of the shared image ({@link ISharedImages}) @return whether the image has correctly been loaded
[ "Register", "an", "image", "from", "the", "workspace", "shared", "image", "pool", ".", "If", "the", "image", "resource", "does", "not", "exist", "or", "fails", "to", "load", "a", "default", "error", "resource", "is", "supplied", "." ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/ImageLibrary.java#L234-L251
train
Create an image from a plugin.
Of course, here is the Java code you requested: ```java private boolean newPluginImage(String name, String pluginId, String filename) { boolean success = true; ImageDescriptor id = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, filename); if (id == null) { id = ImageDescriptor.g...
threerings/narya
core/src/main/java/com/threerings/admin/client/ObjectEditorPanel.java
ObjectEditorPanel.objectAvailable
public void objectAvailable (ConfigObject object) { // keep this for later _object = object; // create our field editors try { Field[] fields = object.getClass().getFields(); for (Field field : fields) { // if the field is anything but a plain...
java
public void objectAvailable (ConfigObject object) { // keep this for later _object = object; // create our field editors try { Field[] fields = object.getClass().getFields(); for (Field field : fields) { // if the field is anything but a plain...
[ "public", "void", "objectAvailable", "(", "ConfigObject", "object", ")", "{", "// keep this for later", "_object", "=", "object", ";", "// create our field editors", "try", "{", "Field", "[", "]", "fields", "=", "object", ".", "getClass", "(", ")", ".", "getFiel...
documentation inherited from interface
[ "documentation", "inherited", "from", "interface" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/client/ObjectEditorPanel.java#L96-L117
train
This method is called by the DObjectManager to indicate that the DObject is available.
Of course, here is the Java code you requested: ```java public void objectAvailable (ConfigObject object) { // keep this for later _object = object; // create our field editors try { Field[] fields = object.getClass().getFields(); for (Field field : fields) ...
aws/aws-sdk-java
aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/model/DisableEnhancedMonitoringResult.java
DisableEnhancedMonitoringResult.setCurrentShardLevelMetrics
public void setCurrentShardLevelMetrics(java.util.Collection<String> currentShardLevelMetrics) { if (currentShardLevelMetrics == null) { this.currentShardLevelMetrics = null; return; } this.currentShardLevelMetrics = new com.amazonaws.internal.SdkInternalList<String>(cur...
java
public void setCurrentShardLevelMetrics(java.util.Collection<String> currentShardLevelMetrics) { if (currentShardLevelMetrics == null) { this.currentShardLevelMetrics = null; return; } this.currentShardLevelMetrics = new com.amazonaws.internal.SdkInternalList<String>(cur...
[ "public", "void", "setCurrentShardLevelMetrics", "(", "java", ".", "util", ".", "Collection", "<", "String", ">", "currentShardLevelMetrics", ")", "{", "if", "(", "currentShardLevelMetrics", "==", "null", ")", "{", "this", ".", "currentShardLevelMetrics", "=", "nu...
<p> Represents the current state of the metrics that are in the enhanced state before the operation. </p> @param currentShardLevelMetrics Represents the current state of the metrics that are in the enhanced state before the operation. @see MetricsName
[ "<p", ">", "Represents", "the", "current", "state", "of", "the", "metrics", "that", "are", "in", "the", "enhanced", "state", "before", "the", "operation", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesis/src/main/java/com/amazonaws/services/kinesis/model/DisableEnhancedMonitoringResult.java#L114-L121
train
Sets the value of the currentShardLevelMetrics property.
Of course, here is the Java code you requested: ```java public void setCurrentShardLevelMetrics(java.util.Collection<String> currentShardLevelMetrics) { if (currentShardLevelMetrics == null) { this.currentShardLevelMetrics = null; return; } this.currentShardLevelMetrics...
ixa-ehu/ixa-pipe-ml
src/main/java/eus/ixa/ixa/pipe/ml/pos/MultiWordMatcher.java
MultiWordMatcher.loadDictionary
private void loadDictionary(final InputStream dictInputStream) throws IOException { dictionary = new HashMap<String, String>(); final BufferedReader breader = new BufferedReader( new InputStreamReader(dictInputStream, Charset.forName("UTF-8"))); String line; while ((line = breader.readLine...
java
private void loadDictionary(final InputStream dictInputStream) throws IOException { dictionary = new HashMap<String, String>(); final BufferedReader breader = new BufferedReader( new InputStreamReader(dictInputStream, Charset.forName("UTF-8"))); String line; while ((line = breader.readLine...
[ "private", "void", "loadDictionary", "(", "final", "InputStream", "dictInputStream", ")", "throws", "IOException", "{", "dictionary", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "final", "BufferedReader", "breader", "=", "new", "Bu...
Load the dictionaries. @throws IOException if io problems
[ "Load", "the", "dictionaries", "." ]
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/pos/MultiWordMatcher.java#L73-L90
train
Load the dictionary from the input stream.
Of course, here is the Java code you requested: ```java private void loadDictionary(final InputStream dictInputStream) throws IOException { dictionary = new HashMap<String, String>(); final BufferedReader breader = new BufferedReader( new InputStreamReader(dictInputStream, Charset.forName("UTF-8"...
javagl/ND
nd-tuples/src/main/java/de/javagl/nd/tuples/Utils.java
Utils.checkForValidSubTupleIndices
public static void checkForValidSubTupleIndices( int parentSize, int fromIndex, int toIndex) { if (fromIndex < 0) { throw new IllegalArgumentException( "Start index is negative: "+fromIndex); } if (toIndex > parentSize) { ...
java
public static void checkForValidSubTupleIndices( int parentSize, int fromIndex, int toIndex) { if (fromIndex < 0) { throw new IllegalArgumentException( "Start index is negative: "+fromIndex); } if (toIndex > parentSize) { ...
[ "public", "static", "void", "checkForValidSubTupleIndices", "(", "int", "parentSize", ",", "int", "fromIndex", ",", "int", "toIndex", ")", "{", "if", "(", "fromIndex", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Start index is negative:...
Checks whether the given indices are valid indices for a sub-tuple of a parent tuple with the given size, and throws an <code>IllegalArgumentException</code> if not. @param parentSize The size of the parent @param fromIndex The start index of the sub-tuple, inclusive @param toIndex The end index of the sub-tuple, excl...
[ "Checks", "whether", "the", "given", "indices", "are", "valid", "indices", "for", "a", "sub", "-", "tuple", "of", "a", "parent", "tuple", "with", "the", "given", "size", "and", "throws", "an", "<code", ">", "IllegalArgumentException<", "/", "code", ">", "i...
bcb655aaf5fc88af6194f73a27cca079186ff559
https://github.com/javagl/ND/blob/bcb655aaf5fc88af6194f73a27cca079186ff559/nd-tuples/src/main/java/de/javagl/nd/tuples/Utils.java#L70-L88
train
Check if the indices of fromIndex and toIndex are valid for a single entry.
Of course, here is the Java code you requested: ```java public static void checkForValidSubTupleIndices( int parentSize, int fromIndex, int toIndex) { if (fromIndex < 0) { throw new IllegalArgumentException( "Start index is negative: "+fromIndex); ...
RestComm/jain-slee.sip
resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/SleeSipProviderImpl.java
SleeSipProviderImpl.getNewDialog
public DialogActivity getNewDialog(Address from, Address to) throws SipException { checkState(); if (from == null) { throw new IllegalArgumentException("From address cant be null"); } if (to == null) { throw new IllegalArgumentException("To address cant be null"); } return _getNewDialog(from, gov.n...
java
public DialogActivity getNewDialog(Address from, Address to) throws SipException { checkState(); if (from == null) { throw new IllegalArgumentException("From address cant be null"); } if (to == null) { throw new IllegalArgumentException("To address cant be null"); } return _getNewDialog(from, gov.n...
[ "public", "DialogActivity", "getNewDialog", "(", "Address", "from", ",", "Address", "to", ")", "throws", "SipException", "{", "checkState", "(", ")", ";", "if", "(", "from", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"From addre...
/* (non-Javadoc) @see net.java.slee.resource.sip.SleeSipProvider#getNewDialog(javax.sip.address .Address, javax.sip.address.Address)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
2c173af0a760cb0ea13fe0ffa58c0f82b14731f9
https://github.com/RestComm/jain-slee.sip/blob/2c173af0a760cb0ea13fe0ffa58c0f82b14731f9/resources/sip11/ra/src/main/java/org/mobicents/slee/resource/sip11/SleeSipProviderImpl.java#L569-L580
train
Create a new DialogActivity with the specified parameters.
Of course, here is the Java code you requested: ```java public DialogActivity getNewDialog(Address from, Address to) throws SipException { checkState(); if (from == null) { throw new IllegalArgumentException("From address cant be null"); } if (to == null) { throw new IllegalArgumentException("To addre...
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java
ComputerVisionImpl.recognizePrintedText
public OcrResult recognizePrintedText(boolean detectOrientation, String url, RecognizePrintedTextOptionalParameter recognizePrintedTextOptionalParameter) { return recognizePrintedTextWithServiceResponseAsync(detectOrientation, url, recognizePrintedTextOptionalParameter).toBlocking().single().body(); }
java
public OcrResult recognizePrintedText(boolean detectOrientation, String url, RecognizePrintedTextOptionalParameter recognizePrintedTextOptionalParameter) { return recognizePrintedTextWithServiceResponseAsync(detectOrientation, url, recognizePrintedTextOptionalParameter).toBlocking().single().body(); }
[ "public", "OcrResult", "recognizePrintedText", "(", "boolean", "detectOrientation", ",", "String", "url", ",", "RecognizePrintedTextOptionalParameter", "recognizePrintedTextOptionalParameter", ")", "{", "return", "recognizePrintedTextWithServiceResponseAsync", "(", "detectOrientati...
Optical Character Recognition (OCR) detects printed text in an image and extracts the recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon failure, the error code together with an error message will be returned. The error code can be one of InvalidImageUrl...
[ "Optical", "Character", "Recognition", "(", "OCR", ")", "detects", "printed", "text", "in", "an", "image", "and", "extracts", "the", "recognized", "characters", "into", "a", "machine", "-", "usable", "character", "stream", ".", "Upon", "success", "the", "OCR",...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1900-L1902
train
Recognize printed text.
Of course, here is the Java code you requested: ```java public OcrResult recognizePrintedText(boolean detectOrientation, String url, RecognizePrintedTextOptionalParameter recognizePrintedTextOptionalParameter) { return recognizePrintedTextWithServiceResponseAsync(detectOrientation, url, recognizePrintedTextOpt...
spotify/featran
java/src/main/java/com/spotify/featran/java/JFeatureSpec.java
JFeatureSpec.extract
public JFeatureExtractor<T> extract(List<T> input) { return new JFeatureExtractor<>(JavaOps.extract(self, input)); }
java
public JFeatureExtractor<T> extract(List<T> input) { return new JFeatureExtractor<>(JavaOps.extract(self, input)); }
[ "public", "JFeatureExtractor", "<", "T", ">", "extract", "(", "List", "<", "T", ">", "input", ")", "{", "return", "new", "JFeatureExtractor", "<>", "(", "JavaOps", ".", "extract", "(", "self", ",", "input", ")", ")", ";", "}" ]
Java wrapper for {@link FeatureSpec#extract(Object, CollectionType)}.
[ "Java", "wrapper", "for", "{" ]
b0a7ae24076248b9d5a12c5c72031eac88216c9a
https://github.com/spotify/featran/blob/b0a7ae24076248b9d5a12c5c72031eac88216c9a/java/src/main/java/com/spotify/featran/java/JFeatureSpec.java#L106-L108
train
Extract a list of features from a list of features.
Of course, here is the Java code you requested: ```java public JFeatureExtractor<T> extract(List<T> input) { return new JFeatureExtractor<>(JavaOps.extract(self, input)); } ``` Hope this helps!
alkacon/opencms-core
src-modules/org/opencms/workplace/tools/content/CmsPropertyChange.java
CmsPropertyChange.setPropertyInFolder
private List setPropertyInFolder( String resourceRootPath, String propertyDefinition, String newValue, boolean recursive) throws CmsException, CmsVfsException { CmsObject cms = getCms(); // collect the resources to look up List resources = new ArrayList(); ...
java
private List setPropertyInFolder( String resourceRootPath, String propertyDefinition, String newValue, boolean recursive) throws CmsException, CmsVfsException { CmsObject cms = getCms(); // collect the resources to look up List resources = new ArrayList(); ...
[ "private", "List", "setPropertyInFolder", "(", "String", "resourceRootPath", ",", "String", "propertyDefinition", ",", "String", "newValue", ",", "boolean", "recursive", ")", "throws", "CmsException", ",", "CmsVfsException", "{", "CmsObject", "cms", "=", "getCms", "...
Sets the given property with the given value to the given resource (potentially recursiv) if it has not been set before.<p> Returns a list with all sub resources that have been modified this way.<p> @param resourceRootPath the resource on which property definition values are changed @param propertyDefinition the name...
[ "Sets", "the", "given", "property", "with", "the", "given", "value", "to", "the", "given", "resource", "(", "potentially", "recursiv", ")", "if", "it", "has", "not", "been", "set", "before", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/tools/content/CmsPropertyChange.java#L469-L503
train
Sets the property in the folder.
Of course, here is the Java code you requested: ```java private List setPropertyInFolder( String resourceRootPath, String propertyDefinition, String newValue, boolean recursive) throws CmsException, CmsVfsException { CmsObject cms = getCms(); // collect the resources t...
geomajas/geomajas-project-server
common-servlet/src/main/java/org/geomajas/spring/ReconfigurableClassPathApplicationContext.java
ReconfigurableClassPathApplicationContext.rollback
public void rollback() throws GeomajasException { try { setConfigLocations(previousConfigLocations); refresh(); } catch (Exception e) { throw new GeomajasException(e, ExceptionCode.REFRESH_CONFIGURATION_FAILED); } }
java
public void rollback() throws GeomajasException { try { setConfigLocations(previousConfigLocations); refresh(); } catch (Exception e) { throw new GeomajasException(e, ExceptionCode.REFRESH_CONFIGURATION_FAILED); } }
[ "public", "void", "rollback", "(", ")", "throws", "GeomajasException", "{", "try", "{", "setConfigLocations", "(", "previousConfigLocations", ")", ";", "refresh", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "GeomajasException"...
Roll back to the previous configuration. @throws GeomajasException indicates an unlikely problem with the rollback (see cause)
[ "Roll", "back", "to", "the", "previous", "configuration", "." ]
904b7d7deed1350d28955589098dd1e0a786d76e
https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/common-servlet/src/main/java/org/geomajas/spring/ReconfigurableClassPathApplicationContext.java#L69-L76
train
Rollback the configuration.
Of course, here is the Java code you requested: ```java public void rollback() throws GeomajasException { try { setConfigLocations(previousConfigLocations); refresh(); } catch (Exception e) { throw new GeomajasException(e, ExceptionCode.REFRESH_CONFIGURATION_FAILED); } } ``` Hope this helps!
overturetool/overture
core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java
SyntaxReader.report
protected void report(LocatedException error, VDMToken[] after, VDMToken[] upto) { VDMError vdmerror = new VDMError(error); errors.add(vdmerror); if (errors.size() >= MAX - 1) { errors.add(new VDMError(9, "Too many syntax errors", error.location)); throw new InternalException(9, "Too many syntax erro...
java
protected void report(LocatedException error, VDMToken[] after, VDMToken[] upto) { VDMError vdmerror = new VDMError(error); errors.add(vdmerror); if (errors.size() >= MAX - 1) { errors.add(new VDMError(9, "Too many syntax errors", error.location)); throw new InternalException(9, "Too many syntax erro...
[ "protected", "void", "report", "(", "LocatedException", "error", ",", "VDMToken", "[", "]", "after", ",", "VDMToken", "[", "]", "upto", ")", "{", "VDMError", "vdmerror", "=", "new", "VDMError", "(", "error", ")", ";", "errors", ".", "add", "(", "vdmerror...
Raise a syntax error and attempt to recover. The error is added to the errors list, and if this exceeds 100 errors the parser is aborted. The "after" and "upto" lists of token types are then used to control the advance of the parser to skip beyond the error. Tokens are read until one occurs in either list or EOF is rea...
[ "Raise", "a", "syntax", "error", "and", "attempt", "to", "recover", ".", "The", "error", "is", "added", "to", "the", "errors", "list", "and", "if", "this", "exceeds", "100", "errors", "the", "parser", "is", "aborted", ".", "The", "after", "and", "upto", ...
83175dc6c24fa171cde4fcf61ecb648eba3bdbc1
https://github.com/overturetool/overture/blob/83175dc6c24fa171cde4fcf61ecb648eba3bdbc1/core/parser/src/main/java/org/overture/parser/syntax/SyntaxReader.java#L543-L579
train
Reports an exception.
Of course, here is the Java code you requested: ```java protected void report(LocatedException error, VDMToken[] after, VDMToken[] upto) { VDMError vdmerror = new VDMError(error); errors.add(vdmerror); if (errors.size() >= MAX - 1) { errors.add(new VDMError(9, "Too many syntax errors", error.location))...
advantageous/qbit-extensions
qbit-ext/jms/src/main/java/io/advantageous/qbit/jms/JmsServiceBuilder.java
JmsServiceBuilder.getProviderURL
public String getProviderURL() { if (providerURL == null) { providerURL = getProviderURLPattern().replace("#host#", getHost()) .replace("#port#", Integer.toString(getPort())); } return providerURL; }
java
public String getProviderURL() { if (providerURL == null) { providerURL = getProviderURLPattern().replace("#host#", getHost()) .replace("#port#", Integer.toString(getPort())); } return providerURL; }
[ "public", "String", "getProviderURL", "(", ")", "{", "if", "(", "providerURL", "==", "null", ")", "{", "providerURL", "=", "getProviderURLPattern", "(", ")", ".", "replace", "(", "\"#host#\"", ",", "getHost", "(", ")", ")", ".", "replace", "(", "\"#port#\"...
If null, will build based on host, port and provider url pattern. @return providerURL @see JmsServiceBuilder#providerURL
[ "If", "null", "will", "build", "based", "on", "host", "port", "and", "provider", "url", "pattern", "." ]
bdd96a7171081480deadd6fc140edb45c3102e28
https://github.com/advantageous/qbit-extensions/blob/bdd96a7171081480deadd6fc140edb45c3102e28/qbit-ext/jms/src/main/java/io/advantageous/qbit/jms/JmsServiceBuilder.java#L293-L300
valid
Gets the provider URL.
Of course, here is the Java code you requested: ```java public String getProviderURL() { if (providerURL == null) { providerURL = getProviderURLPattern().replace("#host#", getHost()) .replace("#port#", Integer.toString(getPort())); } return providerURL; } ``...
netceteragroup/valdr-bean-validation
valdr-bean-validation/src/main/java/com/github/valdr/cli/ValdrBeanValidation.java
ValdrBeanValidation.main
public static void main(String[] args) { org.apache.commons.cli.Options cliOptions = createCliOptions(); try { CommandLine cli = parseCli(args, cliOptions); Options options = loadOptions(cli); validate(options); ConstraintParser parser = new ConstraintParser(options); try { ...
java
public static void main(String[] args) { org.apache.commons.cli.Options cliOptions = createCliOptions(); try { CommandLine cli = parseCli(args, cliOptions); Options options = loadOptions(cli); validate(options); ConstraintParser parser = new ConstraintParser(options); try { ...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "org", ".", "apache", ".", "commons", ".", "cli", ".", "Options", "cliOptions", "=", "createCliOptions", "(", ")", ";", "try", "{", "CommandLine", "cli", "=", "parseCli", "(...
See class comment. @param args cli arguments
[ "See", "class", "comment", "." ]
3f49f1357c575a11331be2de867cf47809a83823
https://github.com/netceteragroup/valdr-bean-validation/blob/3f49f1357c575a11331be2de867cf47809a83823/valdr-bean-validation/src/main/java/com/github/valdr/cli/ValdrBeanValidation.java#L43-L59
train
Main method for the CSI2 application.
Of course, here is the Java code you requested: ```java public static void main(String[] args) { org.apache.commons.cli.Options cliOptions = createCliOptions(); try { CommandLine cli = parseCli(args, cliOptions); Options options = loadOptions(cli); validate(options); ConstraintParser pa...
Azure/azure-sdk-for-java
applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java
AnalyticsItemsInner.listWithServiceResponseAsync
public Observable<ServiceResponse<List<ApplicationInsightsComponentAnalyticsItemInner>>> listWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ItemScope scope, ItemTypeParameter type, Boolean includeContent) { if (this.client.subscriptionId() == null) { ...
java
public Observable<ServiceResponse<List<ApplicationInsightsComponentAnalyticsItemInner>>> listWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ItemScope scope, ItemTypeParameter type, Boolean includeContent) { if (this.client.subscriptionId() == null) { ...
[ "public", "Observable", "<", "ServiceResponse", "<", "List", "<", "ApplicationInsightsComponentAnalyticsItemInner", ">", ">", ">", "listWithServiceResponseAsync", "(", "String", "resourceGroupName", ",", "String", "resourceName", ",", "ItemScopePath", "scopePath", ",", "I...
Gets a list of Analytics Items defined within an Application Insights component. @param resourceGroupName The name of the resource group. @param resourceName The name of the Application Insights component resource. @param scopePath Enum indicating if this item definition is owned by a specific user or is shared betwee...
[ "Gets", "a", "list", "of", "Analytics", "Items", "defined", "within", "an", "Application", "Insights", "component", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/AnalyticsItemsInner.java#L237-L265
train
List Application Insights Component Analytics items.
Of course, here is the Java code you requested: ```java public Observable<ServiceResponse<List<ApplicationInsightsComponentAnalyticsItemInner>>> listWithServiceResponseAsync(String resourceGroupName, String resourceName, ItemScopePath scopePath, ItemScope scope, ItemTypeParameter type, Boolean includeContent) { ...