method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void testInnerClassExtracted() { List<AbstractTypeDeclaration> types = translateClassBody("class Foo { }"); assertEquals(2, types.size()); assertEquals("Test", types.get(0).getName().getIdentifier()); assertEquals("Foo", types.get(1).getName().getIdentifier()); }
void function() { List<AbstractTypeDeclaration> types = translateClassBody(STR); assertEquals(2, types.size()); assertEquals("Test", types.get(0).getName().getIdentifier()); assertEquals("Foo", types.get(1).getName().getIdentifier()); }
/** * Verify that an inner class is moved to the compilation unit's types list. */
Verify that an inner class is moved to the compilation unit's types list
testInnerClassExtracted
{ "repo_name": "Buggaboo/j2objc", "path": "translator/src/test/java/com/google/devtools/j2objc/translate/InnerClassExtractorTest.java", "license": "apache-2.0", "size": 35536 }
[ "com.google.devtools.j2objc.ast.AbstractTypeDeclaration", "java.util.List" ]
import com.google.devtools.j2objc.ast.AbstractTypeDeclaration; import java.util.List;
import com.google.devtools.j2objc.ast.*; import java.util.*;
[ "com.google.devtools", "java.util" ]
com.google.devtools; java.util;
2,081,769
private static CompletableFuture<MessageSet> getMessages(TextChannel channel, int limit, long before, long after) { CompletableFuture<MessageSet> future = new CompletableFuture<>(); channel.getApi().getThreadPool().getExecutorService().submit(() -> { try { // get the initial batch with the first <= 100 messages int initialBatchSize = ((limit % 100) == 0) ? 100 : limit % 100; MessageSet initialMessages = requestAsMessages(channel, initialBatchSize, before, after); // limit <= 100 => initial request got all messages // initialMessages is empty => READ_MESSAGE_HISTORY permission is denied or no more messages available if ((limit <= 100) || initialMessages.isEmpty()) { future.complete(initialMessages); return; } // calculate the amount and direction of remaining message to get // this will be a multiple of 100 and at least 100 int remainingMessages = limit - initialBatchSize; int steps = remainingMessages / 100; // "before" is set or both are not set boolean older = (before != -1) || (after == -1); boolean newer = after != -1; // get remaining messages List<MessageSet> messageSets = new ArrayList<>(); MessageSet lastMessages = initialMessages; messageSets.add(lastMessages); for (int step = 0; step < steps; ++step) { lastMessages = requestAsMessages(channel, 100, lastMessages.getOldestMessage() .filter(message -> older) .map(DiscordEntity::getId) .orElse(-1L), lastMessages.getNewestMessage() .filter(message -> newer) .map(DiscordEntity::getId) .orElse(-1L)); // no more messages available if (lastMessages.isEmpty()) { break; } messageSets.add(lastMessages); } // combine the message sets future.complete(new MessageSetImpl(messageSets.stream() .flatMap(Collection::stream) .collect(Collectors.toList()))); } catch (Throwable t) { future.completeExceptionally(t); } }); return future; }
static CompletableFuture<MessageSet> function(TextChannel channel, int limit, long before, long after) { CompletableFuture<MessageSet> future = new CompletableFuture<>(); channel.getApi().getThreadPool().getExecutorService().submit(() -> { try { int initialBatchSize = ((limit % 100) == 0) ? 100 : limit % 100; MessageSet initialMessages = requestAsMessages(channel, initialBatchSize, before, after); if ((limit <= 100) initialMessages.isEmpty()) { future.complete(initialMessages); return; } int remainingMessages = limit - initialBatchSize; int steps = remainingMessages / 100; boolean older = (before != -1) (after == -1); boolean newer = after != -1; List<MessageSet> messageSets = new ArrayList<>(); MessageSet lastMessages = initialMessages; messageSets.add(lastMessages); for (int step = 0; step < steps; ++step) { lastMessages = requestAsMessages(channel, 100, lastMessages.getOldestMessage() .filter(message -> older) .map(DiscordEntity::getId) .orElse(-1L), lastMessages.getNewestMessage() .filter(message -> newer) .map(DiscordEntity::getId) .orElse(-1L)); if (lastMessages.isEmpty()) { break; } messageSets.add(lastMessages); } future.complete(new MessageSetImpl(messageSets.stream() .flatMap(Collection::stream) .collect(Collectors.toList()))); } catch (Throwable t) { future.completeExceptionally(t); } }); return future; }
/** * Gets up to a given amount of messages in the given channel. * * @param channel The channel of the messages. * @param limit The limit of messages to get. * @param before Get messages before the message with this id. * @param after Get messages after the message with this id. * * @return The messages. * @see #getMessagesAsStream(TextChannel, long, long) */
Gets up to a given amount of messages in the given channel
getMessages
{ "repo_name": "BtoBastian/Javacord", "path": "javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java", "license": "lgpl-3.0", "size": 40859 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.List", "java.util.concurrent.CompletableFuture", "java.util.stream.Collectors", "org.javacord.api.entity.DiscordEntity", "org.javacord.api.entity.channel.TextChannel", "org.javacord.api.entity.message.MessageSet" ]
import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; import org.javacord.api.entity.DiscordEntity; import org.javacord.api.entity.channel.TextChannel; import org.javacord.api.entity.message.MessageSet;
import java.util.*; import java.util.concurrent.*; import java.util.stream.*; import org.javacord.api.entity.*; import org.javacord.api.entity.channel.*; import org.javacord.api.entity.message.*;
[ "java.util", "org.javacord.api" ]
java.util; org.javacord.api;
170,462
void processPendingNotifications() { RemovalNotification<K, V> notification; while ((notification = removalNotificationQueue.poll()) != null) { try { removalListener.onRemoval(notification); } catch (Throwable e) { logger.log(Level.WARNING, "Exception thrown by removal listener", e); } } }
void processPendingNotifications() { RemovalNotification<K, V> notification; while ((notification = removalNotificationQueue.poll()) != null) { try { removalListener.onRemoval(notification); } catch (Throwable e) { logger.log(Level.WARNING, STR, e); } } }
/** * Notifies listeners that an entry has been automatically removed due to expiration, eviction, * or eligibility for garbage collection. This should be called every time expireEntries or * evictEntry is called (once the lock is released). */
Notifies listeners that an entry has been automatically removed due to expiration, eviction, or eligibility for garbage collection. This should be called every time expireEntries or evictEntry is called (once the lock is released)
processPendingNotifications
{ "repo_name": "dropbox/Store", "path": "cache/src/main/java/com/dropbox/android/external/cache3/LocalCache.java", "license": "apache-2.0", "size": 165946 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
841,166
public static ims.core.clinical.domain.objects.IntraOperativeDetails extractIntraOperativeDetails(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.IntraOperativeDetailsLiteVo valueObject) { return extractIntraOperativeDetails(domainFactory, valueObject, new HashMap()); }
static ims.core.clinical.domain.objects.IntraOperativeDetails function(ims.domain.ILightweightDomainFactory domainFactory, ims.clinical.vo.IntraOperativeDetailsLiteVo valueObject) { return extractIntraOperativeDetails(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractIntraOperativeDetails
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/clinical/vo/domain/IntraOperativeDetailsLiteVoAssembler.java", "license": "agpl-3.0", "size": 28212 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
882,314
TaskOperations taskOperations();
TaskOperations taskOperations();
/** * Retrieves {@link TaskOperations}, used for interacting with Google Tasks * API. Requires OAuth scope https://www.googleapis.com/auth/tasks or * https://www.googleapis.com/auth/tasks.readonly * * @return {@link TaskOperations} for the authenticated user */
Retrieves <code>TaskOperations</code>, used for interacting with Google Tasks API. Requires OAuth scope HREF or HREF
taskOperations
{ "repo_name": "spring-social/spring-social-google", "path": "src/main/java/org/springframework/social/google/api/Google.java", "license": "apache-2.0", "size": 4104 }
[ "org.springframework.social.google.api.tasks.TaskOperations" ]
import org.springframework.social.google.api.tasks.TaskOperations;
import org.springframework.social.google.api.tasks.*;
[ "org.springframework.social" ]
org.springframework.social;
2,367,613
public void setPrintStream(PrintStream printStream) { this.printStream = printStream; }
void function(PrintStream printStream) { this.printStream = printStream; }
/** * Sets the {@link PrintStream} to print to when drawing this progress bar. By default, it is * set to {@link System#out}. * * @param printStream * the {@link PrintStream} to use to print this bar */
Sets the <code>PrintStream</code> to print to when drawing this progress bar. By default, it is set to <code>System#out</code>
setPrintStream
{ "repo_name": "joffrey-bion/console-drawing", "path": "src/main/java/org/hildan/utils/console/drawing/progress/AbstractProgressBar.java", "license": "mit", "size": 3886 }
[ "java.io.PrintStream" ]
import java.io.PrintStream;
import java.io.*;
[ "java.io" ]
java.io;
229,697
public void event(Request request, Response response, CometEvent event) throws IOException, ServletException { // Perform the request boolean ok = false; try { getNext().event(request, response, event); ok = true; } finally { if (!ok || response.isClosed() || (event.getEventType() == CometEvent.EventType.END) || (event.getEventType() == CometEvent.EventType.ERROR && !(event.getEventSubType() == CometEvent.EventSubType.TIMEOUT))) { // Remove the connection from webapp reload tracking cometRequests.remove(request); // Remove connection from session expiration tracking // Note: can't get the session if it has been invalidated but // OK since session listener will have done clean-up HttpSession session = request.getSession(false); if (session != null) { synchronized (session) { Request[] reqs = null; try { reqs = (Request[]) session.getAttribute(cometRequestsAttribute); } catch (IllegalStateException ise) { // Ignore - session has been invalidated // Listener will have cleaned up } if (reqs != null) { boolean found = false; for (int i = 0; !found && (i < reqs.length); i++) { found = (reqs[i] == request); } if (found) { if (reqs.length > 1) { Request[] newConnectionInfos = new Request[reqs.length - 1]; int pos = 0; for (int i = 0; i < reqs.length; i++) { if (reqs[i] != request) { newConnectionInfos[pos++] = reqs[i]; } } try { session.setAttribute( cometRequestsAttribute, newConnectionInfos); } catch (IllegalStateException ise) { // Ignore - session has been invalidated // Listener will have cleaned up } } else { try { session.removeAttribute( cometRequestsAttribute); } catch (IllegalStateException ise) { // Ignore - session has been invalidated // Listener will have cleaned up } } } } } } } } }
void function(Request request, Response response, CometEvent event) throws IOException, ServletException { boolean ok = false; try { getNext().event(request, response, event); ok = true; } finally { if (!ok response.isClosed() (event.getEventType() == CometEvent.EventType.END) (event.getEventType() == CometEvent.EventType.ERROR && !(event.getEventSubType() == CometEvent.EventSubType.TIMEOUT))) { cometRequests.remove(request); HttpSession session = request.getSession(false); if (session != null) { synchronized (session) { Request[] reqs = null; try { reqs = (Request[]) session.getAttribute(cometRequestsAttribute); } catch (IllegalStateException ise) { } if (reqs != null) { boolean found = false; for (int i = 0; !found && (i < reqs.length); i++) { found = (reqs[i] == request); } if (found) { if (reqs.length > 1) { Request[] newConnectionInfos = new Request[reqs.length - 1]; int pos = 0; for (int i = 0; i < reqs.length; i++) { if (reqs[i] != request) { newConnectionInfos[pos++] = reqs[i]; } } try { session.setAttribute( cometRequestsAttribute, newConnectionInfos); } catch (IllegalStateException ise) { } } else { try { session.removeAttribute( cometRequestsAttribute); } catch (IllegalStateException ise) { } } } } } } } } }
/** * Use events to update the connection state. * * @param request The servlet request to be processed * @param response The servlet response to be created * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet error occurs */
Use events to update the connection state
event
{ "repo_name": "plumer/codana", "path": "tomcat_files/6.0.43/CometConnectionManagerValve.java", "license": "mit", "size": 14006 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpSession", "org.apache.catalina.CometEvent", "org.apache.catalina.connector.Request", "org.apache.catalina.connector.Response" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpSession; import org.apache.catalina.CometEvent; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import org.apache.catalina.*; import org.apache.catalina.connector.*;
[ "java.io", "javax.servlet", "org.apache.catalina" ]
java.io; javax.servlet; org.apache.catalina;
1,123,556
rows = new ArrayList<Row<MObject>>();
rows = new ArrayList<Row<MObject>>();
/** * Method update updates the data of Table. */
Method update updates the data of Table
update
{ "repo_name": "anonymous100001/maxuse", "path": "src/gui/org/tzi/use/gui/views/selection/objectselection/ObjectPathTableModel.java", "license": "gpl-2.0", "size": 1433 }
[ "java.util.ArrayList", "org.tzi.use.uml.sys.MObject" ]
import java.util.ArrayList; import org.tzi.use.uml.sys.MObject;
import java.util.*; import org.tzi.use.uml.sys.*;
[ "java.util", "org.tzi.use" ]
java.util; org.tzi.use;
1,277,687
@Override public void onSaveInstanceState(@NonNull Bundle outState) { super.onSaveInstanceState(outState); map.onSaveInstanceState(outState); }
void function(@NonNull Bundle outState) { super.onSaveInstanceState(outState); map.onSaveInstanceState(outState); }
/** * Called when the fragment state needs to be saved. * * @param outState The saved state */
Called when the fragment state needs to be saved
onSaveInstanceState
{ "repo_name": "geminy/aidear", "path": "oss/qt/qt-everywhere-opensource-src-5.9.0/qtlocation/src/3rdparty/mapbox-gl-native/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapFragment.java", "license": "gpl-3.0", "size": 4201 }
[ "android.os.Bundle", "android.support.annotation.NonNull" ]
import android.os.Bundle; import android.support.annotation.NonNull;
import android.os.*; import android.support.annotation.*;
[ "android.os", "android.support" ]
android.os; android.support;
2,504,133
static Long convertToLong(Object o) throws HsqlException { long val = ((Number) o).longValue(); if (o instanceof BigDecimal) { BigInteger bi = ((BigDecimal) o).toBigInteger(); if (bi.compareTo(MAX_LONG) > 0 || bi.compareTo(MIN_LONG) < 0) { throw Trace.error(Trace.NUMERIC_VALUE_OUT_OF_RANGE); } return ValuePool.getLong(val); } if (o instanceof Double || o instanceof Float) { double d = ((Number) o).doubleValue(); if (Double.isNaN(d) || d >= (double) Long.MAX_VALUE + 1 || d <= (double) Long.MIN_VALUE - 1) { throw Trace.error(Trace.NUMERIC_VALUE_OUT_OF_RANGE); } return ValuePool.getLong(val); } throw Trace.error(Trace.INVALID_CONVERSION); }
static Long convertToLong(Object o) throws HsqlException { long val = ((Number) o).longValue(); if (o instanceof BigDecimal) { BigInteger bi = ((BigDecimal) o).toBigInteger(); if (bi.compareTo(MAX_LONG) > 0 bi.compareTo(MIN_LONG) < 0) { throw Trace.error(Trace.NUMERIC_VALUE_OUT_OF_RANGE); } return ValuePool.getLong(val); } if (o instanceof Double o instanceof Float) { double d = ((Number) o).doubleValue(); if (Double.isNaN(d) d >= (double) Long.MAX_VALUE + 1 d <= (double) Long.MIN_VALUE - 1) { throw Trace.error(Trace.NUMERIC_VALUE_OUT_OF_RANGE); } return ValuePool.getLong(val); } throw Trace.error(Trace.INVALID_CONVERSION); }
/** * Converter from a numeric object to Long. Input is checked to be * within range represented by Long. */
Converter from a numeric object to Long. Input is checked to be within range represented by Long
convertToLong
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/hsqldb1733/src/org/hsqldb/Column.java", "license": "lgpl-3.0", "size": 54834 }
[ "java.math.BigDecimal", "java.math.BigInteger", "org.hsqldb.store.ValuePool" ]
import java.math.BigDecimal; import java.math.BigInteger; import org.hsqldb.store.ValuePool;
import java.math.*; import org.hsqldb.store.*;
[ "java.math", "org.hsqldb.store" ]
java.math; org.hsqldb.store;
641,724
private List<LexicalRule<? extends WikiRuleInfo>> makeLexicalRules(List<RedisRuleData> rulesData) throws LexicalResourceException { // sim,ulates the 'order by' in the original SQL query Collections.sort(rulesData, new RuleDataReverseComparator()); LinkedList<LexicalRule<? extends WikiRuleInfo>> rules = new LinkedList<LexicalRule<? extends WikiRuleInfo>>(); for (RedisRuleData ruleData : rulesData) { LexicalRule<WikiRuleInfo> rule = new LexicalRule<WikiRuleInfo>(ruleData.getLeftTerm(), this.m_nounPOS, ruleData.getRightTerm(), this.m_nounPOS, Math.max(Math.min(m_classifier.getRank(ruleData),MAXIMAL_CONFIDENCE),MINIMAL_CONFIDENCE), ruleData.getRuleType(), "Wikipedia", WikiRuleInfo.getInstance()); rules.add(rule); } //sort rules Collections.sort(rules, new LexicalRuleReverseComparator()); if (rules.size() > this.m_limitOnRetrievedRules) { return rules.subList(0, this.m_limitOnRetrievedRules); } else { return rules; } }
List<LexicalRule<? extends WikiRuleInfo>> function(List<RedisRuleData> rulesData) throws LexicalResourceException { Collections.sort(rulesData, new RuleDataReverseComparator()); LinkedList<LexicalRule<? extends WikiRuleInfo>> rules = new LinkedList<LexicalRule<? extends WikiRuleInfo>>(); for (RedisRuleData ruleData : rulesData) { LexicalRule<WikiRuleInfo> rule = new LexicalRule<WikiRuleInfo>(ruleData.getLeftTerm(), this.m_nounPOS, ruleData.getRightTerm(), this.m_nounPOS, Math.max(Math.min(m_classifier.getRank(ruleData),MAXIMAL_CONFIDENCE),MINIMAL_CONFIDENCE), ruleData.getRuleType(), STR, WikiRuleInfo.getInstance()); rules.add(rule); } Collections.sort(rules, new LexicalRuleReverseComparator()); if (rules.size() > this.m_limitOnRetrievedRules) { return rules.subList(0, this.m_limitOnRetrievedRules); } else { return rules; } }
/** * The function is used to create a LexicalRule List out of the rulesData List * @param rulesData * @return * @throws LexicalResourceException */
The function is used to create a LexicalRule List out of the rulesData List
makeLexicalRules
{ "repo_name": "hltfbk/Excitement-TDMLEDA", "path": "lexicalinferenceminer/src/main/java/eu/excitementproject/eop/lexicalminer/redis/RedisBasedWikipediaLexicalResource.java", "license": "gpl-3.0", "size": 15061 }
[ "eu.excitementproject.eop.common.component.lexicalknowledge.LexicalResourceException", "eu.excitementproject.eop.common.component.lexicalknowledge.LexicalRule", "java.util.Collections", "java.util.LinkedList", "java.util.List" ]
import eu.excitementproject.eop.common.component.lexicalknowledge.LexicalResourceException; import eu.excitementproject.eop.common.component.lexicalknowledge.LexicalRule; import java.util.Collections; import java.util.LinkedList; import java.util.List;
import eu.excitementproject.eop.common.component.lexicalknowledge.*; import java.util.*;
[ "eu.excitementproject.eop", "java.util" ]
eu.excitementproject.eop; java.util;
178,951
List<ClientResponse> poll(long timeout, long now);
List<ClientResponse> poll(long timeout, long now);
/** * Do actual reads and writes from sockets. * * @param timeout The maximum amount of time to wait for responses in ms, must be non-negative. The implementation * is free to use a lower value if appropriate (common reasons for this are a lower request or * metadata update timeout) * @param now The current time in ms * @throws IllegalStateException If a request is sent to an unready node */
Do actual reads and writes from sockets
poll
{ "repo_name": "ijuma/kafka", "path": "clients/src/main/java/org/apache/kafka/clients/KafkaClient.java", "license": "apache-2.0", "size": 5876 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,347,767
@Override public Collection<ResourceCategory> retrieveCategories() { Iterable<ResourceCategoryEntity> endResults = repository.getCategories(); Collection<ResourceCategory> collection = new HashSet<ResourceCategory>(); if (endResults.iterator() != null) { Iterator<ResourceCategoryEntity> iterator = endResults.iterator(); while (iterator.hasNext()) { collection.add(iterator.next()); } } return collection; }
Collection<ResourceCategory> function() { Iterable<ResourceCategoryEntity> endResults = repository.getCategories(); Collection<ResourceCategory> collection = new HashSet<ResourceCategory>(); if (endResults.iterator() != null) { Iterator<ResourceCategoryEntity> iterator = endResults.iterator(); while (iterator.hasNext()) { collection.add(iterator.next()); } } return collection; }
/** * Returns the categories containing at least one "Software" entity. */
Returns the categories containing at least one "Software" entity
retrieveCategories
{ "repo_name": "gcolbert/ACEM", "path": "ACEM-dal-relational-database/src/main/java/eu/ueb/acem/dal/jpa/jaune/SoftwareDAO.java", "license": "gpl-3.0", "size": 4756 }
[ "eu.ueb.acem.domain.beans.jaune.ResourceCategory", "eu.ueb.acem.domain.beans.jpa.jaune.ResourceCategoryEntity", "java.util.Collection", "java.util.HashSet", "java.util.Iterator" ]
import eu.ueb.acem.domain.beans.jaune.ResourceCategory; import eu.ueb.acem.domain.beans.jpa.jaune.ResourceCategoryEntity; import java.util.Collection; import java.util.HashSet; import java.util.Iterator;
import eu.ueb.acem.domain.beans.jaune.*; import eu.ueb.acem.domain.beans.jpa.jaune.*; import java.util.*;
[ "eu.ueb.acem", "java.util" ]
eu.ueb.acem; java.util;
800,414
@Column(name = "nodes") @JsonIgnore public String getNodesDB() { try { return OBJECT_MAPPER.writeValueAsString(nodes); } catch (JsonProcessingException e) { e.printStackTrace(); return ""; } }
@Column(name = "nodes") String function() { try { return OBJECT_MAPPER.writeValueAsString(nodes); } catch (JsonProcessingException e) { e.printStackTrace(); return ""; } }
/** * Getter method to interact with the DB, because the Java standard serialization doesn't work. * * @return The Nodes of the machine as JSON string. */
Getter method to interact with the DB, because the Java standard serialization doesn't work
getNodesDB
{ "repo_name": "LearnLib/alex", "path": "backend/src/main/java/de/learnlib/alex/learning/entities/learnlibproxies/CompactMealyMachineProxy.java", "license": "apache-2.0", "size": 9034 }
[ "com.fasterxml.jackson.core.JsonProcessingException", "javax.persistence.Column" ]
import com.fasterxml.jackson.core.JsonProcessingException; import javax.persistence.Column;
import com.fasterxml.jackson.core.*; import javax.persistence.*;
[ "com.fasterxml.jackson", "javax.persistence" ]
com.fasterxml.jackson; javax.persistence;
1,503,420
public void setItemText(int index, String text) { checkIndex(index); final Element optionElement = (Element) optionsPanel.getElement().getChild(index); final LabelElement labelElement = (LabelElement) optionElement.getElementsByTagName("label").getItem(0); labelElement.setInnerText(text); if (selectedIndex == index) { currentInputElement.setValue(text); } }
void function(int index, String text) { checkIndex(index); final Element optionElement = (Element) optionsPanel.getElement().getChild(index); final LabelElement labelElement = (LabelElement) optionElement.getElementsByTagName("label").getItem(0); labelElement.setInnerText(text); if (selectedIndex == index) { currentInputElement.setValue(text); } }
/** * Sets the text associated with the item at a given index. * * @param index the index of the item to be set * @param text the item's new text * @throws IndexOutOfBoundsException if the index is out of range */
Sets the text associated with the item at a given index
setItemText
{ "repo_name": "sleshchenko/che", "path": "ide/commons-gwt/src/main/java/org/eclipse/che/ide/ui/listbox/CustomComboBox.java", "license": "epl-1.0", "size": 14902 }
[ "com.google.gwt.dom.client.Element", "com.google.gwt.dom.client.LabelElement" ]
import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.LabelElement;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
742,151
protected void unsetUnRegistrationHandler(UnRegistrationHandler unRegistrationHandler) { if (log.isDebugEnabled()) { log.debug("Unsetting UnRegistrationHandler."); } DCRDataHolder.getInstance().getUnRegistrationHandlerList().add(null); }
void function(UnRegistrationHandler unRegistrationHandler) { if (log.isDebugEnabled()) { log.debug(STR); } DCRDataHolder.getInstance().getUnRegistrationHandlerList().add(null); }
/** * Unsets UnRegistrationHandler. * * @param unRegistrationHandler An instance of UnRegistrationHandler */
Unsets UnRegistrationHandler
unsetUnRegistrationHandler
{ "repo_name": "darshanasbg/identity-inbound-auth-oauth", "path": "components/org.wso2.carbon.identity.oauth.dcr/src/main/java/org/wso2/carbon/identity/oauth/dcr/internal/DCRServiceComponent.java", "license": "apache-2.0", "size": 7658 }
[ "org.wso2.carbon.identity.oauth.dcr.handler.UnRegistrationHandler" ]
import org.wso2.carbon.identity.oauth.dcr.handler.UnRegistrationHandler;
import org.wso2.carbon.identity.oauth.dcr.handler.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
1,183,015
boolean process( List<Point2D_I32> input, DogArray_I32 vertexes );
boolean process( List<Point2D_I32> input, DogArray_I32 vertexes );
/** * Computes a polyline from the set of image pixels. * * @param input (Input) List of points in order * @param vertexes (Output) Indexes in the input list which are corners in the polyline * @return true if successful or false if no fit could be found which matched the requirements */
Computes a polyline from the set of image pixels
process
{ "repo_name": "lessthanoptimal/BoofCV", "path": "main/boofcv-feature/src/main/java/boofcv/abst/shapes/polyline/PointsToPolyline.java", "license": "apache-2.0", "size": 2601 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,196,615
@VisibleForTesting String getListOfSchemasAndTables(List<SchemaAndTable> schemaAndTables) { Map<String, List<String>> schemas = new HashMap<>(); for (SchemaAndTable schemaAndTable : schemaAndTables) { if (schemas.containsKey(schemaAndTable.getSchema())) { schemas.get(schemaAndTable.getSchema()).add(schemaAndTable.getTable()); } else { List<String> tbls = new ArrayList<>(); tbls.add(schemaAndTable.getTable()); schemas.put(schemaAndTable.getSchema(), tbls); } } List<String> queries = new ArrayList<>(); for (Map.Entry<String, List<String>> entry : schemas.entrySet()) { List<String> tables = new ArrayList<>(); int fromIndex = 0; int range = 1000; int maxIndex = entry.getValue().size(); int toIndex = range < maxIndex ? range : maxIndex; while (fromIndex < toIndex) { tables.add(Utils.format( "TABLE_NAME IN ({})", formatTableList(entry.getValue().subList(fromIndex, toIndex)))); fromIndex = toIndex; toIndex = (toIndex + range) < maxIndex ? (toIndex + range) : maxIndex; } queries.add(Utils.format("(SEG_OWNER='{}' AND ({}))", entry.getKey(), String.join(" OR ", tables))); } return "( " + String.join(" OR ", queries) + " )"; }
String getListOfSchemasAndTables(List<SchemaAndTable> schemaAndTables) { Map<String, List<String>> schemas = new HashMap<>(); for (SchemaAndTable schemaAndTable : schemaAndTables) { if (schemas.containsKey(schemaAndTable.getSchema())) { schemas.get(schemaAndTable.getSchema()).add(schemaAndTable.getTable()); } else { List<String> tbls = new ArrayList<>(); tbls.add(schemaAndTable.getTable()); schemas.put(schemaAndTable.getSchema(), tbls); } } List<String> queries = new ArrayList<>(); for (Map.Entry<String, List<String>> entry : schemas.entrySet()) { List<String> tables = new ArrayList<>(); int fromIndex = 0; int range = 1000; int maxIndex = entry.getValue().size(); int toIndex = range < maxIndex ? range : maxIndex; while (fromIndex < toIndex) { tables.add(Utils.format( STR, formatTableList(entry.getValue().subList(fromIndex, toIndex)))); fromIndex = toIndex; toIndex = (toIndex + range) < maxIndex ? (toIndex + range) : maxIndex; } queries.add(Utils.format(STR, entry.getKey(), String.join(STR, tables))); } return STR + String.join(STR, queries) + STR; }
/** * This method needs to get SQL like string with all required schemas and tables. * @param schemaAndTables List of SchemaAndTable objects * @return SQL string of schemas and tables */
This method needs to get SQL like string with all required schemas and tables
getListOfSchemasAndTables
{ "repo_name": "rockmkd/datacollector", "path": "jdbc-protolib/src/main/java/com/streamsets/pipeline/stage/origin/jdbc/cdc/oracle/OracleCDCSource.java", "license": "apache-2.0", "size": 79313 }
[ "com.streamsets.pipeline.api.impl.Utils", "com.streamsets.pipeline.stage.origin.jdbc.cdc.SchemaAndTable", "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map" ]
import com.streamsets.pipeline.api.impl.Utils; import com.streamsets.pipeline.stage.origin.jdbc.cdc.SchemaAndTable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
import com.streamsets.pipeline.api.impl.*; import com.streamsets.pipeline.stage.origin.jdbc.cdc.*; import java.util.*;
[ "com.streamsets.pipeline", "java.util" ]
com.streamsets.pipeline; java.util;
1,523,297
public static SqlIntervalLiteral createInterval( int sign, String intervalStr, SqlIntervalQualifier intervalQualifier, SqlParserPos pos) { return new SqlIntervalLiteral(sign, intervalStr, intervalQualifier, intervalQualifier.typeName(), pos); }
static SqlIntervalLiteral function( int sign, String intervalStr, SqlIntervalQualifier intervalQualifier, SqlParserPos pos) { return new SqlIntervalLiteral(sign, intervalStr, intervalQualifier, intervalQualifier.typeName(), pos); }
/** * Creates an interval literal. * * @param intervalStr input string of '1:23:04' * @param intervalQualifier describes the interval type and precision * @param pos Parser position */
Creates an interval literal
createInterval
{ "repo_name": "julianhyde/calcite", "path": "core/src/main/java/org/apache/calcite/sql/SqlLiteral.java", "license": "apache-2.0", "size": 33739 }
[ "org.apache.calcite.sql.parser.SqlParserPos" ]
import org.apache.calcite.sql.parser.SqlParserPos;
import org.apache.calcite.sql.parser.*;
[ "org.apache.calcite" ]
org.apache.calcite;
1,715,601
public FacesConfigApplicationType<T> removeId() { childNode.removeAttribute("id"); return this; }
FacesConfigApplicationType<T> function() { childNode.removeAttribute("id"); return this; }
/** * Removes the <code>id</code> attribute * @return the current instance of <code>FacesConfigApplicationType<T></code> */
Removes the <code>id</code> attribute
removeId
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facesconfig20/FacesConfigApplicationTypeImpl.java", "license": "epl-1.0", "size": 32125 }
[ "org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigApplicationType" ]
import org.jboss.shrinkwrap.descriptor.api.facesconfig20.FacesConfigApplicationType;
import org.jboss.shrinkwrap.descriptor.api.facesconfig20.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
498,064
void setCodeBuffer(ByteBuffer buffer);
void setCodeBuffer(ByteBuffer buffer);
/** * Provides a buffer to the encoder, to which it should write its encoded binary instructions. * * @param buffer The bufer to output to. */
Provides a buffer to the encoder, to which it should write its encoded binary instructions
setCodeBuffer
{ "repo_name": "rupertlssmith/lojix", "path": "lojix/logic/src/main/com/thesett/aima/logic/fol/bytecode/InstructionEncoder.java", "license": "apache-2.0", "size": 1822 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
1,978,949
InputStream is = null; if (new StringTokenizer(matrix, Commons.getFileSeparator()) .countTokens() == 1) { // Matrix does not include the path // Load the matrix from matrices.jar is = MatrixLoader.class.getClassLoader().getResourceAsStream( MATRICES_HOME + matrix); } else { // Matrix includes the path information // Load the matrix from the file system try { is = new FileInputStream(matrix); } catch (Exception e) { String message = "Failed opening input stream: " + e.getMessage(); logger.log(Level.SEVERE, message, e); throw new MatrixLoaderException(message); } } return load(new NamedInputStream(matrix, is)); } /** * Loads scoring matrix from {@link InputStream}
InputStream is = null; if (new StringTokenizer(matrix, Commons.getFileSeparator()) .countTokens() == 1) { is = MatrixLoader.class.getClassLoader().getResourceAsStream( MATRICES_HOME + matrix); } else { try { is = new FileInputStream(matrix); } catch (Exception e) { String message = STR + e.getMessage(); logger.log(Level.SEVERE, message, e); throw new MatrixLoaderException(message); } } return load(new NamedInputStream(matrix, is)); } /** * Loads scoring matrix from {@link InputStream}
/** * Loads scoring matrix from Jar file or file system. * * @param matrix * to load * @return loaded matrix * @throws MatrixLoaderException * @see Matrix */
Loads scoring matrix from Jar file or file system
load
{ "repo_name": "ahmedmoustafa/JAligner", "path": "src/jaligner/matrix/MatrixLoader.java", "license": "gpl-2.0", "size": 7004 }
[ "java.io.FileInputStream", "java.io.InputStream", "java.util.StringTokenizer", "java.util.logging.Level" ]
import java.io.FileInputStream; import java.io.InputStream; import java.util.StringTokenizer; import java.util.logging.Level;
import java.io.*; import java.util.*; import java.util.logging.*;
[ "java.io", "java.util" ]
java.io; java.util;
434,578
public void addEquivalence(String propertyName) throws NoSuchEntityException, OntologyChangeException { addEquivalence(getOntology().getDataProperty(propertyName)); }
void function(String propertyName) throws NoSuchEntityException, OntologyChangeException { addEquivalence(getOntology().getDataProperty(propertyName)); }
/** * Adds a data property equivalence axiom. * @param propertyName * The name of the equivalent data property. * @throws NoSuchEntityException * If the specified data property does not exist. * @throws OntologyChangeException * If the axiom cannot be added. **/
Adds a data property equivalence axiom
addEquivalence
{ "repo_name": "SPDSS/adss", "path": "it.polito.security.ontologies/src/it/polito/security/ontologies/OntologyDataProperty.java", "license": "epl-1.0", "size": 18357 }
[ "it.polito.security.ontologies.exceptions.NoSuchEntityException", "it.polito.security.ontologies.exceptions.OntologyChangeException" ]
import it.polito.security.ontologies.exceptions.NoSuchEntityException; import it.polito.security.ontologies.exceptions.OntologyChangeException;
import it.polito.security.ontologies.exceptions.*;
[ "it.polito.security" ]
it.polito.security;
995,936
@CheckForNull Object getValue(); }
@CheckForNull Object getValue(); }
/** * The value to compare against. * @return The value to compare or {@code null}. */
The value to compare against
getValue
{ "repo_name": "plutext/sling", "path": "bundles/api/src/main/java/org/apache/sling/api/resource/query/Query.java", "license": "apache-2.0", "size": 4668 }
[ "javax.annotation.CheckForNull" ]
import javax.annotation.CheckForNull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,459,727
public static List<DynamicProperty> getProperties(VimPortType vimPort, ServiceContent serviceContent, ManagedObjectReference moRef, String type, List<String> properties) throws RuntimeFaultFaultMsg, InvalidPropertyFaultMsg { // Create Property Spec PropertySpec propertySpec = new PropertySpec(); propertySpec.setAll(false); propertySpec.setType(type); propertySpec.getPathSet().addAll(properties); // Now create Object Spec ObjectSpec objectSpec = new ObjectSpec(); objectSpec.setObj(moRef); objectSpec.setSkip(false); // Create PropertyFilterSpec using the PropertySpec and ObjectPec // created above. PropertyFilterSpec propertyFilterSpec = new PropertyFilterSpec(); propertyFilterSpec.getPropSet().add(propertySpec); propertyFilterSpec.getObjectSet().add(objectSpec); List<PropertyFilterSpec> listpfs = new ArrayList<PropertyFilterSpec>(1); listpfs.add(propertyFilterSpec); List<ObjectContent> listobjcontent = VimUtil .retrievePropertiesAllObjects(vimPort, serviceContent.getPropertyCollector(), listpfs); assert listobjcontent != null && listobjcontent.size() > 0; ObjectContent contentObj = listobjcontent.get(0); List<DynamicProperty> objList = contentObj.getPropSet(); return objList; }
static List<DynamicProperty> function(VimPortType vimPort, ServiceContent serviceContent, ManagedObjectReference moRef, String type, List<String> properties) throws RuntimeFaultFaultMsg, InvalidPropertyFaultMsg { PropertySpec propertySpec = new PropertySpec(); propertySpec.setAll(false); propertySpec.setType(type); propertySpec.getPathSet().addAll(properties); ObjectSpec objectSpec = new ObjectSpec(); objectSpec.setObj(moRef); objectSpec.setSkip(false); PropertyFilterSpec propertyFilterSpec = new PropertyFilterSpec(); propertyFilterSpec.getPropSet().add(propertySpec); propertyFilterSpec.getObjectSet().add(objectSpec); List<PropertyFilterSpec> listpfs = new ArrayList<PropertyFilterSpec>(1); listpfs.add(propertyFilterSpec); List<ObjectContent> listobjcontent = VimUtil .retrievePropertiesAllObjects(vimPort, serviceContent.getPropertyCollector(), listpfs); assert listobjcontent != null && listobjcontent.size() > 0; ObjectContent contentObj = listobjcontent.get(0); List<DynamicProperty> objList = contentObj.getPropSet(); return objList; }
/** * Get the required properties of the specified object. * * @param vimPort * @param serviceContent * @param moRef * @param type * @param properties * @return * @throws RuntimeFaultFaultMsg * @throws InvalidPropertyFaultMsg */
Get the required properties of the specified object
getProperties
{ "repo_name": "kunal-pmj/vsphere-automation-sdk-java", "path": "src/main/java/vmware/samples/common/vim/helpers/VimUtil.java", "license": "mit", "size": 21502 }
[ "com.vmware.vim25.DynamicProperty", "com.vmware.vim25.InvalidPropertyFaultMsg", "com.vmware.vim25.ManagedObjectReference", "com.vmware.vim25.ObjectContent", "com.vmware.vim25.ObjectSpec", "com.vmware.vim25.PropertyFilterSpec", "com.vmware.vim25.PropertySpec", "com.vmware.vim25.RuntimeFaultFaultMsg", "com.vmware.vim25.ServiceContent", "com.vmware.vim25.VimPortType", "java.util.ArrayList", "java.util.List" ]
import com.vmware.vim25.DynamicProperty; import com.vmware.vim25.InvalidPropertyFaultMsg; import com.vmware.vim25.ManagedObjectReference; import com.vmware.vim25.ObjectContent; import com.vmware.vim25.ObjectSpec; import com.vmware.vim25.PropertyFilterSpec; import com.vmware.vim25.PropertySpec; import com.vmware.vim25.RuntimeFaultFaultMsg; import com.vmware.vim25.ServiceContent; import com.vmware.vim25.VimPortType; import java.util.ArrayList; import java.util.List;
import com.vmware.vim25.*; import java.util.*;
[ "com.vmware.vim25", "java.util" ]
com.vmware.vim25; java.util;
1,136,520
private static BasicAnimation newAnimationByTag(String tag, Context context, XmlResourceParser parser, Container mContainer) { BasicAnimation animation = null; if (tag.equalsIgnoreCase(XML_TAG_PROPERTY_ANIMATION)) { animation = parsePropertyAnimation(context, parser, mContainer); } else if (tag.equalsIgnoreCase(XML_TAG_KEYFRAME_ANIMATION)) { animation = parseKeyframeAnimation(context, parser, mContainer); sIsKeyframeAnimation = true; } else if (tag.equalsIgnoreCase(XML_TAG_ANIMATION_GROUP)) { animation = parseAnimationGroup(context, parser, mContainer); } else if (tag.equalsIgnoreCase(XML_TAG_SPRITE_ANIMATION)) { animation = parseSpriteAnimation(context, parser, mContainer); } else { // TODO : unknow tag , it might be a custom Animation. // How to support custom Animation. throw new IllegalArgumentException("unknown Animation tag in xml file."); } return animation; }
static BasicAnimation function(String tag, Context context, XmlResourceParser parser, Container mContainer) { BasicAnimation animation = null; if (tag.equalsIgnoreCase(XML_TAG_PROPERTY_ANIMATION)) { animation = parsePropertyAnimation(context, parser, mContainer); } else if (tag.equalsIgnoreCase(XML_TAG_KEYFRAME_ANIMATION)) { animation = parseKeyframeAnimation(context, parser, mContainer); sIsKeyframeAnimation = true; } else if (tag.equalsIgnoreCase(XML_TAG_ANIMATION_GROUP)) { animation = parseAnimationGroup(context, parser, mContainer); } else if (tag.equalsIgnoreCase(XML_TAG_SPRITE_ANIMATION)) { animation = parseSpriteAnimation(context, parser, mContainer); } else { throw new IllegalArgumentException(STR); } return animation; }
/** * new animation by tag * * @param tag : the tag string in xml file * @param context : the application environment * @param parser: the xml resource parser created from the xml file * @param mContainer : the container contains the actor that caller wants to apply the animation on * @return the basicAnimation object */
new animation by tag
newAnimationByTag
{ "repo_name": "rex-xxx/mt6572_x201", "path": "mediatek/frameworks/opt/ngin3d/java/com/mediatek/ngin3d/android/Ngin3dAnimationInflater.java", "license": "gpl-2.0", "size": 32351 }
[ "android.content.Context", "android.content.res.XmlResourceParser", "com.mediatek.ngin3d.Container", "com.mediatek.ngin3d.animation.BasicAnimation" ]
import android.content.Context; import android.content.res.XmlResourceParser; import com.mediatek.ngin3d.Container; import com.mediatek.ngin3d.animation.BasicAnimation;
import android.content.*; import android.content.res.*; import com.mediatek.ngin3d.*; import com.mediatek.ngin3d.animation.*;
[ "android.content", "com.mediatek.ngin3d" ]
android.content; com.mediatek.ngin3d;
2,334,014
public void setXpath(String xpath) { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(xpath)) { xpath = xpath.trim(); if (xpath.startsWith("/")) { xpath = xpath.substring(1); } if (xpath.endsWith("/")) { xpath = xpath.substring(0, xpath.length() - 1); } } m_xpath = xpath; }
void function(String xpath) { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(xpath)) { xpath = xpath.trim(); if (xpath.startsWith("/")) { xpath = xpath.substring(1); } if (xpath.endsWith("/")) { xpath = xpath.substring(0, xpath.length() - 1); } } m_xpath = xpath; }
/** * Sets the xpath.<p> * * @param xpath the xpath to set */
Sets the xpath
setXpath
{ "repo_name": "ggiudetti/opencms-core", "path": "src-modules/org/opencms/workplace/tools/searchindex/sourcesearch/CmsSearchReplaceSettings.java", "license": "lgpl-2.1", "size": 8714 }
[ "org.opencms.util.CmsStringUtil" ]
import org.opencms.util.CmsStringUtil;
import org.opencms.util.*;
[ "org.opencms.util" ]
org.opencms.util;
873,515
void restartInput() { if (DEBUG) Log.w(TAG, "restartInput"); getInputMethodManagerWrapper().restartInput(mInternalView); mIgnoreTextInputStateUpdates = false; mNumNestedBatchEdits = 0; }
void restartInput() { if (DEBUG) Log.w(TAG, STR); getInputMethodManagerWrapper().restartInput(mInternalView); mIgnoreTextInputStateUpdates = false; mNumNestedBatchEdits = 0; }
/** * Informs the InputMethodManager and InputMethodSession (i.e. the IME) that the text * state is no longer what the IME has and that it needs to be updated. */
Informs the InputMethodManager and InputMethodSession (i.e. the IME) that the text state is no longer what the IME has and that it needs to be updated
restartInput
{ "repo_name": "loopCM/chromium", "path": "content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java", "license": "bsd-3-clause", "size": 17977 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
494,695
@WebMethod @WebResult(name = "rval", targetNamespace = "https://www.google.com/apis/ads/publisher/v202111") @RequestWrapper(localName = "createMakegoods", targetNamespace = "https://www.google.com/apis/ads/publisher/v202111", className = "com.google.api.ads.admanager.jaxws.v202111.ProposalLineItemServiceInterfacecreateMakegoods") @ResponseWrapper(localName = "createMakegoodsResponse", targetNamespace = "https://www.google.com/apis/ads/publisher/v202111", className = "com.google.api.ads.admanager.jaxws.v202111.ProposalLineItemServiceInterfacecreateMakegoodsResponse") public List<ProposalLineItem> createMakegoods( @WebParam(name = "makegoodInfos", targetNamespace = "https://www.google.com/apis/ads/publisher/v202111") List<ProposalLineItemMakegoodInfo> makegoodInfos) throws ApiException_Exception ;
@WebResult(name = "rval", targetNamespace = STRcreateMakegoodsSTRhttps: @ResponseWrapper(localName = "createMakegoodsResponseSTRhttps: List<ProposalLineItem> function( @WebParam(name = "makegoodInfosSTRhttps: List<ProposalLineItemMakegoodInfo> makegoodInfos) throws ApiException_Exception ;
/** * * Creates makegood proposal line items given the specifications provided. * * * @param makegoodInfos * @return * returns java.util.List<com.google.api.ads.admanager.jaxws.v202111.ProposalLineItem> * @throws ApiException_Exception */
Creates makegood proposal line items given the specifications provided
createMakegoods
{ "repo_name": "googleads/googleads-java-lib", "path": "modules/dfp_appengine/src/main/java/com/google/api/ads/admanager/jaxws/v202111/ProposalLineItemServiceInterface.java", "license": "apache-2.0", "size": 9834 }
[ "java.util.List", "javax.jws.WebParam", "javax.jws.WebResult", "javax.xml.ws.ResponseWrapper" ]
import java.util.List; import javax.jws.WebParam; import javax.jws.WebResult; import javax.xml.ws.ResponseWrapper;
import java.util.*; import javax.jws.*; import javax.xml.ws.*;
[ "java.util", "javax.jws", "javax.xml" ]
java.util; javax.jws; javax.xml;
566,980
public interface Activity extends CDOObject { String getDescription();
interface Activity extends CDOObject { String function();
/** * Returns the value of the '<em><b>Description</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Description</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Description</em>' attribute. * @see #setDescription(String) * @see org.ai4fm.proofprocess.log.ProofProcessLogPackage#getActivity_Description() * @model * @generated */
Returns the value of the 'Description' attribute. If the meaning of the 'Description' attribute isn't clear, there really should be more of a description here...
getDescription
{ "repo_name": "andriusvelykis/proofprocess", "path": "org.ai4fm.proofprocess.project/src/org/ai4fm/proofprocess/log/Activity.java", "license": "epl-1.0", "size": 2387 }
[ "org.eclipse.emf.cdo.CDOObject" ]
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,613,454
CamelEvent createCamelContextRoutesStartingEvent(CamelContext context);
CamelEvent createCamelContextRoutesStartingEvent(CamelContext context);
/** * Creates an {@link CamelEvent} for Camel routes starting. * * @param context camel context * @return the created event */
Creates an <code>CamelEvent</code> for Camel routes starting
createCamelContextRoutesStartingEvent
{ "repo_name": "ullgren/camel", "path": "core/camel-api/src/main/java/org/apache/camel/spi/EventFactory.java", "license": "apache-2.0", "size": 11087 }
[ "org.apache.camel.CamelContext" ]
import org.apache.camel.CamelContext;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
274,533
void completed(DelegateExecution execution) throws Exception;
void completed(DelegateExecution execution) throws Exception;
/** * called after the process instance is destroyed for this activity to perform its outgoing control flow logic. */
called after the process instance is destroyed for this activity to perform its outgoing control flow logic
completed
{ "repo_name": "roberthafner/flowable-engine", "path": "modules/flowable-engine/src/main/java/org/activiti/engine/impl/delegate/SubProcessActivityBehavior.java", "license": "apache-2.0", "size": 1426 }
[ "org.activiti.engine.delegate.DelegateExecution" ]
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.*;
[ "org.activiti.engine" ]
org.activiti.engine;
2,505,288
public String getFilmMode() throws SonyProjectorException { if (!model.isFilmModeAvailable()) { throw new SonyProjectorException("Unavailable item " + SonyProjectorItem.FILM_MODE.getName() + " for projector model " + model.getName()); } return model.getFilmModeNameFromDataCode(getSetting(SonyProjectorItem.FILM_MODE)); }
String function() throws SonyProjectorException { if (!model.isFilmModeAvailable()) { throw new SonyProjectorException(STR + SonyProjectorItem.FILM_MODE.getName() + STR + model.getName()); } return model.getFilmModeNameFromDataCode(getSetting(SonyProjectorItem.FILM_MODE)); }
/** * Request the projector to get the current film mode * * @return the current film mode * * @throws SonyProjectorException - In case this setting is not available for the projector or any other problem */
Request the projector to get the current film mode
getFilmMode
{ "repo_name": "openhab/openhab2", "path": "bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/SonyProjectorConnector.java", "license": "epl-1.0", "size": 43215 }
[ "org.openhab.binding.sonyprojector.internal.SonyProjectorException" ]
import org.openhab.binding.sonyprojector.internal.SonyProjectorException;
import org.openhab.binding.sonyprojector.internal.*;
[ "org.openhab.binding" ]
org.openhab.binding;
93,690
public boolean accepts(WaveletId id) { boolean match = ids.isEmpty() && prefixes.isEmpty(); if (!match) { match = ids.contains(id); } Iterator<String> itr = prefixes.iterator(); while (itr.hasNext() && !match) { match = match || id.getId().startsWith(itr.next()); } return match; }
boolean function(WaveletId id) { boolean match = ids.isEmpty() && prefixes.isEmpty(); if (!match) { match = ids.contains(id); } Iterator<String> itr = prefixes.iterator(); while (itr.hasNext() && !match) { match = match id.getId().startsWith(itr.next()); } return match; }
/** * Checks whether an id is accepted by the filter. */
Checks whether an id is accepted by the filter
accepts
{ "repo_name": "processone/google-wave-api", "path": "wave-model/src/main/java/org/waveprotocol/wave/model/id/IdFilter.java", "license": "apache-2.0", "size": 3509 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,609,995
public void setBorder(Border border) { if (border == null || border instanceof FlowBorder) super.setBorder(border); else throw new RuntimeException( "Border must be an instance of FlowBorder"); //$NON-NLS-1$ }
void function(Border border) { if (border == null border instanceof FlowBorder) super.setBorder(border); else throw new RuntimeException( STR); }
/** * Overridden to assert that only {@link FlowBorder} is used. * <code>null</code> is still a valid value as well. * * @param border * <code>null</code> or a FlowBorder */
Overridden to assert that only <code>FlowBorder</code> is used. <code>null</code> is still a valid value as well
setBorder
{ "repo_name": "opensagres/xdocreport.eclipse", "path": "rap/org.eclipse.draw2d/src/org/eclipse/draw2d/text/InlineFlow.java", "license": "lgpl-2.1", "size": 5593 }
[ "org.eclipse.draw2d.Border" ]
import org.eclipse.draw2d.Border;
import org.eclipse.draw2d.*;
[ "org.eclipse.draw2d" ]
org.eclipse.draw2d;
179,181
protected String buildAttrMdFolderPath(String service, String servicePath, String destination, String attrName, String attrType) { return NGSICharsets.encodeHDFS(service, false) + NGSICharsets.encodeHDFS(servicePath, true) + (servicePath.equals("/") ? "" : "/") + NGSICharsets.encodeHDFS(destination, false) + CommonConstants.CONCATENATOR + NGSICharsets.encodeHDFS(attrName, false) + CommonConstants.CONCATENATOR + NGSICharsets.encodeHDFS(attrType, false); } // buildAttrMdFolderPath
String function(String service, String servicePath, String destination, String attrName, String attrType) { return NGSICharsets.encodeHDFS(service, false) + NGSICharsets.encodeHDFS(servicePath, true) + (servicePath.equals("/") ? STR/") + NGSICharsets.encodeHDFS(destination, false) + CommonConstants.CONCATENATOR + NGSICharsets.encodeHDFS(attrName, false) + CommonConstants.CONCATENATOR + NGSICharsets.encodeHDFS(attrType, false); }
/** * Builds an attribute metadata HDFS folder path. * @param service * @param servicePath * @param destination * @param attrName * @param attrType * @return The attribute metadata HDFS folder path */
Builds an attribute metadata HDFS folder path
buildAttrMdFolderPath
{ "repo_name": "Fiware/data.Cygnus", "path": "cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIHDFSSink.java", "license": "agpl-3.0", "size": 56898 }
[ "com.telefonica.iot.cygnus.utils.CommonConstants", "com.telefonica.iot.cygnus.utils.NGSICharsets" ]
import com.telefonica.iot.cygnus.utils.CommonConstants; import com.telefonica.iot.cygnus.utils.NGSICharsets;
import com.telefonica.iot.cygnus.utils.*;
[ "com.telefonica.iot" ]
com.telefonica.iot;
2,888,247
public boolean hasValueTransfer(SlotId slotA, SlotId slotB) { if (slotA.equals(slotB)) return true; int mappedSrcId = coalescedSlots_[slotA.asInt()]; int mappedDestId = coalescedSlots_[slotB.asInt()]; if (mappedSrcId == -1 || mappedDestId == -1) return false; if (valueTransfer_[mappedSrcId][mappedDestId]) return true; Set<SlotId> eqSlots = completeSubGraphs_.get(slotA); if (eqSlots == null) return false; return eqSlots.contains(slotB); }
boolean function(SlotId slotA, SlotId slotB) { if (slotA.equals(slotB)) return true; int mappedSrcId = coalescedSlots_[slotA.asInt()]; int mappedDestId = coalescedSlots_[slotB.asInt()]; if (mappedSrcId == -1 mappedDestId == -1) return false; if (valueTransfer_[mappedSrcId][mappedDestId]) return true; Set<SlotId> eqSlots = completeSubGraphs_.get(slotA); if (eqSlots == null) return false; return eqSlots.contains(slotB); }
/** * Returns true if slotA always has the same value as slotB or the tuple * containing slotB is NULL. */
Returns true if slotA always has the same value as slotB or the tuple containing slotB is NULL
hasValueTransfer
{ "repo_name": "mapr/impala", "path": "fe/src/main/java/com/cloudera/impala/analysis/Analyzer.java", "license": "apache-2.0", "size": 79565 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,790,179
public void removeHighlighter(Highlighter highlighter) { Highlighter[] old = getHighlighters(); getCompoundHighlighter().removeHighlighter(highlighter); firePropertyChange("highlighters", old, getHighlighters()); }
void function(Highlighter highlighter) { Highlighter[] old = getHighlighters(); getCompoundHighlighter().removeHighlighter(highlighter); firePropertyChange(STR, old, getHighlighters()); }
/** * Removes the given Highlighter. <p> * * Does nothing if the Highlighter is not contained. * * @param highlighter the Highlighter to remove. * @see #addHighlighter(Highlighter) * @see #setHighlighters(Highlighter...) */
Removes the given Highlighter. Does nothing if the Highlighter is not contained
removeHighlighter
{ "repo_name": "tmyroadctfig/swingx", "path": "swingx-core/src/main/java/org/jdesktop/swingx/JXList.java", "license": "lgpl-2.1", "size": 57047 }
[ "org.jdesktop.swingx.decorator.Highlighter" ]
import org.jdesktop.swingx.decorator.Highlighter;
import org.jdesktop.swingx.decorator.*;
[ "org.jdesktop.swingx" ]
org.jdesktop.swingx;
1,728,609
@Override public int read(byte[] buf, int off, int nbytes) throws IOException { int x = in.read(buf, off, nbytes); if (x != -1) { check.update(buf, off, x); } return x; }
int function(byte[] buf, int off, int nbytes) throws IOException { int x = in.read(buf, off, nbytes); if (x != -1) { check.update(buf, off, x); } return x; }
/** * Reads up to n bytes of data from the underlying input stream, storing it * into {@code buf}, starting at offset {@code off}. The checksum is * updated with the bytes read. * * @param buf * the byte array in which to store the bytes read. * @param off * the initial position in {@code buf} to store the bytes read * from this stream. * @param nbytes * the maximum number of bytes to store in {@code buf}. * @return the number of bytes actually read or {@code -1} if arrived at the * end of the filtered stream while reading the data. * @throws IOException * if this stream is closed or some I/O error occurs. */
Reads up to n bytes of data from the underlying input stream, storing it into buf, starting at offset off. The checksum is updated with the bytes read
read
{ "repo_name": "openweave/openweave-core", "path": "third_party/android/platform-libcore/android-platform-libcore/luni/src/main/java/java/util/zip/CheckedInputStream.java", "license": "apache-2.0", "size": 4523 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
411,456
public static void assertNotEmpty(Collection coll) { assertNotEmpty(null, coll); }
static void function(Collection coll) { assertNotEmpty(null, coll); }
/** * Assert that <code>coll</code> is not empty * @param coll the collection */
Assert that <code>coll</code> is not empty
assertNotEmpty
{ "repo_name": "ogajduse/spacewalk", "path": "java/code/src/com/redhat/rhn/testing/RhnBaseTestCase.java", "license": "gpl-2.0", "size": 9288 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
453,405
public static URI convert2selfURI(final char[] content, final String charSet) throws NullPointerException, IllegalArgumentException { if (content == null) { throw new NullPointerException("Content for URI can't be null"); } else if (charSet == null || charSet.isEmpty()) { throw new IllegalArgumentException("Char set for for URI can't be null or empty"); } else { try { return URI.create("self:/#"+new String(Base64.getEncoder().encode(new String(content).getBytes(charSet)))+"?encoding="+charSet); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e.getLocalizedMessage(),e); } } }
static URI function(final char[] content, final String charSet) throws NullPointerException, IllegalArgumentException { if (content == null) { throw new NullPointerException(STR); } else if (charSet == null charSet.isEmpty()) { throw new IllegalArgumentException(STR); } else { try { return URI.create(STR+new String(Base64.getEncoder().encode(new String(content).getBytes(charSet)))+STR+charSet); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e.getLocalizedMessage(),e); } } }
/** * <p>Build 'self' URI from content</p> * @param content content to build 'self' URI for * @param charSet character set for the content to use * @return 'self' URI built with '?encoding=ZZZ' query string * @throws NullPointerException when content is null * @throws IllegalArgumentException when encoding is null, empty or unknown * @see chav1961.purelib.new.self.Handler */
Build 'self' URI from content
convert2selfURI
{ "repo_name": "chav1961/purelib", "path": "src/main/java/chav1961/purelib/basic/URIUtils.java", "license": "mit", "size": 17659 }
[ "java.io.UnsupportedEncodingException", "java.net.URI", "java.util.Base64" ]
import java.io.UnsupportedEncodingException; import java.net.URI; import java.util.Base64;
import java.io.*; import java.net.*; import java.util.*;
[ "java.io", "java.net", "java.util" ]
java.io; java.net; java.util;
1,831,451
protected void assertTypeEquals(JSType expected, Node actual) { assertTypeEquals(expected, new JSTypeExpression(actual, "<BaseJSTypeTestCase.java>")); }
void function(JSType expected, Node actual) { assertTypeEquals(expected, new JSTypeExpression(actual, STR)); }
/** * Asserts that a Node representing a type expression resolves to the * correct {@code JSType}. */
Asserts that a Node representing a type expression resolves to the correct JSType
assertTypeEquals
{ "repo_name": "shantanusharma/closure-compiler", "path": "src/com/google/javascript/rhino/testing/BaseJSTypeTestCase.java", "license": "apache-2.0", "size": 23909 }
[ "com.google.javascript.rhino.JSTypeExpression", "com.google.javascript.rhino.Node", "com.google.javascript.rhino.jstype.JSType" ]
import com.google.javascript.rhino.JSTypeExpression; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.jstype.JSType;
import com.google.javascript.rhino.*; import com.google.javascript.rhino.jstype.*;
[ "com.google.javascript" ]
com.google.javascript;
77,128
long count(); /** * Lists all {@link CommentDto} matching the criteria. * * @param criteria * {@link ListRange}, or {@code null} for all * @return List of matching {@link CommentDto}
long count(); /** * Lists all {@link CommentDto} matching the criteria. * * @param criteria * {@link ListRange}, or {@code null} for all * @return List of matching {@link CommentDto}
/** * Counts the number of all comments (also unpublished ones). */
Counts the number of all comments (also unpublished ones)
count
{ "repo_name": "shred/cilla", "path": "cilla-ws/src/main/java/org/shredzone/cilla/ws/comment/CommentWs.java", "license": "agpl-3.0", "size": 3420 }
[ "java.util.List", "org.shredzone.cilla.ws.ListRange" ]
import java.util.List; import org.shredzone.cilla.ws.ListRange;
import java.util.*; import org.shredzone.cilla.ws.*;
[ "java.util", "org.shredzone.cilla" ]
java.util; org.shredzone.cilla;
381,880
public void addAjaxInsideZone(String id, String xhtml) { if (ajaxInsideZone == null) { ajaxInsideZone = new HashMap<String, String>(); } ajaxInsideZone.put(id, xhtml); }
void function(String id, String xhtml) { if (ajaxInsideZone == null) { ajaxInsideZone = new HashMap<String, String>(); } ajaxInsideZone.put(id, xhtml); }
/** * add a ajax zone for update. * * @param id * a xhtml id * @param xhtml * the new content of the zone */
add a ajax zone for update
addAjaxInsideZone
{ "repo_name": "Javlo/javlo", "path": "src/main/java/org/javlo/context/ContentContext.java", "license": "lgpl-3.0", "size": 62898 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,807,910
private Element getProperty(String propName) { final NodeList elements = document.getElementsByTagName(PROPERTY_NODE_NAME); for (int index = 0; index < elements.getLength(); index++) { final Element item = (Element) elements.item(index); final String name = item.getAttribute(NAME_PROPERTY); if (propName.equals(name)) { return item; } } return null; }
Element function(String propName) { final NodeList elements = document.getElementsByTagName(PROPERTY_NODE_NAME); for (int index = 0; index < elements.getLength(); index++) { final Element item = (Element) elements.item(index); final String name = item.getAttribute(NAME_PROPERTY); if (propName.equals(name)) { return item; } } return null; }
/** * Returns the DOM element that has a certain property, the * properties is identified after its name. E.G. the method * call : * * <pre> * Element e = getProperty(&quot;kiwi.work.dir&quot;); * </pre> * * will return the element tat looks like : * * <pre> * <property name="kiwi.work.dir" value="/tmp/kiwi"/> * </pre> * * @param propName the property name. * @return the property with the given name. */
Returns the DOM element that has a certain property, the properties is identified after its name. E.G. the method call : <code> Element e = getProperty(&quot;kiwi.work.dir&quot;); </code> will return the element tat looks like : <code> </code>
getProperty
{ "repo_name": "StexX/KiWi-OSE", "path": "src/util/kiwi/util/izpack/DatabaseParser.java", "license": "bsd-3-clause", "size": 9577 }
[ "org.w3c.dom.Element", "org.w3c.dom.NodeList" ]
import org.w3c.dom.Element; import org.w3c.dom.NodeList;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,484,915
@When("^I modify the(?: element found by)?( alias)? \"(.*?)\"(?: \\w+)*? by setting the attribute" + "( alias)? \"(.*?)\" to( alias)? \"(.*?)\"( if it exists)?$") public void modifyAttribute( final String alias, final String selectorValue, final String attributeAlias, final String attribute, final String valueAlias, final String value, final String exists) { try { final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread(); final JavascriptExecutor js = (JavascriptExecutor) webDriver; final WebElement element = simpleWebElementInteraction.getPresenceElementFoundBy( StringUtils.isNotBlank(alias), selectorValue, State.getFeatureStateForThread()); final String aliasName = autoAliasUtils.getValue( attribute, StringUtils.isNoneBlank(attributeAlias), State.getFeatureStateForThread()); final String aliasValue = autoAliasUtils.getValue( value, StringUtils.isNoneBlank(valueAlias), State.getFeatureStateForThread()); final String fixedAliasValue = aliasValue.replaceAll("'", "\\'"); js.executeScript( "arguments[0].setAttribute('" + aliasName + "', '" + fixedAliasValue + "');", element); } catch (final WebElementException ex) { if (StringUtils.isBlank(exists)) { throw ex; } } }
@When(STR(.*?)\STR + STR(.*?)\STR(.*?)\STR) void function( final String alias, final String selectorValue, final String attributeAlias, final String attribute, final String valueAlias, final String value, final String exists) { try { final WebDriver webDriver = State.getThreadDesiredCapabilityMap().getWebDriverForThread(); final JavascriptExecutor js = (JavascriptExecutor) webDriver; final WebElement element = simpleWebElementInteraction.getPresenceElementFoundBy( StringUtils.isNotBlank(alias), selectorValue, State.getFeatureStateForThread()); final String aliasName = autoAliasUtils.getValue( attribute, StringUtils.isNoneBlank(attributeAlias), State.getFeatureStateForThread()); final String aliasValue = autoAliasUtils.getValue( value, StringUtils.isNoneBlank(valueAlias), State.getFeatureStateForThread()); final String fixedAliasValue = aliasValue.replaceAll("'", "\\'"); js.executeScript( STR + aliasName + STR + fixedAliasValue + "');", element); } catch (final WebElementException ex) { if (StringUtils.isBlank(exists)) { throw ex; } } }
/** * Opens up the supplied URL. * * @param alias include this text if the url is actually an alias to be loaded from the * configuration file * @param selectorValue The text used to select the element * @param attributeAlias true if the attribute name is forced to an alias * @param attribute The name of the attribute * @param valueAlias true if the attribute value is an alias * @param value The value to assign to the attribute * @param exists Set this string to silently fail if the element can not be found */
Opens up the supplied URL
modifyAttribute
{ "repo_name": "mcasperson/IridiumApplicationTesting", "path": "src/main/java/au/com/agic/apptesting/steps/ModifyAttributeDefinitions.java", "license": "mit", "size": 3135 }
[ "au.com.agic.apptesting.State", "au.com.agic.apptesting.exception.WebElementException", "org.apache.commons.lang3.StringUtils", "org.openqa.selenium.JavascriptExecutor", "org.openqa.selenium.WebDriver", "org.openqa.selenium.WebElement" ]
import au.com.agic.apptesting.State; import au.com.agic.apptesting.exception.WebElementException; import org.apache.commons.lang3.StringUtils; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement;
import au.com.agic.apptesting.*; import au.com.agic.apptesting.exception.*; import org.apache.commons.lang3.*; import org.openqa.selenium.*;
[ "au.com.agic", "org.apache.commons", "org.openqa.selenium" ]
au.com.agic; org.apache.commons; org.openqa.selenium;
2,475,163
public T next() throws NoSuchElementException { if (this.hasNext()) { T tmp = pos.val; this.lastElementReturned = pos; pos = pos.next; return tmp; } else { throw new NoSuchElementException("no more elements"); } // else } // next()
T function() throws NoSuchElementException { if (this.hasNext()) { T tmp = pos.val; this.lastElementReturned = pos; pos = pos.next; return tmp; } else { throw new NoSuchElementException(STR); } }
/** * Returns the value that the iterator is currently at and then advances. If * it is the last value in the list, pos will be set to null. */
Returns the value that the iterator is currently at and then advances. If it is the last value in the list, pos will be set to null
next
{ "repo_name": "goldstei1/csc207-hw7", "path": "src/edu/grinnell/csc207/goldstei1/LinkedLists/DoublyLinkedList.java", "license": "lgpl-3.0", "size": 15419 }
[ "java.util.NoSuchElementException" ]
import java.util.NoSuchElementException;
import java.util.*;
[ "java.util" ]
java.util;
1,520,837
public synchronized void save() throws IOException { if(BulkChange.contains(this)) return; getDataFile().write(this); SaveableListener.fireOnChange(this, getDataFile()); }
synchronized void function() throws IOException { if(BulkChange.contains(this)) return; getDataFile().write(this); SaveableListener.fireOnChange(this, getDataFile()); }
/** * Save the settings to a file. */
Save the settings to a file
save
{ "repo_name": "IsCoolEntertainment/debpkg_jenkins", "path": "core/src/main/java/hudson/model/Run.java", "license": "mit", "size": 68634 }
[ "hudson.model.listeners.SaveableListener", "java.io.IOException" ]
import hudson.model.listeners.SaveableListener; import java.io.IOException;
import hudson.model.listeners.*; import java.io.*;
[ "hudson.model.listeners", "java.io" ]
hudson.model.listeners; java.io;
1,408,946
String getCplFactType(Collection<I_C_AdvCommissionFact> cplFacts);
String getCplFactType(Collection<I_C_AdvCommissionFact> cplFacts);
/** * For a given collection of commission fact that reference a {@link I_C_AdvCommissionPayrollLine}, this method returns the FactType that should be used when recording a commission invoice line. * * @param cplFact * @return */
For a given collection of commission fact that reference a <code>I_C_AdvCommissionPayrollLine</code>, this method returns the FactType that should be used when recording a commission invoice line
getCplFactType
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.commission/de.metas.commission.base/src/main/java/de/metas/commission/service/ICommissionFactBL.java", "license": "gpl-2.0", "size": 9336 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,142,614
public void testCountByReportQuery() throws Exception { // 7 articles, 2 books, 3 cds Criteria criteria = new Criteria(); criteria.addEqualTo("productGroupId", new Integer(5)); ReportQueryByCriteria query = QueryFactory.newReportQuery(Article.class, criteria); query.setAttributes(new String[]{"count(*)"}); Iterator iter = broker.getReportQueryIteratorByQuery(query); Object[] row; int count = 0; while (iter.hasNext()) { row = (Object[]) iter.next(); count += ((Number) row[0]).intValue(); } assertEquals("Iterator should produce 12 items", 12, count); // get count count = broker.getCount(query); assertEquals("Count should be 12", 12, count); }
void function() throws Exception { Criteria criteria = new Criteria(); criteria.addEqualTo(STR, new Integer(5)); ReportQueryByCriteria query = QueryFactory.newReportQuery(Article.class, criteria); query.setAttributes(new String[]{STR}); Iterator iter = broker.getReportQueryIteratorByQuery(query); Object[] row; int count = 0; while (iter.hasNext()) { row = (Object[]) iter.next(); count += ((Number) row[0]).intValue(); } assertEquals(STR, 12, count); count = broker.getCount(query); assertEquals(STR, 12, count); }
/** * do a count by report query */
do a count by report query
testCountByReportQuery
{ "repo_name": "kuali/ojb-1.0.4", "path": "src/test/org/apache/ojb/broker/PersistenceBrokerTest.java", "license": "apache-2.0", "size": 62167 }
[ "java.util.Iterator", "org.apache.ojb.broker.query.Criteria", "org.apache.ojb.broker.query.QueryFactory", "org.apache.ojb.broker.query.ReportQueryByCriteria" ]
import java.util.Iterator; import org.apache.ojb.broker.query.Criteria; import org.apache.ojb.broker.query.QueryFactory; import org.apache.ojb.broker.query.ReportQueryByCriteria;
import java.util.*; import org.apache.ojb.broker.query.*;
[ "java.util", "org.apache.ojb" ]
java.util; org.apache.ojb;
2,812,348
Observable<ServiceResponse<A>> getDefaultModelA400ValidAsync();
Observable<ServiceResponse<A>> getDefaultModelA400ValidAsync();
/** * Send a 400 response with valid payload: {'statusCode': '400'}. * * @return the observable to the A object */
Send a 400 response with valid payload: {'statusCode': '400'}
getDefaultModelA400ValidAsync
{ "repo_name": "haocs/autorest", "path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/http/MultipleResponses.java", "license": "mit", "size": 33841 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
905,173
public static String textToHtmlFragment(final String text) { // Escape the entities and add newlines. String htmlified = TextUtils.htmlEncode(text); // Linkify the message. StringBuffer linkified = new StringBuffer(htmlified.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); UriLinkifier.linkifyText(htmlified, linkified); // Add newlines and unescaping. // // For some reason, TextUtils.htmlEncode escapes ' into &apos;, which is technically part of the XHTML 1.0 // standard, but Gmail doesn't recognize it as an HTML entity. We unescape that here. return linkified.toString().replaceAll("\r?\n", "<br>\r\n").replace("&apos;", "&#39;"); }
static String function(final String text) { String htmlified = TextUtils.htmlEncode(text); StringBuffer linkified = new StringBuffer(htmlified.length() + TEXT_TO_HTML_EXTRA_BUFFER_LENGTH); UriLinkifier.linkifyText(htmlified, linkified); return linkified.toString().replaceAll("\r?\n", STR).replace(STR, "&#39;"); }
/** * Convert a plain text string into an HTML fragment. * @param text Plain text. * @return HTML fragment. */
Convert a plain text string into an HTML fragment
textToHtmlFragment
{ "repo_name": "jca02266/k-9", "path": "k9mail/src/main/java/com/fsck/k9/message/html/HtmlConverter.java", "license": "apache-2.0", "size": 41073 }
[ "android.text.TextUtils" ]
import android.text.TextUtils;
import android.text.*;
[ "android.text" ]
android.text;
2,687,021
public Builder repoCurveGroups(Map<LegalEntityId, RepoGroup> repoCurveGroups) { JodaBeanUtils.notNull(repoCurveGroups, "repoCurveGroups"); this.repoCurveGroups = repoCurveGroups; return this; }
Builder function(Map<LegalEntityId, RepoGroup> repoCurveGroups) { JodaBeanUtils.notNull(repoCurveGroups, STR); this.repoCurveGroups = repoCurveGroups; return this; }
/** * Sets the groups used to find a repo curve by legal entity. * <p> * This maps the legal entity ID to a group. * The group is used to find the curve in {@code repoCurves}. * @param repoCurveGroups the new value, not null * @return this, for chaining, not null */
Sets the groups used to find a repo curve by legal entity. This maps the legal entity ID to a group. The group is used to find the curve in repoCurves
repoCurveGroups
{ "repo_name": "OpenGamma/Strata", "path": "modules/pricer/src/main/java/com/opengamma/strata/pricer/bond/ImmutableLegalEntityDiscountingProvider.java", "license": "apache-2.0", "size": 31884 }
[ "com.opengamma.strata.market.curve.RepoGroup", "com.opengamma.strata.product.LegalEntityId", "java.util.Map", "org.joda.beans.JodaBeanUtils" ]
import com.opengamma.strata.market.curve.RepoGroup; import com.opengamma.strata.product.LegalEntityId; import java.util.Map; import org.joda.beans.JodaBeanUtils;
import com.opengamma.strata.market.curve.*; import com.opengamma.strata.product.*; import java.util.*; import org.joda.beans.*;
[ "com.opengamma.strata", "java.util", "org.joda.beans" ]
com.opengamma.strata; java.util; org.joda.beans;
2,896,548
protected static String makeCompoundName(String op, ArrayList<Term> arg) { StringBuffer name = new StringBuffer(); name.append(Symbols.COMPOUND_TERM_OPENER); name.append(op); for (Term t : arg) { name.append(Symbols.ARGUMENT_SEPARATOR); if (t instanceof CompoundTerm) { ((CompoundTerm) t).setName(((CompoundTerm) t).makeName()); } name.append(t.getName()); } name.append(Symbols.COMPOUND_TERM_CLOSER); return name.toString(); }
static String function(String op, ArrayList<Term> arg) { StringBuffer name = new StringBuffer(); name.append(Symbols.COMPOUND_TERM_OPENER); name.append(op); for (Term t : arg) { name.append(Symbols.ARGUMENT_SEPARATOR); if (t instanceof CompoundTerm) { ((CompoundTerm) t).setName(((CompoundTerm) t).makeName()); } name.append(t.getName()); } name.append(Symbols.COMPOUND_TERM_CLOSER); return name.toString(); }
/** * default method to make the name of a compound term from given fields * @param op the term operator * @param arg the list of components * @return the name of the term */
default method to make the name of a compound term from given fields
makeCompoundName
{ "repo_name": "automenta/jcog", "path": "nars/jcog/nars/reason/language/CompoundTerm.java", "license": "gpl-3.0", "size": 26257 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
345,413
private void checkPayloadTypeCache(RTPPacket rtpPacket) throws PartiallyProcessedPacketException { if (cache.sm.formatinfo.get(rtpPacket.payloadType) == null) { throw new PartiallyProcessedPacketException( "No format has been registered for RTP Payload type " + rtpPacket.payloadType); } }
void function(RTPPacket rtpPacket) throws PartiallyProcessedPacketException { if (cache.sm.formatinfo.get(rtpPacket.payloadType) == null) { throw new PartiallyProcessedPacketException( STR + rtpPacket.payloadType); } }
/** * Check whether we have a format for the current packet's payload type. * If not, we're not going to be able to process it so throw it away. * * @param rtpPacket The RTP packet to check * @throws PartiallyProcessedPacketException */
Check whether we have a format for the current packet's payload type. If not, we're not going to be able to process it so throw it away
checkPayloadTypeCache
{ "repo_name": "Metaswitch/fmj", "path": "src.rtp/net/sf/fmj/media/rtp/RTPReceiver.java", "license": "lgpl-3.0", "size": 25144 }
[ "net.sf.fmj.media.rtp.util.RTPPacket" ]
import net.sf.fmj.media.rtp.util.RTPPacket;
import net.sf.fmj.media.rtp.util.*;
[ "net.sf.fmj" ]
net.sf.fmj;
183,960
@Test public void testParse () { parser.parse(this, fieldReference, "123456789.987654321"); assertEquals(123456789.987654321, field, DELTA_DOUBLE_COMPARISON); }
void function () { parser.parse(this, fieldReference, STR); assertEquals(123456789.987654321, field, DELTA_DOUBLE_COMPARISON); }
/** * Test method for {@link DoubleParser#parse(Object, Field, String)}. */
Test method for <code>DoubleParser#parse(Object, Field, String)</code>
testParse
{ "repo_name": "AlexRNL/Commons", "path": "src/test/java/com/alexrnl/commons/arguments/parsers/DoubleParserTest.java", "license": "bsd-3-clause", "size": 1648 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,658,605
public int position(Node node, Env env, AbstractPattern pattern) throws XPathException { Iterator iter = _expr.evalNodeSet(node, env); int i = 1; while (iter.hasNext()) { if (iter.next() == node) return i; i++; } return 0; }
int function(Node node, Env env, AbstractPattern pattern) throws XPathException { Iterator iter = _expr.evalNodeSet(node, env); int i = 1; while (iter.hasNext()) { if (iter.next() == node) return i; i++; } return 0; }
/** * The position is the position in the expression node-set. */
The position is the position in the expression node-set
position
{ "repo_name": "dwango/quercus", "path": "src/main/java/com/caucho/xpath/pattern/FromExpr.java", "license": "gpl-2.0", "size": 3338 }
[ "com.caucho.xpath.Env", "com.caucho.xpath.XPathException", "java.util.Iterator", "org.w3c.dom.Node" ]
import com.caucho.xpath.Env; import com.caucho.xpath.XPathException; import java.util.Iterator; import org.w3c.dom.Node;
import com.caucho.xpath.*; import java.util.*; import org.w3c.dom.*;
[ "com.caucho.xpath", "java.util", "org.w3c.dom" ]
com.caucho.xpath; java.util; org.w3c.dom;
488,976
protected String getDocumentDescription(BankTransaction bankTransaction){ String documentDescription = bankTransaction.getDescription(); if ( StringUtils.isBlank(bankTransaction.getDescriptiveTxt6()) ){ documentDescription = bankTransaction.getBankReference(); } return StringUtils.left(documentDescription, KFSConstants.BankTransactionConstants.MAX_DESCRIPTION_LEN); }
String function(BankTransaction bankTransaction){ String documentDescription = bankTransaction.getDescription(); if ( StringUtils.isBlank(bankTransaction.getDescriptiveTxt6()) ){ documentDescription = bankTransaction.getBankReference(); } return StringUtils.left(documentDescription, KFSConstants.BankTransactionConstants.MAX_DESCRIPTION_LEN); }
/** * Returns trimmed down description from the bankTransaction to set in the document as following: * 1. If bankTransaction.DescriptiveTxt6 is empty, it will return the bankTransaction.BankReference * 2. Otherwise it will return bankTransaction.DescriptiveTxt6 concatenated with bankTransaction.DescriptiveTxt7 * Result above is trimmed down KFSConstants.BankTransactionConstants.MAX_DESCRIPTION_LEN leftmost charaters * * @param bankTransaction * @return */
Returns trimmed down description from the bankTransaction to set in the document as following: 1. If bankTransaction.DescriptiveTxt6 is empty, it will return the bankTransaction.BankReference 2. Otherwise it will return bankTransaction.DescriptiveTxt6 concatenated with bankTransaction.DescriptiveTxt7 Result above is trimmed down KFSConstants.BankTransactionConstants.MAX_DESCRIPTION_LEN leftmost charaters
getDocumentDescription
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-core/src/main/java/edu/arizona/kfs/fp/batch/service/impl/AbstractBankDocumentService.java", "license": "agpl-3.0", "size": 9105 }
[ "edu.arizona.kfs.fp.businessobject.BankTransaction", "edu.arizona.kfs.sys.KFSConstants", "org.apache.commons.lang.StringUtils" ]
import edu.arizona.kfs.fp.businessobject.BankTransaction; import edu.arizona.kfs.sys.KFSConstants; import org.apache.commons.lang.StringUtils;
import edu.arizona.kfs.fp.businessobject.*; import edu.arizona.kfs.sys.*; import org.apache.commons.lang.*;
[ "edu.arizona.kfs", "org.apache.commons" ]
edu.arizona.kfs; org.apache.commons;
1,404,651
public YearMonth plusYears(long yearsToAdd) { if (yearsToAdd == 0) { return this; } int newYear = YEAR.checkValidIntValue(year + yearsToAdd); // safe overflow return with(newYear, month); }
YearMonth function(long yearsToAdd) { if (yearsToAdd == 0) { return this; } int newYear = YEAR.checkValidIntValue(year + yearsToAdd); return with(newYear, month); }
/** * Returns a copy of this year-month with the specified period in years added. * <p> * This instance is immutable and unaffected by this method call. * * @param yearsToAdd the years to add, may be negative * @return a {@code YearMonth} based on this year-month with the years added, not null * @throws DateTimeException if the result exceeds the supported range */
Returns a copy of this year-month with the specified period in years added. This instance is immutable and unaffected by this method call
plusYears
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jdk/src/share/classes/java/time/YearMonth.java", "license": "mit", "size": 53958 }
[ "java.time.temporal.ChronoField" ]
import java.time.temporal.ChronoField;
import java.time.temporal.*;
[ "java.time" ]
java.time;
735,054
public void importSchemaDir(String dir, Boolean includeEnums) throws IOException { UmlCom.message("Importing NIEM schema"); // Configure DOM Path path = FileSystems.getDefault().getPath(dir); String importPath = path.toString(); int passes = (includeEnums) ? 4 : 3; // Walk directory to import in passes (0: types, 1: elements, 2: // elements in types, 3: enumerations for (importPass = 0; importPass < passes; importPass++) { switch (importPass) { case 0: Log.trace("\nImporting types"); break; case 1: Log.trace("\nImporting elements"); break; case 2: Log.trace("\nImporting elements and attributes in types"); break; }
void function(String dir, Boolean includeEnums) throws IOException { UmlCom.message(STR); Path path = FileSystems.getDefault().getPath(dir); String importPath = path.toString(); int passes = (includeEnums) ? 4 : 3; for (importPass = 0; importPass < passes; importPass++) { switch (importPass) { case 0: Log.trace(STR); break; case 1: Log.trace(STR); break; case 2: Log.trace(STR); break; }
/** import NIEM reference model into HashMaps to support validation of NIEM elements and types * @param dir * @param includeEnums * @throws IOException */
import NIEM reference model into HashMaps to support validation of NIEM elements and types
importSchemaDir
{ "repo_name": "cabralje/niem-tools", "path": "niemtools-bouml/src/com/infotrack/niemtools/NiemUmlClass.java", "license": "gpl-3.0", "size": 44758 }
[ "fr.bouml.UmlCom", "java.io.IOException", "java.nio.file.FileSystems", "java.nio.file.Path" ]
import fr.bouml.UmlCom; import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Path;
import fr.bouml.*; import java.io.*; import java.nio.file.*;
[ "fr.bouml", "java.io", "java.nio" ]
fr.bouml; java.io; java.nio;
802,710
public SnowOwlConfiguration getConfiguration() { return configuration; } /** * Bootstraps the application with a default configuration. * @return * * @throws Exception * @see {@link #bootstrap(String)}
SnowOwlConfiguration function() { return configuration; } /** * Bootstraps the application with a default configuration. * @return * * @throws Exception * @see {@link #bootstrap(String)}
/** * Returns the global {@link SnowOwlConfiguration} of this * {@link SnowOwl}. * * @return */
Returns the global <code>SnowOwlConfiguration</code> of this <code>SnowOwl</code>
getConfiguration
{ "repo_name": "b2ihealthcare/snow-owl", "path": "core/com.b2international.snowowl.core/src/com/b2international/snowowl/core/SnowOwl.java", "license": "apache-2.0", "size": 13977 }
[ "com.b2international.snowowl.core.config.SnowOwlConfiguration" ]
import com.b2international.snowowl.core.config.SnowOwlConfiguration;
import com.b2international.snowowl.core.config.*;
[ "com.b2international.snowowl" ]
com.b2international.snowowl;
1,377,369
if (value == null) { synchronized (this) { if (value == null) { try { T t = Preconditions.checkNotNull(delegate.get()); value = Either.ofLeft(t); return t; } catch (Exception e) { if (exceptionClass.isInstance(e)) { value = Either.ofRight(exceptionClass.cast(e)); Throwables.throwIfInstanceOf(e, exceptionClass); } Throwables.throwIfUnchecked(e); throw new IllegalStateException(e); } } } } if (value.isLeft()) { return value.getLeft(); } throw value.getRight(); }
if (value == null) { synchronized (this) { if (value == null) { try { T t = Preconditions.checkNotNull(delegate.get()); value = Either.ofLeft(t); return t; } catch (Exception e) { if (exceptionClass.isInstance(e)) { value = Either.ofRight(exceptionClass.cast(e)); Throwables.throwIfInstanceOf(e, exceptionClass); } Throwables.throwIfUnchecked(e); throw new IllegalStateException(e); } } } } if (value.isLeft()) { return value.getLeft(); } throw value.getRight(); }
/** * Get the value and memoize the result. Constructs the value if it hasn't been memoized before, * or if the previously memoized value has been collected. * * @param delegate delegate for constructing the value * @return the value */
Get the value and memoize the result. Constructs the value if it hasn't been memoized before, or if the previously memoized value has been collected
get
{ "repo_name": "facebook/buck", "path": "src/com/facebook/buck/util/AbstractMemoizer.java", "license": "apache-2.0", "size": 2045 }
[ "com.facebook.buck.util.types.Either", "com.google.common.base.Preconditions", "com.google.common.base.Throwables" ]
import com.facebook.buck.util.types.Either; import com.google.common.base.Preconditions; import com.google.common.base.Throwables;
import com.facebook.buck.util.types.*; import com.google.common.base.*;
[ "com.facebook.buck", "com.google.common" ]
com.facebook.buck; com.google.common;
2,100,466
private JPanel makeButtonPanel() { add = new JButton(JMeterUtils.getResString("add")); // $NON-NLS-1$ add.setActionCommand(ADD); add.setEnabled(true); delete = new JButton(JMeterUtils.getResString("delete")); // $NON-NLS-1$ delete.setActionCommand(DELETE); template = new JButton("Generate Template"); template.setActionCommand(GEN_TEMPLATE); template.setEnabled(true); exportAppModel = new JButton("Export Models (.dot)"); exportAppModel.setActionCommand(EXPORT_APPMODEL); exportAppModel.setEnabled(true); checkDeleteStatus(); JPanel buttonPanel = new JPanel(); buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); if (this.background != null) { buttonPanel.setBackground(this.background); } add.addActionListener(this); delete.addActionListener(this); template.addActionListener(this); exportAppModel.addActionListener(this); buttonPanel.add(add); buttonPanel.add(delete); buttonPanel.add(template); buttonPanel.add(exportAppModel); return buttonPanel; }
JPanel function() { add = new JButton(JMeterUtils.getResString("add")); add.setActionCommand(ADD); add.setEnabled(true); delete = new JButton(JMeterUtils.getResString(STR)); delete.setActionCommand(DELETE); template = new JButton(STR); template.setActionCommand(GEN_TEMPLATE); template.setEnabled(true); exportAppModel = new JButton(STR); exportAppModel.setActionCommand(EXPORT_APPMODEL); exportAppModel.setEnabled(true); checkDeleteStatus(); JPanel buttonPanel = new JPanel(); buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); if (this.background != null) { buttonPanel.setBackground(this.background); } add.addActionListener(this); delete.addActionListener(this); template.addActionListener(this); exportAppModel.addActionListener(this); buttonPanel.add(add); buttonPanel.add(delete); buttonPanel.add(template); buttonPanel.add(exportAppModel); return buttonPanel; }
/** * Create a panel containing the add and delete buttons. * * @return a GUI panel containing the buttons */
Create a panel containing the add and delete buttons
makeButtonPanel
{ "repo_name": "Wessbas/wessbas.markov4jmeter", "path": "src/net/voorn/markov4jmeter/control/gui/BehaviorMixPanel.java", "license": "apache-2.0", "size": 26355 }
[ "javax.swing.BorderFactory", "javax.swing.JButton", "javax.swing.JPanel", "org.apache.jmeter.util.JMeterUtils" ]
import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JPanel; import org.apache.jmeter.util.JMeterUtils;
import javax.swing.*; import org.apache.jmeter.util.*;
[ "javax.swing", "org.apache.jmeter" ]
javax.swing; org.apache.jmeter;
2,552,663
String getAuthentication(DefaultHttpSession httpSession, HttpResponseMessage httpMessage, RequestorType requestorType) { Integer maxAthenticates = new Integer((httpSession.getRemoteAddress().getOption(MAX_AUTHENTICATION_ATTEMPTS))); String result = null; if (maxAthenticates > 0 && HTTP_AUTHENTICATOR.isEnabled(configuration)) { try { ResourceAddress remoteAddress = httpSession.getRemoteAddress(); final URI remoteURI = remoteAddress.getResource(); List<WWWAuthChallenge> challenges = getChallenges(httpMessage.getHeader(HttpHeaders.HEADER_WWW_AUTHENTICATE)); for (WWWAuthChallenge challenge : challenges) { // @formatter:off String scheme = challenge.getScheme(); PasswordAuthentication credentials = Authenticator.requestPasswordAuthentication( remoteURI.getHost(), InetAddress.getByName(remoteURI.getHost()), remoteURI.getPort(), "HTTP", challenge.getChallenge().replaceFirst(scheme + " ", ""), scheme, remoteURI.toURL(), requestorType); // @formatter:on result = WWWAuthChallenge.encodeAuthorizationHeader(scheme, credentials); if (result != null) { break; } } } catch (Exception e) { if (logger.isWarnEnabled()) { logger.warn("Failed to get a valid response from Authenticator due to exception ", e); } } } return result; }
String getAuthentication(DefaultHttpSession httpSession, HttpResponseMessage httpMessage, RequestorType requestorType) { Integer maxAthenticates = new Integer((httpSession.getRemoteAddress().getOption(MAX_AUTHENTICATION_ATTEMPTS))); String result = null; if (maxAthenticates > 0 && HTTP_AUTHENTICATOR.isEnabled(configuration)) { try { ResourceAddress remoteAddress = httpSession.getRemoteAddress(); final URI remoteURI = remoteAddress.getResource(); List<WWWAuthChallenge> challenges = getChallenges(httpMessage.getHeader(HttpHeaders.HEADER_WWW_AUTHENTICATE)); for (WWWAuthChallenge challenge : challenges) { String scheme = challenge.getScheme(); PasswordAuthentication credentials = Authenticator.requestPasswordAuthentication( remoteURI.getHost(), InetAddress.getByName(remoteURI.getHost()), remoteURI.getPort(), "HTTP", challenge.getChallenge().replaceFirst(scheme + " ", STRFailed to get a valid response from Authenticator due to exception ", e); } } } return result; }
/** * Gets the password Authentication header value * @param httpSession * @param httpMessage * @param requestorType * @return */
Gets the password Authentication header value
getAuthentication
{ "repo_name": "justinma246/gateway", "path": "transport/http/src/main/java/org/kaazing/gateway/transport/http/HttpConnector.java", "license": "apache-2.0", "size": 29722 }
[ "java.net.Authenticator", "java.net.InetAddress", "java.net.PasswordAuthentication", "java.util.List", "org.kaazing.gateway.resource.address.ResourceAddress", "org.kaazing.gateway.transport.http.bridge.HttpResponseMessage", "org.kaazing.gateway.transport.http.security.auth.WWWAuthChallenge", "org.kaazing.gateway.transport.http.security.auth.WWWAuthenticateHeaderUtils" ]
import java.net.Authenticator; import java.net.InetAddress; import java.net.PasswordAuthentication; import java.util.List; import org.kaazing.gateway.resource.address.ResourceAddress; import org.kaazing.gateway.transport.http.bridge.HttpResponseMessage; import org.kaazing.gateway.transport.http.security.auth.WWWAuthChallenge; import org.kaazing.gateway.transport.http.security.auth.WWWAuthenticateHeaderUtils;
import java.net.*; import java.util.*; import org.kaazing.gateway.resource.address.*; import org.kaazing.gateway.transport.http.bridge.*; import org.kaazing.gateway.transport.http.security.auth.*;
[ "java.net", "java.util", "org.kaazing.gateway" ]
java.net; java.util; org.kaazing.gateway;
738,540
public void getSQLFromField(PreparedStatement statement, int iType, int iParamColumn) throws SQLException { if (this.isNull()) statement.setNull(iParamColumn, Types.BIT); else { String strBitSupported = DBConstants.TRUE; if (this.getRecord() != null) if (this.getRecord().getTable() != null) if (this.getRecord().getTable().getDatabase().getProperties() != null) strBitSupported = (String)this.getRecord().getTable().getDatabase().getProperties().get(SQLParams.BIT_TYPE_SUPPORTED); if (DBConstants.TRUE.equals(strBitSupported)) statement.setBoolean(iParamColumn, this.getState()); else statement.setByte(iParamColumn, (this.getState() ? (byte)1 : (byte)0)); } }
void function(PreparedStatement statement, int iType, int iParamColumn) throws SQLException { if (this.isNull()) statement.setNull(iParamColumn, Types.BIT); else { String strBitSupported = DBConstants.TRUE; if (this.getRecord() != null) if (this.getRecord().getTable() != null) if (this.getRecord().getTable().getDatabase().getProperties() != null) strBitSupported = (String)this.getRecord().getTable().getDatabase().getProperties().get(SQLParams.BIT_TYPE_SUPPORTED); if (DBConstants.TRUE.equals(strBitSupported)) statement.setBoolean(iParamColumn, this.getState()); else statement.setByte(iParamColumn, (this.getState() ? (byte)1 : (byte)0)); } }
/** * Move the physical binary data to this SQL parameter row. * @param statement The SQL prepare statement. * @param iType the type of SQL statement. * @param iParamColumn The column in the prepared statement to set the data. * @exception SQLException From SQL calls. */
Move the physical binary data to this SQL parameter row
getSQLFromField
{ "repo_name": "jbundle/jbundle", "path": "base/base/src/main/java/org/jbundle/base/field/BooleanField.java", "license": "gpl-3.0", "size": 13818 }
[ "java.sql.PreparedStatement", "java.sql.SQLException", "java.sql.Types", "org.jbundle.base.db.SQLParams", "org.jbundle.base.model.DBConstants" ]
import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Types; import org.jbundle.base.db.SQLParams; import org.jbundle.base.model.DBConstants;
import java.sql.*; import org.jbundle.base.db.*; import org.jbundle.base.model.*;
[ "java.sql", "org.jbundle.base" ]
java.sql; org.jbundle.base;
165,903
@Test public void exportBuzaInJson(){ l(this,"@Test exportBuzaInJson"); BuzaExporterMock bem = new BuzaExporterMock(); bem.exportBuzaInJson(Mockito.mock(BuzasActivity.class), buzaToExport, ""); }
void function(){ l(this,STR); BuzaExporterMock bem = new BuzaExporterMock(); bem.exportBuzaInJson(Mockito.mock(BuzasActivity.class), buzaToExport, ""); }
/** * Tests the exportBuzaInJson() method */
Tests the exportBuzaInJson() method
exportBuzaInJson
{ "repo_name": "pylapp/Buza", "path": "app/src/test/java/pylapp/buza/android/tools/export/UtBuzaExporterMock.java", "license": "mit", "size": 3868 }
[ "org.mockito.Mockito" ]
import org.mockito.Mockito;
import org.mockito.*;
[ "org.mockito" ]
org.mockito;
57,672
void query(Connection conn, String s, int i, int size, StringBuilder buff) { if (!(s.startsWith("@") && s.endsWith("."))) { buff.append(PageParser.escapeHtml(s + ";")).append("<br />"); } boolean forceEdit = s.startsWith("@edit"); buff.append(getResult(conn, i + 1, s, size == 1, forceEdit)). append("<br />"); }
void query(Connection conn, String s, int i, int size, StringBuilder buff) { if (!(s.startsWith("@") && s.endsWith("."))) { buff.append(PageParser.escapeHtml(s + ";")).append(STR); } boolean forceEdit = s.startsWith("@edit"); buff.append(getResult(conn, i + 1, s, size == 1, forceEdit)). append(STR); }
/** * Execute a query and append the result to the buffer. * * @param conn the connection * @param s the statement * @param i the index * @param size the number of statements * @param buff the target buffer */
Execute a query and append the result to the buffer
query
{ "repo_name": "paulnguyen/data", "path": "sqldbs/h2java/src/main/org/h2/server/web/WebApp.java", "license": "apache-2.0", "size": 76492 }
[ "java.sql.Connection" ]
import java.sql.Connection;
import java.sql.*;
[ "java.sql" ]
java.sql;
110,387
LinkGroup createdGroup = null; if (group != null) { createdGroup = dataStore.create(group); LOGGER.info("Created Group {}", createdGroup.getName()); } return createdGroup; }
LinkGroup createdGroup = null; if (group != null) { createdGroup = dataStore.create(group); LOGGER.info(STR, createdGroup.getName()); } return createdGroup; }
/** * Creates a new Group with given Object * * @param group Object to be Create * @return created Group object */
Creates a new Group with given Object
create
{ "repo_name": "srinivasscm87/tarvis", "path": "zols-cms-plugin/src/main/java/org/zols/links/service/LinkGroupService.java", "license": "apache-2.0", "size": 4562 }
[ "org.zols.links.domain.LinkGroup" ]
import org.zols.links.domain.LinkGroup;
import org.zols.links.domain.*;
[ "org.zols.links" ]
org.zols.links;
1,862,893
private void handleBlockComment(Comment comment) { Pattern p = Pattern.compile("(/|(\n[ \t]*))\\*[ \t]*@[a-zA-Z]+[ \t\n{]"); if (p.matcher(comment.value).find()) { errorReporter.warning( SUSPICIOUS_COMMENT_WARNING, sourceName, lineno(comment.location.start), charno(comment.location.start)); } }
void function(Comment comment) { Pattern p = Pattern.compile(STR); if (p.matcher(comment.value).find()) { errorReporter.warning( SUSPICIOUS_COMMENT_WARNING, sourceName, lineno(comment.location.start), charno(comment.location.start)); } }
/** * Check to see if the given block comment looks like it should be JSDoc. */
Check to see if the given block comment looks like it should be JSDoc
handleBlockComment
{ "repo_name": "rintaro/closure-compiler", "path": "src/com/google/javascript/jscomp/parsing/IRFactory.java", "license": "apache-2.0", "size": 110634 }
[ "com.google.javascript.jscomp.parsing.parser.trees.Comment", "java.util.regex.Pattern" ]
import com.google.javascript.jscomp.parsing.parser.trees.Comment; import java.util.regex.Pattern;
import com.google.javascript.jscomp.parsing.parser.trees.*; import java.util.regex.*;
[ "com.google.javascript", "java.util" ]
com.google.javascript; java.util;
2,755,000
@SuppressWarnings("deprecation") public boolean equalsIgnoreBase(IdType theId) { if (theId == null) { return false; } if (theId.isEmpty()) { return isEmpty(); } return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); }
@SuppressWarnings(STR) boolean function(IdType theId) { if (theId == null) { return false; } if (theId.isEmpty()) { return isEmpty(); } return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); }
/** * Returns true if this IdType matches the given IdType in terms of resource * type and ID, but ignores the URL base */
Returns true if this IdType matches the given IdType in terms of resource type and ID, but ignores the URL base
equalsIgnoreBase
{ "repo_name": "Cloudyle/hapi-fhir", "path": "hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/IdType.java", "license": "apache-2.0", "size": 21913 }
[ "org.apache.commons.lang3.ObjectUtils" ]
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.*;
[ "org.apache.commons" ]
org.apache.commons;
1,907,299
protected boolean checkIfHeaders(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes) throws IOException { if (!super.checkIfHeaders(request, response, resourceAttributes)) return false; // TODO : Checking the WebDAV If header return true; }
boolean function(HttpServletRequest request, HttpServletResponse response, ResourceAttributes resourceAttributes) throws IOException { if (!super.checkIfHeaders(request, response, resourceAttributes)) return false; return true; }
/** * Check if the conditions specified in the optional If headers are * satisfied. * * @param request The servlet request we are processing * @param response The servlet response we are creating * @param resourceAttributes The resource information * @return boolean true if the resource meets all the specified conditions, * and false if any of the conditions is not satisfied, in which case * request processing is stopped */
Check if the conditions specified in the optional If headers are satisfied
checkIfHeaders
{ "repo_name": "Netprophets/JBOSSWEB_7_0_13_FINAL", "path": "java/org/apache/catalina/servlets/WebdavServlet.java", "license": "lgpl-3.0", "size": 110965 }
[ "java.io.IOException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.naming.resources.ResourceAttributes" ]
import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.naming.resources.ResourceAttributes;
import java.io.*; import javax.servlet.http.*; import org.apache.naming.resources.*;
[ "java.io", "javax.servlet", "org.apache.naming" ]
java.io; javax.servlet; org.apache.naming;
742,688
@Test public void notVersionableCreateRecordFromVersion() { // content node is not versionable doReturn(false).when(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE); // create record from version recordableVersionService.createRecordFromLatestVersion(filePlan, nodeRef); // nothing happens verify(mockedRecordService, never()).createRecordFromCopy(eq(filePlan), any(NodeRef.class)); }
void function() { doReturn(false).when(mockedNodeService).hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE); recordableVersionService.createRecordFromLatestVersion(filePlan, nodeRef); verify(mockedRecordService, never()).createRecordFromCopy(eq(filePlan), any(NodeRef.class)); }
/** * Given that a node is not versionable * When I try and create a record from the latest version * Then nothing will happen, because there is not version to record */
Given that a node is not versionable When I try and create a record from the latest version Then nothing will happen, because there is not version to record
notVersionableCreateRecordFromVersion
{ "repo_name": "dnacreative/records-management", "path": "rm-server/unit-test/java/org/alfresco/module/org_alfresco_module_rm/version/RecordableVersionServiceImplUnitTest.java", "license": "lgpl-3.0", "size": 22998 }
[ "org.alfresco.model.ContentModel", "org.alfresco.service.cmr.repository.NodeRef", "org.mockito.Matchers", "org.mockito.Mockito" ]
import org.alfresco.model.ContentModel; import org.alfresco.service.cmr.repository.NodeRef; import org.mockito.Matchers; import org.mockito.Mockito;
import org.alfresco.model.*; import org.alfresco.service.cmr.repository.*; import org.mockito.*;
[ "org.alfresco.model", "org.alfresco.service", "org.mockito" ]
org.alfresco.model; org.alfresco.service; org.mockito;
910,468
int updateByExampleSelective(@Param("record") RelayEmailNotificationWithBLOBs record, @Param("example") RelayEmailNotificationExample example);
int updateByExampleSelective(@Param(STR) RelayEmailNotificationWithBLOBs record, @Param(STR) RelayEmailNotificationExample example);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table s_relay_email_notification * * @mbggenerated Thu Jul 16 10:50:11 ICT 2015 */
This method was generated by MyBatis Generator. This method corresponds to the database table s_relay_email_notification
updateByExampleSelective
{ "repo_name": "uniteddiversity/mycollab", "path": "mycollab-services/src/main/java/com/esofthead/mycollab/common/dao/RelayEmailNotificationMapper.java", "license": "agpl-3.0", "size": 5245 }
[ "com.esofthead.mycollab.common.domain.RelayEmailNotificationExample", "com.esofthead.mycollab.common.domain.RelayEmailNotificationWithBLOBs", "org.apache.ibatis.annotations.Param" ]
import com.esofthead.mycollab.common.domain.RelayEmailNotificationExample; import com.esofthead.mycollab.common.domain.RelayEmailNotificationWithBLOBs; import org.apache.ibatis.annotations.Param;
import com.esofthead.mycollab.common.domain.*; import org.apache.ibatis.annotations.*;
[ "com.esofthead.mycollab", "org.apache.ibatis" ]
com.esofthead.mycollab; org.apache.ibatis;
2,838,407
public void trace(String msg, Object arg0) { logIfEnabled(Level.TRACE, null, msg, arg0, UNKNOWN_ARG, UNKNOWN_ARG, null); }
void function(String msg, Object arg0) { logIfEnabled(Level.TRACE, null, msg, arg0, UNKNOWN_ARG, UNKNOWN_ARG, null); }
/** * Log a trace message. */
Log a trace message
trace
{ "repo_name": "droidefense/engine", "path": "mods/simplemagic/src/main/java/com/j256/simplemagic/logger/Logger.java", "license": "gpl-3.0", "size": 19636 }
[ "com.j256.simplemagic.logger.Log" ]
import com.j256.simplemagic.logger.Log;
import com.j256.simplemagic.logger.*;
[ "com.j256.simplemagic" ]
com.j256.simplemagic;
2,368,903
protected void initSessionInfo() { CmsResource editedResource = null; try { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamResource())) { editedResource = getCms().readResource(getParamResource()); } } catch (CmsException e) { // ignore } CmsEditorSessionInfo info = null; if (editedResource != null) { HttpSession session = getSession(); info = (CmsEditorSessionInfo)session.getAttribute(CmsEditorSessionInfo.getEditorSessionInfoKey(editedResource)); if (info == null) { info = new CmsEditorSessionInfo(editedResource.getStructureId()); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_paramBackLink)) { info.setBackLink(m_paramBackLink); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_paramElementlanguage)) { info.setElementLocale(CmsLocaleManager.getLocale(m_paramElementlanguage)); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_paramDirectedit)) { info.setDirectEdit(Boolean.parseBoolean(m_paramDirectedit)); } session.setAttribute(info.getEditorSessionInfoKey(), info); } m_editorSessionInfo = info; }
void function() { CmsResource editedResource = null; try { if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamResource())) { editedResource = getCms().readResource(getParamResource()); } } catch (CmsException e) { } CmsEditorSessionInfo info = null; if (editedResource != null) { HttpSession session = getSession(); info = (CmsEditorSessionInfo)session.getAttribute(CmsEditorSessionInfo.getEditorSessionInfoKey(editedResource)); if (info == null) { info = new CmsEditorSessionInfo(editedResource.getStructureId()); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_paramBackLink)) { info.setBackLink(m_paramBackLink); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_paramElementlanguage)) { info.setElementLocale(CmsLocaleManager.getLocale(m_paramElementlanguage)); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_paramDirectedit)) { info.setDirectEdit(Boolean.parseBoolean(m_paramDirectedit)); } session.setAttribute(info.getEditorSessionInfoKey(), info); } m_editorSessionInfo = info; }
/** * Initializes the editor session info bean.<p> */
Initializes the editor session info bean
initSessionInfo
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/workplace/editors/CmsEditor.java", "license": "lgpl-2.1", "size": 38835 }
[ "javax.servlet.http.HttpSession", "org.opencms.file.CmsResource", "org.opencms.i18n.CmsLocaleManager", "org.opencms.main.CmsException", "org.opencms.util.CmsStringUtil" ]
import javax.servlet.http.HttpSession; import org.opencms.file.CmsResource; import org.opencms.i18n.CmsLocaleManager; import org.opencms.main.CmsException; import org.opencms.util.CmsStringUtil;
import javax.servlet.http.*; import org.opencms.file.*; import org.opencms.i18n.*; import org.opencms.main.*; import org.opencms.util.*;
[ "javax.servlet", "org.opencms.file", "org.opencms.i18n", "org.opencms.main", "org.opencms.util" ]
javax.servlet; org.opencms.file; org.opencms.i18n; org.opencms.main; org.opencms.util;
493,221
public List<UserAnswerBlock> getUserAnswerBlockList() { return userAnswerBlockList; }
List<UserAnswerBlock> function() { return userAnswerBlockList; }
/** * Get the user answer block list * * @return the user answer block list */
Get the user answer block list
getUserAnswerBlockList
{ "repo_name": "IljaKroonen/quiz_wikiversity", "path": "src/main/java/org/tsaap/questions/impl/DefaultUserResponse.java", "license": "apache-2.0", "size": 2333 }
[ "java.util.List", "org.tsaap.questions.UserAnswerBlock" ]
import java.util.List; import org.tsaap.questions.UserAnswerBlock;
import java.util.*; import org.tsaap.questions.*;
[ "java.util", "org.tsaap.questions" ]
java.util; org.tsaap.questions;
385,361
@Nonnull public HttpChainProcessor filter(@Nonnull Filter filter) { elements.add(new FilterElement(filter)); return this; }
HttpChainProcessor function(@Nonnull Filter filter) { elements.add(new FilterElement(filter)); return this; }
/** * Add filter to the chain * * @param filter the filter * @return this instance */
Add filter to the chain
filter
{ "repo_name": "alesharik/AlesharikWebServer", "path": "api/src/com/alesharik/webserver/module/http/bundle/processor/impl/HttpChainProcessor.java", "license": "gpl-3.0", "size": 5117 }
[ "com.alesharik.webserver.module.http.bundle.processor.Filter", "javax.annotation.Nonnull" ]
import com.alesharik.webserver.module.http.bundle.processor.Filter; import javax.annotation.Nonnull;
import com.alesharik.webserver.module.http.bundle.processor.*; import javax.annotation.*;
[ "com.alesharik.webserver", "javax.annotation" ]
com.alesharik.webserver; javax.annotation;
1,105,322
private void reconnectPending() { synchronized (mPendingReconnect) { for (WeakReference<TerminalBridge> ref : mPendingReconnect) { TerminalBridge bridge = ref.get(); if (bridge == null) { continue; } bridge.startConnection(); } mPendingReconnect.clear(); } }
void function() { synchronized (mPendingReconnect) { for (WeakReference<TerminalBridge> ref : mPendingReconnect) { TerminalBridge bridge = ref.get(); if (bridge == null) { continue; } bridge.startConnection(); } mPendingReconnect.clear(); } }
/** * Reconnect all bridges that were pending a reconnect when connectivity * was lost. */
Reconnect all bridges that were pending a reconnect when connectivity was lost
reconnectPending
{ "repo_name": "0xD34D/connectbot", "path": "src/sk/vx/connectbot/service/TerminalManager.java", "license": "apache-2.0", "size": 19272 }
[ "java.lang.ref.WeakReference" ]
import java.lang.ref.WeakReference;
import java.lang.ref.*;
[ "java.lang" ]
java.lang;
792,054
public void setParent( LoggingObjectInterface parent ) { this.parent = parent; this.log = new LogChannel( this, parent ); this.logLevel = log.getLogLevel(); this.containerObjectId = log.getContainerObjectId(); if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, "Trans.Log.TransformationIsPreloaded" ) ); } if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, "Trans.Log.NumberOfStepsToRun", String.valueOf( transMeta .nrSteps() ), String.valueOf( transMeta.nrTransHops() ) ) ); } }
void function( LoggingObjectInterface parent ) { this.parent = parent; this.log = new LogChannel( this, parent ); this.logLevel = log.getLogLevel(); this.containerObjectId = log.getContainerObjectId(); if ( log.isDetailed() ) { log.logDetailed( BaseMessages.getString( PKG, STR ) ); } if ( log.isDebug() ) { log.logDebug( BaseMessages.getString( PKG, STR, String.valueOf( transMeta .nrSteps() ), String.valueOf( transMeta.nrTransHops() ) ) ); } }
/** * Sets the parent logging object. * * @param parent * the new parent */
Sets the parent logging object
setParent
{ "repo_name": "rfellows/pentaho-kettle", "path": "engine/src/org/pentaho/di/trans/Trans.java", "license": "apache-2.0", "size": 189048 }
[ "org.pentaho.di.core.logging.LogChannel", "org.pentaho.di.core.logging.LoggingObjectInterface", "org.pentaho.di.i18n.BaseMessages" ]
import org.pentaho.di.core.logging.LogChannel; import org.pentaho.di.core.logging.LoggingObjectInterface; import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.core.logging.*; import org.pentaho.di.i18n.*;
[ "org.pentaho.di" ]
org.pentaho.di;
1,614,180
public long getMinHeartbeatFrequency(final TimeUnit timeUnit) { return timeUnit.convert(minHeartbeatFrequencyMS, TimeUnit.MILLISECONDS); }
long function(final TimeUnit timeUnit) { return timeUnit.convert(minHeartbeatFrequencyMS, TimeUnit.MILLISECONDS); }
/** * Gets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait * at least this long since the previous check to avoid wasted effort. The default value is 500 milliseconds. * * @param timeUnit the time unit * @return the heartbeat reconnect retry frequency */
Gets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort. The default value is 500 milliseconds
getMinHeartbeatFrequency
{ "repo_name": "PSCGroup/mongo-java-driver", "path": "driver-core/src/main/com/mongodb/connection/ServerSettings.java", "license": "apache-2.0", "size": 4957 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
1,877,302
public static PublicKey generatePublicKey(String encodedPublicKey) { try { byte[] decodedKey = Base64.decode(encodedPublicKey); KeyFactory keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORITHM); return keyFactory.generatePublic(new X509EncodedKeySpec(decodedKey)); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (InvalidKeySpecException e) { Log.e(TAG, "Invalid key specification."); throw new IllegalArgumentException(e); } catch (Base64DecoderException e) { Log.e(TAG, "Base64 decoding failed."); throw new IllegalArgumentException(e); } }
static PublicKey function(String encodedPublicKey) { try { byte[] decodedKey = Base64.decode(encodedPublicKey); KeyFactory keyFactory = KeyFactory.getInstance(KEY_FACTORY_ALGORITHM); return keyFactory.generatePublic(new X509EncodedKeySpec(decodedKey)); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } catch (InvalidKeySpecException e) { Log.e(TAG, STR); throw new IllegalArgumentException(e); } catch (Base64DecoderException e) { Log.e(TAG, STR); throw new IllegalArgumentException(e); } }
/** * Generates a PublicKey instance from a string containing the * Base64-encoded public key. * * @param encodedPublicKey Base64-encoded public key * @throws IllegalArgumentException if encodedPublicKey is invalid */
Generates a PublicKey instance from a string containing the Base64-encoded public key
generatePublicKey
{ "repo_name": "se-bastiaan/ButterRemote-Android", "path": "app/src/main/java/eu/se_bastiaan/popcorntimeremote/iab/utils/Security.java", "license": "apache-2.0", "size": 5349 }
[ "android.util.Log", "java.security.KeyFactory", "java.security.NoSuchAlgorithmException", "java.security.PublicKey", "java.security.spec.InvalidKeySpecException", "java.security.spec.X509EncodedKeySpec" ]
import android.util.Log; import java.security.KeyFactory; import java.security.NoSuchAlgorithmException; import java.security.PublicKey; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec;
import android.util.*; import java.security.*; import java.security.spec.*;
[ "android.util", "java.security" ]
android.util; java.security;
2,523,664
public void print(final Object value, final Appendable out, final boolean newRecord) throws IOException { // null values are considered empty // Only call CharSequence.toString() if you have to, helps GC-free use cases. CharSequence charSequence; if (value == null) { // https://issues.apache.org/jira/browse/CSV-203 if (null == nullString) { charSequence = EMPTY; } else if (QuoteMode.ALL == quoteMode) { charSequence = quotedNullString; } else { charSequence = nullString; } } else if (value instanceof CharSequence) { charSequence = (CharSequence) value; } else if (value instanceof Reader) { print((Reader) value, out, newRecord); return; } else { charSequence = value.toString(); } charSequence = getTrim() ? trim(charSequence) : charSequence; print(value, charSequence, out, newRecord); }
void function(final Object value, final Appendable out, final boolean newRecord) throws IOException { CharSequence charSequence; if (value == null) { if (null == nullString) { charSequence = EMPTY; } else if (QuoteMode.ALL == quoteMode) { charSequence = quotedNullString; } else { charSequence = nullString; } } else if (value instanceof CharSequence) { charSequence = (CharSequence) value; } else if (value instanceof Reader) { print((Reader) value, out, newRecord); return; } else { charSequence = value.toString(); } charSequence = getTrim() ? trim(charSequence) : charSequence; print(value, charSequence, out, newRecord); }
/** * Prints the {@code value} as the next value on the line to {@code out}. The value will be escaped or encapsulated as needed. Useful when one wants to * avoid creating CSVPrinters. Trims the value if {@link #getTrim()} is true. * * @param value value to output. * @param out where to print the value. * @param newRecord if this a new record. * @throws IOException If an I/O error occurs. * @since 1.4 */
Prints the value as the next value on the line to out. The value will be escaped or encapsulated as needed. Useful when one wants to avoid creating CSVPrinters. Trims the value if <code>#getTrim()</code> is true
print
{ "repo_name": "apache/commons-csv", "path": "src/main/java/org/apache/commons/csv/CSVFormat.java", "license": "apache-2.0", "size": 103151 }
[ "java.io.IOException", "java.io.Reader" ]
import java.io.IOException; import java.io.Reader;
import java.io.*;
[ "java.io" ]
java.io;
1,519,443
public Range getDomainBounds(boolean includeInterval) { Range result = null; Range temp = null; Iterator iterator = this.data.iterator(); while (iterator.hasNext()) { TimePeriodValues series = (TimePeriodValues) iterator.next(); int count = series.getItemCount(); if (count > 0) { TimePeriod start = series.getTimePeriod( series.getMinStartIndex()); TimePeriod end = series.getTimePeriod(series.getMaxEndIndex()); if (!includeInterval) { if (this.xPosition == TimePeriodAnchor.START) { TimePeriod maxStart = series.getTimePeriod( series.getMaxStartIndex()); temp = new Range(start.getStart().getTime(), maxStart.getStart().getTime()); } else if (this.xPosition == TimePeriodAnchor.MIDDLE) { TimePeriod minMiddle = series.getTimePeriod( series.getMinMiddleIndex()); long s1 = minMiddle.getStart().getTime(); long e1 = minMiddle.getEnd().getTime(); TimePeriod maxMiddle = series.getTimePeriod( series.getMaxMiddleIndex()); long s2 = maxMiddle.getStart().getTime(); long e2 = maxMiddle.getEnd().getTime(); temp = new Range(s1 + (e1 - s1) / 2, s2 + (e2 - s2) / 2); } else if (this.xPosition == TimePeriodAnchor.END) { TimePeriod minEnd = series.getTimePeriod( series.getMinEndIndex()); temp = new Range(minEnd.getEnd().getTime(), end.getEnd().getTime()); } } else { temp = new Range(start.getStart().getTime(), end.getEnd().getTime()); } result = Range.combine(result, temp); } } return result; }
Range function(boolean includeInterval) { Range result = null; Range temp = null; Iterator iterator = this.data.iterator(); while (iterator.hasNext()) { TimePeriodValues series = (TimePeriodValues) iterator.next(); int count = series.getItemCount(); if (count > 0) { TimePeriod start = series.getTimePeriod( series.getMinStartIndex()); TimePeriod end = series.getTimePeriod(series.getMaxEndIndex()); if (!includeInterval) { if (this.xPosition == TimePeriodAnchor.START) { TimePeriod maxStart = series.getTimePeriod( series.getMaxStartIndex()); temp = new Range(start.getStart().getTime(), maxStart.getStart().getTime()); } else if (this.xPosition == TimePeriodAnchor.MIDDLE) { TimePeriod minMiddle = series.getTimePeriod( series.getMinMiddleIndex()); long s1 = minMiddle.getStart().getTime(); long e1 = minMiddle.getEnd().getTime(); TimePeriod maxMiddle = series.getTimePeriod( series.getMaxMiddleIndex()); long s2 = maxMiddle.getStart().getTime(); long e2 = maxMiddle.getEnd().getTime(); temp = new Range(s1 + (e1 - s1) / 2, s2 + (e2 - s2) / 2); } else if (this.xPosition == TimePeriodAnchor.END) { TimePeriod minEnd = series.getTimePeriod( series.getMinEndIndex()); temp = new Range(minEnd.getEnd().getTime(), end.getEnd().getTime()); } } else { temp = new Range(start.getStart().getTime(), end.getEnd().getTime()); } result = Range.combine(result, temp); } } return result; }
/** * Returns the range of the values in this dataset's domain. * * @param includeInterval a flag that determines whether or not the * x-interval is taken into account. * * @return The range. */
Returns the range of the values in this dataset's domain
getDomainBounds
{ "repo_name": "SpoonLabs/astor", "path": "examples/chart_11/source/org/jfree/data/time/TimePeriodValuesCollection.java", "license": "gpl-2.0", "size": 15265 }
[ "java.util.Iterator", "org.jfree.data.Range" ]
import java.util.Iterator; import org.jfree.data.Range;
import java.util.*; import org.jfree.data.*;
[ "java.util", "org.jfree.data" ]
java.util; org.jfree.data;
65,753
void assertGaugeGt(String name, double expected, BaseSource source);
void assertGaugeGt(String name, double expected, BaseSource source);
/** * Assert that a gauge exists and it's value is greater than a given value * * @param name The name of the gauge * @param expected Value that the gauge is expected to be greater than * @param source The BaseSource{@link BaseSource} that will provide the tags, * gauges, and counters. */
Assert that a gauge exists and it's value is greater than a given value
assertGaugeGt
{ "repo_name": "ultratendency/hbase", "path": "hbase-hadoop-compat/src/test/java/org/apache/hadoop/hbase/test/MetricsAssertHelper.java", "license": "apache-2.0", "size": 6630 }
[ "org.apache.hadoop.hbase.metrics.BaseSource" ]
import org.apache.hadoop.hbase.metrics.BaseSource;
import org.apache.hadoop.hbase.metrics.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
982,682
public void setInsets(Insets insets) { this.insets = insets; if (autoRepaint) { repaint(); } }
void function(Insets insets) { this.insets = insets; if (autoRepaint) { repaint(); } }
/** * Sets the border around the graphical display. This border should be at * least half the node width to ensure nodes are fully contained inside the * panel. * * @param insets the border around the graphical display */
Sets the border around the graphical display. This border should be at least half the node width to ensure nodes are fully contained inside the panel
setInsets
{ "repo_name": "jkinable/jorlib", "path": "jorlib-core/src/main/java/org/jorlib/io/tspLibReader/TSPPanel.java", "license": "lgpl-2.1", "size": 11680 }
[ "java.awt.Insets" ]
import java.awt.Insets;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,141,397
@SuppressWarnings("unused") @CalledByNative private void onAppendResponseHeader(ResponseHeadersMap headersMap, String name, String value) { try { if (!headersMap.containsKey(name)) { headersMap.put(name, new ArrayList<String>()); } headersMap.get(name).add(value); } catch (Exception e) { onCalledByNativeException(e); } }
@SuppressWarnings(STR) void function(ResponseHeadersMap headersMap, String name, String value) { try { if (!headersMap.containsKey(name)) { headersMap.put(name, new ArrayList<String>()); } headersMap.get(name).add(value); } catch (Exception e) { onCalledByNativeException(e); } }
/** * Appends header |name| with value |value| to |headersMap|. */
Appends header |name| with value |value| to |headersMap|
onAppendResponseHeader
{ "repo_name": "axinging/chromium-crosswalk", "path": "components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequest.java", "license": "bsd-3-clause", "size": 26226 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,524,105
public Collection<E> toCollection() { return toList(); }
Collection<E> function() { return toList(); }
/** * Returns a collection of all unique elements of this set (including subsets) * in an implementation-specified order as a {@code Collection}. * * <p>If you do not need a Collection and an Iterable is enough, use the * nested set itself as an Iterable. */
Returns a collection of all unique elements of this set (including subsets) in an implementation-specified order as a Collection. If you do not need a Collection and an Iterable is enough, use the nested set itself as an Iterable
toCollection
{ "repo_name": "hermione521/bazel", "path": "src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSet.java", "license": "apache-2.0", "size": 13013 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,190,494
public Observable<ServiceResponse<Page<SystemTopicInner>>> listSinglePageAsync(final String filter, final Integer top) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); }
Observable<ServiceResponse<Page<SystemTopicInner>>> function(final String filter, final Integer top) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
/** * List system topics under an Azure subscription. * List all the system topics under an Azure subscription. * ServiceResponse<PageImpl<SystemTopicInner>> * @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. These operations are: the 'contains' function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'. ServiceResponse<PageImpl<SystemTopicInner>> * @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;SystemTopicInner&gt; object wrapped in {@link ServiceResponse} if successful. */
List system topics under an Azure subscription. List all the system topics under an Azure subscription
listSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/eventgrid/mgmt-v2020_04_01_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2020_04_01_preview/implementation/SystemTopicsInner.java", "license": "mit", "size": 97754 }
[ "com.microsoft.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
799,979
@SuppressForbidden(reason = "FilesUtils#deleteDirectory") public static void deleteDirectory(final File directory) throws IOException { org.apache.commons.io.FileUtils.deleteDirectory(directory); }
@SuppressForbidden(reason = STR) static void function(final File directory) throws IOException { org.apache.commons.io.FileUtils.deleteDirectory(directory); }
/** * Equivalent to {@link org.apache.commons.io.FileUtils#deleteDirectory(File)}. Exists here mostly so callers * can avoid dealing with our FileUtils and the Commons FileUtils having the same name. */
Equivalent to <code>org.apache.commons.io.FileUtils#deleteDirectory(File)</code>. Exists here mostly so callers can avoid dealing with our FileUtils and the Commons FileUtils having the same name
deleteDirectory
{ "repo_name": "gianm/druid", "path": "core/src/main/java/org/apache/druid/java/util/common/FileUtils.java", "license": "apache-2.0", "size": 13801 }
[ "io.netty.util.SuppressForbidden", "java.io.File", "java.io.IOException" ]
import io.netty.util.SuppressForbidden; import java.io.File; import java.io.IOException;
import io.netty.util.*; import java.io.*;
[ "io.netty.util", "java.io" ]
io.netty.util; java.io;
2,065,424
@Override public EngineeringCRS createEngineeringCRS(final String code) throws FactoryException { return (EngineeringCRS) replace( getCRSAuthorityFactory(code) .createEngineeringCRS(toBackingFactoryCode(code))); }
EngineeringCRS function(final String code) throws FactoryException { return (EngineeringCRS) replace( getCRSAuthorityFactory(code) .createEngineeringCRS(toBackingFactoryCode(code))); }
/** * Creates a {@linkplain EngineeringCRS engineering coordinate reference system} from a code. * * @throws FactoryException if the object creation failed. */
Creates a EngineeringCRS engineering coordinate reference system from a code
createEngineeringCRS
{ "repo_name": "geotools/geotools", "path": "modules/library/referencing/src/main/java/org/geotools/referencing/factory/AuthorityFactoryAdapter.java", "license": "lgpl-2.1", "size": 54063 }
[ "org.opengis.referencing.FactoryException", "org.opengis.referencing.crs.EngineeringCRS" ]
import org.opengis.referencing.FactoryException; import org.opengis.referencing.crs.EngineeringCRS;
import org.opengis.referencing.*; import org.opengis.referencing.crs.*;
[ "org.opengis.referencing" ]
org.opengis.referencing;
698,267
FilterNode node = new FilterNode(); assertNull(node.getFilter()); assertTrue( node.toString() .compareTo( Localisation.getString( ExpressionPanelv2.class, "FilterNode.filterNotSet")) == 0); Class<?> type = Double.class; node.setType(type); assertEquals(type, node.getType()); }
FilterNode node = new FilterNode(); assertNull(node.getFilter()); assertTrue( node.toString() .compareTo( Localisation.getString( ExpressionPanelv2.class, STR)) == 0); Class<?> type = Double.class; node.setType(type); assertEquals(type, node.getType()); }
/** * Test method for {@link com.sldeditor.filter.v2.expression.FilterNode#FilterNode()}. Test * method for {@link com.sldeditor.filter.v2.expression.FilterNode#toString()}. Test method for * {@link com.sldeditor.filter.v2.expression.FilterNode#getFilter()}. Test method for {@link * com.sldeditor.filter.v2.expression.FilterNode#getType()}. Test method for {@link * com.sldeditor.filter.v2.expression.FilterNode#setType(java.lang.Class)}. */
Test method for <code>com.sldeditor.filter.v2.expression.FilterNode#FilterNode()</code>. Test method for <code>com.sldeditor.filter.v2.expression.FilterNode#toString()</code>. Test method for <code>com.sldeditor.filter.v2.expression.FilterNode#getFilter()</code>. Test method for <code>com.sldeditor.filter.v2.expression.FilterNode#getType()</code>. Test method for <code>com.sldeditor.filter.v2.expression.FilterNode#setType(java.lang.Class)</code>
testFilterNode
{ "repo_name": "robward-scisys/sldeditor", "path": "modules/application/src/test/java/com/sldeditor/test/unit/filter/v2/expression/FilterNodeTest.java", "license": "gpl-3.0", "size": 8576 }
[ "com.sldeditor.common.localisation.Localisation", "com.sldeditor.filter.v2.expression.ExpressionPanelv2", "com.sldeditor.filter.v2.expression.FilterNode", "org.junit.jupiter.api.Assertions" ]
import com.sldeditor.common.localisation.Localisation; import com.sldeditor.filter.v2.expression.ExpressionPanelv2; import com.sldeditor.filter.v2.expression.FilterNode; import org.junit.jupiter.api.Assertions;
import com.sldeditor.common.localisation.*; import com.sldeditor.filter.v2.expression.*; import org.junit.jupiter.api.*;
[ "com.sldeditor.common", "com.sldeditor.filter", "org.junit.jupiter" ]
com.sldeditor.common; com.sldeditor.filter; org.junit.jupiter;
1,353,171
@Override public synchronized FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions properties) throws FileSystemException { // Parse the name final StringBuilder buffer = new StringBuilder(uri); final String scheme = UriParser.extractScheme(uri, buffer); UriParser.fixSeparators(buffer); UriParser.normalisePath(buffer); final String path = buffer.toString(); // Create the temp file system if it does not exist // FileSystem filesystem = findFileSystem( this, (Properties) null); FileSystem filesystem = findFileSystem(this, properties); if (filesystem == null) { if (rootFile == null) { rootFile = getContext().getTemporaryFileStore().allocateFile("tempfs"); } final FileName rootName = getContext().parseURI(scheme + ":" + FileName.ROOT_PATH); // final FileName rootName = // new LocalFileName(scheme, scheme + ":", FileName.ROOT_PATH); filesystem = new LocalFileSystem(rootName, rootFile.getAbsolutePath(), properties); addFileSystem(this, filesystem); } // Find the file return filesystem.resolveFile(path); }
synchronized FileObject function(final FileObject baseFile, final String uri, final FileSystemOptions properties) throws FileSystemException { final StringBuilder buffer = new StringBuilder(uri); final String scheme = UriParser.extractScheme(uri, buffer); UriParser.fixSeparators(buffer); UriParser.normalisePath(buffer); final String path = buffer.toString(); FileSystem filesystem = findFileSystem(this, properties); if (filesystem == null) { if (rootFile == null) { rootFile = getContext().getTemporaryFileStore().allocateFile(STR); } final FileName rootName = getContext().parseURI(scheme + ":" + FileName.ROOT_PATH); filesystem = new LocalFileSystem(rootName, rootFile.getAbsolutePath(), properties); addFileSystem(this, filesystem); } return filesystem.resolveFile(path); }
/** * Locates a file object, by absolute URI. * @param baseFile The base FileObject. * @param uri The URI of the file to be located. * @param properties FileSystemOptions to use to locate or create the file. * @return The FileObject. * @throws FileSystemException if an error occurs. */
Locates a file object, by absolute URI
findFile
{ "repo_name": "distribuitech/datos", "path": "datos-vfs/src/main/java/com/datos/vfs/provider/temp/TemporaryFileProvider.java", "license": "apache-2.0", "size": 4123 }
[ "com.datos.vfs.FileName", "com.datos.vfs.FileObject", "com.datos.vfs.FileSystem", "com.datos.vfs.FileSystemException", "com.datos.vfs.FileSystemOptions", "com.datos.vfs.provider.UriParser", "com.datos.vfs.provider.local.LocalFileSystem" ]
import com.datos.vfs.FileName; import com.datos.vfs.FileObject; import com.datos.vfs.FileSystem; import com.datos.vfs.FileSystemException; import com.datos.vfs.FileSystemOptions; import com.datos.vfs.provider.UriParser; import com.datos.vfs.provider.local.LocalFileSystem;
import com.datos.vfs.*; import com.datos.vfs.provider.*; import com.datos.vfs.provider.local.*;
[ "com.datos.vfs" ]
com.datos.vfs;
2,255,047
public void reportInvalidOptions(EventHandler reporter) { for (Fragment fragment : fragments.values()) { fragment.reportInvalidOptions(reporter, this.buildOptions); } Set<String> plugins = new HashSet<>(); for (Label plugin : options.pluginList) { String name = plugin.getName(); if (plugins.contains(name)) { reporter.handle(Event.error("A build cannot have two plugins with the same name")); } plugins.add(name); } for (Map.Entry<String, String> opt : options.pluginCoptList) { if (!plugins.contains(opt.getKey())) { reporter.handle(Event.error("A plugin_copt must refer to an existing plugin")); } } if (options.outputDirectoryName != null) { reporter.handle(Event.error( "The internal '--output directory name' option cannot be used on the command line")); } if (options.testShardingStrategy == TestActionBuilder.TestShardingStrategy.EXPERIMENTAL_HEURISTIC) { reporter.handle(Event.warn( "Heuristic sharding is intended as a one-off experimentation tool for determing the " + "benefit from sharding certain tests. Please don't keep this option in your " + ".blazerc or continuous build")); } if (trimConfigurations() && !options.useDistinctHostConfiguration) { reporter.handle(Event.error( "--nodistinct_host_configuration does not currently work with dynamic configurations")); } }
void function(EventHandler reporter) { for (Fragment fragment : fragments.values()) { fragment.reportInvalidOptions(reporter, this.buildOptions); } Set<String> plugins = new HashSet<>(); for (Label plugin : options.pluginList) { String name = plugin.getName(); if (plugins.contains(name)) { reporter.handle(Event.error(STR)); } plugins.add(name); } for (Map.Entry<String, String> opt : options.pluginCoptList) { if (!plugins.contains(opt.getKey())) { reporter.handle(Event.error(STR)); } } if (options.outputDirectoryName != null) { reporter.handle(Event.error( STR)); } if (options.testShardingStrategy == TestActionBuilder.TestShardingStrategy.EXPERIMENTAL_HEURISTIC) { reporter.handle(Event.warn( STR + STR + STR)); } if (trimConfigurations() && !options.useDistinctHostConfiguration) { reporter.handle(Event.error( STR)); } }
/** * Validates the options for this BuildConfiguration. Issues warnings for the * use of deprecated options, and warnings or errors for any option settings * that conflict. */
Validates the options for this BuildConfiguration. Issues warnings for the use of deprecated options, and warnings or errors for any option settings that conflict
reportInvalidOptions
{ "repo_name": "mbrukman/bazel", "path": "src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java", "license": "apache-2.0", "size": 96626 }
[ "com.google.devtools.build.lib.cmdline.Label", "com.google.devtools.build.lib.events.Event", "com.google.devtools.build.lib.events.EventHandler", "com.google.devtools.build.lib.rules.test.TestActionBuilder", "java.util.HashSet", "java.util.Map", "java.util.Set" ]
import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.rules.test.TestActionBuilder; import java.util.HashSet; import java.util.Map; import java.util.Set;
import com.google.devtools.build.lib.cmdline.*; import com.google.devtools.build.lib.events.*; import com.google.devtools.build.lib.rules.test.*; import java.util.*;
[ "com.google.devtools", "java.util" ]
com.google.devtools; java.util;
938,255
public List<GroupApp> avaibleGroups(UserApp user) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<GroupApp> query = cb.createQuery(GroupApp.class); Root<GroupApp> root = query.from(GroupApp.class); if (!user.getGroups().isEmpty()) query.where(cb.not(root.in(user.getGroups()))); query.select(root); return em.createQuery(query).getResultList(); }
List<GroupApp> function(UserApp user) { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<GroupApp> query = cb.createQuery(GroupApp.class); Root<GroupApp> root = query.from(GroupApp.class); if (!user.getGroups().isEmpty()) query.where(cb.not(root.in(user.getGroups()))); query.select(root); return em.createQuery(query).getResultList(); }
/** * Return the groups list avaible for user * @param user * @return */
Return the groups list avaible for user
avaibleGroups
{ "repo_name": "dmainardi/esass", "path": "src/main/java/com/dmainardi/esass/business/boundary/UserService.java", "license": "gpl-3.0", "size": 2759 }
[ "com.dmainardi.esass.business.entity.GroupApp", "com.dmainardi.esass.business.entity.UserApp", "java.util.List", "javax.persistence.criteria.CriteriaBuilder", "javax.persistence.criteria.CriteriaQuery", "javax.persistence.criteria.Root" ]
import com.dmainardi.esass.business.entity.GroupApp; import com.dmainardi.esass.business.entity.UserApp; import java.util.List; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Root;
import com.dmainardi.esass.business.entity.*; import java.util.*; import javax.persistence.criteria.*;
[ "com.dmainardi.esass", "java.util", "javax.persistence" ]
com.dmainardi.esass; java.util; javax.persistence;
1,404,601
public Map<String, ValidatorProtos.AtRuleSpec.BlockType> getAtRuleSpec() { return this.atRuleSpec; }
Map<String, ValidatorProtos.AtRuleSpec.BlockType> function() { return this.atRuleSpec; }
/** * Getter for underlying AtRule spec. * * @return the AtRule spec */
Getter for underlying AtRule spec
getAtRuleSpec
{ "repo_name": "src-code/amphtml", "path": "validator/java/src/main/java/dev/amp/validator/css/CssParsingConfig.java", "license": "apache-2.0", "size": 4458 }
[ "dev.amp.validator.ValidatorProtos", "java.util.Map" ]
import dev.amp.validator.ValidatorProtos; import java.util.Map;
import dev.amp.validator.*; import java.util.*;
[ "dev.amp.validator", "java.util" ]
dev.amp.validator; java.util;
907,345
void writeTestSuites(XmlWriter writer, TestResult result) throws IOException;
void writeTestSuites(XmlWriter writer, TestResult result) throws IOException;
/** * Converts the {@link TestResult} to an XML representation and writes it into the * {@link XmlWriter} passed to the constructor. * * @param writer where to write the generated XML. * @param result the {@link TestResult} to process. * @throws IOException */
Converts the <code>TestResult</code> to an XML representation and writes it into the <code>XmlWriter</code> passed to the constructor
writeTestSuites
{ "repo_name": "dslomov/bazel", "path": "src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/XmlResultWriter.java", "license": "apache-2.0", "size": 1094 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,256,071
private X509Certificate[] loadCertCollection(final KeyStore keyStore) { if (keyStore == null) { return null; } final Enumeration<String> aliases; try { aliases = keyStore.aliases(); } catch (KeyStoreException e) { return null; } while (aliases.hasMoreElements()) { final String alias = aliases.nextElement(); final X509Certificate[] certCollection = loadCertCollectionForAlias(keyStore, alias); if (certCollection != null) { return certCollection; } } return null; }
X509Certificate[] function(final KeyStore keyStore) { if (keyStore == null) { return null; } final Enumeration<String> aliases; try { aliases = keyStore.aliases(); } catch (KeyStoreException e) { return null; } while (aliases.hasMoreElements()) { final String alias = aliases.nextElement(); final X509Certificate[] certCollection = loadCertCollectionForAlias(keyStore, alias); if (certCollection != null) { return certCollection; } } return null; }
/** * <p>Loads the first valid X509 certificate found in the keystore, and returns it as a one-element * array so that it can be passed to {@link SslContextBuilder#trustManager(File)}.</p> * * <p>Returns <code>null</code> if there is any problem accessing the keystore, or if no X509 certificates * are found at all.</p> * * @param keyStore * @return */
Loads the first valid X509 certificate found in the keystore, and returns it as a one-element array so that it can be passed to <code>SslContextBuilder#trustManager(File)</code>. Returns <code>null</code> if there is any problem accessing the keystore, or if no X509 certificates are found at all
loadCertCollection
{ "repo_name": "NazarethCollege/heweb2017-devops-presentation", "path": "sites/tweetheat/src/backend/vendor/src/github.com/youtube/vitess/java/grpc-client/src/main/java/io/vitess/client/grpc/GrpcClientFactory.java", "license": "mit", "size": 13234 }
[ "java.security.KeyStore", "java.security.KeyStoreException", "java.security.cert.X509Certificate", "java.util.Enumeration" ]
import java.security.KeyStore; import java.security.KeyStoreException; import java.security.cert.X509Certificate; import java.util.Enumeration;
import java.security.*; import java.security.cert.*; import java.util.*;
[ "java.security", "java.util" ]
java.security; java.util;
1,721,492
public List<ElementDto> fillElementsFromPBCFeeder(List<ConnectionPortfolioDto> connectionPortfolioDtoList, LocalDate period, Integer ptusPerDay, Integer ptuSize) { List<ElementDto> elementDtoList = new ArrayList<>(); // fetch PBC data for the period List<PbcStubDataDto> pbcStubDataList = pbcFeederClient.getPbcStubDataList(period, 1, ptusPerDay); // map the PBC data into uncontrolled load and PV load forecast Map<Integer, BigInteger> uncontrolledLoadPerPtu = fetchUncontrolledLoad(pbcStubDataList); //pv is production so should be negative for the methods below. Map<Integer, BigInteger> pvLoadForecastPerPtu = negateMap(fetchPVLoadForecast(pbcStubDataList)); // for each connection create 3 elements (PV1 and ADS1 and UCL1) connectionPortfolioDtoList.stream().forEach(connectionPortfolioDTO -> { elementDtoList.add(createManagedDeviceForADS(period, ptusPerDay, ptuSize, connectionPortfolioDTO)); elementDtoList.add(createManagedDeviceForPV(ptusPerDay, ptuSize, pvLoadForecastPerPtu, connectionPortfolioDTO)); elementDtoList.add(createSyntheticData(ptusPerDay, ptuSize, uncontrolledLoadPerPtu, connectionPortfolioDTO)); }); return elementDtoList; }
List<ElementDto> function(List<ConnectionPortfolioDto> connectionPortfolioDtoList, LocalDate period, Integer ptusPerDay, Integer ptuSize) { List<ElementDto> elementDtoList = new ArrayList<>(); List<PbcStubDataDto> pbcStubDataList = pbcFeederClient.getPbcStubDataList(period, 1, ptusPerDay); Map<Integer, BigInteger> uncontrolledLoadPerPtu = fetchUncontrolledLoad(pbcStubDataList); Map<Integer, BigInteger> pvLoadForecastPerPtu = negateMap(fetchPVLoadForecast(pbcStubDataList)); connectionPortfolioDtoList.stream().forEach(connectionPortfolioDTO -> { elementDtoList.add(createManagedDeviceForADS(period, ptusPerDay, ptuSize, connectionPortfolioDTO)); elementDtoList.add(createManagedDeviceForPV(ptusPerDay, ptuSize, pvLoadForecastPerPtu, connectionPortfolioDTO)); elementDtoList.add(createSyntheticData(ptusPerDay, ptuSize, uncontrolledLoadPerPtu, connectionPortfolioDTO)); }); return elementDtoList; }
/** * Creates and fills elements for a list of {@link ConnectionPortfolioDto}'s. * <p> * 3 Element's are created: 1 ADS(MANAGED_DEVICE_, 1 PV(MANAGED_DEVICE) and one UCL(SYNTHETIC_DATA). * * @param connectionPortfolioDtoList * @param period * @param ptusPerDay * @param ptuSize * @return */
Creates and fills elements for a list of <code>ConnectionPortfolioDto</code>'s. 3 Element's are created: 1 ADS(MANAGED_DEVICE_, 1 PV(MANAGED_DEVICE) and one UCL(SYNTHETIC_DATA)
fillElementsFromPBCFeeder
{ "repo_name": "FHPproject/FHPUsef", "path": "usef-build/usef-simulation/usef-simulation-agr/src/main/java/energy/usef/agr/pbcfeederimpl/PbcFeederService.java", "license": "apache-2.0", "size": 25624 }
[ "energy.usef.agr.dto.ConnectionPortfolioDto", "energy.usef.agr.dto.ElementDto", "energy.usef.pbcfeeder.dto.PbcStubDataDto", "java.math.BigInteger", "java.util.ArrayList", "java.util.List", "java.util.Map", "org.joda.time.LocalDate" ]
import energy.usef.agr.dto.ConnectionPortfolioDto; import energy.usef.agr.dto.ElementDto; import energy.usef.pbcfeeder.dto.PbcStubDataDto; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.joda.time.LocalDate;
import energy.usef.agr.dto.*; import energy.usef.pbcfeeder.dto.*; import java.math.*; import java.util.*; import org.joda.time.*;
[ "energy.usef.agr", "energy.usef.pbcfeeder", "java.math", "java.util", "org.joda.time" ]
energy.usef.agr; energy.usef.pbcfeeder; java.math; java.util; org.joda.time;
523,688
public Node evalLValue(OAssign.LValue to) throws FaultException, ExternalVariableModuleException { final OdeInternalInstance napi = getBpelRuntime(); Node lval = null; if (!(to instanceof OAssign.PartnerLinkRef) && !(to instanceof OAssign.ContextRef)) { VariableInstance lvar; try { lvar = _scopeFrame.resolve(to.getVariable()); } catch (RuntimeException e) { __log.error("iid: " + napi.getInstanceId() + " error evaluating lvalue"); throw new FaultException(getOActivity().getOwner().constants.qnSelectionFailure, e.getMessage()); } if (!napi.isVariableInitialized(lvar)) { Document doc = DOMUtils.newDocument(); Node val = to.getVariable().type.newInstance(doc); if (val.getNodeType() == Node.TEXT_NODE) { Element tempwrapper = doc.createElementNS(null, "temporary-simple-type-wrapper"); doc.appendChild(tempwrapper); tempwrapper.appendChild(val); val = tempwrapper; } else doc.appendChild(val); // Only external variables need to be initialized, others are new and going to be overwritten if (lvar.declaration.extVar != null) lval = initializeVariable(lvar, val); else lval = val; } else lval = fetchVariableData(lvar, true); } return lval; }
Node function(OAssign.LValue to) throws FaultException, ExternalVariableModuleException { final OdeInternalInstance napi = getBpelRuntime(); Node lval = null; if (!(to instanceof OAssign.PartnerLinkRef) && !(to instanceof OAssign.ContextRef)) { VariableInstance lvar; try { lvar = _scopeFrame.resolve(to.getVariable()); } catch (RuntimeException e) { __log.error(STR + napi.getInstanceId() + STR); throw new FaultException(getOActivity().getOwner().constants.qnSelectionFailure, e.getMessage()); } if (!napi.isVariableInitialized(lvar)) { Document doc = DOMUtils.newDocument(); Node val = to.getVariable().type.newInstance(doc); if (val.getNodeType() == Node.TEXT_NODE) { Element tempwrapper = doc.createElementNS(null, STR); doc.appendChild(tempwrapper); tempwrapper.appendChild(val); val = tempwrapper; } else doc.appendChild(val); if (lvar.declaration.extVar != null) lval = initializeVariable(lvar, val); else lval = val; } else lval = fetchVariableData(lvar, true); } return lval; }
/** * madars.vitolins _at gmail.com - 2009.04.17 - Moved from ASSIGN here * @param to * @return * @throws FaultException * @throws ExternalVariableModuleException */
madars.vitolins _at gmail.com - 2009.04.17 - Moved from ASSIGN here
evalLValue
{ "repo_name": "aaronanderson/ode", "path": "runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/AssignHelper.java", "license": "apache-2.0", "size": 23003 }
[ "org.apache.ode.bpel.common.FaultException", "org.apache.ode.bpel.evar.ExternalVariableModuleException", "org.apache.ode.utils.DOMUtils", "org.w3c.dom.Document", "org.w3c.dom.Element", "org.w3c.dom.Node" ]
import org.apache.ode.bpel.common.FaultException; import org.apache.ode.bpel.evar.ExternalVariableModuleException; import org.apache.ode.utils.DOMUtils; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node;
import org.apache.ode.bpel.common.*; import org.apache.ode.bpel.evar.*; import org.apache.ode.utils.*; import org.w3c.dom.*;
[ "org.apache.ode", "org.w3c.dom" ]
org.apache.ode; org.w3c.dom;
498,516
public static Type getType(final Constructor<?> c) { return getType(getConstructorDescriptor(c)); }
static Type function(final Constructor<?> c) { return getType(getConstructorDescriptor(c)); }
/** * Returns the Java method type corresponding to the given constructor. * * @param c * a {@link Constructor Constructor} object. * @return the Java method type corresponding to the given constructor. */
Returns the Java method type corresponding to the given constructor
getType
{ "repo_name": "GeeQuery/ef-orm", "path": "common-core/src/main/java/com/github/geequery/asm/Type.java", "license": "apache-2.0", "size": 25488 }
[ "java.lang.reflect.Constructor" ]
import java.lang.reflect.Constructor;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,014,107