repo
stringclasses
199 values
path
stringlengths
28
169
func_name
stringlengths
6
98
original_string
stringlengths
91
27.2k
language
stringclasses
1 value
code
stringlengths
91
27.2k
code_tokens
listlengths
21
5.01k
docstring
stringlengths
1
6.47k
docstring_tokens
listlengths
1
587
sha
stringclasses
199 values
url
stringlengths
117
257
partition
stringclasses
1 value
summary
stringlengths
3
207
output
stringlengths
170
27.3k
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas2.java
JCublas2.cublasDotEx
public static int cublasDotEx( cublasHandle handle, int n, Pointer x, int xType, int incx, Pointer y, int yType, int incy, Pointer result, int resultType, int executionType) { return checkResult(cu...
java
public static int cublasDotEx( cublasHandle handle, int n, Pointer x, int xType, int incx, Pointer y, int yType, int incy, Pointer result, int resultType, int executionType) { return checkResult(cu...
[ "public", "static", "int", "cublasDotEx", "(", "cublasHandle", "handle", ",", "int", "n", ",", "Pointer", "x", ",", "int", "xType", ",", "int", "incx", ",", "Pointer", "y", ",", "int", "yType", ",", "int", "incy", ",", "Pointer", "result", ",", "int", ...
host or device pointer
[ "host", "or", "device", "pointer" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas2.java#L734-L748
test
Cublas Dot Ex.
Of course, here is the Java code you requested: ```java public static int cublasDotEx( cublasHandle handle, int n, Pointer x, int xType, int incx, Pointer y, int yType, int incy, Pointer result, int resultType, ...
wildfly/wildfly
ejb3/src/main/java/org/jboss/as/ejb3/component/EJBComponentDescription.java
EJBComponentDescription.addTransactionManagerDependencies
protected void addTransactionManagerDependencies() { this.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration componentConfiguration) throws Deploym...
java
protected void addTransactionManagerDependencies() { this.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration componentConfiguration) throws Deploym...
[ "protected", "void", "addTransactionManagerDependencies", "(", ")", "{", "this", ".", "getConfigurators", "(", ")", ".", "add", "(", "new", "ComponentConfigurator", "(", ")", "{", "@", "Override", "public", "void", "configure", "(", "final", "DeploymentPhaseContex...
Sets up a {@link ComponentConfigurator} which then sets up the relevant dependencies on the transaction manager services for the {@link EJBComponentCreateService}
[ "Sets", "up", "a", "{" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/component/EJBComponentDescription.java#L561-L578
test
Add transaction manager dependencies
Of course, here is the Java code you requested: ```java protected void addTransactionManagerDependencies() { this.getConfigurators().add(new ComponentConfigurator() { @Override public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final Comp...
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/Immoxml.java
Immoxml.getAnbieter
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<Anbieter> getAnbieter() { if (anbieter == null) { anbieter = new ArrayList<Anbieter>(); } return this.anbieter; }
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<Anbieter> getAnbieter() { if (anbieter == null) { anbieter = new ArrayList<Anbieter>(); } return this.anbieter; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:50:55+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "List", "<", "Anbieter", ">", "getAnbieter", "(", ")", "{", "if", "(", "anbieter", ...
Gets the value of the anbieter property. <p> This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for the anbieter property. <p> For example, to add...
[ "Gets", "the", "value", "of", "the", "anbieter", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/Immoxml.java#L105-L111
test
Gets the value of the anbieter property.
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<Anbieter> getAnbieter() { if (anbieter == null) { anbieter = new ArrayList<Anbieter>(); } return t...
Unidata/thredds
opendap/src/main/java/opendap/dap/DDS.java
DDS.getDDXText
public String getDDXText() { StringWriter sw = new StringWriter(); this.printXML(new PrintWriter(sw)); return sw.toString(); }
java
public String getDDXText() { StringWriter sw = new StringWriter(); this.printXML(new PrintWriter(sw)); return sw.toString(); }
[ "public", "String", "getDDXText", "(", ")", "{", "StringWriter", "sw", "=", "new", "StringWriter", "(", ")", ";", "this", ".", "printXML", "(", "new", "PrintWriter", "(", "sw", ")", ")", ";", "return", "sw", ".", "toString", "(", ")", ";", "}" ]
This a wrapper method for <code>DDS.printXML()</code>. @return The output of <code>DDS.printXML()</code> as <code>String</code> @opendap.ddx.experimental @see #printXML(PrintWriter)
[ "This", "a", "wrapper", "method", "for", "<code", ">", "DDS", ".", "printXML", "()", "<", "/", "code", ">", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DDS.java#L2209-L2214
test
Get the DDX text for this xsd file.
Of course, here is the Java code you requested: ```java public String getDDXText() { StringWriter sw = new StringWriter(); this.printXML(new PrintWriter(sw)); return sw.toString(); } ``` Hope this helps!
wildfly/wildfly
picketlink/src/main/java/org/wildfly/extension/picketlink/idm/service/JPAIdentityStoreService.java
JPAIdentityStoreService.getOrCreateTransactionalEntityManager
private EntityManager getOrCreateTransactionalEntityManager(TransactionManager transactionManager) { try { if (transactionManager.getStatus() == Status.STATUS_ACTIVE) { EntityManager entityManager = this.transactionalEntityManagerHelper.getTransactionScopedEntityManager(getPersistenc...
java
private EntityManager getOrCreateTransactionalEntityManager(TransactionManager transactionManager) { try { if (transactionManager.getStatus() == Status.STATUS_ACTIVE) { EntityManager entityManager = this.transactionalEntityManagerHelper.getTransactionScopedEntityManager(getPersistenc...
[ "private", "EntityManager", "getOrCreateTransactionalEntityManager", "(", "TransactionManager", "transactionManager", ")", "{", "try", "{", "if", "(", "transactionManager", ".", "getStatus", "(", ")", "==", "Status", ".", "STATUS_ACTIVE", ")", "{", "EntityManager", "e...
<p>Returns an {@link javax.persistence.EntityManager} associated with the actual {@link javax.transaction.Transaction}, if present.</p> <p>If {@link javax.transaction.Transaction} is {@link Status#STATUS_ACTIVE}, this method tries to return an entity manager already associated with it. If there is no entity manager a ...
[ "<p", ">", "Returns", "an", "{", "@link", "javax", ".", "persistence", ".", "EntityManager", "}", "associated", "with", "the", "actual", "{", "@link", "javax", ".", "transaction", ".", "Transaction", "}", "if", "present", ".", "<", "/", "p", ">" ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/picketlink/src/main/java/org/wildfly/extension/picketlink/idm/service/JPAIdentityStoreService.java#L233-L250
test
Gets or creates a transactional entity manager.
Of course, here is the Java code you requested: ```java private EntityManager getOrCreateTransactionalEntityManager(TransactionManager transactionManager) { try { if (transactionManager.getStatus() == Status.STATUS_ACTIVE) { EntityManager entityManager = this.transactionalEntityMana...
spring-projects/spring-security
core/src/main/java/org/springframework/security/authentication/jaas/AbstractJaasAuthenticationProvider.java
AbstractJaasAuthenticationProvider.publishFailureEvent
protected void publishFailureEvent(UsernamePasswordAuthenticationToken token, AuthenticationException ase) { if (this.applicationEventPublisher != null) { this.applicationEventPublisher .publishEvent(new JaasAuthenticationFailedEvent(token, ase)); } }
java
protected void publishFailureEvent(UsernamePasswordAuthenticationToken token, AuthenticationException ase) { if (this.applicationEventPublisher != null) { this.applicationEventPublisher .publishEvent(new JaasAuthenticationFailedEvent(token, ase)); } }
[ "protected", "void", "publishFailureEvent", "(", "UsernamePasswordAuthenticationToken", "token", ",", "AuthenticationException", "ase", ")", "{", "if", "(", "this", ".", "applicationEventPublisher", "!=", "null", ")", "{", "this", ".", "applicationEventPublisher", ".", ...
Publishes the {@link JaasAuthenticationFailedEvent}. Can be overridden by subclasses for different functionality @param token The authentication token being processed @param ase The excetion that caused the authentication failure
[ "Publishes", "the", "{", "@link", "JaasAuthenticationFailedEvent", "}", ".", "Can", "be", "overridden", "by", "subclasses", "for", "different", "functionality" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/authentication/jaas/AbstractJaasAuthenticationProvider.java#L292-L298
test
Publish an authentication failure event.
Of course, here is the Java code you requested: ```java protected void publishFailureEvent(UsernamePasswordAuthenticationToken token, AuthenticationException ase) { if (this.applicationEventPublisher != null) { this.applicationEventPublisher .publishEvent(new JaasAuthenticationFailedEvent(token, ase)); ...
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/AutomagicMadvocConfigurator.java
AutomagicMadvocConfigurator.acceptMadvocComponentClass
protected void acceptMadvocComponentClass(final Class componentClass) { if (componentClass == null) { return; } if (!checkClass(componentClass)) { return; } madvocComponents.add(() -> madvocContainer.registerComponent(componentClass)); }
java
protected void acceptMadvocComponentClass(final Class componentClass) { if (componentClass == null) { return; } if (!checkClass(componentClass)) { return; } madvocComponents.add(() -> madvocContainer.registerComponent(componentClass)); }
[ "protected", "void", "acceptMadvocComponentClass", "(", "final", "Class", "componentClass", ")", "{", "if", "(", "componentClass", "==", "null", ")", "{", "return", ";", "}", "if", "(", "!", "checkClass", "(", "componentClass", ")", ")", "{", "return", ";", ...
Registers new Madvoc component.
[ "Registers", "new", "Madvoc", "component", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/AutomagicMadvocConfigurator.java#L235-L245
test
Accept a component class.
Of course, here is the Java code you requested: ```java protected void acceptMadvocComponentClass(final Class componentClass) { if (componentClass == null) { return; } if (!checkClass(componentClass)) { return; } madvocComponents.add(() -> madvocContainer.registerComponent(componentClass)); } ``` H...
oblac/jodd
jodd-core/src/main/java/jodd/util/CollectionUtil.java
CollectionUtil.asEnumeration
public static <E> Enumeration<E> asEnumeration(final Iterator<E> iter) { return new Enumeration<E>() { @Override public boolean hasMoreElements() { return iter.hasNext(); } @Override public E nextElement() { return iter.next(); } }; }
java
public static <E> Enumeration<E> asEnumeration(final Iterator<E> iter) { return new Enumeration<E>() { @Override public boolean hasMoreElements() { return iter.hasNext(); } @Override public E nextElement() { return iter.next(); } }; }
[ "public", "static", "<", "E", ">", "Enumeration", "<", "E", ">", "asEnumeration", "(", "final", "Iterator", "<", "E", ">", "iter", ")", "{", "return", "new", "Enumeration", "<", "E", ">", "(", ")", "{", "@", "Override", "public", "boolean", "hasMoreEle...
Adapt the specified <code>Iterator</code> to the <code>Enumeration</code> interface.
[ "Adapt", "the", "specified", "<code", ">", "Iterator<", "/", "code", ">", "to", "the", "<code", ">", "Enumeration<", "/", "code", ">", "interface", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/CollectionUtil.java#L46-L58
test
As enumeration.
Of course, here is the Java code you requested: ```java public static <E> Enumeration<E> asEnumeration(final Iterator<E> iter) { return new Enumeration<E>() { @Override public boolean hasMoreElements() { return iter.hasNext(); } @Override public E nextElement() { return iter.next(); } };...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/provider/BasicWorkspaceManager.java
BasicWorkspaceManager.destroyAllWorkspacesForCurrentThread
@Override public void destroyAllWorkspacesForCurrentThread() { ensureThreadExistense(); List<MemoryWorkspace> workspaces = new ArrayList<>(); workspaces.addAll(backingMap.get().values()); for (MemoryWorkspace workspace : workspaces) { destroyWorkspace(workspace); ...
java
@Override public void destroyAllWorkspacesForCurrentThread() { ensureThreadExistense(); List<MemoryWorkspace> workspaces = new ArrayList<>(); workspaces.addAll(backingMap.get().values()); for (MemoryWorkspace workspace : workspaces) { destroyWorkspace(workspace); ...
[ "@", "Override", "public", "void", "destroyAllWorkspacesForCurrentThread", "(", ")", "{", "ensureThreadExistense", "(", ")", ";", "List", "<", "MemoryWorkspace", ">", "workspaces", "=", "new", "ArrayList", "<>", "(", ")", ";", "workspaces", ".", "addAll", "(", ...
This method destroys all workspaces allocated in current thread
[ "This", "method", "destroys", "all", "workspaces", "allocated", "in", "current", "thread" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/provider/BasicWorkspaceManager.java#L148-L160
test
Destroy all workspaces for the current thread.
Of course, here is the Java code you requested: ```java @Override public void destroyAllWorkspacesForCurrentThread() { ensureThreadExistense(); List<MemoryWorkspace> workspaces = new ArrayList<>(); workspaces.addAll(backingMap.get().values()); for (MemoryWorkspace workspace : work...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/frameworks/music/resources/PlaybackStateResource.java
PlaybackStateResource.getPlaybackStateFromResource
public static Optional<PlaybackState> getPlaybackStateFromResource(ResourceModel x) { if (!x.getResourceID().equals(ID)) return Optional.empty(); Object resource = x.getResource(); if (resource instanceof String) { String state = (String) resource; try { ...
java
public static Optional<PlaybackState> getPlaybackStateFromResource(ResourceModel x) { if (!x.getResourceID().equals(ID)) return Optional.empty(); Object resource = x.getResource(); if (resource instanceof String) { String state = (String) resource; try { ...
[ "public", "static", "Optional", "<", "PlaybackState", ">", "getPlaybackStateFromResource", "(", "ResourceModel", "x", ")", "{", "if", "(", "!", "x", ".", "getResourceID", "(", ")", ".", "equals", "(", "ID", ")", ")", "return", "Optional", ".", "empty", "("...
returns the PlaybackState from the resource @param x the resourceModel @return the optional Playbackstate (empty if illegal resource)
[ "returns", "the", "PlaybackState", "from", "the", "resource" ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/resources/PlaybackStateResource.java#L68-L82
test
Gets the playback state from the resource model.
Of course, here is the Java code you requested: ```java public static Optional<PlaybackState> getPlaybackStateFromResource(ResourceModel x) { if (!x.getResourceID().equals(ID)) return Optional.empty(); Object resource = x.getResource(); if (resource instanceof String) { ...
streamsets/datacollector
cluster-common/src/main/java/com/streamsets/pipeline/cluster/Producer.java
Producer.put
public Object put(OffsetAndResult<Map.Entry> batch) { if (consumerError != null) { throw new RuntimeException(Utils.format("Consumer encountered error: {}", consumerError), consumerError); } if (producerError != null) { throw new RuntimeException(Utils.format("Producer encountered error: {}", pr...
java
public Object put(OffsetAndResult<Map.Entry> batch) { if (consumerError != null) { throw new RuntimeException(Utils.format("Consumer encountered error: {}", consumerError), consumerError); } if (producerError != null) { throw new RuntimeException(Utils.format("Producer encountered error: {}", pr...
[ "public", "Object", "put", "(", "OffsetAndResult", "<", "Map", ".", "Entry", ">", "batch", ")", "{", "if", "(", "consumerError", "!=", "null", ")", "{", "throw", "new", "RuntimeException", "(", "Utils", ".", "format", "(", "\"Consumer encountered error: {}\"",...
Queues the batch for the consumer and waits until the consumer successfully commits the batch. While waiting processes any control messages from the consumer. Throws an exception when the consumer has indicated it encountered an error.
[ "Queues", "the", "batch", "for", "the", "consumer", "and", "waits", "until", "the", "consumer", "successfully", "commits", "the", "batch", ".", "While", "waiting", "processes", "any", "control", "messages", "from", "the", "consumer", ".", "Throws", "an", "exce...
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/cluster-common/src/main/java/com/streamsets/pipeline/cluster/Producer.java#L55-L93
test
Put a batch of entries into the cache.
Of course, here is the Java code you requested: ```java public Object put(OffsetAndResult<Map.Entry> batch) { if (consumerError != null) { throw new RuntimeException(Utils.format("Consumer encountered error: {}", consumerError), consumerError); } if (producerError != null) { throw new RuntimeEx...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/TypeUtils.java
TypeUtils.isAssignableFrom
public static boolean isAssignableFrom(Class<?> to, Class<?> from) { Class<?> notPrimitiveTo = to.isPrimitive() ? PRIMITIVE_TO_WRAPPER.get(to) : to; Class<?> notPrimitiveFrom = from.isPrimitive() ? PRIMITIVE_TO_WRAPPER.get(from) : from; return notPrimitiveTo.isAssignableFrom(notPrimitiveFrom); }
java
public static boolean isAssignableFrom(Class<?> to, Class<?> from) { Class<?> notPrimitiveTo = to.isPrimitive() ? PRIMITIVE_TO_WRAPPER.get(to) : to; Class<?> notPrimitiveFrom = from.isPrimitive() ? PRIMITIVE_TO_WRAPPER.get(from) : from; return notPrimitiveTo.isAssignableFrom(notPrimitiveFrom); }
[ "public", "static", "boolean", "isAssignableFrom", "(", "Class", "<", "?", ">", "to", ",", "Class", "<", "?", ">", "from", ")", "{", "Class", "<", "?", ">", "notPrimitiveTo", "=", "to", ".", "isPrimitive", "(", ")", "?", "PRIMITIVE_TO_WRAPPER", ".", "g...
Just like Class.isAssignableFrom(), but does the right thing when considering autoboxing.
[ "Just", "like", "Class", ".", "isAssignableFrom", "()", "but", "does", "the", "right", "thing", "when", "considering", "autoboxing", "." ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/TypeUtils.java#L99-L104
test
Checks if two classes are assignable.
Of course, here is the Java code you requested: ```java public static boolean isAssignableFrom(Class<?> to, Class<?> from) { Class<?> notPrimitiveTo = to.isPrimitive() ? PRIMITIVE_TO_WRAPPER.get(to) : to; Class<?> notPrimitiveFrom = from.isPrimitive() ? PRIMITIVE_TO_WRAPPER.get(from) : from; return notPrimitive...
Netflix/hollow
hollow/src/main/java/com/netflix/hollow/core/read/engine/HollowBlobHeaderReader.java
HollowBlobHeaderReader.readHeaderTags
private Map<String, String> readHeaderTags(DataInputStream dis) throws IOException { int numHeaderTags = dis.readShort(); Map<String, String> headerTags = new HashMap<String, String>(); for (int i = 0; i < numHeaderTags; i++) { headerTags.put(dis.readUTF(), dis.readUTF()); } ...
java
private Map<String, String> readHeaderTags(DataInputStream dis) throws IOException { int numHeaderTags = dis.readShort(); Map<String, String> headerTags = new HashMap<String, String>(); for (int i = 0; i < numHeaderTags; i++) { headerTags.put(dis.readUTF(), dis.readUTF()); } ...
[ "private", "Map", "<", "String", ",", "String", ">", "readHeaderTags", "(", "DataInputStream", "dis", ")", "throws", "IOException", "{", "int", "numHeaderTags", "=", "dis", ".", "readShort", "(", ")", ";", "Map", "<", "String", ",", "String", ">", "headerT...
Map of string header tags reading. @param dis @throws IOException
[ "Map", "of", "string", "header", "tags", "reading", "." ]
43ca100034a01050fb764170bd32b085ac9a3c22
https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/read/engine/HollowBlobHeaderReader.java#L85-L92
test
read the header tags from the input stream
Of course, here is the Java code you requested: ```java private Map<String, String> readHeaderTags(DataInputStream dis) throws IOException { int numHeaderTags = dis.readShort(); Map<String, String> headerTags = new HashMap<String, String>(); for (int i = 0; i < numHeaderTags; i++) { ...
spring-projects/spring-security
oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtGrantedAuthoritiesConverter.java
JwtGrantedAuthoritiesConverter.convert
@Override public Collection<GrantedAuthority> convert(Jwt jwt) { return getScopes(jwt) .stream() .map(authority -> SCOPE_AUTHORITY_PREFIX + authority) .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); }
java
@Override public Collection<GrantedAuthority> convert(Jwt jwt) { return getScopes(jwt) .stream() .map(authority -> SCOPE_AUTHORITY_PREFIX + authority) .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); }
[ "@", "Override", "public", "Collection", "<", "GrantedAuthority", ">", "convert", "(", "Jwt", "jwt", ")", "{", "return", "getScopes", "(", "jwt", ")", ".", "stream", "(", ")", ".", "map", "(", "authority", "->", "SCOPE_AUTHORITY_PREFIX", "+", "authority", ...
Extracts the authorities @param jwt The {@link Jwt} token @return The {@link GrantedAuthority authorities} read from the token scopes
[ "Extracts", "the", "authorities" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtGrantedAuthoritiesConverter.java#L48-L55
test
Convert the JWT to a collection of GrantedAuthorities.
Of course, here is the Java code you requested: ```java @Override public Collection<GrantedAuthority> convert(Jwt jwt) { return getScopes(jwt) .stream() .map(authority -> SCOPE_AUTHORITY_PREFIX + authority) .map(SimpleGrantedAuthority::new) .collect(Collectors.toList()); } ``` Hope this helps!
oaqa/baseqa
src/main/java/edu/cmu/lti/oaqa/type/kb/Concept.java
Concept.setMentions
public void setMentions(FSList v) { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_mentions == null) jcasType.jcas.throwFeatMissing("mentions", "edu.cmu.lti.oaqa.type.kb.Concept"); jcasType.ll_cas.ll_setRefValue(addr, ((Concept_Type)jcasType).casFeatCode_mentions, jcasType.ll_cas.ll_getFSR...
java
public void setMentions(FSList v) { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_mentions == null) jcasType.jcas.throwFeatMissing("mentions", "edu.cmu.lti.oaqa.type.kb.Concept"); jcasType.ll_cas.ll_setRefValue(addr, ((Concept_Type)jcasType).casFeatCode_mentions, jcasType.ll_cas.ll_getFSR...
[ "public", "void", "setMentions", "(", "FSList", "v", ")", "{", "if", "(", "Concept_Type", ".", "featOkTst", "&&", "(", "(", "Concept_Type", ")", "jcasType", ")", ".", "casFeat_mentions", "==", "null", ")", "jcasType", ".", "jcas", ".", "throwFeatMissing", ...
setter for mentions - sets A list of ConceptMentions (text spans) that might be surface forms to this concept. @generated @param v value to set into the feature
[ "setter", "for", "mentions", "-", "sets", "A", "list", "of", "ConceptMentions", "(", "text", "spans", ")", "that", "might", "be", "surface", "forms", "to", "this", "concept", "." ]
6ea632d8e51e3e617d4876fc1185c49be0ad7eb8
https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/kb/Concept.java#L151-L154
test
setter for mentions - sets
Of course, here is the Java code you requested: ```java public void setMentions(FSList v) { if (Concept_Type.featOkTst && ((Concept_Type)jcasType).casFeat_mentions == null) jcasType.jcas.throwFeatMissing("mentions", "edu.cmu.lti.oaqa.type.kb.Concept"); jcasType.ll_cas.ll_setRefValue(addr, ((Concept_Type)...
RestComm/jain-slee
container/common/src/main/java/org/mobicents/slee/container/management/jmx/TraceMBeanImpl.java
TraceMBeanImpl.getTracersUsed
public String[] getTracersUsed(NotificationSource src) throws NullPointerException, UnrecognizedNotificationSourceException, ManagementException { if(src == null) { throw new NullPointerException("NotificationSource must nto be null!"); } if(!this.isNotificationSourceDefined(src)) { throw new Unr...
java
public String[] getTracersUsed(NotificationSource src) throws NullPointerException, UnrecognizedNotificationSourceException, ManagementException { if(src == null) { throw new NullPointerException("NotificationSource must nto be null!"); } if(!this.isNotificationSourceDefined(src)) { throw new Unr...
[ "public", "String", "[", "]", "getTracersUsed", "(", "NotificationSource", "src", ")", "throws", "NullPointerException", ",", "UnrecognizedNotificationSourceException", ",", "ManagementException", "{", "if", "(", "src", "==", "null", ")", "{", "throw", "new", "NullP...
/* (non-Javadoc) @see javax.slee.management.TraceMBean#getTracersUsed(javax.slee.management.NotificationSource)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/container/management/jmx/TraceMBeanImpl.java#L224-L238
test
Returns the names of all the tracers that are used by the given notification source.
Of course, here is the Java code you requested: ```java public String[] getTracersUsed(NotificationSource src) throws NullPointerException, UnrecognizedNotificationSourceException, ManagementException { if(src == null) { throw new NullPointerException("NotificationSource must nto be null!"); } if(!this...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java
SwitchUserFilter.setSwitchUserUrl
public void setSwitchUserUrl(String switchUserUrl) { Assert.isTrue(UrlUtils.isValidRedirectUrl(switchUserUrl), "switchUserUrl cannot be empty and must be a valid redirect URL"); this.switchUserMatcher = createMatcher(switchUserUrl); }
java
public void setSwitchUserUrl(String switchUserUrl) { Assert.isTrue(UrlUtils.isValidRedirectUrl(switchUserUrl), "switchUserUrl cannot be empty and must be a valid redirect URL"); this.switchUserMatcher = createMatcher(switchUserUrl); }
[ "public", "void", "setSwitchUserUrl", "(", "String", "switchUserUrl", ")", "{", "Assert", ".", "isTrue", "(", "UrlUtils", ".", "isValidRedirectUrl", "(", "switchUserUrl", ")", ",", "\"switchUserUrl cannot be empty and must be a valid redirect URL\"", ")", ";", "this", "...
Set the URL to respond to switch user processing. This is a shortcut for {@link #setSwitchUserMatcher(RequestMatcher)} @param switchUserUrl The switch user URL.
[ "Set", "the", "URL", "to", "respond", "to", "switch", "user", "processing", ".", "This", "is", "a", "shortcut", "for", "{", "@link", "#setSwitchUserMatcher", "(", "RequestMatcher", ")", "}" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java#L467-L471
test
Sets the switch user URL.
Of course, here is the Java code you requested: ```java public void setSwitchUserUrl(String switchUserUrl) { Assert.isTrue(UrlUtils.isValidRedirectUrl(switchUserUrl), "switchUserUrl cannot be empty and must be a valid redirect URL"); this.switchUserMatcher = createMatcher(switchUserUrl); } ``` Hope this help...
apache/parquet-mr
parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoWriteSupport.java
ProtoWriteSupport.serializeDescriptor
private String serializeDescriptor(Class<? extends Message> protoClass) { Descriptor descriptor = Protobufs.getMessageDescriptor(protoClass); DescriptorProtos.DescriptorProto asProto = descriptor.toProto(); return TextFormat.printToString(asProto); }
java
private String serializeDescriptor(Class<? extends Message> protoClass) { Descriptor descriptor = Protobufs.getMessageDescriptor(protoClass); DescriptorProtos.DescriptorProto asProto = descriptor.toProto(); return TextFormat.printToString(asProto); }
[ "private", "String", "serializeDescriptor", "(", "Class", "<", "?", "extends", "Message", ">", "protoClass", ")", "{", "Descriptor", "descriptor", "=", "Protobufs", ".", "getMessageDescriptor", "(", "protoClass", ")", ";", "DescriptorProtos", ".", "DescriptorProto",...
Returns message descriptor as JSON String
[ "Returns", "message", "descriptor", "as", "JSON", "String" ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoWriteSupport.java#L483-L487
test
Serialize a descriptor to a string
Of course, here is the Java code you requested: ```java private String serializeDescriptor(Class<? extends Message> protoClass) { Descriptor descriptor = Protobufs.getMessageDescriptor(protoClass); DescriptorProtos.DescriptorProto asProto = descriptor.toProto(); return TextFormat.printToString(asProto); ...
Unidata/thredds
cdm/src/main/java/ucar/nc2/units/DateRange.java
DateRange.intersect
public DateRange intersect(DateRange clip) { if (isEmpty) return this; if (clip.isEmpty) return clip; DateType ss = getStart(); DateType s = ss.before(clip.getStart()) ? clip.getStart() : ss; DateType ee = getEnd(); DateType e = ee.before(clip.getEnd()) ? ee : clip.getEnd(); return new Da...
java
public DateRange intersect(DateRange clip) { if (isEmpty) return this; if (clip.isEmpty) return clip; DateType ss = getStart(); DateType s = ss.before(clip.getStart()) ? clip.getStart() : ss; DateType ee = getEnd(); DateType e = ee.before(clip.getEnd()) ? ee : clip.getEnd(); return new Da...
[ "public", "DateRange", "intersect", "(", "DateRange", "clip", ")", "{", "if", "(", "isEmpty", ")", "return", "this", ";", "if", "(", "clip", ".", "isEmpty", ")", "return", "clip", ";", "DateType", "ss", "=", "getStart", "(", ")", ";", "DateType", "s", ...
Intersect with another date range @param clip intersect with this date range @return new date range that is the intersection
[ "Intersect", "with", "another", "date", "range" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/units/DateRange.java#L209-L220
test
Intersects this date range with another.
Of course, here is the Java code you requested: ```java public DateRange intersect(DateRange clip) { if (isEmpty) return this; if (clip.isEmpty) return clip; DateType ss = getStart(); DateType s = ss.before(clip.getStart()) ? clip.getStart() : ss; DateType ee = getEnd(); DateType e = ee.befor...
oblac/jodd
jodd-servlet/src/main/java/jodd/servlet/SessionMonitor.java
SessionMonitor.sessionDestroyed
@Override public void sessionDestroyed(final HttpSessionEvent httpSessionEvent) { HttpSession session = httpSessionEvent.getSession(); sessionMap.remove(session.getId()); for (HttpSessionListener listener : listeners) { listener.sessionDestroyed(httpSessionEvent); } }
java
@Override public void sessionDestroyed(final HttpSessionEvent httpSessionEvent) { HttpSession session = httpSessionEvent.getSession(); sessionMap.remove(session.getId()); for (HttpSessionListener listener : listeners) { listener.sessionDestroyed(httpSessionEvent); } }
[ "@", "Override", "public", "void", "sessionDestroyed", "(", "final", "HttpSessionEvent", "httpSessionEvent", ")", "{", "HttpSession", "session", "=", "httpSessionEvent", ".", "getSession", "(", ")", ";", "sessionMap", ".", "remove", "(", "session", ".", "getId", ...
Removes session from a map and broadcasts event to registered listeners.
[ "Removes", "session", "from", "a", "map", "and", "broadcasts", "event", "to", "registered", "listeners", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/SessionMonitor.java#L100-L108
test
Called by the event handler to notify all listeners that the session has been destroyed.
Of course, here is the Java code you requested: ```java @Override public void sessionDestroyed(final HttpSessionEvent httpSessionEvent) { HttpSession session = httpSessionEvent.getSession(); sessionMap.remove(session.getId()); for (HttpSessionListener listener : listeners) { listener.sessionDestroyed(httpSe...
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/ComboValue.java
ComboValue.isClosest
private static boolean isClosest(long ts, long[] timeStamps, int curIdx) { if (curIdx >= (timeStamps.length - 1)) { // curIdx is the last one so it must be the closest return true; } if (ts == timeStamps[curIdx]) { return true; } return closer(ts, timeStamps...
java
private static boolean isClosest(long ts, long[] timeStamps, int curIdx) { if (curIdx >= (timeStamps.length - 1)) { // curIdx is the last one so it must be the closest return true; } if (ts == timeStamps[curIdx]) { return true; } return closer(ts, timeStamps...
[ "private", "static", "boolean", "isClosest", "(", "long", "ts", ",", "long", "[", "]", "timeStamps", ",", "int", "curIdx", ")", "{", "if", "(", "curIdx", ">=", "(", "timeStamps", ".", "length", "-", "1", ")", ")", "{", "// curIdx is the last one so it must...
Returns true if the timeStamp at curIdx is the one that ts is the closest to. We know that timeStamps[curIdx-1], if it exists, was not the closest.
[ "Returns", "true", "if", "the", "timeStamp", "at", "curIdx", "is", "the", "one", "that", "ts", "is", "the", "closest", "to", ".", "We", "know", "that", "timeStamps", "[", "curIdx", "-", "1", "]", "if", "it", "exists", "was", "not", "the", "closest", ...
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/stats/ComboValue.java#L327-L336
test
Checks if the timestamp is the closest to the timestamp in the array.
Of course, here is the Java code you requested: ```java private static boolean isClosest(long ts, long[] timeStamps, int curIdx) { if (curIdx >= (timeStamps.length - 1)) { // curIdx is the last one so it must be the closest return true; } if (ts == timeStamps[curIdx]) { ...
alipay/sofa-bolt
src/main/java/com/alipay/remoting/BaseRemoting.java
BaseRemoting.oneway
protected void oneway(final Connection conn, final RemotingCommand request) { try { conn.getChannel().writeAndFlush(request).addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture f) throws Exception { if (...
java
protected void oneway(final Connection conn, final RemotingCommand request) { try { conn.getChannel().writeAndFlush(request).addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture f) throws Exception { if (...
[ "protected", "void", "oneway", "(", "final", "Connection", "conn", ",", "final", "RemotingCommand", "request", ")", "{", "try", "{", "conn", ".", "getChannel", "(", ")", ".", "writeAndFlush", "(", "request", ")", ".", "addListener", "(", "new", "ChannelFutur...
Oneway invocation. @param conn @param request @throws InterruptedException
[ "Oneway", "invocation", "." ]
0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046
https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/BaseRemoting.java#L217-L238
test
Oneway method. Sends the remoting command to the remote server.
Of course, here is the Java code you requested: ```java protected void oneway(final Connection conn, final RemotingCommand request) { try { conn.getChannel().writeAndFlush(request).addListener(new ChannelFutureListener() { @Override public void operationComplete(Cha...
ibm-bluemix-mobile-services/bms-clientsdk-android-analytics
lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/logger/api/LogPersister.java
LogPersister.getLogLevel
static public Logger.LEVEL getLogLevel() { final Future<Logger.LEVEL> task = ThreadPoolWorkQueue.submit(new Callable<Logger.LEVEL>() { @Override public Logger.LEVEL call() { return getLevelSync(); } }); try { return task.get(); } ...
java
static public Logger.LEVEL getLogLevel() { final Future<Logger.LEVEL> task = ThreadPoolWorkQueue.submit(new Callable<Logger.LEVEL>() { @Override public Logger.LEVEL call() { return getLevelSync(); } }); try { return task.get(); } ...
[ "static", "public", "Logger", ".", "LEVEL", "getLogLevel", "(", ")", "{", "final", "Future", "<", "Logger", ".", "LEVEL", ">", "task", "=", "ThreadPoolWorkQueue", ".", "submit", "(", "new", "Callable", "<", "Logger", ".", "LEVEL", ">", "(", ")", "{", "...
Get the current Logger.LEVEL. @return Logger.LEVEL
[ "Get", "the", "current", "Logger", ".", "LEVEL", "." ]
40f1256e3c970fd008dd69c316493f609b89ec24
https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-analytics/blob/40f1256e3c970fd008dd69c316493f609b89ec24/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/logger/api/LogPersister.java#L372-L385
test
Get the level of the current logger.
Of course, here is the Java code you requested: ```java static public Logger.LEVEL getLogLevel() { final Future<Logger.LEVEL> task = ThreadPoolWorkQueue.submit(new Callable<Logger.LEVEL>() { @Override public Logger.LEVEL call() { return getLevelSync(); } }); ...
streamsets/datacollector
container/src/main/java/com/streamsets/datacollector/runner/PipeRunner.java
PipeRunner.executeBatch
public void executeBatch( String offsetKey, String offsetValue, long batchStartTime, ThrowingConsumer<Pipe> consumer ) throws PipelineRuntimeException, StageException { MDC.put(LogConstants.RUNNER, String.valueOf(runnerId)); // Persist static information for the batch (this won't chang...
java
public void executeBatch( String offsetKey, String offsetValue, long batchStartTime, ThrowingConsumer<Pipe> consumer ) throws PipelineRuntimeException, StageException { MDC.put(LogConstants.RUNNER, String.valueOf(runnerId)); // Persist static information for the batch (this won't chang...
[ "public", "void", "executeBatch", "(", "String", "offsetKey", ",", "String", "offsetValue", ",", "long", "batchStartTime", ",", "ThrowingConsumer", "<", "Pipe", ">", "consumer", ")", "throws", "PipelineRuntimeException", ",", "StageException", "{", "MDC", ".", "pu...
Run batch with given consumer for each pipe. This method will also set the logger appropriately and calculate the runner specific metrics.
[ "Run", "batch", "with", "given", "consumer", "for", "each", "pipe", "." ]
ea63245ea14d59d5229248387f0628f46131eae5
https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/container/src/main/java/com/streamsets/datacollector/runner/PipeRunner.java#L120-L153
test
Execute a batch of records.
Of course, here is the Java code you requested: ```java public void executeBatch( String offsetKey, String offsetValue, long batchStartTime, ThrowingConsumer<Pipe> consumer ) throws PipelineRuntimeException, StageException { MDC.put(LogConstants.RUNNER, String.valueOf(runnerId)); // P...
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunction.java
DifferentialFunction.hasPlaceHolderInputs
public boolean hasPlaceHolderInputs() { val args = args(); for(val arg : args) if(sameDiff.hasPlaceHolderVariables(arg().getVarName())) return true; return false; }
java
public boolean hasPlaceHolderInputs() { val args = args(); for(val arg : args) if(sameDiff.hasPlaceHolderVariables(arg().getVarName())) return true; return false; }
[ "public", "boolean", "hasPlaceHolderInputs", "(", ")", "{", "val", "args", "=", "args", "(", ")", ";", "for", "(", "val", "arg", ":", "args", ")", "if", "(", "sameDiff", ".", "hasPlaceHolderVariables", "(", "arg", "(", ")", ".", "getVarName", "(", ")",...
Returns true if this function has place holder inputs @return
[ "Returns", "true", "if", "this", "function", "has", "place", "holder", "inputs" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/functions/DifferentialFunction.java#L418-L424
test
Checks if the place holder inputs are present in the sameDiff.
Of course, here is the Java code you requested: ```java public boolean hasPlaceHolderInputs() { val args = args(); for(val arg : args) if(sameDiff.hasPlaceHolderVariables(arg().getVarName())) return true; return false; } ``` Hope this helps!
real-logic/aeron
aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java
ChannelUriStringBuilder.controlMode
public ChannelUriStringBuilder controlMode(final String controlMode) { if (null != controlMode && !controlMode.equals(CommonContext.MDC_CONTROL_MODE_MANUAL) && !controlMode.equals(CommonContext.MDC_CONTROL_MODE_DYNAMIC)) { throw new IllegalArgumentException("inval...
java
public ChannelUriStringBuilder controlMode(final String controlMode) { if (null != controlMode && !controlMode.equals(CommonContext.MDC_CONTROL_MODE_MANUAL) && !controlMode.equals(CommonContext.MDC_CONTROL_MODE_DYNAMIC)) { throw new IllegalArgumentException("inval...
[ "public", "ChannelUriStringBuilder", "controlMode", "(", "final", "String", "controlMode", ")", "{", "if", "(", "null", "!=", "controlMode", "&&", "!", "controlMode", ".", "equals", "(", "CommonContext", ".", "MDC_CONTROL_MODE_MANUAL", ")", "&&", "!", "controlMode...
Set the control mode for multi-destination-cast. Set to "manual" for allowing control from the publication API. @param controlMode for taking control of MDC. @return this for a fluent API. @see Publication#addDestination(String) @see Publication#removeDestination(String) @see CommonContext#MDC_CONTROL_MODE_PARAM_NAME ...
[ "Set", "the", "control", "mode", "for", "multi", "-", "destination", "-", "cast", ".", "Set", "to", "manual", "for", "allowing", "control", "from", "the", "publication", "API", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-client/src/main/java/io/aeron/ChannelUriStringBuilder.java#L281-L292
test
Sets the control mode.
Of course, here is the Java code you requested: ```java public ChannelUriStringBuilder controlMode(final String controlMode) { if (null != controlMode && !controlMode.equals(CommonContext.MDC_CONTROL_MODE_MANUAL) && !controlMode.equals(CommonContext.MDC_CONTROL_MODE_DYNAMIC)) ...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/CommandHandler.java
CommandHandler.handleVolume
private void handleVolume(EventModel eventModel, ResourceModel<String> resourceModel) { Optional<Volume> volumeResource = VolumeResource.getVolume(eventModel); if (!volumeResource.isPresent()) { musicHelper.playerError(PlayerError.ERROR_ILLEGAL + "command: " + resourceModel.getResource() + "...
java
private void handleVolume(EventModel eventModel, ResourceModel<String> resourceModel) { Optional<Volume> volumeResource = VolumeResource.getVolume(eventModel); if (!volumeResource.isPresent()) { musicHelper.playerError(PlayerError.ERROR_ILLEGAL + "command: " + resourceModel.getResource() + "...
[ "private", "void", "handleVolume", "(", "EventModel", "eventModel", ",", "ResourceModel", "<", "String", ">", "resourceModel", ")", "{", "Optional", "<", "Volume", ">", "volumeResource", "=", "VolumeResource", ".", "getVolume", "(", "eventModel", ")", ";", "if",...
handles the volume-command @param eventModel the event @param resourceModel the resourcemodel
[ "handles", "the", "volume", "-", "command" ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/CommandHandler.java#L191-L198
test
Handle volume.
Of course, here is the Java code you requested: ```java private void handleVolume(EventModel eventModel, ResourceModel<String> resourceModel) { Optional<Volume> volumeResource = VolumeResource.getVolume(eventModel); if (!volumeResource.isPresent()) { musicHelper.playerError(PlayerError.ERRO...
ReactiveX/RxJava
src/main/java/io/reactivex/internal/functions/Functions.java
Functions.identity
@SuppressWarnings("unchecked") public static <T> Function<T, T> identity() { return (Function<T, T>)IDENTITY; }
java
@SuppressWarnings("unchecked") public static <T> Function<T, T> identity() { return (Function<T, T>)IDENTITY; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Function", "<", "T", ",", "T", ">", "identity", "(", ")", "{", "return", "(", "Function", "<", "T", ",", "T", ">", ")", "IDENTITY", ";", "}" ]
Returns an identity function that simply returns its argument. @param <T> the input and output value type @return the identity function
[ "Returns", "an", "identity", "function", "that", "simply", "returns", "its", "argument", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/functions/Functions.java#L88-L91
test
A convenience method for creating an identity function.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public static <T> Function<T, T> identity() { return (Function<T, T>)IDENTITY; } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.certificate
public static AuthenticationScheme certificate(String trustStorePath, String trustStorePassword, String keyStorePath, String keyStorePassword, CertificateAuthSettings certificateAuthSettings) { AssertParameter....
java
public static AuthenticationScheme certificate(String trustStorePath, String trustStorePassword, String keyStorePath, String keyStorePassword, CertificateAuthSettings certificateAuthSettings) { AssertParameter....
[ "public", "static", "AuthenticationScheme", "certificate", "(", "String", "trustStorePath", ",", "String", "trustStorePassword", ",", "String", "keyStorePath", ",", "String", "keyStorePassword", ",", "CertificateAuthSettings", "certificateAuthSettings", ")", "{", "AssertPar...
Sets a certificate to be used for SSL authentication. See {@link Class#getResource(String)} for how to get a URL from a resource on the classpath. <p/> @param trustStorePath URL to a JKS trust store where the certificate is stored. @param trustStorePassword The password for the trust store @param keyStor...
[ "Sets", "a", "certificate", "to", "be", "used", "for", "SSL", "authentication", ".", "See", "{", "@link", "Class#getResource", "(", "String", ")", "}", "for", "how", "to", "get", "a", "URL", "from", "a", "resource", "on", "the", "classpath", ".", "<p", ...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L1294-L1315
test
Create a certificate authentication scheme.
Of course, here is the Java code you requested: ```java public static AuthenticationScheme certificate(String trustStorePath, String trustStorePassword, String keyStorePath, String keyStorePassword, CertificateAuthSet...
apache/parquet-mr
parquet-column/src/main/java/org/apache/parquet/column/statistics/Statistics.java
Statistics.getBuilderForReading
public static Builder getBuilderForReading(PrimitiveType type) { switch (type.getPrimitiveTypeName()) { case FLOAT: return new FloatBuilder(type); case DOUBLE: return new DoubleBuilder(type); default: return new Builder(type); } }
java
public static Builder getBuilderForReading(PrimitiveType type) { switch (type.getPrimitiveTypeName()) { case FLOAT: return new FloatBuilder(type); case DOUBLE: return new DoubleBuilder(type); default: return new Builder(type); } }
[ "public", "static", "Builder", "getBuilderForReading", "(", "PrimitiveType", "type", ")", "{", "switch", "(", "type", ".", "getPrimitiveTypeName", "(", ")", ")", "{", "case", "FLOAT", ":", "return", "new", "FloatBuilder", "(", "type", ")", ";", "case", "DOUB...
Returns a builder to create new statistics object. Used to read the statistics from the parquet file. @param type type of the column @return builder to create new statistics object
[ "Returns", "a", "builder", "to", "create", "new", "statistics", "object", ".", "Used", "to", "read", "the", "statistics", "from", "the", "parquet", "file", "." ]
62dcc68acaf64012bf731e103be780956f1f446d
https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-column/src/main/java/org/apache/parquet/column/statistics/Statistics.java#L223-L232
test
Get a builder for reading a single type.
Of course, here is the Java code you requested: ```java public static Builder getBuilderForReading(PrimitiveType type) { switch (type.getPrimitiveTypeName()) { case FLOAT: return new FloatBuilder(type); case DOUBLE: return new DoubleBuilder(type); default: return new Build...
spring-projects/spring-security
core/src/main/java/org/springframework/security/authentication/jaas/DefaultJaasAuthenticationProvider.java
DefaultJaasAuthenticationProvider.createLoginContext
@Override protected LoginContext createLoginContext(CallbackHandler handler) throws LoginException { return new LoginContext(getLoginContextName(), null, handler, getConfiguration()); }
java
@Override protected LoginContext createLoginContext(CallbackHandler handler) throws LoginException { return new LoginContext(getLoginContextName(), null, handler, getConfiguration()); }
[ "@", "Override", "protected", "LoginContext", "createLoginContext", "(", "CallbackHandler", "handler", ")", "throws", "LoginException", "{", "return", "new", "LoginContext", "(", "getLoginContextName", "(", ")", ",", "null", ",", "handler", ",", "getConfiguration", ...
Creates a LoginContext using the Configuration that was specified in {@link #setConfiguration(Configuration)}.
[ "Creates", "a", "LoginContext", "using", "the", "Configuration", "that", "was", "specified", "in", "{" ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/core/src/main/java/org/springframework/security/authentication/jaas/DefaultJaasAuthenticationProvider.java#L107-L111
test
Override this method to create a login context.
Of course, here is the Java code you requested: ```java @Override protected LoginContext createLoginContext(CallbackHandler handler) throws LoginException { return new LoginContext(getLoginContextName(), null, handler, getConfiguration()); } ``` Hope this helps!
Unidata/thredds
cdm/src/main/java/thredds/featurecollection/FeatureCollectionConfigBuilder.java
FeatureCollectionConfigBuilder.readConfigFromFile
public FeatureCollectionConfig readConfigFromFile(String filename) { org.jdom2.Document doc; try { SAXBuilder builder = new SAXBuilder(); doc = builder.build(filename); } catch (Exception e) { System.out.printf("Error parsing featureCollection %s err = %s", filename, e.getMessage()); ...
java
public FeatureCollectionConfig readConfigFromFile(String filename) { org.jdom2.Document doc; try { SAXBuilder builder = new SAXBuilder(); doc = builder.build(filename); } catch (Exception e) { System.out.printf("Error parsing featureCollection %s err = %s", filename, e.getMessage()); ...
[ "public", "FeatureCollectionConfig", "readConfigFromFile", "(", "String", "filename", ")", "{", "org", ".", "jdom2", ".", "Document", "doc", ";", "try", "{", "SAXBuilder", "builder", "=", "new", "SAXBuilder", "(", ")", ";", "doc", "=", "builder", ".", "build...
input is xml file with just the <featureCollection>
[ "input", "is", "xml", "file", "with", "just", "the", "<featureCollection", ">" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/featurecollection/FeatureCollectionConfigBuilder.java#L61-L73
test
Read a featureCollection configuration from a file.
Of course, here is the Java code you requested: ```java public FeatureCollectionConfig readConfigFromFile(String filename) { org.jdom2.Document doc; try { SAXBuilder builder = new SAXBuilder(); doc = builder.build(filename); } catch (Exception e) { System.out.printf("Error parsing featur...
Unidata/thredds
legacy/src/main/java/thredds/catalog/InvCatalogRef.java
InvCatalogRef.getDatasets
@Override public java.util.List<InvDataset> getDatasets() { read(); return useProxy ? proxy.getDatasets() : super.getDatasets(); }
java
@Override public java.util.List<InvDataset> getDatasets() { read(); return useProxy ? proxy.getDatasets() : super.getDatasets(); }
[ "@", "Override", "public", "java", ".", "util", ".", "List", "<", "InvDataset", ">", "getDatasets", "(", ")", "{", "read", "(", ")", ";", "return", "useProxy", "?", "proxy", ".", "getDatasets", "(", ")", ":", "super", ".", "getDatasets", "(", ")", ";...
Get a list of all the nested datasets. @return Datasets. This triggers a read of the referenced catalog the first time its called.
[ "Get", "a", "list", "of", "all", "the", "nested", "datasets", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/InvCatalogRef.java#L109-L113
test
Returns the list of data set in the CID .
Of course, here is the Java code you requested: ```java @Override public java.util.List<InvDataset> getDatasets() { read(); return useProxy ? proxy.getDatasets() : super.getDatasets(); } ``` Hope this helps!
snakerflow/snakerflow
snaker-core/src/main/java/org/snaker/engine/access/AbstractDBAccess.java
AbstractDBAccess.buildMap
private Map<String, Object> buildMap(Object entity, String su) { Map<String, Object> map = new HashMap<String, Object>(); map.put(KEY_ENTITY, entity); map.put(KEY_SU, su); return map; }
java
private Map<String, Object> buildMap(Object entity, String su) { Map<String, Object> map = new HashMap<String, Object>(); map.put(KEY_ENTITY, entity); map.put(KEY_SU, su); return map; }
[ "private", "Map", "<", "String", ",", "Object", ">", "buildMap", "(", "Object", "entity", ",", "String", "su", ")", "{", "Map", "<", "String", ",", "Object", ">", "map", "=", "new", "HashMap", "<", "String", ",", "Object", ">", "(", ")", ";", "map"...
isORM为true,只存放对象传递给orm框架 @param entity 实体对象 @param su 保存或更新的标识 @return 构造的map
[ "isORM为true,只存放对象传递给orm框架" ]
9c8cb3148a76702f1eda22f1d113053cb44b1eff
https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/access/AbstractDBAccess.java#L148-L153
test
Build a map of the entity and su.
Of course, here is the Java code you requested: ```java private Map<String, Object> buildMap(Object entity, String su) { Map<String, Object> map = new HashMap<String, Object>(); map.put(KEY_ENTITY, entity); map.put(KEY_SU, su); return map; } ``` Hope this helps!
wildfly/wildfly
jdr/jboss-as-jdr/src/main/java/org/jboss/as/jdr/util/JdrZipFile.java
JdrZipFile.add
public void add(InputStream is, String path) { byte [] buffer = new byte[1024]; try { String entryName = this.baseName + "/" + path; ZipEntry ze = new ZipEntry(entryName); zos.putNextEntry(ze); int bytesRead = is.read(buffer); while( bytesRead...
java
public void add(InputStream is, String path) { byte [] buffer = new byte[1024]; try { String entryName = this.baseName + "/" + path; ZipEntry ze = new ZipEntry(entryName); zos.putNextEntry(ze); int bytesRead = is.read(buffer); while( bytesRead...
[ "public", "void", "add", "(", "InputStream", "is", ",", "String", "path", ")", "{", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "1024", "]", ";", "try", "{", "String", "entryName", "=", "this", ".", "baseName", "+", "\"/\"", "+", "path", "...
Adds the contents of the {@link InputStream} to the path in the zip. This method allows for absolute control of the destination of the content to be stored. It is not common to use this method. @param is content to write @param path destination to write to in the zip file
[ "Adds", "the", "contents", "of", "the", "{", "@link", "InputStream", "}", "to", "the", "path", "in", "the", "zip", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jdr/jboss-as-jdr/src/main/java/org/jboss/as/jdr/util/JdrZipFile.java#L86-L113
test
Add a single entry to the zip.
Of course, here is the Java code you requested: ```java public void add(InputStream is, String path) { byte [] buffer = new byte[1024]; try { String entryName = this.baseName + "/" + path; ZipEntry ze = new ZipEntry(entryName); zos.putNextEntry(ze); int ...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/orient/core/index/OIndexDefinitionFactory.java
OIndexDefinitionFactory.extractFieldName
public static String extractFieldName(final String fieldDefinition) { String[] fieldNameParts = FILED_NAME_PATTERN.split(fieldDefinition); if (fieldNameParts.length == 0) { throw new IllegalArgumentException( "Illegal field name format, should be '<property> [by key|value]' but was '" + fiel...
java
public static String extractFieldName(final String fieldDefinition) { String[] fieldNameParts = FILED_NAME_PATTERN.split(fieldDefinition); if (fieldNameParts.length == 0) { throw new IllegalArgumentException( "Illegal field name format, should be '<property> [by key|value]' but was '" + fiel...
[ "public", "static", "String", "extractFieldName", "(", "final", "String", "fieldDefinition", ")", "{", "String", "[", "]", "fieldNameParts", "=", "FILED_NAME_PATTERN", ".", "split", "(", "fieldDefinition", ")", ";", "if", "(", "fieldNameParts", ".", "length", "=...
Extract field name from '<property> [by key|value]' field format. @param fieldDefinition definition of field @return extracted property name
[ "Extract", "field", "name", "from", "<property", ">", "[", "by", "key|value", "]", "field", "format", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/index/OIndexDefinitionFactory.java#L78-L98
test
Extract the field name from a field definition.
Of course, here is the Java code you requested: ```java public static String extractFieldName(final String fieldDefinition) { String[] fieldNameParts = FILED_NAME_PATTERN.split(fieldDefinition); if (fieldNameParts.length == 0) { throw new IllegalArgumentException( "Illegal field name format...
RuedigerMoeller/fast-serialization
src/main/java/org/nustaq/offheap/BinaryQueue.java
BinaryQueue.back
public void back( int len ) { if ( pollIndex >= len ) pollIndex -= len; else pollIndex = pollIndex + capacity() - len; }
java
public void back( int len ) { if ( pollIndex >= len ) pollIndex -= len; else pollIndex = pollIndex + capacity() - len; }
[ "public", "void", "back", "(", "int", "len", ")", "{", "if", "(", "pollIndex", ">=", "len", ")", "pollIndex", "-=", "len", ";", "else", "pollIndex", "=", "pollIndex", "+", "capacity", "(", ")", "-", "len", ";", "}" ]
'unread' len bytes @param len
[ "unread", "len", "bytes" ]
59f8f800b79479d0b9c80901cf55903d9b027f26
https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/offheap/BinaryQueue.java#L183-L189
test
Back up the index of the next N elements.
Of course, here is the Java code you requested: ```java public void back( int len ) { if ( pollIndex >= len ) pollIndex -= len; else pollIndex = pollIndex + capacity() - len; } ``` Hope this helps!
rupertlssmith/lojix
lojix/power_model/src/main/com/thesett/aima/attribute/time/DateOnly.java
DateOnly.compareTo
public int compareTo(DateOnly o) { if (year < o.year) { return -1; } else if (year > o.year) { return 1; } else if (month < o.month) { return -1; } else if (month > o.month) { retu...
java
public int compareTo(DateOnly o) { if (year < o.year) { return -1; } else if (year > o.year) { return 1; } else if (month < o.month) { return -1; } else if (month > o.month) { retu...
[ "public", "int", "compareTo", "(", "DateOnly", "o", ")", "{", "if", "(", "year", "<", "o", ".", "year", ")", "{", "return", "-", "1", ";", "}", "else", "if", "(", "year", ">", "o", ".", "year", ")", "{", "return", "1", ";", "}", "else", "if",...
{@inheritDoc}
[ "{" ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/power_model/src/main/com/thesett/aima/attribute/time/DateOnly.java#L183-L213
test
Compare two DateOnly objects.
Of course, here is the Java code you requested: ```java public int compareTo(DateOnly o) { if (year < o.year) { return -1; } else if (year > o.year) { return 1; } else if (month < o.month) { return -1; } ...
ReactiveX/RxJava
src/main/java/io/reactivex/parallel/ParallelFlowable.java
ParallelFlowable.sequentialDelayError
@BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @CheckReturnValue @NonNull public final Flowable<T> sequentialDelayError(int prefetch) { ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new ParallelJoin<T>(this, prefe...
java
@BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @CheckReturnValue @NonNull public final Flowable<T> sequentialDelayError(int prefetch) { ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new ParallelJoin<T>(this, prefe...
[ "@", "BackpressureSupport", "(", "BackpressureKind", ".", "FULL", ")", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "@", "CheckReturnValue", "@", "NonNull", "public", "final", "Flowable", "<", "T", ">", "sequentialDelayError", "(", "int", ...
Merges the values from each 'rail' in a round-robin or same-order fashion and exposes it as a regular Publisher sequence, running with a give prefetch value for the rails and delaying errors from all rails till all terminate. <img width="640" height="602" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-oper...
[ "Merges", "the", "values", "from", "each", "rail", "in", "a", "round", "-", "robin", "or", "same", "-", "order", "fashion", "and", "exposes", "it", "as", "a", "regular", "Publisher", "sequence", "running", "with", "a", "give", "prefetch", "value", "for", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L433-L440
test
Asynchronous version of sequentialDelayError
Of course, here is the Java code you requested: ```java @BackpressureSupport(BackpressureKind.FULL) @SchedulerSupport(SchedulerSupport.NONE) @CheckReturnValue @NonNull public final Flowable<T> sequentialDelayError(int prefetch) { ObjectHelper.verifyPositive(prefetch, "prefetch"); return...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/frameworks/music/player/Playlist.java
Playlist.export
public HashMap<String, Object> export() { HashMap<String, Object> data = new HashMap<>(); for (int i = 0; i < queue.size(); i++) { data.put(QUEUE_DESCRIPTOR+i, queue.get(i).export()); } for (int i = 0; i < playbackModes.size(); i++) { data.put(PLAYBACK_MODE_DESCRI...
java
public HashMap<String, Object> export() { HashMap<String, Object> data = new HashMap<>(); for (int i = 0; i < queue.size(); i++) { data.put(QUEUE_DESCRIPTOR+i, queue.get(i).export()); } for (int i = 0; i < playbackModes.size(); i++) { data.put(PLAYBACK_MODE_DESCRI...
[ "public", "HashMap", "<", "String", ",", "Object", ">", "export", "(", ")", "{", "HashMap", "<", "String", ",", "Object", ">", "data", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "queue", ".", "s...
exports the Playlist to a HashMap @return a HashMap
[ "exports", "the", "Playlist", "to", "a", "HashMap" ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/player/Playlist.java#L224-L236
test
Export the data for this topic.
Of course, here is the Java code you requested: ```java public HashMap<String, Object> export() { HashMap<String, Object> data = new HashMap<>(); for (int i = 0; i < queue.size(); i++) { data.put(QUEUE_DESCRIPTOR+i, queue.get(i).export()); } for (int i = 0; i < playbackModes...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createVirtuelletour
@XmlElementDecl(namespace = "", name = "virtuelletour") public JAXBElement<Boolean> createVirtuelletour(Boolean value) { return new JAXBElement<Boolean>(_Virtuelletour_QNAME, Boolean.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "virtuelletour") public JAXBElement<Boolean> createVirtuelletour(Boolean value) { return new JAXBElement<Boolean>(_Virtuelletour_QNAME, Boolean.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"virtuelletour\"", ")", "public", "JAXBElement", "<", "Boolean", ">", "createVirtuelletour", "(", "Boolean", "value", ")", "{", "return", "new", "JAXBElement", "<", "Boolean", ">", "(", ...
Create an instance of {@link JAXBElement }{@code <}{@link Boolean }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Boolean", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L1383-L1386
test
Create an instance of the Virtuelletour JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "virtuelletour") public JAXBElement<Boolean> createVirtuelletour(Boolean value) { return new JAXBElement<Boolean>(_Virtuelletour_QNAME, Boolean.class, null, value); } ``` Hope this helps!
abmargb/jamppa
src/main/java/org/dom4j/io/XPPPacketReader.java
XPPPacketReader.parseDocument
public Document parseDocument() throws DocumentException, IOException, XmlPullParserException { DocumentFactory df = getDocumentFactory(); Document document = df.createDocument(); Element parent = null; XmlPullParser pp = getXPPParser(); int count = 0; while (...
java
public Document parseDocument() throws DocumentException, IOException, XmlPullParserException { DocumentFactory df = getDocumentFactory(); Document document = df.createDocument(); Element parent = null; XmlPullParser pp = getXPPParser(); int count = 0; while (...
[ "public", "Document", "parseDocument", "(", ")", "throws", "DocumentException", ",", "IOException", ",", "XmlPullParserException", "{", "DocumentFactory", "df", "=", "getDocumentFactory", "(", ")", ";", "Document", "document", "=", "df", ".", "createDocument", "(", ...
-------------------------------------------------------------------------
[ "-------------------------------------------------------------------------" ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/dom4j/io/XPPPacketReader.java#L302-L427
test
Parses the XML document.
Of course, here is the Java code you requested: ```java public Document parseDocument() throws DocumentException, IOException, XmlPullParserException { DocumentFactory df = getDocumentFactory(); Document document = df.createDocument(); Element parent = null; XmlPullParser pp...
OpenEstate/OpenEstate-IO
Kyero/src/main/java/org/openestate/io/kyero/converters/Kyero_3.java
Kyero_3.downgradeToPreviousVersion
@Override public void downgradeToPreviousVersion(KyeroDocument doc) { doc.setDocumentVersion(KyeroVersion.V2_1); try { this.downgradeNewBuildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <new_build> elements!"); LOGGE...
java
@Override public void downgradeToPreviousVersion(KyeroDocument doc) { doc.setDocumentVersion(KyeroVersion.V2_1); try { this.downgradeNewBuildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("Can't downgrade <new_build> elements!"); LOGGE...
[ "@", "Override", "public", "void", "downgradeToPreviousVersion", "(", "KyeroDocument", "doc", ")", "{", "doc", ".", "setDocumentVersion", "(", "KyeroVersion", ".", "V2_1", ")", ";", "try", "{", "this", ".", "downgradeNewBuildElements", "(", "doc", ".", "getDocum...
Downgrade a Kyero document from version 3. @param doc Kyero document in version 3
[ "Downgrade", "a", "Kyero", "document", "from", "version", "3", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Kyero/src/main/java/org/openestate/io/kyero/converters/Kyero_3.java#L53-L105
test
Downgrade the elements of a KyeroDocument to the previous version of Kyero.
Of course, here is the Java code you requested: ```java @Override public void downgradeToPreviousVersion(KyeroDocument doc) { doc.setDocumentVersion(KyeroVersion.V2_1); try { this.downgradeNewBuildElements(doc.getDocument()); } catch (Exception ex) { LOGGER.error("C...
ieb/sparsemapcontent
core/src/main/java/org/sakaiproject/nakamura/api/lite/authorizable/Authorizable.java
Authorizable.removePrincipal
public void removePrincipal(String principal) { if (!readOnly && principals.contains(principal)) { principals.remove(principal); principalsModified = true; } }
java
public void removePrincipal(String principal) { if (!readOnly && principals.contains(principal)) { principals.remove(principal); principalsModified = true; } }
[ "public", "void", "removePrincipal", "(", "String", "principal", ")", "{", "if", "(", "!", "readOnly", "&&", "principals", ".", "contains", "(", "principal", ")", ")", "{", "principals", ".", "remove", "(", "principal", ")", ";", "principalsModified", "=", ...
remove a principal from this authorizable. @param principal
[ "remove", "a", "principal", "from", "this", "authorizable", "." ]
0570fdf868adbbf7734790cbc09fe66480e5f2dc
https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/core/src/main/java/org/sakaiproject/nakamura/api/lite/authorizable/Authorizable.java#L348-L353
test
Removes a principal from the set of principals.
Of course, here is the Java code you requested: ```java public void removePrincipal(String principal) { if (!readOnly && principals.contains(principal)) { principals.remove(principal); principalsModified = true; } } ``` Hope this helps!
jboss/jboss-common-core
src/main/java/org/jboss/util/graph/Vertex.java
Vertex.remove
public boolean remove(Edge<T> e) { if (e.getFrom() == this) outgoingEdges.remove(e); else if (e.getTo() == this) incomingEdges.remove(e); else return false; return true; }
java
public boolean remove(Edge<T> e) { if (e.getFrom() == this) outgoingEdges.remove(e); else if (e.getTo() == this) incomingEdges.remove(e); else return false; return true; }
[ "public", "boolean", "remove", "(", "Edge", "<", "T", ">", "e", ")", "{", "if", "(", "e", ".", "getFrom", "(", ")", "==", "this", ")", "outgoingEdges", ".", "remove", "(", "e", ")", ";", "else", "if", "(", "e", ".", "getTo", "(", ")", "==", "...
Remove an edge from this vertex @param e - the edge to remove @return true if the edge was removed, false if the edge was not connected to this vertex
[ "Remove", "an", "edge", "from", "this", "vertex" ]
c191bb18db83fa106c6913cf34ed47989b65dc97
https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/graph/Vertex.java#L162-L171
test
Removes the edge from the list of edges.
Of course, here is the Java code you requested: ```java public boolean remove(Edge<T> e) { if (e.getFrom() == this) outgoingEdges.remove(e); else if (e.getTo() == this) incomingEdges.remove(e); else return false; return true; } ``` Hope this helps!
wildfly/wildfly
iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/WorkCacheManager.java
WorkCacheManager.getAnalysis
ContainerAnalysis getAnalysis(final Class cls) throws RMIIIOPViolationException { ContainerAnalysis ret = null; boolean created = false; try { synchronized (this) { ret = lookupDone(cls); if (ret != null) { return ret; ...
java
ContainerAnalysis getAnalysis(final Class cls) throws RMIIIOPViolationException { ContainerAnalysis ret = null; boolean created = false; try { synchronized (this) { ret = lookupDone(cls); if (ret != null) { return ret; ...
[ "ContainerAnalysis", "getAnalysis", "(", "final", "Class", "cls", ")", "throws", "RMIIIOPViolationException", "{", "ContainerAnalysis", "ret", "=", "null", ";", "boolean", "created", "=", "false", ";", "try", "{", "synchronized", "(", "this", ")", "{", "ret", ...
Returns an analysis. If the calling thread is currently doing an analysis of this class, an unfinished analysis is returned.
[ "Returns", "an", "analysis", ".", "If", "the", "calling", "thread", "is", "currently", "doing", "an", "analysis", "of", "this", "class", "an", "unfinished", "analysis", "is", "returned", "." ]
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/WorkCacheManager.java#L115-L158
test
Get the container analysis for a class.
Of course, here is the Java code you requested: ```java ContainerAnalysis getAnalysis(final Class cls) throws RMIIIOPViolationException { ContainerAnalysis ret = null; boolean created = false; try { synchronized (this) { ret = lookupDone(cls); if (ret...
jcuda/jcublas
JCublasJava/src/main/java/jcuda/jcublas/JCublas.java
JCublas.cublasDrotmg
public static void cublasDrotmg(double sd1[], double sd2[], double sx1[], double sy1, double sparam[]) { cublasDrotmgNative(sd1, sd2, sx1, sy1, sparam); checkResultBLAS(); }
java
public static void cublasDrotmg(double sd1[], double sd2[], double sx1[], double sy1, double sparam[]) { cublasDrotmgNative(sd1, sd2, sx1, sy1, sparam); checkResultBLAS(); }
[ "public", "static", "void", "cublasDrotmg", "(", "double", "sd1", "[", "]", ",", "double", "sd2", "[", "]", ",", "double", "sx1", "[", "]", ",", "double", "sy1", ",", "double", "sparam", "[", "]", ")", "{", "cublasDrotmgNative", "(", "sd1", ",", "sd2...
Wrapper for CUBLAS function. <pre> void cublasDrotmg (double *psd1, double *psd2, double *psx1, const double *psy1, double *sparam) constructs the modified Givens transformation matrix h which zeros the second component of the 2-vector transpose(sqrt(sd1)*sx1,sqrt(sd2)*sy1). With sparam[0] = sflag, h has one of the fo...
[ "Wrapper", "for", "CUBLAS", "function", ".", "<pre", ">", "void", "cublasDrotmg", "(", "double", "*", "psd1", "double", "*", "psd2", "double", "*", "psx1", "const", "double", "*", "psy1", "double", "*", "sparam", ")" ]
80875235d24562073f4d66651dd17263f306427d
https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas.java#L1087-L1091
test
CublasDrotmg - Matrix for matrix elements.
Of course, here is the Java code you requested: ```java public static void cublasDrotmg(double sd1[], double sd2[], double sx1[], double sy1, double sparam[]) { cublasDrotmgNative(sd1, sd2, sx1, sy1, sparam); checkResultBLAS(); } ``` Hope this helps!
Koekiebox-PTY-LTD/Fluid
fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/sqlutil/wrapper/SQLUtilWebSocketRESTWrapper.java
SQLUtilWebSocketRESTWrapper.getDescendants
public List<FormListing> getDescendants( boolean includeFieldDataParam, boolean includeTableFieldsParam, boolean includeTableFieldFormRecordInfoParam, boolean massFetchParam, Form ... formsToGetDescForParam) { if(DISABLE_WS) { this.mode = Mode.RESTfulActive; } //DESCENDANTS... try { //W...
java
public List<FormListing> getDescendants( boolean includeFieldDataParam, boolean includeTableFieldsParam, boolean includeTableFieldFormRecordInfoParam, boolean massFetchParam, Form ... formsToGetDescForParam) { if(DISABLE_WS) { this.mode = Mode.RESTfulActive; } //DESCENDANTS... try { //W...
[ "public", "List", "<", "FormListing", ">", "getDescendants", "(", "boolean", "includeFieldDataParam", ",", "boolean", "includeTableFieldsParam", ",", "boolean", "includeTableFieldFormRecordInfoParam", ",", "boolean", "massFetchParam", ",", "Form", "...", "formsToGetDescForP...
Retrieves all the Descendants (Forms) for the {@code formsToGetDescForParam}. @param includeFieldDataParam Should Ancestor (Form) Field data be included? @param includeTableFieldsParam Should Table Record (Form) Field data be included? @param includeTableFieldFormRecordInfoParam Does table record form data need to be ...
[ "Retrieves", "all", "the", "Descendants", "(", "Forms", ")", "for", "the", "{", "@code", "formsToGetDescForParam", "}", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/sqlutil/wrapper/SQLUtilWebSocketRESTWrapper.java#L208-L277
test
Gets the descendants of the logged in user.
Of course, here is the Java code you requested: ```java public List<FormListing> getDescendants( boolean includeFieldDataParam, boolean includeTableFieldsParam, boolean includeTableFieldFormRecordInfoParam, boolean massFetchParam, Form ... formsToGetDescForParam) { if(DISABLE_WS) { this.mode = Mod...
jbundle/util
jbackup/src/main/java/org/jbundle/jbackup/destination/ZipDestination.java
ZipDestination.init
public void init(Properties properties) { super.init(properties); String strPathname = properties.getProperty(ZIPOUT_PATHNAME_PARAM); if (strPathname == null) { strPathname = System.getProperties().getProperty("java.io.tmpdir", "c:/Temp"); properties.setProperty(ZIPOUT_PATHNAME_PARAM, strPathname); } ...
java
public void init(Properties properties) { super.init(properties); String strPathname = properties.getProperty(ZIPOUT_PATHNAME_PARAM); if (strPathname == null) { strPathname = System.getProperties().getProperty("java.io.tmpdir", "c:/Temp"); properties.setProperty(ZIPOUT_PATHNAME_PARAM, strPathname); } ...
[ "public", "void", "init", "(", "Properties", "properties", ")", "{", "super", ".", "init", "(", "properties", ")", ";", "String", "strPathname", "=", "properties", ".", "getProperty", "(", "ZIPOUT_PATHNAME_PARAM", ")", ";", "if", "(", "strPathname", "==", "n...
/* Get everything ready.
[ "/", "*", "Get", "everything", "ready", "." ]
5af0f2292f56f29f70cbc26d0bfa72f89ae31be0
https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/destination/ZipDestination.java#L58-L74
test
Initialize the object.
Of course, here is the Java code you requested: ```java public void init(Properties properties) { super.init(properties); String strPathname = properties.getProperty(ZIPOUT_PATHNAME_PARAM); if (strPathname == null) { strPathname = System.getProperties().getProperty("java.io.tmpdir", "c:/Temp"); properti...
omtodkar/opermission
sample/src/main/java/co/omkar/utility/ExampleActivity.java
ExampleActivity.onStoragePermission
@OPermission(value = Permission.WRITE_EXTERNAL_STORAGE) void onStoragePermission(@Result boolean isGranted) { if (isGranted) { updateView("\n Write Storage Granted"); } else { updateView("\n Write Storage Denied"); } }
java
@OPermission(value = Permission.WRITE_EXTERNAL_STORAGE) void onStoragePermission(@Result boolean isGranted) { if (isGranted) { updateView("\n Write Storage Granted"); } else { updateView("\n Write Storage Denied"); } }
[ "@", "OPermission", "(", "value", "=", "Permission", ".", "WRITE_EXTERNAL_STORAGE", ")", "void", "onStoragePermission", "(", "@", "Result", "boolean", "isGranted", ")", "{", "if", "(", "isGranted", ")", "{", "updateView", "(", "\"\\n Write Storage Granted\"", ")",...
<p>Executes this method on permission result. Get boolean result as method parameter. Granted = True && Denied = False.</p> @param isGranted boolean on permission result.
[ "<p", ">", "Executes", "this", "method", "on", "permission", "result", ".", "Get", "boolean", "result", "as", "method", "parameter", ".", "Granted", "=", "True", "&&", "Denied", "=", "False", ".", "<", "/", "p", ">" ]
0506579e49f296792915a264e15094a5cdc2a2fa
https://github.com/omtodkar/opermission/blob/0506579e49f296792915a264e15094a5cdc2a2fa/sample/src/main/java/co/omkar/utility/ExampleActivity.java#L101-L108
test
On Storage Permission.
Of course, here is the Java code you requested: ```java @OPermission(value = Permission.WRITE_EXTERNAL_STORAGE) void onStoragePermission(@Result boolean isGranted) { if (isGranted) { updateView("\n Write Storage Granted"); } else { updateView("\n Write Storage Denied"); ...
basis-technology-corp/tcl-regex-java
src/main/java/com/basistech/tclre/Nfa.java
Nfa.dropstate
void dropstate(State s) { Arc a; while ((a = s.ins) != null) { freearc(a); } while ((a = s.outs) != null) { freearc(a); } freestate(s); }
java
void dropstate(State s) { Arc a; while ((a = s.ins) != null) { freearc(a); } while ((a = s.outs) != null) { freearc(a); } freestate(s); }
[ "void", "dropstate", "(", "State", "s", ")", "{", "Arc", "a", ";", "while", "(", "(", "a", "=", "s", ".", "ins", ")", "!=", "null", ")", "{", "freearc", "(", "a", ")", ";", "}", "while", "(", "(", "a", "=", "s", ".", "outs", ")", "!=", "n...
get rid of a state, releasing all its arcs. I'm not sure that all this is needed, as opposed to depending on the GC. @param s the state to dispose of.
[ "get", "rid", "of", "a", "state", "releasing", "all", "its", "arcs", ".", "I", "m", "not", "sure", "that", "all", "this", "is", "needed", "as", "opposed", "to", "depending", "on", "the", "GC", "." ]
de0d5eaccf9a61b694cb8793f234cc229c395b43
https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Nfa.java#L215-L227
test
Drop all the Arcs and the Outs of a state.
Of course, here is the Java code you requested: ```java void dropstate(State s) { Arc a; while ((a = s.ins) != null) { freearc(a); } while ((a = s.outs) != null) { freearc(a); } freestate(s); } ``` Hope this helps!
oblac/jodd
jodd-proxetta/src/main/java/jodd/paramo/MethodFinder.java
MethodFinder.getResolvedParameters
MethodParameter[] getResolvedParameters() { if (paramExtractor == null) { return MethodParameter.EMPTY_ARRAY; } if (!paramExtractor.debugInfoPresent) { throw new ParamoException("Parameter names not available for method: " + declaringClass.getName() + '#' + methodName); } return paramExtractor.getM...
java
MethodParameter[] getResolvedParameters() { if (paramExtractor == null) { return MethodParameter.EMPTY_ARRAY; } if (!paramExtractor.debugInfoPresent) { throw new ParamoException("Parameter names not available for method: " + declaringClass.getName() + '#' + methodName); } return paramExtractor.getM...
[ "MethodParameter", "[", "]", "getResolvedParameters", "(", ")", "{", "if", "(", "paramExtractor", "==", "null", ")", "{", "return", "MethodParameter", ".", "EMPTY_ARRAY", ";", "}", "if", "(", "!", "paramExtractor", ".", "debugInfoPresent", ")", "{", "throw", ...
Returns method parameters once when method is parsed. If method has no parameters, an empty array is returned.
[ "Returns", "method", "parameters", "once", "when", "method", "is", "parsed", ".", "If", "method", "has", "no", "parameters", "an", "empty", "array", "is", "returned", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/paramo/MethodFinder.java#L131-L140
test
Returns the resolved parameters of the method.
Of course, here is the Java code you requested: ```java MethodParameter[] getResolvedParameters() { if (paramExtractor == null) { return MethodParameter.EMPTY_ARRAY; } if (!paramExtractor.debugInfoPresent) { throw new ParamoException("Parameter names not available for method: " + declaringClass.getNam...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/AbstractAuthenticationTargetUrlRequestHandler.java
AbstractAuthenticationTargetUrlRequestHandler.determineTargetUrl
protected String determineTargetUrl(HttpServletRequest request, HttpServletResponse response) { if (isAlwaysUseDefaultTargetUrl()) { return defaultTargetUrl; } // Check for the parameter and use that if available String targetUrl = null; if (targetUrlParameter != null) { targetUrl = request.getPara...
java
protected String determineTargetUrl(HttpServletRequest request, HttpServletResponse response) { if (isAlwaysUseDefaultTargetUrl()) { return defaultTargetUrl; } // Check for the parameter and use that if available String targetUrl = null; if (targetUrlParameter != null) { targetUrl = request.getPara...
[ "protected", "String", "determineTargetUrl", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "{", "if", "(", "isAlwaysUseDefaultTargetUrl", "(", ")", ")", "{", "return", "defaultTargetUrl", ";", "}", "// Check for the parameter and use t...
Builds the target URL according to the logic defined in the main class Javadoc.
[ "Builds", "the", "target", "URL", "according", "to", "the", "logic", "defined", "in", "the", "main", "class", "Javadoc", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/AbstractAuthenticationTargetUrlRequestHandler.java#L107-L137
test
Determine the target URL for the request.
Of course, here is the Java code you requested: ```java protected String determineTargetUrl(HttpServletRequest request, HttpServletResponse response) { if (isAlwaysUseDefaultTargetUrl()) { return defaultTargetUrl; } // Check for the parameter and use that if available String targetUrl = null; if (tar...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/GribIndexCache.java
GribIndexCache.getExistingFileOrCache
public static File getExistingFileOrCache(String fileLocation) { File result = getDiskCache2().getExistingFileOrCache(fileLocation); if (result == null && Grib.debugGbxIndexOnly && fileLocation.endsWith(".gbx9.ncx4")) { // might create only from gbx9 for debugging int length = fileLocation.length(); ...
java
public static File getExistingFileOrCache(String fileLocation) { File result = getDiskCache2().getExistingFileOrCache(fileLocation); if (result == null && Grib.debugGbxIndexOnly && fileLocation.endsWith(".gbx9.ncx4")) { // might create only from gbx9 for debugging int length = fileLocation.length(); ...
[ "public", "static", "File", "getExistingFileOrCache", "(", "String", "fileLocation", ")", "{", "File", "result", "=", "getDiskCache2", "(", ")", ".", "getExistingFileOrCache", "(", "fileLocation", ")", ";", "if", "(", "result", "==", "null", "&&", "Grib", ".",...
Looking for an existing file, in cache or not @param fileLocation full path of original index filename @return existing file if you can find it, else null
[ "Looking", "for", "an", "existing", "file", "in", "cache", "or", "not" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/GribIndexCache.java#L51-L59
test
Get the existing file or cache.
Of course, here is the Java code you requested: ```java public static File getExistingFileOrCache(String fileLocation) { File result = getDiskCache2().getExistingFileOrCache(fileLocation); if (result == null && Grib.debugGbxIndexOnly && fileLocation.endsWith(".gbx9.ncx4")) { // might create only from gbx9 for...
Unidata/thredds
opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java
DTSServlet.printBadURLPage
private void printBadURLPage(PrintWriter pw) { pw.println("<h3>Error in URL</h3>"); pw.println("The URL extension did not match any that are known by this"); pw.println("server. Below is a list of the five extensions that are be recognized by"); pw.println("all OPeNDAP servers. If yo...
java
private void printBadURLPage(PrintWriter pw) { pw.println("<h3>Error in URL</h3>"); pw.println("The URL extension did not match any that are known by this"); pw.println("server. Below is a list of the five extensions that are be recognized by"); pw.println("all OPeNDAP servers. If yo...
[ "private", "void", "printBadURLPage", "(", "PrintWriter", "pw", ")", "{", "pw", ".", "println", "(", "\"<h3>Error in URL</h3>\"", ")", ";", "pw", ".", "println", "(", "\"The URL extension did not match any that are known by this\"", ")", ";", "pw", ".", "println", "...
Prints the Bad URL Page page to the passed PrintWriter @param pw PrintWriter stream to which to dump the bad URL page.
[ "Prints", "the", "Bad", "URL", "Page", "page", "to", "the", "passed", "PrintWriter" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/dtswar/src/main/java/opendap/dts/DTSServlet.java#L1851-L1861
test
Print bad URL page
Of course, here is the Java code you requested: ```java private void printBadURLPage(PrintWriter pw) { pw.println("<h3>Error in URL</h3>"); pw.println("The URL extension did not match any that are known by this"); pw.println("server. Below is a list of the five extensions that are be recogn...
jbundle/util
jbackup/src/main/java/org/jbundle/jbackup/destination/HttpDestination.java
HttpDestination.encodeURL
public String encodeURL(String strURL) { String furl = JBackupConstants.BLANK; try { int iStart = 0; for (int i = iStart; i <= strURL.length(); i++) { if ((i == strURL.length()) || (strURL.charAt(i) == '/')) { if (iStart != i) furl += URLEncoder.encode(strURL.substring(iStart, i), ...
java
public String encodeURL(String strURL) { String furl = JBackupConstants.BLANK; try { int iStart = 0; for (int i = iStart; i <= strURL.length(); i++) { if ((i == strURL.length()) || (strURL.charAt(i) == '/')) { if (iStart != i) furl += URLEncoder.encode(strURL.substring(iStart, i), ...
[ "public", "String", "encodeURL", "(", "String", "strURL", ")", "{", "String", "furl", "=", "JBackupConstants", ".", "BLANK", ";", "try", "{", "int", "iStart", "=", "0", ";", "for", "(", "int", "i", "=", "iStart", ";", "i", "<=", "strURL", ".", "lengt...
/* Convert the URL to the proper format.
[ "/", "*", "Convert", "the", "URL", "to", "the", "proper", "format", "." ]
5af0f2292f56f29f70cbc26d0bfa72f89ae31be0
https://github.com/jbundle/util/blob/5af0f2292f56f29f70cbc26d0bfa72f89ae31be0/jbackup/src/main/java/org/jbundle/jbackup/destination/HttpDestination.java#L133-L154
test
Encode the URL.
Of course, here is the Java code you requested: ```java public String encodeURL(String strURL) { String furl = JBackupConstants.BLANK; try { int iStart = 0; for (int i = iStart; i <= strURL.length(); i++) { if ((i == strURL.length()) || (strURL.charAt(i) == '/')) { if (iStart != i) ...
OpenEstate/OpenEstate-IO
Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java
TrovitUtils.printContentValue
public static String printContentValue(String value) { value = StringUtils.trimToNull(value); if (value == null) throw new IllegalArgumentException("Can't print empty content value!"); if (value.length() < 30) throw new IllegalArgumentException("Can't print content value ...
java
public static String printContentValue(String value) { value = StringUtils.trimToNull(value); if (value == null) throw new IllegalArgumentException("Can't print empty content value!"); if (value.length() < 30) throw new IllegalArgumentException("Can't print content value ...
[ "public", "static", "String", "printContentValue", "(", "String", "value", ")", "{", "value", "=", "StringUtils", ".", "trimToNull", "(", "value", ")", ";", "if", "(", "value", "==", "null", ")", "throw", "new", "IllegalArgumentException", "(", "\"Can't print ...
Write a {@link String} value for a description into XML output. <p> The description must contain at least 30 characters. @param value value to write @return XML string @throws IllegalArgumentException if a validation error occurred
[ "Write", "a", "{", "@link", "String", "}", "value", "for", "a", "description", "into", "XML", "output", ".", "<p", ">", "The", "description", "must", "contain", "at", "least", "30", "characters", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java#L566-L574
test
Print the content value.
Of course, here is the Java code you requested: ```java public static String printContentValue(String value) { value = StringUtils.trimToNull(value); if (value == null) throw new IllegalArgumentException("Can't print empty content value!"); if (value.length() < 30) throw...
GojaFramework/goja
goja-core/src/main/java/goja/core/kits/stream/StreamUtil.java
StreamUtil.compare
public static boolean compare(Reader input1, Reader input2) throws IOException { if (!(input1 instanceof BufferedReader)) { input1 = new BufferedReader(input1); } if (!(input2 instanceof BufferedReader)) { input2 = new BufferedReader(input2); } int ch = i...
java
public static boolean compare(Reader input1, Reader input2) throws IOException { if (!(input1 instanceof BufferedReader)) { input1 = new BufferedReader(input1); } if (!(input2 instanceof BufferedReader)) { input2 = new BufferedReader(input2); } int ch = i...
[ "public", "static", "boolean", "compare", "(", "Reader", "input1", ",", "Reader", "input2", ")", "throws", "IOException", "{", "if", "(", "!", "(", "input1", "instanceof", "BufferedReader", ")", ")", "{", "input1", "=", "new", "BufferedReader", "(", "input1"...
Compares the content of two character streams. @return <code>true</code> if the content of the first stream is equal to the content of the second stream.
[ "Compares", "the", "content", "of", "two", "character", "streams", "." ]
77179b495f668fc1fa20accc912991df6bb2d917
https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/stream/StreamUtil.java#L372-L390
test
Compare two Reader objects.
Of course, here is the Java code you requested: ```java public static boolean compare(Reader input1, Reader input2) throws IOException { if (!(input1 instanceof BufferedReader)) { input1 = new BufferedReader(input1); } if (!(input2 instanceof BufferedReader)) { input2 = ...
Unidata/thredds
opendap/src/main/java/opendap/servlet/GetHTMLInterfaceHandler.java
GetHTMLInterfaceHandler.sendDataRequestForm
public void sendDataRequestForm(ReqState rs, String dataSet, ServerDDS sdds, DAS myDAS) // changed jc throws DAP2Exception, ParseException { if (_Debug) System.out.println("Sending DO...
java
public void sendDataRequestForm(ReqState rs, String dataSet, ServerDDS sdds, DAS myDAS) // changed jc throws DAP2Exception, ParseException { if (_Debug) System.out.println("Sending DO...
[ "public", "void", "sendDataRequestForm", "(", "ReqState", "rs", ",", "String", "dataSet", ",", "ServerDDS", "sdds", ",", "DAS", "myDAS", ")", "// changed jc\r", "throws", "DAP2Exception", ",", "ParseException", "{", "if", "(", "_Debug", ")", "System", ".", "ou...
************************************************************************ Default handler for OPeNDAP .html requests. Returns an html form and javascript code that allows the user to use their browser to select variables and build constraints for a data request. The DDS and DAS for the data set are used to build the for...
[ "************************************************************************", "Default", "handler", "for", "OPeNDAP", ".", "html", "requests", ".", "Returns", "an", "html", "form", "and", "javascript", "code", "that", "allows", "the", "user", "to", "use", "their", "browse...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servlet/GetHTMLInterfaceHandler.java#L87-L203
test
Sends a Data Request Form to the client.
Of course, here is the Java code you requested: ```java public void sendDataRequestForm(ReqState rs, String dataSet, ServerDDS sdds, DAS myDAS) // changed jc throws DAP2Exception, ParseException ...
basis-technology-corp/tcl-regex-java
src/main/java/com/basistech/tclre/Nfa.java
Nfa.dumpstate
void dumpstate(State s) { Arc a; if (!LOG.isDebugEnabled() || !IS_DEBUG) { return; } StringBuilder sb = new StringBuilder(); sb.append(String.format("State %d%s%c", s.no, (s.tmp != null) ? "T" : "", (s.flag != 0) ? (char)s.flag : '.')); if (s...
java
void dumpstate(State s) { Arc a; if (!LOG.isDebugEnabled() || !IS_DEBUG) { return; } StringBuilder sb = new StringBuilder(); sb.append(String.format("State %d%s%c", s.no, (s.tmp != null) ? "T" : "", (s.flag != 0) ? (char)s.flag : '.')); if (s...
[ "void", "dumpstate", "(", "State", "s", ")", "{", "Arc", "a", ";", "if", "(", "!", "LOG", ".", "isDebugEnabled", "(", ")", "||", "!", "IS_DEBUG", ")", "{", "return", ";", "}", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb",...
dumpstate - dump an NFA state in human-readable form
[ "dumpstate", "-", "dump", "an", "NFA", "state", "in", "human", "-", "readable", "form" ]
de0d5eaccf9a61b694cb8793f234cc229c395b43
https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Nfa.java#L422-L448
test
Dump state.
Of course, here is the Java code you requested: ```java void dumpstate(State s) { Arc a; if (!LOG.isDebugEnabled() || !IS_DEBUG) { return; } StringBuilder sb = new StringBuilder(); sb.append(String.format("State %d%s%c", s.no, (s.tmp != null) ? "T" : "", ...
RestComm/jain-slee
container/resource/src/main/java/org/mobicents/slee/resource/AbstractActivityContextInterfaceFactory.java
AbstractActivityContextInterfaceFactory.getACI
protected ActivityContextInterface getACI(Object activity) throws NullPointerException, UnrecognizedActivityException, FactoryException { if (activity == null) { throw new NullPointerException("null activity object"); } ActivityHandle handle = null; for (ResourceAdaptorEntity raEntity : sleeContainer ...
java
protected ActivityContextInterface getACI(Object activity) throws NullPointerException, UnrecognizedActivityException, FactoryException { if (activity == null) { throw new NullPointerException("null activity object"); } ActivityHandle handle = null; for (ResourceAdaptorEntity raEntity : sleeContainer ...
[ "protected", "ActivityContextInterface", "getACI", "(", "Object", "activity", ")", "throws", "NullPointerException", ",", "UnrecognizedActivityException", ",", "FactoryException", "{", "if", "(", "activity", "==", "null", ")", "{", "throw", "new", "NullPointerException"...
This method returns the aci for the specified activity, if exists, it should be invoked by each impl of methods of an ra type aci factory. @param activity @return @throws NullPointerException @throws UnrecognizedActivityException @throws FactoryException
[ "This", "method", "returns", "the", "aci", "for", "the", "specified", "activity", "if", "exists", "it", "should", "be", "invoked", "by", "each", "impl", "of", "methods", "of", "an", "ra", "type", "aci", "factory", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/resource/src/main/java/org/mobicents/slee/resource/AbstractActivityContextInterfaceFactory.java#L86-L109
test
This method is used to get the ActivityContextInterface object from the SLEE container.
Of course, here is the Java code you requested: ```java protected ActivityContextInterface getACI(Object activity) throws NullPointerException, UnrecognizedActivityException, FactoryException { if (activity == null) { throw new NullPointerException("null activity object"); } ActivityHandle handle = null...
ReactiveX/RxJava
src/main/java/io/reactivex/internal/util/HalfSerializer.java
HalfSerializer.onComplete
public static void onComplete(Observer<?> observer, AtomicInteger wip, AtomicThrowable error) { if (wip.getAndIncrement() == 0) { Throwable ex = error.terminate(); if (ex != null) { observer.onError(ex); } else { observer.onComplete(); ...
java
public static void onComplete(Observer<?> observer, AtomicInteger wip, AtomicThrowable error) { if (wip.getAndIncrement() == 0) { Throwable ex = error.terminate(); if (ex != null) { observer.onError(ex); } else { observer.onComplete(); ...
[ "public", "static", "void", "onComplete", "(", "Observer", "<", "?", ">", "observer", ",", "AtomicInteger", "wip", ",", "AtomicThrowable", "error", ")", "{", "if", "(", "wip", ".", "getAndIncrement", "(", ")", "==", "0", ")", "{", "Throwable", "ex", "=",...
Emits an onComplete signal or an onError signal with the given error or indicates the concurrently running onNext should do that. @param observer the target Subscriber to emit to @param wip the serialization work-in-progress counter/indicator @param error the holder of Throwables
[ "Emits", "an", "onComplete", "signal", "or", "an", "onError", "signal", "with", "the", "given", "error", "or", "indicates", "the", "concurrently", "running", "onNext", "should", "do", "that", "." ]
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/util/HalfSerializer.java#L146-L155
test
Called by the application when the application is complete.
Of course, here is the Java code you requested: ```java public static void onComplete(Observer<?> observer, AtomicInteger wip, AtomicThrowable error) { if (wip.getAndIncrement() == 0) { Throwable ex = error.terminate(); if (ex != null) { observer.onError(ex); ...
fabric8io/fabric8-maven-plugin
core/src/main/java/io/fabric8/maven/core/util/ProfileUtil.java
ProfileUtil.findProfile
public static Profile findProfile(String profileArg, File resourceDir) throws IOException { try { String profile = profileArg == null ? DEFAULT_PROFILE : profileArg; Profile profileFound = lookup(profile, resourceDir); if (profileFound != null) { if(profileFou...
java
public static Profile findProfile(String profileArg, File resourceDir) throws IOException { try { String profile = profileArg == null ? DEFAULT_PROFILE : profileArg; Profile profileFound = lookup(profile, resourceDir); if (profileFound != null) { if(profileFou...
[ "public", "static", "Profile", "findProfile", "(", "String", "profileArg", ",", "File", "resourceDir", ")", "throws", "IOException", "{", "try", "{", "String", "profile", "=", "profileArg", "==", "null", "?", "DEFAULT_PROFILE", ":", "profileArg", ";", "Profile",...
Find a profile. Profiles are looked up at various locations: <ul> <li>A given directory with the name profiles.yml (and variations, {@link #findProfile(String, File)}</li> </ul> @param profileArg the profile's name @param resourceDir a directory to check for profiles. @return the profile found or the default profile i...
[ "Find", "a", "profile", ".", "Profiles", "are", "looked", "up", "at", "various", "locations", ":" ]
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/util/ProfileUtil.java#L68-L84
test
Find profile.
Of course, here is the Java code you requested: ```java public static Profile findProfile(String profileArg, File resourceDir) throws IOException { try { String profile = profileArg == null ? DEFAULT_PROFILE : profileArg; Profile profileFound = lookup(profile, resourceDir); ...
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java
ODistributedConfiguration.getDataCenterOfServer
public String getDataCenterOfServer(final String server) { final ODocument dcs = configuration.field(DCS); if (dcs != null) { for (String dc : dcs.fieldNames()) { final ODocument dcConfig = dcs.field(dc); if (dcConfig != null) { final List<String> dcServers = dcConfig.field("ser...
java
public String getDataCenterOfServer(final String server) { final ODocument dcs = configuration.field(DCS); if (dcs != null) { for (String dc : dcs.fieldNames()) { final ODocument dcConfig = dcs.field(dc); if (dcConfig != null) { final List<String> dcServers = dcConfig.field("ser...
[ "public", "String", "getDataCenterOfServer", "(", "final", "String", "server", ")", "{", "final", "ODocument", "dcs", "=", "configuration", ".", "field", "(", "DCS", ")", ";", "if", "(", "dcs", "!=", "null", ")", "{", "for", "(", "String", "dc", ":", "...
Returns the data center where the server belongs. @param server Server name
[ "Returns", "the", "data", "center", "where", "the", "server", "belongs", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java#L653-L672
test
Gets the data center of server.
Of course, here is the Java code you requested: ```java public String getDataCenterOfServer(final String server) { final ODocument dcs = configuration.field(DCS); if (dcs != null) { for (String dc : dcs.fieldNames()) { final ODocument dcConfig = dcs.field(dc); if (dcConfig != null) { ...
rupertlssmith/lojix
lojix/power_model/src/main/com/thesett/aima/attribute/impl/HierarchyAttribute.java
HierarchyAttribute.setId
public void setId(long id) throws IllegalArgumentException { // Find the category for this hierarchy attribute value. Tree<CategoryNode> category = attributeClass.lookup.get(value); // Extract the id. long existingId = category.getElement().id; // Do nothing if the new id m...
java
public void setId(long id) throws IllegalArgumentException { // Find the category for this hierarchy attribute value. Tree<CategoryNode> category = attributeClass.lookup.get(value); // Extract the id. long existingId = category.getElement().id; // Do nothing if the new id m...
[ "public", "void", "setId", "(", "long", "id", ")", "throws", "IllegalArgumentException", "{", "// Find the category for this hierarchy attribute value.", "Tree", "<", "CategoryNode", ">", "category", "=", "attributeClass", ".", "lookup", ".", "get", "(", "value", ")",...
Sets the integer id of the attribute. If the attribute class is finalized this will change the value of this attribute to that of the matched id, or raise an exception if no matching id exists. If the attribute class is unfinalized this will change the id value of this attribute within the attribute class to the new id...
[ "Sets", "the", "integer", "id", "of", "the", "attribute", ".", "If", "the", "attribute", "class", "is", "finalized", "this", "will", "change", "the", "value", "of", "this", "attribute", "to", "that", "of", "the", "matched", "id", "or", "raise", "an", "ex...
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/power_model/src/main/com/thesett/aima/attribute/impl/HierarchyAttribute.java#L354-L396
test
Sets the value of this attribute to the given value.
Of course, here is the Java code you requested: ```java public void setId(long id) throws IllegalArgumentException { // Find the category for this hierarchy attribute value. Tree<CategoryNode> category = attributeClass.lookup.get(value); // Extract the id. long existingId = categor...
rackerlabs/blueflood
blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DAbstractMetricIO.java
DAbstractMetricIO.getRollupsForLocator
protected <T extends Object> Table<Locator, Long, T> getRollupsForLocator(final Locator locator, String columnFamily, Range range) { return getValuesForLoca...
java
protected <T extends Object> Table<Locator, Long, T> getRollupsForLocator(final Locator locator, String columnFamily, Range range) { return getValuesForLoca...
[ "protected", "<", "T", "extends", "Object", ">", "Table", "<", "Locator", ",", "Long", ",", "T", ">", "getRollupsForLocator", "(", "final", "Locator", "locator", ",", "String", "columnFamily", ",", "Range", "range", ")", "{", "return", "getValuesForLocators", ...
Fetch rollup objects for a {@link com.rackspacecloud.blueflood.types.Locator} from the specified column family and range. @param locator @param columnFamily @param range @return
[ "Fetch", "rollup", "objects", "for", "a", "{", "@link", "com", ".", "rackspacecloud", ".", "blueflood", ".", "types", ".", "Locator", "}", "from", "the", "specified", "column", "family", "and", "range", "." ]
4722a3449b1a7f8e88889ea8c340c6f24396b5b0
https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DAbstractMetricIO.java#L112-L118
test
Gets the rollups table for a single locator.
Of course, here is the Java code you requested: ```java protected <T extends Object> Table<Locator, Long, T> getRollupsForLocator(final Locator locator, String columnFamily, ...
oblac/jodd
jodd-madvoc/src/main/java/jodd/madvoc/component/ResultMapper.java
ResultMapper.resolveResultPath
public ResultPath resolveResultPath(String path, String value) { boolean absolutePath = false; if (value != null) { // [*] resolve alias in value value = resolveAlias(value); // [*] absolute paths if (StringUtil.startsWithChar(value, '/')) { absolutePath = true; int dotNdx = value.indexOf(".....
java
public ResultPath resolveResultPath(String path, String value) { boolean absolutePath = false; if (value != null) { // [*] resolve alias in value value = resolveAlias(value); // [*] absolute paths if (StringUtil.startsWithChar(value, '/')) { absolutePath = true; int dotNdx = value.indexOf(".....
[ "public", "ResultPath", "resolveResultPath", "(", "String", "path", ",", "String", "value", ")", "{", "boolean", "absolutePath", "=", "false", ";", "if", "(", "value", "!=", "null", ")", "{", "// [*] resolve alias in value", "value", "=", "resolveAlias", "(", ...
Resolves result path.
[ "Resolves", "result", "path", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/ResultMapper.java#L125-L193
test
Resolves the result path.
Of course, here is the Java code you requested: ```java public ResultPath resolveResultPath(String path, String value) { boolean absolutePath = false; if (value != null) { // [*] resolve alias in value value = resolveAlias(value); // [*] absolute paths if (StringUtil.startsWithChar(value, '/')) { ...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/op/DatasetViewer.java
DatasetViewer.dataTable
private void dataTable(BeanTable from) { VariableBean vb = (VariableBean) from.getSelectedBean(); if (vb == null) return; Variable v = vb.vs; if (v instanceof Structure) { try { dataTable.setStructure((Structure)v); } catch (Exception ex) { ex.printStackTrace()...
java
private void dataTable(BeanTable from) { VariableBean vb = (VariableBean) from.getSelectedBean(); if (vb == null) return; Variable v = vb.vs; if (v instanceof Structure) { try { dataTable.setStructure((Structure)v); } catch (Exception ex) { ex.printStackTrace()...
[ "private", "void", "dataTable", "(", "BeanTable", "from", ")", "{", "VariableBean", "vb", "=", "(", "VariableBean", ")", "from", ".", "getSelectedBean", "(", ")", ";", "if", "(", "vb", "==", "null", ")", "return", ";", "Variable", "v", "=", "vb", ".", ...
/* private void showMissingData(BeanTable from) { VariableBean vb = (VariableBean) from.getSelectedBean(); if (vb == null) return; Variable v = vb.vs; if ((v != null) && (v.getDataType() == ucar.nc2.DataType.STRUCTURE)) { showMissingStructureData( (Structure) v); } if (!vb.vs.hasMissing()) return; int count = 0, total...
[ "/", "*", "private", "void", "showMissingData", "(", "BeanTable", "from", ")", "{", "VariableBean", "vb", "=", "(", "VariableBean", ")", "from", ".", "getSelectedBean", "()", ";", "if", "(", "vb", "==", "null", ")", "return", ";", "Variable", "v", "=", ...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/op/DatasetViewer.java#L716-L751
test
Create the data table.
Of course, here is the Java code you requested: ```java private void dataTable(BeanTable from) { VariableBean vb = (VariableBean) from.getSelectedBean(); if (vb == null) return; Variable v = vb.vs; if (v instanceof Structure) { try { dataTable.setStructure((Structure)v); } ...
tiefaces/TieFaces
src/org/tiefaces/components/websheet/utility/ShiftFormulaUtility.java
ShiftFormulaUtility.fixupRefRelativeRowOneToOne
protected static Object fixupRefRelativeRowOneToOne(final Object ptg, final Row newRow) { if (ptg instanceof RefPtgBase) { if (ptg instanceof Ref3DPxg) { Ref3DPxg ref3dPxg = (Ref3DPxg) ptg; Ref3DPxg new3dpxg = new Ref3DPxg( ref3dPxg.getExternalWorkbookNumber(), new SheetIdentifier(nul...
java
protected static Object fixupRefRelativeRowOneToOne(final Object ptg, final Row newRow) { if (ptg instanceof RefPtgBase) { if (ptg instanceof Ref3DPxg) { Ref3DPxg ref3dPxg = (Ref3DPxg) ptg; Ref3DPxg new3dpxg = new Ref3DPxg( ref3dPxg.getExternalWorkbookNumber(), new SheetIdentifier(nul...
[ "protected", "static", "Object", "fixupRefRelativeRowOneToOne", "(", "final", "Object", "ptg", ",", "final", "Row", "newRow", ")", "{", "if", "(", "ptg", "instanceof", "RefPtgBase", ")", "{", "if", "(", "ptg", "instanceof", "Ref3DPxg", ")", "{", "Ref3DPxg", ...
Fixup ref relative row one to one. @param ptg the ptg @param newRow the new row @return the object
[ "Fixup", "ref", "relative", "row", "one", "to", "one", "." ]
3b57b9701ed0f080b5fa4fa78269cc0c422b34ba
https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/utility/ShiftFormulaUtility.java#L278-L338
test
Fixup the refRelativeRowOneToOne relation.
Of course, here is the Java code you requested: ```java protected static Object fixupRefRelativeRowOneToOne(final Object ptg, final Row newRow) { if (ptg instanceof RefPtgBase) { if (ptg instanceof Ref3DPxg) { Ref3DPxg ref3dPxg = (Ref3DPxg) ptg; Ref3DPxg new3dpxg = new Ref3DPxg( ref3dPxg.ge...
AndrewReitz/shillelagh
shillelagh-processor/src/main/java/shillelagh/internal/TableObject.java
TableObject.brewJava
void brewJava(Writer writer) throws IOException { logger.d("brewJava"); JavaWriter javaWriter = new JavaWriter(writer); javaWriter.setCompressingTypes(false); javaWriter.emitSingleLineComment("Generated code from Shillelagh. Do not modify!") // .emitPackage(classPackage) // /* Knows not...
java
void brewJava(Writer writer) throws IOException { logger.d("brewJava"); JavaWriter javaWriter = new JavaWriter(writer); javaWriter.setCompressingTypes(false); javaWriter.emitSingleLineComment("Generated code from Shillelagh. Do not modify!") // .emitPackage(classPackage) // /* Knows not...
[ "void", "brewJava", "(", "Writer", "writer", ")", "throws", "IOException", "{", "logger", ".", "d", "(", "\"brewJava\"", ")", ";", "JavaWriter", "javaWriter", "=", "new", "JavaWriter", "(", "writer", ")", ";", "javaWriter", ".", "setCompressingTypes", "(", "...
Create the java functions required for the internal class
[ "Create", "the", "java", "functions", "required", "for", "the", "internal", "class" ]
d016971487bf8993686eb7d03146110f658e0f18
https://github.com/AndrewReitz/shillelagh/blob/d016971487bf8993686eb7d03146110f658e0f18/shillelagh-processor/src/main/java/shillelagh/internal/TableObject.java#L154-L186
test
Brew Java code.
Of course, here is the Java code you requested: ```java void brewJava(Writer writer) throws IOException { logger.d("brewJava"); JavaWriter javaWriter = new JavaWriter(writer); javaWriter.setCompressingTypes(false); javaWriter.emitSingleLineComment("Generated code from Shillelagh. Do not modify!") // ...
Unidata/thredds
legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java
NetcdfFileWriteable.addVariableAttribute
public void addVariableAttribute(String varName, String attName, Array value) { Attribute att = new Attribute(attName, value); addVariableAttribute(varName, att); }
java
public void addVariableAttribute(String varName, String attName, Array value) { Attribute att = new Attribute(attName, value); addVariableAttribute(varName, att); }
[ "public", "void", "addVariableAttribute", "(", "String", "varName", ",", "String", "attName", ",", "Array", "value", ")", "{", "Attribute", "att", "=", "new", "Attribute", "(", "attName", ",", "value", ")", ";", "addVariableAttribute", "(", "varName", ",", "...
Add an attribute of type Array to the named Variable. Must be in define mode. @param varName name of variable. IllegalArgumentException if not valid name. @param attName name of attribute. @param value Array of valkues
[ "Add", "an", "attribute", "of", "type", "Array", "to", "the", "named", "Variable", ".", "Must", "be", "in", "define", "mode", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/ucar/nc2/NetcdfFileWriteable.java#L527-L530
test
Add a variable attribute to the CID .
Of course, here is the Java code you requested: ```java public void addVariableAttribute(String varName, String attName, Array value) { Attribute att = new Attribute(attName, value); addVariableAttribute(varName, att); } ``` Hope this helps!
oblac/jodd
jodd-joy/src/main/java/jodd/joy/page/DbPager.java
DbPager.removeToFrom
protected String removeToFrom(String sql) { int from = 0; int fromCount = 1; int selectCount = 0; int lastNdx = 0; while (true) { int ndx = StringUtil.indexOfIgnoreCase(sql, "from", from); if (ndx == -1) { break; } // count selects in left part String left = sql.substring(lastNdx, ndx); ...
java
protected String removeToFrom(String sql) { int from = 0; int fromCount = 1; int selectCount = 0; int lastNdx = 0; while (true) { int ndx = StringUtil.indexOfIgnoreCase(sql, "from", from); if (ndx == -1) { break; } // count selects in left part String left = sql.substring(lastNdx, ndx); ...
[ "protected", "String", "removeToFrom", "(", "String", "sql", ")", "{", "int", "from", "=", "0", ";", "int", "fromCount", "=", "1", ";", "int", "selectCount", "=", "0", ";", "int", "lastNdx", "=", "0", ";", "while", "(", "true", ")", "{", "int", "nd...
Removes the first part of the sql up to the relevant 'from'. Tries to detect sub-queries in the 'select' part.
[ "Removes", "the", "first", "part", "of", "the", "sql", "up", "to", "the", "relevant", "from", ".", "Tries", "to", "detect", "sub", "-", "queries", "in", "the", "select", "part", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-joy/src/main/java/jodd/joy/page/DbPager.java#L183-L209
test
remove from from
Of course, here is the Java code you requested: ```java protected String removeToFrom(String sql) { int from = 0; int fromCount = 1; int selectCount = 0; int lastNdx = 0; while (true) { int ndx = StringUtil.indexOfIgnoreCase(sql, "from", from); if (ndx == -1) { break; } // count selects in l...
Unidata/thredds
ui/src/main/java/ucar/nc2/ui/util/Resource.java
Resource.getImage
public static Image getImage( String fullImageName) { Image image = null; java.net.URL url = cl.getResource(fullImageName); if (url != null) image = Toolkit.getDefaultToolkit().createImage(url); if (image == null) System.out.println(" ERROR: Resource.getImageResource failed on "+fullImageName); ...
java
public static Image getImage( String fullImageName) { Image image = null; java.net.URL url = cl.getResource(fullImageName); if (url != null) image = Toolkit.getDefaultToolkit().createImage(url); if (image == null) System.out.println(" ERROR: Resource.getImageResource failed on "+fullImageName); ...
[ "public", "static", "Image", "getImage", "(", "String", "fullImageName", ")", "{", "Image", "image", "=", "null", ";", "java", ".", "net", ".", "URL", "url", "=", "cl", ".", "getResource", "(", "fullImageName", ")", ";", "if", "(", "url", "!=", "null",...
Get a gif file, make it into an Image. @param fullImageName full path name of gif file (use forward slashes!) @return Image or null on failure
[ "Get", "a", "gif", "file", "make", "it", "into", "an", "Image", "." ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/util/Resource.java#L58-L65
test
Get an image from a resource name
Of course, here is the Java code you requested: ```java public static Image getImage( String fullImageName) { Image image = null; java.net.URL url = cl.getResource(fullImageName); if (url != null) image = Toolkit.getDefaultToolkit().createImage(url); if (image == null) System.out.println(" ERROR...
real-logic/aeron
aeron-cluster/src/main/java/io/aeron/cluster/ClusterMember.java
ClusterMember.reset
public void reset() { isBallotSent = false; isLeader = false; hasRequestedJoin = false; hasSentTerminationAck = false; vote = null; candidateTermId = Aeron.NULL_VALUE; leadershipTermId = Aeron.NULL_VALUE; logPosition = NULL_POSITION; }
java
public void reset() { isBallotSent = false; isLeader = false; hasRequestedJoin = false; hasSentTerminationAck = false; vote = null; candidateTermId = Aeron.NULL_VALUE; leadershipTermId = Aeron.NULL_VALUE; logPosition = NULL_POSITION; }
[ "public", "void", "reset", "(", ")", "{", "isBallotSent", "=", "false", ";", "isLeader", "=", "false", ";", "hasRequestedJoin", "=", "false", ";", "hasSentTerminationAck", "=", "false", ";", "vote", "=", "null", ";", "candidateTermId", "=", "Aeron", ".", "...
Reset the state of a cluster member so it can be canvassed and reestablished.
[ "Reset", "the", "state", "of", "a", "cluster", "member", "so", "it", "can", "be", "canvassed", "and", "reestablished", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-cluster/src/main/java/io/aeron/cluster/ClusterMember.java#L90-L100
test
Resets the internal state of the CRAsCTYPE.
Of course, here is the Java code you requested: ```java public void reset() { isBallotSent = false; isLeader = false; hasRequestedJoin = false; hasSentTerminationAck = false; vote = null; candidateTermId = Aeron.NULL_VALUE; leadershipTermId = Aeron.NULL_VALUE...
ReactiveX/RxJava
src/main/java/io/reactivex/Single.java
Single.timeout
@CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Single<T> timeout(long timeout, TimeUnit unit) { return timeout0(timeout, unit, Schedulers.computation(), null); }
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Single<T> timeout(long timeout, TimeUnit unit) { return timeout0(timeout, unit, Schedulers.computation(), null); }
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "COMPUTATION", ")", "public", "final", "Single", "<", "T", ">", "timeout", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "{", "return", "timeout0", "(", "timeout", ",", "...
Signals a TimeoutException if the current Single doesn't signal a success value within the specified timeout window. <dl> <dt><b>Scheduler:</b></dt> <dd>{@code timeout} signals the TimeoutException on the {@code computation} {@link Scheduler}.</dd> </dl> @param timeout the timeout amount @param unit the time unit @retu...
[ "Signals", "a", "TimeoutException", "if", "the", "current", "Single", "doesn", "t", "signal", "a", "success", "value", "within", "the", "specified", "timeout", "window", ".", "<dl", ">", "<dt", ">", "<b", ">", "Scheduler", ":", "<", "/", "b", ">", "<", ...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L3773-L3777
test
Timeout for a single entity.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.COMPUTATION) public final Single<T> timeout(long timeout, TimeUnit unit) { return timeout0(timeout, unit, Schedulers.computation(), null); } ``` Hope this helps!
fabric8io/fabric8-maven-plugin
core/src/main/java/io/fabric8/maven/core/util/MavenUtil.java
MavenUtil.getPlugin
public static Plugin getPlugin(MavenProject project, String groupId, String artifactId) { if (artifactId == null) { throw new IllegalArgumentException("artifactId cannot be null"); } List<Plugin> plugins = project.getBuildPlugins(); if (plugins != null) { for (Pl...
java
public static Plugin getPlugin(MavenProject project, String groupId, String artifactId) { if (artifactId == null) { throw new IllegalArgumentException("artifactId cannot be null"); } List<Plugin> plugins = project.getBuildPlugins(); if (plugins != null) { for (Pl...
[ "public", "static", "Plugin", "getPlugin", "(", "MavenProject", "project", ",", "String", "groupId", ",", "String", "artifactId", ")", "{", "if", "(", "artifactId", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"artifactId cannot be nu...
Returns the plugin with the given groupId (if present) and artifactId.
[ "Returns", "the", "plugin", "with", "the", "given", "groupId", "(", "if", "present", ")", "and", "artifactId", "." ]
b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3
https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/core/src/main/java/io/fabric8/maven/core/util/MavenUtil.java#L174-L191
test
Get the plugin from the project.
Of course, here is the Java code you requested: ```java public static Plugin getPlugin(MavenProject project, String groupId, String artifactId) { if (artifactId == null) { throw new IllegalArgumentException("artifactId cannot be null"); } List<Plugin> plugins = project.getBuildPlug...
rupertlssmith/lojix
lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMBaseMachine.java
WAMBaseMachine.setCodeAddress
protected WAMCallPoint setCodeAddress(int functorName, int offset, int length) { WAMCallPoint entry = new WAMCallPoint(offset, length, functorName); symbolTable.put(functorName, SYMKEY_CALLPOINTS, entry); // Keep a reverse lookup from address to functor name. reverseTable.put(offset...
java
protected WAMCallPoint setCodeAddress(int functorName, int offset, int length) { WAMCallPoint entry = new WAMCallPoint(offset, length, functorName); symbolTable.put(functorName, SYMKEY_CALLPOINTS, entry); // Keep a reverse lookup from address to functor name. reverseTable.put(offset...
[ "protected", "WAMCallPoint", "setCodeAddress", "(", "int", "functorName", ",", "int", "offset", ",", "int", "length", ")", "{", "WAMCallPoint", "entry", "=", "new", "WAMCallPoint", "(", "offset", ",", "length", ",", "functorName", ")", ";", "symbolTable", ".",...
Records the offset of the start of the code for the named functor. @param functorName The interned name of the functor to find the start address of the code for. @param offset The offset of the start of the functors code within the code area. @param length The size of the code to set the address for. @re...
[ "Records", "the", "offset", "of", "the", "start", "of", "the", "code", "for", "the", "named", "functor", "." ]
ad494dc8bce2345567de7689d42291d4b30fbd51
https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMBaseMachine.java#L173-L182
test
This method is called to set the code address of a resource entry.
Of course, here is the Java code you requested: ```java protected WAMCallPoint setCodeAddress(int functorName, int offset, int length) { WAMCallPoint entry = new WAMCallPoint(offset, length, functorName); symbolTable.put(functorName, SYMKEY_CALLPOINTS, entry); // Keep a reverse lookup from...
spring-projects/spring-security
web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedAuthenticationProvider.java
PreAuthenticatedAuthenticationProvider.authenticate
public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (!supports(authentication.getClass())) { return null; } if (logger.isDebugEnabled()) { logger.debug("PreAuthenticated authentication request: " + authentication); } if (authentication.getPrincipal(...
java
public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (!supports(authentication.getClass())) { return null; } if (logger.isDebugEnabled()) { logger.debug("PreAuthenticated authentication request: " + authentication); } if (authentication.getPrincipal(...
[ "public", "Authentication", "authenticate", "(", "Authentication", "authentication", ")", "throws", "AuthenticationException", "{", "if", "(", "!", "supports", "(", "authentication", ".", "getClass", "(", ")", ")", ")", "{", "return", "null", ";", "}", "if", "...
Authenticate the given PreAuthenticatedAuthenticationToken. <p> If the principal contained in the authentication object is null, the request will be ignored to allow other providers to authenticate it.
[ "Authenticate", "the", "given", "PreAuthenticatedAuthenticationToken", ".", "<p", ">", "If", "the", "principal", "contained", "in", "the", "authentication", "object", "is", "null", "the", "request", "will", "be", "ignored", "to", "allow", "other", "providers", "to...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/preauth/PreAuthenticatedAuthenticationProvider.java#L72-L112
test
Authenticate the given authentication.
Of course, here is the Java code you requested: ```java public Authentication authenticate(Authentication authentication) throws AuthenticationException { if (!supports(authentication.getClass())) { return null; } if (logger.isDebugEnabled()) { logger.debug("PreAuthenticated authentication request: " +...
Unidata/thredds
visad/src/main/java/ucar/nc2/iosp/mcidas/McIDASLookup.java
McIDASLookup.isLayer
public boolean isLayer(GridRecord gr) { if (cust != null) { return cust.isLayer( gr.getLevelType1()); } if (gr.getLevel2() == 0) { return false; } return true; }
java
public boolean isLayer(GridRecord gr) { if (cust != null) { return cust.isLayer( gr.getLevelType1()); } if (gr.getLevel2() == 0) { return false; } return true; }
[ "public", "boolean", "isLayer", "(", "GridRecord", "gr", ")", "{", "if", "(", "cust", "!=", "null", ")", "{", "return", "cust", ".", "isLayer", "(", "gr", ".", "getLevelType1", "(", ")", ")", ";", "}", "if", "(", "gr", ".", "getLevel2", "(", ")", ...
Is this a layer? @param gr record to check @return true if a layer
[ "Is", "this", "a", "layer?" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/mcidas/McIDASLookup.java#L259-L268
test
Checks if the given grid record is a layer.
Of course, here is the Java code you requested: ```java public boolean isLayer(GridRecord gr) { if (cust != null) { return cust.isLayer( gr.getLevelType1()); } if (gr.getLevel2() == 0) { return false; } return true; } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java
Transforms.max
public static INDArray max(INDArray first, INDArray second, boolean dup) { if (dup) { first = first.dup(); } return exec(new OldMax(second, first, first, first.length())); }
java
public static INDArray max(INDArray first, INDArray second, boolean dup) { if (dup) { first = first.dup(); } return exec(new OldMax(second, first, first, first.length())); }
[ "public", "static", "INDArray", "max", "(", "INDArray", "first", ",", "INDArray", "second", ",", "boolean", "dup", ")", "{", "if", "(", "dup", ")", "{", "first", "=", "first", ".", "dup", "(", ")", ";", "}", "return", "exec", "(", "new", "OldMax", ...
Element wise maximum function between 2 INDArrays @param first @param second @param dup @return
[ "Element", "wise", "maximum", "function", "between", "2", "INDArrays" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/ops/transforms/Transforms.java#L815-L820
test
Max function implementation
Of course, here is the Java code you requested: ```java public static INDArray max(INDArray first, INDArray second, boolean dup) { if (dup) { first = first.dup(); } return exec(new OldMax(second, first, first, first.length())); } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/http/client/HttpConnection.java
HttpConnection.getResponseHeaderFieldName
public String getResponseHeaderFieldName(int position) throws IOException { Assert.isTrue(position >= 0); sendRequest(); return responseHeader.getFieldName(position); }
java
public String getResponseHeaderFieldName(int position) throws IOException { Assert.isTrue(position >= 0); sendRequest(); return responseHeader.getFieldName(position); }
[ "public", "String", "getResponseHeaderFieldName", "(", "int", "position", ")", "throws", "IOException", "{", "Assert", ".", "isTrue", "(", "position", ">=", "0", ")", ";", "sendRequest", "(", ")", ";", "return", "responseHeader", ".", "getFieldName", "(", "pos...
Returns the response header field name at the given position, or <code>null</code> if there is no field name at that position. @param position a position in the response header greater than or equal to zero @return the response header field name at the given postion @exception IOException if an I/O error occurs while ...
[ "Returns", "the", "response", "header", "field", "name", "at", "the", "given", "position", "or", "<code", ">", "null<", "/", "code", ">", "if", "there", "is", "no", "field", "name", "at", "that", "position", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/http/client/HttpConnection.java#L852-L856
test
Gets the value of the response header field name.
Of course, here is the Java code you requested: ```java public String getResponseHeaderFieldName(int position) throws IOException { Assert.isTrue(position >= 0); sendRequest(); return responseHeader.getFieldName(position); } ``` Hope this helps!
orientechnologies/orientdb
server/src/main/java/com/orientechnologies/orient/server/network/OServerNetworkListener.java
OServerNetworkListener.readParameters
private void readParameters(final OContextConfiguration iServerConfig, final OServerParameterConfiguration[] iParameters) { configuration = new OContextConfiguration(iServerConfig); // SET PARAMETERS if (iParameters != null && iParameters.length > 0) { // CONVERT PARAMETERS IN MAP TO INTIALIZE T...
java
private void readParameters(final OContextConfiguration iServerConfig, final OServerParameterConfiguration[] iParameters) { configuration = new OContextConfiguration(iServerConfig); // SET PARAMETERS if (iParameters != null && iParameters.length > 0) { // CONVERT PARAMETERS IN MAP TO INTIALIZE T...
[ "private", "void", "readParameters", "(", "final", "OContextConfiguration", "iServerConfig", ",", "final", "OServerParameterConfiguration", "[", "]", "iParameters", ")", "{", "configuration", "=", "new", "OContextConfiguration", "(", "iServerConfig", ")", ";", "// SET P...
Initializes connection parameters by the reading XML configuration. If not specified, get the parameters defined as global configuration. @param iServerConfig
[ "Initializes", "connection", "parameters", "by", "the", "reading", "XML", "configuration", ".", "If", "not", "specified", "get", "the", "parameters", "defined", "as", "global", "configuration", "." ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/network/OServerNetworkListener.java#L368-L379
test
Read the parameters from the server configuration.
Of course, here is the Java code you requested: ```java private void readParameters(final OContextConfiguration iServerConfig, final OServerParameterConfiguration[] iParameters) { configuration = new OContextConfiguration(iServerConfig); // SET PARAMETERS if (iParameters != null && iParameters.length ...
eclipse/packagedrone
bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/ServletWriter.java
ServletWriter.printin
public void printin(String s) { writer.print(SPACES.substring(0, indent)); writer.print(s); }
java
public void printin(String s) { writer.print(SPACES.substring(0, indent)); writer.print(s); }
[ "public", "void", "printin", "(", "String", "s", ")", "{", "writer", ".", "print", "(", "SPACES", ".", "substring", "(", "0", ",", "indent", ")", ")", ";", "writer", ".", "print", "(", "s", ")", ";", "}" ]
Prints the current indention, followed by the given string
[ "Prints", "the", "current", "indention", "followed", "by", "the", "given", "string" ]
3869c1643cdc6f7cb8b26097a7b6994683b13d7e
https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/ServletWriter.java#L161-L164
test
Prints a string in the XML.
Of course, here is the Java code you requested: ```java public void printin(String s) { writer.print(SPACES.substring(0, indent)); writer.print(s); } ``` Hope this helps!
oblac/jodd
jodd-bean/src/main/java/jodd/typeconverter/impl/ByteArrayConverter.java
ByteArrayConverter.convertValueToArray
protected byte[] convertValueToArray(final Object value) { if (value instanceof Blob) { final Blob blob = (Blob) value; try { final long length = blob.length(); if (length > Integer.MAX_VALUE) { throw new TypeConversionException("Blob is too big."); } return blob.getBytes(1, (int) length); ...
java
protected byte[] convertValueToArray(final Object value) { if (value instanceof Blob) { final Blob blob = (Blob) value; try { final long length = blob.length(); if (length > Integer.MAX_VALUE) { throw new TypeConversionException("Blob is too big."); } return blob.getBytes(1, (int) length); ...
[ "protected", "byte", "[", "]", "convertValueToArray", "(", "final", "Object", "value", ")", "{", "if", "(", "value", "instanceof", "Blob", ")", "{", "final", "Blob", "blob", "=", "(", "Blob", ")", "value", ";", "try", "{", "final", "long", "length", "=...
Converts non-array value to array. Detects various types and collections, iterates them to make conversion and to create target array.
[ "Converts", "non", "-", "array", "value", "to", "array", ".", "Detects", "various", "types", "and", "collections", "iterates", "them", "to", "make", "conversion", "and", "to", "create", "target", "array", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/typeconverter/impl/ByteArrayConverter.java#L88-L150
test
Converts the value to a byte array.
Of course, here is the Java code you requested: ```java protected byte[] convertValueToArray(final Object value) { if (value instanceof Blob) { final Blob blob = (Blob) value; try { final long length = blob.length(); if (length > Integer.MAX_VALUE) { throw new TypeConversionException("Blob is too ...
khennig/jpql-querybuilder
src/main/java/com/tri/persistence/jpql/QueryBuilder.java
QueryBuilder.createQuery
public Query createQuery(final EntityManager manager) { if (manager == null) { throw new NullPointerException("Entity Manager required"); } final Query query = manager.createQuery(render()); for (Parameter<?> parameter : parameters) { parameter.apply(query); } return query; }
java
public Query createQuery(final EntityManager manager) { if (manager == null) { throw new NullPointerException("Entity Manager required"); } final Query query = manager.createQuery(render()); for (Parameter<?> parameter : parameters) { parameter.apply(query); } return query; }
[ "public", "Query", "createQuery", "(", "final", "EntityManager", "manager", ")", "{", "if", "(", "manager", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Entity Manager required\"", ")", ";", "}", "final", "Query", "query", "=", "mana...
Returns a JPA Query with all previously specified parameters added. @param manager JPA EntityManager @return JPA Query
[ "Returns", "a", "JPA", "Query", "with", "all", "previously", "specified", "parameters", "added", "." ]
61206f7c42631c67a49603b9beddccf48a8112e8
https://github.com/khennig/jpql-querybuilder/blob/61206f7c42631c67a49603b9beddccf48a8112e8/src/main/java/com/tri/persistence/jpql/QueryBuilder.java#L166-L178
test
Create a query using the specified EntityManager.
Of course, here is the Java code you requested: ```java public Query createQuery(final EntityManager manager) { if (manager == null) { throw new NullPointerException("Entity Manager required"); } final Query query = manager.createQuery(render()); for (Parameter<?> parameter : parameters) { parameter.ap...
intellimate/IzouSDK
src/main/java/org/intellimate/izou/sdk/frameworks/presence/provider/template/PresenceConstant.java
PresenceConstant.updateVague
private void updateVague() { generateResource(PresenceResource.ID) .orElse(CompletableFuture.completedFuture(new ArrayList<>())) .thenAccept(list -> mostVague.set(list.stream() .map(Presence::importPresence) .filter(Optional::isPres...
java
private void updateVague() { generateResource(PresenceResource.ID) .orElse(CompletableFuture.completedFuture(new ArrayList<>())) .thenAccept(list -> mostVague.set(list.stream() .map(Presence::importPresence) .filter(Optional::isPres...
[ "private", "void", "updateVague", "(", ")", "{", "generateResource", "(", "PresenceResource", ".", "ID", ")", ".", "orElse", "(", "CompletableFuture", ".", "completedFuture", "(", "new", "ArrayList", "<>", "(", ")", ")", ")", ".", "thenAccept", "(", "list", ...
updates the boolean whether it is the mode vague
[ "updates", "the", "boolean", "whether", "it", "is", "the", "mode", "vague" ]
bc8705ad48a6ca12a722f2b787be435949fa5d08
https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/presence/provider/template/PresenceConstant.java#L162-L172
test
Update the Vague.
Of course, here is the Java code you requested: ```java private void updateVague() { generateResource(PresenceResource.ID) .orElse(CompletableFuture.completedFuture(new ArrayList<>())) .thenAccept(list -> mostVague.set(list.stream() .map(Presence::importPrese...
boonproject/boon
boon/src/main/java/org/boon/Str.java
Str.splitByPipe
public static String[] splitByPipe( String str ) { char[][] split = CharScanner.splitByPipe( FastStringUtils.toCharArray(str) ); return fromCharArrayOfArrayToStringArray( split ); }
java
public static String[] splitByPipe( String str ) { char[][] split = CharScanner.splitByPipe( FastStringUtils.toCharArray(str) ); return fromCharArrayOfArrayToStringArray( split ); }
[ "public", "static", "String", "[", "]", "splitByPipe", "(", "String", "str", ")", "{", "char", "[", "]", "[", "]", "split", "=", "CharScanner", ".", "splitByPipe", "(", "FastStringUtils", ".", "toCharArray", "(", "str", ")", ")", ";", "return", "fromChar...
Split a string by pipe @param str string to split @return string array
[ "Split", "a", "string", "by", "pipe" ]
9bc6870dbe5dd58c45c18d8edb493e8efc089463
https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/Str.java#L431-L434
test
Split by pipes.
Of course, here is the Java code you requested: ```java public static String[] splitByPipe( String str ) { char[][] split = CharScanner.splitByPipe( FastStringUtils.toCharArray(str) ); return fromCharArrayOfArrayToStringArray( split ); } ``` Hope this helps!
wildfly/wildfly
ee/src/main/java/org/jboss/as/ee/component/ViewConfiguration.java
ViewConfiguration.getClientInterceptors
public List<InterceptorFactory> getClientInterceptors(Method method) { OrderedItemContainer<InterceptorFactory> container = clientInterceptors.get(method); if (container == null) { return Collections.emptyList(); } return container.getSortedItems(); }
java
public List<InterceptorFactory> getClientInterceptors(Method method) { OrderedItemContainer<InterceptorFactory> container = clientInterceptors.get(method); if (container == null) { return Collections.emptyList(); } return container.getSortedItems(); }
[ "public", "List", "<", "InterceptorFactory", ">", "getClientInterceptors", "(", "Method", "method", ")", "{", "OrderedItemContainer", "<", "InterceptorFactory", ">", "container", "=", "clientInterceptors", ".", "get", "(", "method", ")", ";", "if", "(", "container...
Get the client interceptors for a method. These interceptors are run sequentially on the "client side" of an invocation. The interceptor factories are used every time a new client proxy instance is constructed, called with a new factory context each time. The factory may return the same interceptor instance or a new...
[ "Get", "the", "client", "interceptors", "for", "a", "method", ".", "These", "interceptors", "are", "run", "sequentially", "on", "the", "client", "side", "of", "an", "invocation", ".", "The", "interceptor", "factories", "are", "used", "every", "time", "a", "n...
64896f1500fe465ad83d96ede9fa19d0c3747f18
https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/ViewConfiguration.java#L148-L154
test
Gets the client interceptors for a given method.
Of course, here is the Java code you requested: ```java public List<InterceptorFactory> getClientInterceptors(Method method) { OrderedItemContainer<InterceptorFactory> container = clientInterceptors.get(method); if (container == null) { return Collections.emptyList(); } retu...
orientechnologies/orientdb
core/src/main/java/com/orientechnologies/common/serialization/types/OBinaryTypeSerializer.java
OBinaryTypeSerializer.deserializeFromByteBufferObject
@Override public byte[] deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) { final int len = walChanges.getIntValue(buffer, offset); offset += OIntegerSerializer.INT_SIZE; return walChanges.getBinaryValue(buffer, offset, len); }
java
@Override public byte[] deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) { final int len = walChanges.getIntValue(buffer, offset); offset += OIntegerSerializer.INT_SIZE; return walChanges.getBinaryValue(buffer, offset, len); }
[ "@", "Override", "public", "byte", "[", "]", "deserializeFromByteBufferObject", "(", "ByteBuffer", "buffer", ",", "OWALChanges", "walChanges", ",", "int", "offset", ")", "{", "final", "int", "len", "=", "walChanges", ".", "getIntValue", "(", "buffer", ",", "of...
{@inheritDoc}
[ "{" ]
d970b12033f0462f0239ea0ad8ed41207e6e26f1
https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/common/serialization/types/OBinaryTypeSerializer.java#L131-L136
test
Deserialize from byte buffer object.
Of course, here is the Java code you requested: ```java @Override public byte[] deserializeFromByteBufferObject(ByteBuffer buffer, OWALChanges walChanges, int offset) { final int len = walChanges.getIntValue(buffer, offset); offset += OIntegerSerializer.INT_SIZE; return walChanges.getBinaryValue(buffer, ...
OpenEstate/OpenEstate-IO
IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java
ObjectFactory.createVermarktungGrundstueckWohnenMieteTypMiete
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Miete", scope = VermarktungGrundstueckWohnenMieteTyp.class) public JAXBElement<VermarktungGrundstueckWohnenMieteTyp.Miete> createVermarktungGrundstueckWohnenMieteTypMiete(VermarktungGrundstueckWohnenMieteTyp.Miete value) { ...
java
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Miete", scope = VermarktungGrundstueckWohnenMieteTyp.class) public JAXBElement<VermarktungGrundstueckWohnenMieteTyp.Miete> createVermarktungGrundstueckWohnenMieteTypMiete(VermarktungGrundstueckWohnenMieteTyp.Miete value) { ...
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.immobilienscout24.de/immobilientransfer\"", ",", "name", "=", "\"Miete\"", ",", "scope", "=", "VermarktungGrundstueckWohnenMieteTyp", ".", "class", ")", "public", "JAXBElement", "<", "VermarktungGrundstueckWohnenMiet...
Create an instance of {@link JAXBElement }{@code <}{@link VermarktungGrundstueckWohnenMieteTyp.Miete }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "VermarktungGrundstueckWohnenMieteTyp", ".", "Miete", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java#L1296-L1299
test
Create an instance of a VermarktungGrundstueckWohnenMieteTyp.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Miete", scope = VermarktungGrundstueckWohnenMieteTyp.class) public JAXBElement<VermarktungGrundstueckWohnenMieteTyp.Miete> createVermarktungGrundstueckWohnenMieteTypMiet...
oblac/jodd
jodd-petite/src/main/java/jodd/petite/resolver/SetResolver.java
SetResolver.resolve
public SetInjectionPoint[] resolve(final Class type, final boolean autowire) { ClassDescriptor cd = ClassIntrospector.get().lookup(type); List<SetInjectionPoint> list = new ArrayList<>(); PropertyDescriptor[] allProperties = cd.getAllPropertyDescriptors(); for (PropertyDescriptor propertyDescriptor : allPrope...
java
public SetInjectionPoint[] resolve(final Class type, final boolean autowire) { ClassDescriptor cd = ClassIntrospector.get().lookup(type); List<SetInjectionPoint> list = new ArrayList<>(); PropertyDescriptor[] allProperties = cd.getAllPropertyDescriptors(); for (PropertyDescriptor propertyDescriptor : allPrope...
[ "public", "SetInjectionPoint", "[", "]", "resolve", "(", "final", "Class", "type", ",", "final", "boolean", "autowire", ")", "{", "ClassDescriptor", "cd", "=", "ClassIntrospector", ".", "get", "(", ")", ".", "lookup", "(", "type", ")", ";", "List", "<", ...
Resolves all collections for given type.
[ "Resolves", "all", "collections", "for", "given", "type", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/resolver/SetResolver.java#L49-L93
test
Resolves the given type to a set of InjectionPoints.
Of course, here is the Java code you requested: ```java public SetInjectionPoint[] resolve(final Class type, final boolean autowire) { ClassDescriptor cd = ClassIntrospector.get().lookup(type); List<SetInjectionPoint> list = new ArrayList<>(); PropertyDescriptor[] allProperties = cd.getAllPropertyDescriptors();...
ieb/sparsemapcontent
core/src/main/java/org/sakaiproject/nakamura/api/lite/StorageClientUtils.java
StorageClientUtils.deleteTree
public static void deleteTree(ContentManager contentManager, String path) throws AccessDeniedException, StorageClientException { Content content = contentManager.get(path); if (content != null) { for (String childPath : content.listChildPaths()) { deleteTree(conte...
java
public static void deleteTree(ContentManager contentManager, String path) throws AccessDeniedException, StorageClientException { Content content = contentManager.get(path); if (content != null) { for (String childPath : content.listChildPaths()) { deleteTree(conte...
[ "public", "static", "void", "deleteTree", "(", "ContentManager", "contentManager", ",", "String", "path", ")", "throws", "AccessDeniedException", ",", "StorageClientException", "{", "Content", "content", "=", "contentManager", ".", "get", "(", "path", ")", ";", "i...
Delete an entire tree starting from the deepest part of the tree and working back up. Will stop the moment a permission denied is encountered either for read or for delete. @param contentManager @param path @throws AccessDeniedException @throws StorageClientException
[ "Delete", "an", "entire", "tree", "starting", "from", "the", "deepest", "part", "of", "the", "tree", "and", "working", "back", "up", ".", "Will", "stop", "the", "moment", "a", "permission", "denied", "is", "encountered", "either", "for", "read", "or", "for...
0570fdf868adbbf7734790cbc09fe66480e5f2dc
https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/core/src/main/java/org/sakaiproject/nakamura/api/lite/StorageClientUtils.java#L561-L570
test
Delete a tree of content.
Of course, here is the Java code you requested: ```java public static void deleteTree(ContentManager contentManager, String path) throws AccessDeniedException, StorageClientException { Content content = contentManager.get(path); if (content != null) { for (String childPath : con...
real-logic/aeron
aeron-driver/src/main/java/io/aeron/driver/Configuration.java
Configuration.producerWindowLength
public static int producerWindowLength(final int termBufferLength, final int defaultTermWindowLength) { int termWindowLength = termBufferLength / 2; if (0 != defaultTermWindowLength) { termWindowLength = Math.min(defaultTermWindowLength, termWindowLength); } ret...
java
public static int producerWindowLength(final int termBufferLength, final int defaultTermWindowLength) { int termWindowLength = termBufferLength / 2; if (0 != defaultTermWindowLength) { termWindowLength = Math.min(defaultTermWindowLength, termWindowLength); } ret...
[ "public", "static", "int", "producerWindowLength", "(", "final", "int", "termBufferLength", ",", "final", "int", "defaultTermWindowLength", ")", "{", "int", "termWindowLength", "=", "termBufferLength", "/", "2", ";", "if", "(", "0", "!=", "defaultTermWindowLength", ...
How far ahead a producer can get from a consumer position. @param termBufferLength for when default is not set and considering an appropriate minimum. @param defaultTermWindowLength to take priority. @return the length to be used for the producer window.
[ "How", "far", "ahead", "a", "producer", "can", "get", "from", "a", "consumer", "position", "." ]
045c32f0256d1ea35d562520216affc281a41239
https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-driver/src/main/java/io/aeron/driver/Configuration.java#L740-L750
test
producerWindowLength This method calculates the term window length.
Of course, here is the Java code you requested: ```java public static int producerWindowLength(final int termBufferLength, final int defaultTermWindowLength) { int termWindowLength = termBufferLength / 2; if (0 != defaultTermWindowLength) { termWindowLength = Math.min(defaultTe...
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java
src/main/java/org/teachingkidsprogramming/section07objects/DeepDive07Objects.java
DeepDive07Objects.throwPizzaParty
private Tortoise[] throwPizzaParty() { Tortoise karai = new Tortoise(); Tortoise cecil = new Tortoise(); Tortoise michealangelo = new Tortoise(); Tortoise fred = new Tortoise(); return new Tortoise[]{karai, cecil, michealangelo, fred}; }
java
private Tortoise[] throwPizzaParty() { Tortoise karai = new Tortoise(); Tortoise cecil = new Tortoise(); Tortoise michealangelo = new Tortoise(); Tortoise fred = new Tortoise(); return new Tortoise[]{karai, cecil, michealangelo, fred}; }
[ "private", "Tortoise", "[", "]", "throwPizzaParty", "(", ")", "{", "Tortoise", "karai", "=", "new", "Tortoise", "(", ")", ";", "Tortoise", "cecil", "=", "new", "Tortoise", "(", ")", ";", "Tortoise", "michealangelo", "=", "new", "Tortoise", "(", ")", ";",...
Ignore the following, It's needed to run the deep dive
[ "Ignore", "the", "following", "It", "s", "needed", "to", "run", "the", "deep", "dive" ]
516fee15e537ecdb3f4dcbe3695c5cfde7e930da
https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingkidsprogramming/section07objects/DeepDive07Objects.java#L145-L152
test
Throw a PizzaParty.
Of course, here is the Java code you requested: ```java private Tortoise[] throwPizzaParty() { Tortoise karai = new Tortoise(); Tortoise cecil = new Tortoise(); Tortoise michealangelo = new Tortoise(); Tortoise fred = new Tortoise(); return new Tortoise[]{karai, cecil, michealangelo, fred}; } `...
ReactiveX/RxJava
src/main/java/io/reactivex/Observable.java
Observable.concatMapEagerDelayError
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapEagerDelayError(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int maxConcurrency, int prefetch, boolean tillTheEnd) { ObjectHelper.requireNonNull(mapper, "mapper is null"...
java
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapEagerDelayError(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int maxConcurrency, int prefetch, boolean tillTheEnd) { ObjectHelper.requireNonNull(mapper, "mapper is null"...
[ "@", "CheckReturnValue", "@", "SchedulerSupport", "(", "SchedulerSupport", ".", "NONE", ")", "public", "final", "<", "R", ">", "Observable", "<", "R", ">", "concatMapEagerDelayError", "(", "Function", "<", "?", "super", "T", ",", "?", "extends", "ObservableSou...
Maps a sequence of values into ObservableSources and concatenates these ObservableSources eagerly into a single ObservableSource. <p> Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the source ObservableSources. The operator buffers the values emitted by these ObservableS...
[ "Maps", "a", "sequence", "of", "values", "into", "ObservableSources", "and", "concatenates", "these", "ObservableSources", "eagerly", "into", "a", "single", "ObservableSource", ".", "<p", ">", "Eager", "concatenation", "means", "that", "once", "a", "subscriber", "...
ac84182aa2bd866b53e01c8e3fe99683b882c60e
https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L6653-L6661
test
Creates an observable that is a sequence of items that are concatenated with a single element from the source observable.
Of course, here is the Java code you requested: ```java @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> concatMapEagerDelayError(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int maxConcurrency, int prefetch, boolean tillTheEnd) { ...
Unidata/thredds
dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java
CDMUtil.convertVector
static public Object convertVector(DapType dsttype, DapType srctype, Object src) { int i; TypeSort srcatomtype = srctype.getAtomicType(); TypeSort dstatomtype = dsttype.getAtomicType(); if(srcatomtype == dstatomtype) { return src; } if(srcatomtype.is...
java
static public Object convertVector(DapType dsttype, DapType srctype, Object src) { int i; TypeSort srcatomtype = srctype.getAtomicType(); TypeSort dstatomtype = dsttype.getAtomicType(); if(srcatomtype == dstatomtype) { return src; } if(srcatomtype.is...
[ "static", "public", "Object", "convertVector", "(", "DapType", "dsttype", ",", "DapType", "srctype", ",", "Object", "src", ")", "{", "int", "i", ";", "TypeSort", "srcatomtype", "=", "srctype", ".", "getAtomicType", "(", ")", ";", "TypeSort", "dstatomtype", "...
Convert an array of one type of values to another type @param dsttype target type @param srctype source type @param src array of values to convert @return resulting array of converted values as an object
[ "Convert", "an", "array", "of", "one", "type", "of", "values", "to", "another", "type" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4cdm/src/main/java/dap4/cdm/CDMUtil.java#L394-L413
test
Convert a vector of objects to a single object of type DapType.
Of course, here is the Java code you requested: ```java static public Object convertVector(DapType dsttype, DapType srctype, Object src) { int i; TypeSort srcatomtype = srctype.getAtomicType(); TypeSort dstatomtype = dsttype.getAtomicType(); if(srcatomtype == dstatomtype) { ...
OpenEstate/OpenEstate-IO
OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java
ObjectFactory.createHausgeld
@XmlElementDecl(namespace = "", name = "hausgeld") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createHausgeld(BigDecimal value) { return new JAXBElement<BigDecimal>(_Hausgeld_QNAME, BigDecimal.class, null, value); }
java
@XmlElementDecl(namespace = "", name = "hausgeld") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createHausgeld(BigDecimal value) { return new JAXBElement<BigDecimal>(_Hausgeld_QNAME, BigDecimal.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"\"", ",", "name", "=", "\"hausgeld\"", ")", "@", "XmlJavaTypeAdapter", "(", "Adapter2", ".", "class", ")", "public", "JAXBElement", "<", "BigDecimal", ">", "createHausgeld", "(", "BigDecimal", "value", ")", "{",...
Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "BigDecimal", "}", "{", "@code", ">", "}}" ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L1823-L1827
test
Create an instance of a Hausgeld JAXBElement.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "", name = "hausgeld") @XmlJavaTypeAdapter(Adapter2 .class) public JAXBElement<BigDecimal> createHausgeld(BigDecimal value) { return new JAXBElement<BigDecimal>(_Hausgeld_QNAME, BigDecimal.class, null, value); } ```...
spring-projects/spring-security
acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java
JdbcMutableAclService.createEntries
protected void createEntries(final MutableAcl acl) { if (acl.getEntries().isEmpty()) { return; } jdbcOperations.batchUpdate(insertEntry, new BatchPreparedStatementSetter() { public int getBatchSize() { return acl.getEntries().size(); } public void setValues(PreparedStatement stmt, int i) throws S...
java
protected void createEntries(final MutableAcl acl) { if (acl.getEntries().isEmpty()) { return; } jdbcOperations.batchUpdate(insertEntry, new BatchPreparedStatementSetter() { public int getBatchSize() { return acl.getEntries().size(); } public void setValues(PreparedStatement stmt, int i) throws S...
[ "protected", "void", "createEntries", "(", "final", "MutableAcl", "acl", ")", "{", "if", "(", "acl", ".", "getEntries", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", ";", "}", "jdbcOperations", ".", "batchUpdate", "(", "insertEntry", ",", "new"...
Creates a new row in acl_entry for every ACE defined in the passed MutableAcl object. @param acl containing the ACEs to insert
[ "Creates", "a", "new", "row", "in", "acl_entry", "for", "every", "ACE", "defined", "in", "the", "passed", "MutableAcl", "object", "." ]
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/acl/src/main/java/org/springframework/security/acls/jdbc/JdbcMutableAclService.java#L134-L159
test
Create the entries of the MutableAcl.
Of course, here is the Java code you requested: ```java protected void createEntries(final MutableAcl acl) { if (acl.getEntries().isEmpty()) { return; } jdbcOperations.batchUpdate(insertEntry, new BatchPreparedStatementSetter() { public int getBatchSize() { return acl.getEntries().size(); } publ...
eiichiro/bootleg
src/main/java/org/eiichiro/bootleg/Pipeline.java
Pipeline.set
public Pipeline<T> set(int index, String name, Function<T, T> function) { Preconditions.checkArgument(function != null, "Parameter 'function' must not be [" + function + "]"); stages.add(index, function); names.put(function, name); return this; }
java
public Pipeline<T> set(int index, String name, Function<T, T> function) { Preconditions.checkArgument(function != null, "Parameter 'function' must not be [" + function + "]"); stages.add(index, function); names.put(function, name); return this; }
[ "public", "Pipeline", "<", "T", ">", "set", "(", "int", "index", ",", "String", "name", ",", "Function", "<", "T", ",", "T", ">", "function", ")", "{", "Preconditions", ".", "checkArgument", "(", "function", "!=", "null", ",", "\"Parameter 'function' must ...
Sets the specified {@code Function} to the next processing stage with the specified index and stage name. @param index The index the specified {@code Function} to be set. @param name The stage name. @param function The {@code Function} set to the next processing stage. @return This {@code Pipeline} instance.
[ "Sets", "the", "specified", "{", "@code", "Function", "}", "to", "the", "next", "processing", "stage", "with", "the", "specified", "index", "and", "stage", "name", "." ]
b98a108500597cb6185056be2eef7de5ba1963d2
https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/Pipeline.java#L126-L132
test
Sets a function to be executed on the pipeline.
Of course, here is the Java code you requested: ```java public Pipeline<T> set(int index, String name, Function<T, T> function) { Preconditions.checkArgument(function != null, "Parameter 'function' must not be [" + function + "]"); stages.add(index, function); names.put(function, name); return this; } ``...
RestComm/jain-slee
container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitJarComponentBuilder.java
DeployableUnitJarComponentBuilder.extractFile
private File extractFile(String fileName, JarFile containingJar, File dstDir) throws DeploymentException { ZipEntry zipFileEntry = containingJar.getEntry(fileName); logger.trace("Extracting file " + fileName + " from " + containingJar.getName()); if (zipFileEntry == null) { throw new DeploymentExceptio...
java
private File extractFile(String fileName, JarFile containingJar, File dstDir) throws DeploymentException { ZipEntry zipFileEntry = containingJar.getEntry(fileName); logger.trace("Extracting file " + fileName + " from " + containingJar.getName()); if (zipFileEntry == null) { throw new DeploymentExceptio...
[ "private", "File", "extractFile", "(", "String", "fileName", ",", "JarFile", "containingJar", ",", "File", "dstDir", ")", "throws", "DeploymentException", "{", "ZipEntry", "zipFileEntry", "=", "containingJar", ".", "getEntry", "(", "fileName", ")", ";", "logger", ...
Extracts the file with name <code>fileName</code> out of the <code>containingJar</code> archive and stores it in <code>dstDir</code>. @param fileName the name of the file to extract. @param containingJar the archive where to extract it from. @param dstDir the location where the extracted file should be stored. @return...
[ "Extracts", "the", "file", "with", "name", "<code", ">", "fileName<", "/", "code", ">", "out", "of", "the", "<code", ">", "containingJar<", "/", "code", ">", "archive", "and", "stores", "it", "in", "<code", ">", "dstDir<", "/", "code", ">", "." ]
0eaa16ff2d4b6faf43f0d99260e88878fd54dee0
https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitJarComponentBuilder.java#L360-L384
test
Extract a file from a jar file.
Of course, here is the Java code you requested: ```java private File extractFile(String fileName, JarFile containingJar, File dstDir) throws DeploymentException { ZipEntry zipFileEntry = containingJar.getEntry(fileName); logger.trace("Extracting file " + fileName + " from " + containingJar.getName()); if...