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
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<List<String>> listAvailableResponseHeadersAsync() {
return listAvailableResponseHeadersWithResponseAsync()
.flatMap(
(Response<List<String>> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<List<String>> function() { return listAvailableResponseHeadersWithResponseAsync() .flatMap( (Response<List<String>> res) -> { if (res.getValue() != null) { return Mono.just(res.getValue()); } else { return Mono.empty(); } }); } | /**
* Lists all available response headers.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableResponseHeaders API service call.
*/ | Lists all available response headers | listAvailableResponseHeadersAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysClientImpl.java",
"license": "mit",
"size": 166717
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"java.util.List"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import java.util.List; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import java.util.*; | [
"com.azure.core",
"java.util"
] | com.azure.core; java.util; | 778,496 |
public void addListener(final IGraphSearchFieldListener listener) {
m_listenerProvider.addListener(listener);
} | void function(final IGraphSearchFieldListener listener) { m_listenerProvider.addListener(listener); } | /**
* Adds a listener that is notified about completed searches.
*
* @param listener The listener object to add.
*/ | Adds a listener that is notified about completed searches | addListener | {
"repo_name": "ispras/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/yfileswrap/Gui/GraphWindows/Searchers/Text/Gui/CGraphSearchField.java",
"license": "apache-2.0",
"size": 8867
} | [
"com.google.security.zynamics.binnavi.Gui"
] | import com.google.security.zynamics.binnavi.Gui; | import com.google.security.zynamics.binnavi.*; | [
"com.google.security"
] | com.google.security; | 1,870,626 |
@ServiceMethod(returns = ReturnType.SINGLE)
StorageQueueInner create(String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); | @ServiceMethod(returns = ReturnType.SINGLE) StorageQueueInner create(String resourceGroupName, String accountName, String queueName, StorageQueueInner queue); | /**
* Creates a new queue with the specified queue name, under the specified account.
*
* @param resourceGroupName The name of the resource group within the user's subscription. The name is case
* insensitive.
* @param accountName The name of the storage account within the specified resource group. Storage account names
* must be between 3 and 24 characters in length and use numbers and lower-case letters only.
* @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The
* name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an
* alphanumeric character and it cannot have two consecutive dash(-) characters.
* @param queue Queue properties and metadata to be created with.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
*/ | Creates a new queue with the specified queue name, under the specified account | create | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/QueuesClient.java",
"license": "mit",
"size": 27242
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.storage.fluent.models.StorageQueueInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.storage.fluent.models.StorageQueueInner; | import com.azure.core.annotation.*; import com.azure.resourcemanager.storage.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,461,580 |
default void populateMetadata(HasMetadata holder, boolean disableInterceptor) {
} | default void populateMetadata(HasMetadata holder, boolean disableInterceptor) { } | /**
* Populate the metadata.
*
* @param holder metadata
* @param disableInterceptor diable interceptor
*/ | Populate the metadata | populateMetadata | {
"repo_name": "tgianos/metacat",
"path": "metacat-common-server/src/main/java/com/netflix/metacat/common/server/usermetadata/UserMetadataService.java",
"license": "apache-2.0",
"size": 9008
} | [
"com.netflix.metacat.common.dto.HasMetadata"
] | import com.netflix.metacat.common.dto.HasMetadata; | import com.netflix.metacat.common.dto.*; | [
"com.netflix.metacat"
] | com.netflix.metacat; | 2,199,131 |
@Override
protected Control createDialogArea(Composite parent) {
applyStyle(parent);
Composite composite = (Composite) super.createDialogArea(parent);
applyStyle(composite);
{
var gl = (GridLayout) composite.getLayout();
gl.marginWidth = 0;
gl.marginHeight = 0;
gl.verticalSpacing = 0;
composite.addDisposeListener(e -> disposeResources());
}
{
// title
var label = new Label(composite, 0);
var img = loadImage("background.png");
label.setBackgroundImage(img);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.grabExcessVerticalSpace = true;
gd.minimumHeight = img.getBounds().height;
label.setLayoutData(gd);
}
// Should only create the Recent Workspaces Composite if Recent
// workspaces exist
boolean createRecentWorkspacesComposite = false;
if (launchData.getRecentWorkspaces()[0] != null) {
createRecentWorkspacesComposite = true;
}
createWorkspaceBrowseRow(composite);
// if (!suppressAskAgain) {
// createShowDialogButton(composite);
// }
if (createRecentWorkspacesComposite) {
createRecentWorkspacesComposite(composite);
}
Dialog.applyDialogFont(composite);
return composite;
} | Control function(Composite parent) { applyStyle(parent); Composite composite = (Composite) super.createDialogArea(parent); applyStyle(composite); { var gl = (GridLayout) composite.getLayout(); gl.marginWidth = 0; gl.marginHeight = 0; gl.verticalSpacing = 0; composite.addDisposeListener(e -> disposeResources()); } { var label = new Label(composite, 0); var img = loadImage(STR); label.setBackgroundImage(img); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.grabExcessVerticalSpace = true; gd.minimumHeight = img.getBounds().height; label.setLayoutData(gd); } boolean createRecentWorkspacesComposite = false; if (launchData.getRecentWorkspaces()[0] != null) { createRecentWorkspacesComposite = true; } createWorkspaceBrowseRow(composite); if (createRecentWorkspacesComposite) { createRecentWorkspacesComposite(composite); } Dialog.applyDialogFont(composite); return composite; } | /**
* Creates and returns the contents of the upper part of this dialog (above the
* button bar).
* <p>
* The <code>Dialog</code> implementation of this framework method creates and
* returns a new <code>Composite</code> with no margins and spacing.
* </p>
*
* @param parent
* the parent composite to contain the dialog area
* @return the dialog area control
*/ | Creates and returns the contents of the upper part of this dialog (above the button bar). The <code>Dialog</code> implementation of this framework method creates and returns a new <code>Composite</code> with no margins and spacing. | createDialogArea | {
"repo_name": "boniatillo-com/PhaserEditor",
"path": "source/v2/phasereditor/phasereditor.ide/src/phasereditor/ide/ui/ModifiedChooseWorkspaceDialog.java",
"license": "epl-1.0",
"size": 23777
} | [
"org.eclipse.jface.dialogs.Dialog",
"org.eclipse.swt.layout.GridData",
"org.eclipse.swt.layout.GridLayout",
"org.eclipse.swt.widgets.Composite",
"org.eclipse.swt.widgets.Control",
"org.eclipse.swt.widgets.Label"
] | import org.eclipse.jface.dialogs.Dialog; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; | import org.eclipse.jface.dialogs.*; import org.eclipse.swt.layout.*; import org.eclipse.swt.widgets.*; | [
"org.eclipse.jface",
"org.eclipse.swt"
] | org.eclipse.jface; org.eclipse.swt; | 2,602,386 |
private DataComponent getParallelismComponent() {
return (parallelComponentEnabled)
? (DataComponent) getComponent(parallelId)
: createParallelismComponent();
} | DataComponent function() { return (parallelComponentEnabled) ? (DataComponent) getComponent(parallelId) : createParallelismComponent(); } | /**
* <p>
* This operation retrieves the parallelism component from the set and
* returns it. If it is not already in the set of components for the Form
* then it creates it.
* </p>
*
* @return
* <p>
* The parallelism component.
* </p>
*/ | This operation retrieves the parallelism component from the set and returns it. If it is not already in the set of components for the Form then it creates it. | getParallelismComponent | {
"repo_name": "eclipse/ice",
"path": "org.eclipse.ice.item/src/org/eclipse/ice/item/jobLauncher/JobLauncherForm.java",
"license": "epl-1.0",
"size": 24339
} | [
"org.eclipse.ice.datastructures.form.DataComponent"
] | import org.eclipse.ice.datastructures.form.DataComponent; | import org.eclipse.ice.datastructures.form.*; | [
"org.eclipse.ice"
] | org.eclipse.ice; | 1,649,539 |
@SuppressWarnings("serial")
private void initializeMenuButtons() {
buttonBar.setFocusOnHoverEnabled(false);
startButton = new CustomMenuItem(new SafeHtml() { | @SuppressWarnings(STR) void function() { buttonBar.setFocusOnHoverEnabled(false); startButton = new CustomMenuItem(new SafeHtml() { | /**
* Initializes menu items.
*/ | Initializes menu items | initializeMenuButtons | {
"repo_name": "ungerik/ephesoft",
"path": "Ephesoft_Community_Release_4.0.2.0/source/gxt/gxt-upload-batch/src/main/java/com/ephesoft/gxt/uploadbatch/client/view/UploadBatchButtonPanelView.java",
"license": "agpl-3.0",
"size": 13294
} | [
"com.ephesoft.gxt.core.client.ui.widget.CustomMenuItem",
"com.google.gwt.safehtml.shared.SafeHtml"
] | import com.ephesoft.gxt.core.client.ui.widget.CustomMenuItem; import com.google.gwt.safehtml.shared.SafeHtml; | import com.ephesoft.gxt.core.client.ui.widget.*; import com.google.gwt.safehtml.shared.*; | [
"com.ephesoft.gxt",
"com.google.gwt"
] | com.ephesoft.gxt; com.google.gwt; | 2,895,826 |
protected boolean fetchPartialEventCols(TimelineFilterList eventFilters,
EnumSet<Field> fieldsToRetrieve) {
return (eventFilters != null && !eventFilters.getFilterList().isEmpty() &&
!hasField(fieldsToRetrieve, Field.EVENTS));
} | boolean function(TimelineFilterList eventFilters, EnumSet<Field> fieldsToRetrieve) { return (eventFilters != null && !eventFilters.getFilterList().isEmpty() && !hasField(fieldsToRetrieve, Field.EVENTS)); } | /**
* Check if we need to fetch only some of the event columns.
*
* @return true if we need to fetch some of the columns, false otherwise.
*/ | Check if we need to fetch only some of the event columns | fetchPartialEventCols | {
"repo_name": "soumabrata-chakraborty/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice-hbase/src/main/java/org/apache/hadoop/yarn/server/timelineservice/storage/reader/GenericEntityReader.java",
"license": "apache-2.0",
"size": 29073
} | [
"java.util.EnumSet",
"org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList",
"org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader"
] | import java.util.EnumSet; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.TimelineFilterList; import org.apache.hadoop.yarn.server.timelineservice.storage.TimelineReader; | import java.util.*; import org.apache.hadoop.yarn.server.timelineservice.reader.filter.*; import org.apache.hadoop.yarn.server.timelineservice.storage.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 265,548 |
public void addTWorkItemRelatedByResponsibleID(TWorkItem l) throws TorqueException
{
getTWorkItemsRelatedByResponsibleID().add(l);
l.setTPersonRelatedByResponsibleID((TPerson) this);
} | void function(TWorkItem l) throws TorqueException { getTWorkItemsRelatedByResponsibleID().add(l); l.setTPersonRelatedByResponsibleID((TPerson) this); } | /**
* Method called to associate a TWorkItem object to this object
* through the TWorkItem foreign key attribute
*
* @param l TWorkItem
* @throws TorqueException
*/ | Method called to associate a TWorkItem object to this object through the TWorkItem foreign key attribute | addTWorkItemRelatedByResponsibleID | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/persist/BaseTPerson.java",
"license": "gpl-3.0",
"size": 1013508
} | [
"com.aurel.track.persist.TPerson",
"org.apache.torque.TorqueException"
] | import com.aurel.track.persist.TPerson; import org.apache.torque.TorqueException; | import com.aurel.track.persist.*; import org.apache.torque.*; | [
"com.aurel.track",
"org.apache.torque"
] | com.aurel.track; org.apache.torque; | 1,206,827 |
public static Framework createFramework(
final IPropertyLookup lookup1,
final FilesystemFramework filesystemFramework,
final ProjectManager projectManager,
Map<String,FrameworkSupportService> services
)
{
ServiceSupport serviceSupport = new ServiceSupport();
NodeSupport iFrameworkNodes = new NodeSupport();
iFrameworkNodes.setLookup(lookup1);
//framework
Framework framework = new Framework(
filesystemFramework,
projectManager,
lookup1,
serviceSupport,
iFrameworkNodes
);
filesystemFramework.setFramework(framework);
if(null!=services) {
//load predefined services
for (String s : services.keySet()) {
framework.setService(s, services.get(s));
}
}
serviceSupport.initialize(framework);
return framework;
} | static Framework function( final IPropertyLookup lookup1, final FilesystemFramework filesystemFramework, final ProjectManager projectManager, Map<String,FrameworkSupportService> services ) { ServiceSupport serviceSupport = new ServiceSupport(); NodeSupport iFrameworkNodes = new NodeSupport(); iFrameworkNodes.setLookup(lookup1); Framework framework = new Framework( filesystemFramework, projectManager, lookup1, serviceSupport, iFrameworkNodes ); filesystemFramework.setFramework(framework); if(null!=services) { for (String s : services.keySet()) { framework.setService(s, services.get(s)); } } serviceSupport.initialize(framework); return framework; } | /**
* Create framework
* @param lookup1 properties
* @param filesystemFramework filessystem
* @param projectManager project
* @param services preloaded services
* @return framework
*/ | Create framework | createFramework | {
"repo_name": "rundeck/rundeck",
"path": "core/src/main/java/com/dtolabs/rundeck/core/common/FrameworkFactory.java",
"license": "apache-2.0",
"size": 11226
} | [
"com.dtolabs.rundeck.core.utils.IPropertyLookup",
"java.util.Map"
] | import com.dtolabs.rundeck.core.utils.IPropertyLookup; import java.util.Map; | import com.dtolabs.rundeck.core.utils.*; import java.util.*; | [
"com.dtolabs.rundeck",
"java.util"
] | com.dtolabs.rundeck; java.util; | 2,485,745 |
int maybeCommit() {
final int committed;
if (now - lastCommitMs > commitTimeMs) {
if (log.isDebugEnabled()) {
log.debug("Committing all active tasks {} and standby tasks {} since {}ms has elapsed (commit interval is {}ms)",
taskManager.activeTaskIds(), taskManager.standbyTaskIds(), now - lastCommitMs, commitTimeMs);
}
committed = taskManager.commit(
taskManager.tasks()
.values()
.stream()
.filter(t -> t.state() == Task.State.RUNNING || t.state() == Task.State.RESTORING)
.collect(Collectors.toSet())
);
if (committed > 0) {
// try to purge the committed records for repartition topics if possible
taskManager.maybePurgeCommittedRecords();
}
if (committed == -1) {
log.debug("Unable to commit as we are in the middle of a rebalance, will try again when it completes.");
} else {
now = time.milliseconds();
lastCommitMs = now;
}
} else {
committed = taskManager.maybeCommitActiveTasksPerUserRequested();
}
return committed;
} | int maybeCommit() { final int committed; if (now - lastCommitMs > commitTimeMs) { if (log.isDebugEnabled()) { log.debug(STR, taskManager.activeTaskIds(), taskManager.standbyTaskIds(), now - lastCommitMs, commitTimeMs); } committed = taskManager.commit( taskManager.tasks() .values() .stream() .filter(t -> t.state() == Task.State.RUNNING t.state() == Task.State.RESTORING) .collect(Collectors.toSet()) ); if (committed > 0) { taskManager.maybePurgeCommittedRecords(); } if (committed == -1) { log.debug(STR); } else { now = time.milliseconds(); lastCommitMs = now; } } else { committed = taskManager.maybeCommitActiveTasksPerUserRequested(); } return committed; } | /**
* Try to commit all active tasks owned by this thread.
*
* Visible for testing.
*
* @throws TaskMigratedException if committing offsets failed (non-EOS)
* or if the task producer got fenced (EOS)
*/ | Try to commit all active tasks owned by this thread. Visible for testing | maybeCommit | {
"repo_name": "guozhangwang/kafka",
"path": "streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java",
"license": "apache-2.0",
"size": 55914
} | [
"java.util.stream.Collectors"
] | import java.util.stream.Collectors; | import java.util.stream.*; | [
"java.util"
] | java.util; | 1,911,213 |
private PvmTransition getStartTransaction(List<ActivityImpl> startEventActList, HistoricActivityInstance firstActInst) {
for (ActivityImpl startEventAct : startEventActList) {
for (PvmTransition trans : startEventAct.getOutgoingTransitions()) {
if (trans.getDestination().getId().equals(firstActInst.getActivityId())) {
return trans;
}
}
}
return null;
} | PvmTransition function(List<ActivityImpl> startEventActList, HistoricActivityInstance firstActInst) { for (ActivityImpl startEventAct : startEventActList) { for (PvmTransition trans : startEventAct.getOutgoingTransitions()) { if (trans.getDestination().getId().equals(firstActInst.getActivityId())) { return trans; } } } return null; } | /**
* Check out the outgoing transition connected to firstActInst from startEventActList
*
* @param startEventActList
* @param firstActInst
* @return
*/ | Check out the outgoing transition connected to firstActInst from startEventActList | getStartTransaction | {
"repo_name": "quangou365/sub",
"path": "subadmin/src/main/java/com/thinkgem/jeesite/modules/act/rest/diagram/services/ProcessInstanceHighlightsResource.java",
"license": "apache-2.0",
"size": 9681
} | [
"java.util.List",
"org.activiti.engine.history.HistoricActivityInstance",
"org.activiti.engine.impl.pvm.PvmTransition",
"org.activiti.engine.impl.pvm.process.ActivityImpl"
] | import java.util.List; import org.activiti.engine.history.HistoricActivityInstance; import org.activiti.engine.impl.pvm.PvmTransition; import org.activiti.engine.impl.pvm.process.ActivityImpl; | import java.util.*; import org.activiti.engine.history.*; import org.activiti.engine.impl.pvm.*; import org.activiti.engine.impl.pvm.process.*; | [
"java.util",
"org.activiti.engine"
] | java.util; org.activiti.engine; | 763,428 |
@BeforeClass
public static void setup() throws Exception
{
schemaManager = new DefaultSchemaManager();
} | static void function() throws Exception { schemaManager = new DefaultSchemaManager(); } | /**
* Initialize OIDs maps for normalization
*/ | Initialize OIDs maps for normalization | setup | {
"repo_name": "darranl/directory-shared",
"path": "integ/src/test/java/org/apache/directory/api/ldap/model/name/SchemaAwareRdnSerializationTest.java",
"license": "apache-2.0",
"size": 6878
} | [
"org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager"
] | import org.apache.directory.api.ldap.schemamanager.impl.DefaultSchemaManager; | import org.apache.directory.api.ldap.schemamanager.impl.*; | [
"org.apache.directory"
] | org.apache.directory; | 831,488 |
public boolean ehRoqueMaior(TipoCorJogador corJogador) {
// Se for um roque maior do jogador de peças brancas
if (corJogador == TipoCorJogador.BRANCO)
return verificaRoque(new Posicao(5, 1), new Posicao(1, 1),
new Posicao(3, 1), new Posicao(4, 1));
// Se for um roque maior do jogador de peças pretas
else
return verificaRoque(new Posicao(5, 8), new Posicao(1, 8),
new Posicao(3, 8), new Posicao(4, 8));
} | boolean function(TipoCorJogador corJogador) { if (corJogador == TipoCorJogador.BRANCO) return verificaRoque(new Posicao(5, 1), new Posicao(1, 1), new Posicao(3, 1), new Posicao(4, 1)); else return verificaRoque(new Posicao(5, 8), new Posicao(1, 8), new Posicao(3, 8), new Posicao(4, 8)); } | /**
* Verifica se pode ser realizado o roque maior
*
* @param jogador
* Jogador que quer realizar o roque maior
* @return se o roque foi possivel ou não
*/ | Verifica se pode ser realizado o roque maior | ehRoqueMaior | {
"repo_name": "possatti/xadrez-poo1",
"path": "src/main/java/br/edu/ifes/poo1/cln/cdp/TabuleiroXadrez.java",
"license": "gpl-2.0",
"size": 24772
} | [
"br.edu.ifes.poo1.cln.cdp.tipos.TipoCorJogador"
] | import br.edu.ifes.poo1.cln.cdp.tipos.TipoCorJogador; | import br.edu.ifes.poo1.cln.cdp.tipos.*; | [
"br.edu.ifes"
] | br.edu.ifes; | 2,850,547 |
int match(CharsetDetector det, int[] commonChars) {
@SuppressWarnings("unused")
int singleByteCharCount = 0; //TODO Do we really need this?
int doubleByteCharCount = 0;
int commonCharCount = 0;
int badCharCount = 0;
int totalCharCount = 0;
int confidence = 0;
iteratedChar iter = new iteratedChar();
detectBlock:
{
for (iter.reset(); nextChar(iter, det); ) {
totalCharCount++;
if (iter.error) {
badCharCount++;
} else {
long cv = iter.charValue & 0xFFFFFFFFL;
if (cv <= 0xff) {
singleByteCharCount++;
} else {
doubleByteCharCount++;
if (commonChars != null) {
// NOTE: This assumes that there are no 4-byte common chars.
if (Arrays.binarySearch(commonChars, (int) cv) >= 0) {
commonCharCount++;
}
}
}
}
if (badCharCount >= 2 && badCharCount * 5 >= doubleByteCharCount) {
// Bail out early if the byte data is not matching the encoding scheme.
break detectBlock;
}
}
if (doubleByteCharCount <= 10 && badCharCount == 0) {
// Not many multi-byte chars.
if (doubleByteCharCount == 0 && totalCharCount < 10) {
// There weren't any multibyte sequences, and there was a low density of non-ASCII single bytes.
// We don't have enough data to have any confidence.
// Statistical analysis of single byte non-ASCII charcters would probably help here.
confidence = 0;
} else {
// ASCII or ISO file? It's probably not our encoding,
// but is not incompatible with our encoding, so don't give it a zero.
confidence = 10;
}
break detectBlock;
}
//
// No match if there are too many characters that don't fit the encoding scheme.
// (should we have zero tolerance for these?)
//
if (doubleByteCharCount < 20 * badCharCount) {
confidence = 0;
break detectBlock;
}
if (commonChars == null) {
// We have no statistics on frequently occuring characters.
// Assess confidence purely on having a reasonable number of
// multi-byte characters (the more the better
confidence = 30 + doubleByteCharCount - 20 * badCharCount;
if (confidence > 100) {
confidence = 100;
}
} else {
//
// Frequency of occurence statistics exist.
//
double maxVal = Math.log((float) doubleByteCharCount / 4);
double scaleFactor = 90.0 / maxVal;
confidence = (int) (Math.log(commonCharCount + 1) * scaleFactor + 10);
confidence = Math.min(confidence, 100);
}
} // end of detectBlock:
return confidence;
} | int match(CharsetDetector det, int[] commonChars) { @SuppressWarnings(STR) int singleByteCharCount = 0; int doubleByteCharCount = 0; int commonCharCount = 0; int badCharCount = 0; int totalCharCount = 0; int confidence = 0; iteratedChar iter = new iteratedChar(); detectBlock: { for (iter.reset(); nextChar(iter, det); ) { totalCharCount++; if (iter.error) { badCharCount++; } else { long cv = iter.charValue & 0xFFFFFFFFL; if (cv <= 0xff) { singleByteCharCount++; } else { doubleByteCharCount++; if (commonChars != null) { if (Arrays.binarySearch(commonChars, (int) cv) >= 0) { commonCharCount++; } } } } if (badCharCount >= 2 && badCharCount * 5 >= doubleByteCharCount) { break detectBlock; } } if (doubleByteCharCount <= 10 && badCharCount == 0) { if (doubleByteCharCount == 0 && totalCharCount < 10) { confidence = 0; } else { confidence = 10; } break detectBlock; } confidence = 0; break detectBlock; } if (commonChars == null) { confidence = 30 + doubleByteCharCount - 20 * badCharCount; if (confidence > 100) { confidence = 100; } } else { double scaleFactor = 90.0 / maxVal; confidence = (int) (Math.log(commonCharCount + 1) * scaleFactor + 10); confidence = Math.min(confidence, 100); } } return confidence; } | /**
* Test the match of this charset with the input text data
* which is obtained via the CharsetDetector object.
*
* @param det The CharsetDetector, which contains the input text
* to be checked for being in this charset.
* @return Two values packed into one int (Damn java, anyhow)
* <br/>
* bits 0-7: the match confidence, ranging from 0-100
* <br/>
* bits 8-15: The match reason, an enum-like value.
*/ | Test the match of this charset with the input text data which is obtained via the CharsetDetector object | match | {
"repo_name": "berisd/VirtualFile",
"path": "src/main/java/at/beris/virtualfile/content/charset/CharsetRecog_mbcs.java",
"license": "lgpl-3.0",
"size": 22247
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,193,465 |
public ArrayList<CausalLink> getLinks()
{
return _links;
}
| ArrayList<CausalLink> function() { return _links; } | /**
* Gets the plan CausalLinks
* @return an ArrayList with all the plan's CausalLinks
*/ | Gets the plan CausalLinks | getLinks | {
"repo_name": "nurv/lirec",
"path": "AgentMind/branches/FAtiMA-Modular/FAtiMA/src/FAtiMA/Core/plans/Plan.java",
"license": "gpl-3.0",
"size": 56006
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,937,592 |
public void getKeyData(int keyPtr, IBuffer outKey); | void function(int keyPtr, IBuffer outKey); | /**
* This function is used in conjuction with visitRecords. it Reads the data of
* a key referenced by keyPtr into the output buffer. Note: assumes the keyPtr
* is a valid key pointer. behavior is undefined if keyPtr is pointing to an
* actual key in this map.
*
* @param keyPtr
* pointer to key
* @param outKey
* stores key data in this IBuffer
*/ | This function is used in conjuction with visitRecords. it Reads the data of a key referenced by keyPtr into the output buffer. Note: assumes the keyPtr is a valid key pointer. behavior is undefined if keyPtr is pointing to an actual key in this map | getKeyData | {
"repo_name": "KobeFeng/banana",
"path": "banana/src/net/yadan/banana/map/IVarKeyHashMap.java",
"license": "bsd-3-clause",
"size": 2134
} | [
"net.yadan.banana.memory.IBuffer"
] | import net.yadan.banana.memory.IBuffer; | import net.yadan.banana.memory.*; | [
"net.yadan.banana"
] | net.yadan.banana; | 1,239,412 |
public void doSave_props_edit(RunData data, Context context)
{
SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid());
if (!"POST".equals(data.getRequest().getMethod())) {
return;
}
// read the properties form
readPropertiesForm(data, state);
doSave_edit(data, context);
}
| void function(RunData data, Context context) { SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); if (!"POST".equals(data.getRequest().getMethod())) { return; } readPropertiesForm(data, state); doSave_edit(data, context); } | /**
* Handle a request to save the edit from either page or tools list mode - no form to read in.
*/ | Handle a request to save the edit from either page or tools list mode - no form to read in | doSave_props_edit | {
"repo_name": "ouit0408/sakai",
"path": "site/site-tool/tool/src/java/org/sakaiproject/site/tool/AdminSitesAction.java",
"license": "apache-2.0",
"size": 76844
} | [
"org.sakaiproject.cheftool.Context",
"org.sakaiproject.cheftool.JetspeedRunData",
"org.sakaiproject.cheftool.RunData",
"org.sakaiproject.event.api.SessionState"
] | import org.sakaiproject.cheftool.Context; import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState; | import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*; | [
"org.sakaiproject.cheftool",
"org.sakaiproject.event"
] | org.sakaiproject.cheftool; org.sakaiproject.event; | 2,739,780 |
List<RequestInfo> getQueuedRequests(QueryContext queryContext); | List<RequestInfo> getQueuedRequests(QueryContext queryContext); | /**
* Returns all queued requests
* @return
*/ | Returns all queued requests | getQueuedRequests | {
"repo_name": "rsynek/droolsjbpm-knowledge",
"path": "kie-api/src/main/java/org/kie/api/executor/ExecutorQueryService.java",
"license": "apache-2.0",
"size": 4256
} | [
"java.util.List",
"org.kie.api.runtime.query.QueryContext"
] | import java.util.List; import org.kie.api.runtime.query.QueryContext; | import java.util.*; import org.kie.api.runtime.query.*; | [
"java.util",
"org.kie.api"
] | java.util; org.kie.api; | 2,702,063 |
String authenticate(String username, String password) throws BadCredentialsException, AuthenticationSystemException; | String authenticate(String username, String password) throws BadCredentialsException, AuthenticationSystemException; | /**
* authenticate a user. returns ticket
* @param username
* @param password
*/ | authenticate a user. returns ticket | authenticate | {
"repo_name": "sumerjabri/studio",
"path": "src/main/java/org/craftercms/studio/api/v1/service/security/SecurityService.java",
"license": "gpl-3.0",
"size": 10782
} | [
"org.craftercms.studio.api.v1.exception.security.AuthenticationSystemException",
"org.craftercms.studio.api.v1.exception.security.BadCredentialsException"
] | import org.craftercms.studio.api.v1.exception.security.AuthenticationSystemException; import org.craftercms.studio.api.v1.exception.security.BadCredentialsException; | import org.craftercms.studio.api.v1.exception.security.*; | [
"org.craftercms.studio"
] | org.craftercms.studio; | 1,959,254 |
Observable<byte[]> writeDescriptor(UUID serviceUuid, UUID characteristicUuid, UUID descriptorUuid, byte[] data);
/**
* Performs GATT write operation on a given descriptor.
*
* @param descriptor Requested {@link android.bluetooth.BluetoothGattDescriptor} | Observable<byte[]> writeDescriptor(UUID serviceUuid, UUID characteristicUuid, UUID descriptorUuid, byte[] data); /** * Performs GATT write operation on a given descriptor. * * @param descriptor Requested {@link android.bluetooth.BluetoothGattDescriptor} | /**
* Performs GATT write operation on a descriptor from a characteristic with a given UUID from a service with a given UUID.
*
* @param serviceUuid Requested {@link android.bluetooth.BluetoothGattDescriptor} UUID
* @param characteristicUuid Requested {@link android.bluetooth.BluetoothGattCharacteristic} UUID
* @param descriptorUuid Requested {@link android.bluetooth.BluetoothGattDescriptor} UUID
* @return Observable emitting the written descriptor value after write or an error in case of failure.
* @throws BleGattCannotStartException if write operation couldn't be started for internal reason.
* @throws BleGattException if write operation failed
*/ | Performs GATT write operation on a descriptor from a characteristic with a given UUID from a service with a given UUID | writeDescriptor | {
"repo_name": "BingoGG/RxAndroidBle",
"path": "rxandroidble/src/main/java/com/polidea/rxandroidble/RxBleConnection.java",
"license": "lgpl-3.0",
"size": 16376
} | [
"android.bluetooth.BluetoothGattDescriptor"
] | import android.bluetooth.BluetoothGattDescriptor; | import android.bluetooth.*; | [
"android.bluetooth"
] | android.bluetooth; | 1,569,704 |
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String firewallPolicyName); | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String firewallPolicyName); | /**
* Deletes the specified Firewall Policy.
*
* @param resourceGroupName The name of the resource group.
* @param firewallPolicyName The name of the Firewall Policy.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/ | Deletes the specified Firewall Policy | deleteWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/FirewallPoliciesClient.java",
"license": "mit",
"size": 20753
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"java.nio.ByteBuffer"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import java.nio.ByteBuffer; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import java.nio.*; | [
"com.azure.core",
"java.nio"
] | com.azure.core; java.nio; | 2,263,367 |
JSONObject event = new JSONObject();
event.put("action", type.getTypeName());
event.put("value", value);
put("clickEvent", event);
return this;
} | JSONObject event = new JSONObject(); event.put(STR, type.getTypeName()); event.put("value", value); put(STR, event); return this; } | /**
* Sets the click event for the section of text
*
* @param type The operation to perform on click
* @param value The value of the operation (command, url, etc.)
* @return The message component with the event set (used for easy
* construction of messages)
*/ | Sets the click event for the section of text | setClickEvent | {
"repo_name": "minnymin3/Zephyrus-II",
"path": "Zephyrus-Core/src/main/java/com/minnymin/zephyrus/core/chat/MessageComponent.java",
"license": "gpl-3.0",
"size": 4036
} | [
"org.json.simple.JSONObject"
] | import org.json.simple.JSONObject; | import org.json.simple.*; | [
"org.json.simple"
] | org.json.simple; | 37,556 |
private HRegionServer getOtherRegionServer(final MiniHBaseCluster cluster,
final HRegionServer notThisOne) {
for (RegionServerThread rst: cluster.getRegionServerThreads()) {
HRegionServer hrs = rst.getRegionServer();
if (hrs.getServerName().equals(notThisOne.getServerName())) continue;
if (hrs.isStopping() || hrs.isStopped()) continue;
return hrs;
}
return null;
} | HRegionServer function(final MiniHBaseCluster cluster, final HRegionServer notThisOne) { for (RegionServerThread rst: cluster.getRegionServerThreads()) { HRegionServer hrs = rst.getRegionServer(); if (hrs.getServerName().equals(notThisOne.getServerName())) continue; if (hrs.isStopping() hrs.isStopped()) continue; return hrs; } return null; } | /**
* Find regionserver other than the one passed.
* Can't rely on indexes into list of regionservers since crashed servers
* occupy an index.
* @param cluster
* @param notThisOne
* @return A regionserver that is not <code>notThisOne</code> or null if none
* found
*/ | Find regionserver other than the one passed. Can't rely on indexes into list of regionservers since crashed servers occupy an index | getOtherRegionServer | {
"repo_name": "ibmsoe/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransactionOnCluster.java",
"license": "apache-2.0",
"size": 73531
} | [
"org.apache.hadoop.hbase.MiniHBaseCluster",
"org.apache.hadoop.hbase.util.JVMClusterUtil"
] | import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.util.JVMClusterUtil; | import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 67,264 |
private double getLengthTf(final Object gemNr,
final String gu,
final GerinneGeschlFlaechenReportDialog.Art art,
final Integer from,
final Integer till) {
final List<GmdPartObjGeschl> gemList = gemPartMap.get(gemNr);
double length = 0;
for (final GmdPartObjGeschl tmp : gemList) {
if (tmp.getOwner().equals(gu) && tmp.getArt().equals(art.name()) && valueBetween(tmp.getTf(), from, till)) {
length += tmp.getLength();
}
}
return length;
} | double function(final Object gemNr, final String gu, final GerinneGeschlFlaechenReportDialog.Art art, final Integer from, final Integer till) { final List<GmdPartObjGeschl> gemList = gemPartMap.get(gemNr); double length = 0; for (final GmdPartObjGeschl tmp : gemList) { if (tmp.getOwner().equals(gu) && tmp.getArt().equals(art.name()) && valueBetween(tmp.getTf(), from, till)) { length += tmp.getLength(); } } return length; } | /**
* DOCUMENT ME!
*
* @param gemNr DOCUMENT ME!
* @param gu gew DOCUMENT ME!
* @param art DOCUMENT ME!
* @param from DOCUMENT ME!
* @param till DOCUMENT ME!
*
* @return DOCUMENT ME!
*/ | DOCUMENT ME | getLengthTf | {
"repo_name": "cismet/watergis-client",
"path": "src/main/java/de/cismet/watergis/reports/GerinneGFlReport.java",
"license": "lgpl-3.0",
"size": 159735
} | [
"de.cismet.watergis.gui.dialog.GerinneGeschlFlaechenReportDialog",
"de.cismet.watergis.reports.types.GmdPartObjGeschl",
"java.util.List"
] | import de.cismet.watergis.gui.dialog.GerinneGeschlFlaechenReportDialog; import de.cismet.watergis.reports.types.GmdPartObjGeschl; import java.util.List; | import de.cismet.watergis.gui.dialog.*; import de.cismet.watergis.reports.types.*; import java.util.*; | [
"de.cismet.watergis",
"java.util"
] | de.cismet.watergis; java.util; | 489,822 |
private void doProfileDialog(IngestProfile selectedProfile) {
// Create a files set defintion panel.
final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true);
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//start wait cursor for ingest job settings construction
if (selectedProfile != null) {
// Editing an existing set definition.
panel = new ProfilePanel(selectedProfile);
} else {
// Creating a new set definition.
panel = new ProfilePanel();
}
dialog.addApplyButtonListener(
(ActionEvent e) -> {
panel.store();
option = JOptionPane.OK_OPTION;
dialog.close();
}
);
//end wait Cursor for ingest job settings construction
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
// Do a dialog box with the profilePanel till the user enters a name or chooses cancel
do {
option = JOptionPane.CANCEL_OPTION;
dialog.display(panel);
} while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
if (option == JOptionPane.OK_OPTION) {
// While adding new profile(selectedPRofile == null), if a profile with same name already exists, do not add to the profiles hashMap.
// In case of editing an existing profile(selectedProfile != null), following check is not performed.
if (this.profiles.containsKey(panel.getProfileName()) && selectedProfile == null) {
MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(),
"ProfileSettingsPanel.doFileSetsDialog.duplicateProfile.text",
panel.getProfileName()));
return;
}
panel.saveSettings();
load();
}
} | void function(IngestProfile selectedProfile) { final AdvancedConfigurationDialog dialog = new AdvancedConfigurationDialog(true); this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); if (selectedProfile != null) { panel = new ProfilePanel(selectedProfile); } else { panel = new ProfilePanel(); } dialog.addApplyButtonListener( (ActionEvent e) -> { panel.store(); option = JOptionPane.OK_OPTION; dialog.close(); } ); setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); do { option = JOptionPane.CANCEL_OPTION; dialog.display(panel); } while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition()); if (option == JOptionPane.OK_OPTION) { if (this.profiles.containsKey(panel.getProfileName()) && selectedProfile == null) { MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(), STR, panel.getProfileName())); return; } panel.saveSettings(); load(); } } | /**
* Open a dialog for the the creation or modification of a profile.
*
* @param selectedProfile
*/ | Open a dialog for the the creation or modification of a profile | doProfileDialog | {
"repo_name": "millmanorama/autopsy",
"path": "Core/src/org/sleuthkit/autopsy/ingest/ProfileSettingsPanel.java",
"license": "apache-2.0",
"size": 30151
} | [
"java.awt.Cursor",
"java.awt.event.ActionEvent",
"javax.swing.JOptionPane",
"org.openide.util.NbBundle",
"org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog",
"org.sleuthkit.autopsy.coreutils.MessageNotifyUtil",
"org.sleuthkit.autopsy.ingest.IngestProfiles"
] | import java.awt.Cursor; import java.awt.event.ActionEvent; import javax.swing.JOptionPane; import org.openide.util.NbBundle; import org.sleuthkit.autopsy.corecomponents.AdvancedConfigurationDialog; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.ingest.IngestProfiles; | import java.awt.*; import java.awt.event.*; import javax.swing.*; import org.openide.util.*; import org.sleuthkit.autopsy.corecomponents.*; import org.sleuthkit.autopsy.coreutils.*; import org.sleuthkit.autopsy.ingest.*; | [
"java.awt",
"javax.swing",
"org.openide.util",
"org.sleuthkit.autopsy"
] | java.awt; javax.swing; org.openide.util; org.sleuthkit.autopsy; | 21,737 |
public Object3D toObject3D() {
final boolean hasUV = (mUVs.size() > 0);
final boolean hasNormals = (mNormals.size() > 0);
Object3D object3D = new Object3D();
for(Strip strip : mStrips) {
Face3D face3D = new Face3D();
int nbIndex = strip.mIndexes.size();
VertexList vertexList = new VertexList();
vertexList.init(nbIndex);
UVList uvList = null;
ColorList colorList = null;
if (hasUV) {
uvList = new UVList();
uvList.init(nbIndex);
} else {
colorList = new ColorList();
colorList.init(nbIndex);
}
NormalList normalList = null;
if (hasNormals) {
normalList = new NormalList();
normalList.init(nbIndex);
}
for(IndexInfo indexInfo : strip.mIndexes) {
int vertexIndex = indexInfo.mVertexIndex;
Vertex vertex = mVertex.get(vertexIndex);
vertexList.add(vertex.mX, vertex.mY, vertex.mZ);
if (hasUV) {
int uvIndex = indexInfo.mUVIndex;
UV uv = mUVs.get(uvIndex);
uvList.add(uv.mU, uv.mV);
} else if (vertex.mHasColors) {
colorList.add(vertex.mR, vertex.mG, vertex.mB, 1); // TODO: find a way to change the alpha channel?
} else {
throw new RuntimeException("Model must have texture UVs or vertex Colors");
}
if (hasNormals) {
int normalIndex = indexInfo.mNormalIndex;
Normal normal = mNormals.get(normalIndex);
normalList.add(normal.mX, normal.mY, normal.mZ);
}
}
vertexList.finalizeBuffer();
face3D.setVertexList(vertexList);
if (hasUV) {
uvList.finalizeBuffer();
face3D.setUVList(uvList);
Texture texture = mTextures.get(strip.mTextureName);
face3D.setTexture(texture);
} else {
colorList.finalizeBuffer();
face3D.setColorList(colorList);
}
if (hasNormals) {
normalList.finalizeBuffer();
face3D.setNormalList(normalList);
}
object3D.addFace(face3D);
}
return object3D;
} | Object3D function() { final boolean hasUV = (mUVs.size() > 0); final boolean hasNormals = (mNormals.size() > 0); Object3D object3D = new Object3D(); for(Strip strip : mStrips) { Face3D face3D = new Face3D(); int nbIndex = strip.mIndexes.size(); VertexList vertexList = new VertexList(); vertexList.init(nbIndex); UVList uvList = null; ColorList colorList = null; if (hasUV) { uvList = new UVList(); uvList.init(nbIndex); } else { colorList = new ColorList(); colorList.init(nbIndex); } NormalList normalList = null; if (hasNormals) { normalList = new NormalList(); normalList.init(nbIndex); } for(IndexInfo indexInfo : strip.mIndexes) { int vertexIndex = indexInfo.mVertexIndex; Vertex vertex = mVertex.get(vertexIndex); vertexList.add(vertex.mX, vertex.mY, vertex.mZ); if (hasUV) { int uvIndex = indexInfo.mUVIndex; UV uv = mUVs.get(uvIndex); uvList.add(uv.mU, uv.mV); } else if (vertex.mHasColors) { colorList.add(vertex.mR, vertex.mG, vertex.mB, 1); } else { throw new RuntimeException(STR); } if (hasNormals) { int normalIndex = indexInfo.mNormalIndex; Normal normal = mNormals.get(normalIndex); normalList.add(normal.mX, normal.mY, normal.mZ); } } vertexList.finalizeBuffer(); face3D.setVertexList(vertexList); if (hasUV) { uvList.finalizeBuffer(); face3D.setUVList(uvList); Texture texture = mTextures.get(strip.mTextureName); face3D.setTexture(texture); } else { colorList.finalizeBuffer(); face3D.setColorList(colorList); } if (hasNormals) { normalList.finalizeBuffer(); face3D.setNormalList(normalList); } object3D.addFace(face3D); } return object3D; } | /**
* Converts the model to an Object3D
* @return an Object3D
*/ | Converts the model to an Object3D | toObject3D | {
"repo_name": "Motsai/neblina-android",
"path": "NebCtrlPanel/app/src/main/java/com/motsai/nebctrlpanel/WavefrontModel.java",
"license": "mit",
"size": 14293
} | [
"fr.arnaudguyon.smartgl.opengl.ColorList",
"fr.arnaudguyon.smartgl.opengl.Face3D",
"fr.arnaudguyon.smartgl.opengl.NormalList",
"fr.arnaudguyon.smartgl.opengl.Object3D",
"fr.arnaudguyon.smartgl.opengl.Texture",
"fr.arnaudguyon.smartgl.opengl.UVList",
"fr.arnaudguyon.smartgl.opengl.VertexList"
] | import fr.arnaudguyon.smartgl.opengl.ColorList; import fr.arnaudguyon.smartgl.opengl.Face3D; import fr.arnaudguyon.smartgl.opengl.NormalList; import fr.arnaudguyon.smartgl.opengl.Object3D; import fr.arnaudguyon.smartgl.opengl.Texture; import fr.arnaudguyon.smartgl.opengl.UVList; import fr.arnaudguyon.smartgl.opengl.VertexList; | import fr.arnaudguyon.smartgl.opengl.*; | [
"fr.arnaudguyon.smartgl"
] | fr.arnaudguyon.smartgl; | 208,168 |
public Date getEventStart() {
return (Date) get(2);
} | Date function() { return (Date) get(2); } | /**
* Getter for <code>lifetime.lifetime_event.event_start</code>.
*/ | Getter for <code>lifetime.lifetime_event.event_start</code> | getEventStart | {
"repo_name": "zuacaldeira/lifetime",
"path": "lifetime-ejb/src/main/java/lifetime/backend/persistence/jooq/tables/records/LifetimeEventRecord.java",
"license": "unlicense",
"size": 9153
} | [
"java.sql.Date"
] | import java.sql.Date; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,657,630 |
public Job findByUuid(String uuid) {
FramedGraph graph = GraphDBTx.getGraphTx().getGraph();
// 1. Find the element with given uuid within the whole graph
Iterator<Vertex> it = db().getVertices(MeshVertexImpl.class, new String[] { "uuid" }, new String[] { uuid });
if (it.hasNext()) {
Vertex potentialElement = it.next();
// 2. Use the edge index to determine whether the element is part of this root vertex
Iterable<Edge> edges = graph.getEdges("e." + getRootLabel().toLowerCase() + "_inout",
db().index().createComposedIndexKey(potentialElement.getId(), id()));
if (edges.iterator().hasNext()) {
// Don't frame explicitly since multiple types can be returned
return graph.frameElement(potentialElement, getPersistanceClass());
}
}
return null;
} | Job function(String uuid) { FramedGraph graph = GraphDBTx.getGraphTx().getGraph(); Iterator<Vertex> it = db().getVertices(MeshVertexImpl.class, new String[] { "uuid" }, new String[] { uuid }); if (it.hasNext()) { Vertex potentialElement = it.next(); Iterable<Edge> edges = graph.getEdges("e." + getRootLabel().toLowerCase() + STR, db().index().createComposedIndexKey(potentialElement.getId(), id())); if (edges.iterator().hasNext()) { return graph.frameElement(potentialElement, getPersistanceClass()); } } return null; } | /**
* Find the element with the given uuid.
*
* @param uuid
* Uuid of the element to be located
* @return Found element or null if the element could not be located
*/ | Find the element with the given uuid | findByUuid | {
"repo_name": "gentics/mesh",
"path": "mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/core/data/job/impl/JobRootImpl.java",
"license": "apache-2.0",
"size": 8207
} | [
"com.gentics.mesh.core.data.generic.MeshVertexImpl",
"com.gentics.mesh.core.data.job.Job",
"com.gentics.mesh.core.db.GraphDBTx",
"com.syncleus.ferma.FramedGraph",
"com.tinkerpop.blueprints.Edge",
"com.tinkerpop.blueprints.Vertex",
"java.util.Iterator"
] | import com.gentics.mesh.core.data.generic.MeshVertexImpl; import com.gentics.mesh.core.data.job.Job; import com.gentics.mesh.core.db.GraphDBTx; import com.syncleus.ferma.FramedGraph; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Vertex; import java.util.Iterator; | import com.gentics.mesh.core.data.generic.*; import com.gentics.mesh.core.data.job.*; import com.gentics.mesh.core.db.*; import com.syncleus.ferma.*; import com.tinkerpop.blueprints.*; import java.util.*; | [
"com.gentics.mesh",
"com.syncleus.ferma",
"com.tinkerpop.blueprints",
"java.util"
] | com.gentics.mesh; com.syncleus.ferma; com.tinkerpop.blueprints; java.util; | 1,892,510 |
public void add(final Iterable<Cell> cells, MemStoreSizing memstoreSizing) {
storeEngine.readLock();
try {
if (this.currentParallelPutCount.getAndIncrement() > this.parallelPutCountPrintThreshold) {
LOG.trace("tableName={}, encodedName={}, columnFamilyName={} is too busy!",
this.getTableName(), this.getRegionInfo().getEncodedName(), this.getColumnFamilyName());
}
memstore.add(cells, memstoreSizing);
} finally {
storeEngine.readUnlock();
currentParallelPutCount.decrementAndGet();
}
} | void function(final Iterable<Cell> cells, MemStoreSizing memstoreSizing) { storeEngine.readLock(); try { if (this.currentParallelPutCount.getAndIncrement() > this.parallelPutCountPrintThreshold) { LOG.trace(STR, this.getTableName(), this.getRegionInfo().getEncodedName(), this.getColumnFamilyName()); } memstore.add(cells, memstoreSizing); } finally { storeEngine.readUnlock(); currentParallelPutCount.decrementAndGet(); } } | /**
* Adds the specified value to the memstore
*/ | Adds the specified value to the memstore | add | {
"repo_name": "mahak/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java",
"license": "apache-2.0",
"size": 94328
} | [
"org.apache.hadoop.hbase.Cell"
] | import org.apache.hadoop.hbase.Cell; | import org.apache.hadoop.hbase.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,408,270 |
protected void execSQL(String sql, PrintStream out) throws SQLException {
// Check and ignore empty statements
if ("".equals(sql.trim())) {
return;
}
ResultSet resultSet = null;
try {
totalSql++;
log("SQL: " + sql, Project.MSG_VERBOSE);
boolean ret;
int updateCount = 0, updateCountTotal = 0;
ret = getStatement().execute(sql);
updateCount = getStatement().getUpdateCount();
do {
if (updateCount != -1) {
updateCountTotal += updateCount;
}
if (ret) {
resultSet = getStatement().getResultSet();
printWarnings(resultSet.getWarnings(), false);
resultSet.clearWarnings();
if (print) {
printResults(resultSet, out);
}
}
ret = getStatement().getMoreResults();
updateCount = getStatement().getUpdateCount();
} while (ret || updateCount != -1);
printWarnings(getStatement().getWarnings(), false);
getStatement().clearWarnings();
log(updateCountTotal + " rows affected", Project.MSG_VERBOSE);
if (updateCountTotal != -1) {
setRowCountProperty(updateCountTotal);
}
if (print && showtrailers) {
out.println(updateCountTotal + " rows affected");
}
SQLWarning warning = getConnection().getWarnings();
printWarnings(warning, true);
getConnection().clearWarnings();
goodSql++;
} catch (SQLException e) {
log("Failed to execute: " + sql, Project.MSG_ERR);
setErrorProperty();
if (!onError.equals("abort")) {
log(e.toString(), Project.MSG_ERR);
}
if (!onError.equals("continue")) {
throw e;
}
} finally {
if (resultSet != null) {
try {
resultSet.close();
} catch (SQLException e) {
//ignore
}
}
}
} | void function(String sql, PrintStream out) throws SQLException { if (STRSQL: STR rows affectedSTR rows affectedSTRFailed to execute: STRabortSTRcontinue")) { throw e; } } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } } } } | /**
* Exec the sql statement.
* @param sql the SQL statement to execute
* @param out the place to put output
* @throws SQLException on SQL problems
*/ | Exec the sql statement | execSQL | {
"repo_name": "BIORIMP/biorimp",
"path": "BIO-RIMP/test_data/code/antapache/src/main/org/apache/tools/ant/taskdefs/SQLExec.java",
"license": "gpl-2.0",
"size": 36142
} | [
"java.io.PrintStream",
"java.sql.SQLException"
] | import java.io.PrintStream; import java.sql.SQLException; | import java.io.*; import java.sql.*; | [
"java.io",
"java.sql"
] | java.io; java.sql; | 598,899 |
@SuppressWarnings("unchecked")
private List addNodesAndParentsToList(final int recursionLevel, final CourseNode courseNode) {
// 1) Get list of children data using recursion of this method
final List childrenData = new ArrayList();
for (int i = 0; i < courseNode.getChildCount(); i++) {
final CourseNode child = (CourseNode) courseNode.getChildAt(i);
final List childData = addNodesAndParentsToList((recursionLevel + 1), child);
if (childData != null) {
childrenData.addAll(childData);
}
}
final String nodent = nodeType.getType();
if (childrenData.size() > 0 || courseNode.getType().equals(nodeType.getType())) {
// Store node data in map. This map array serves as data model for
// the tasks overview table. Leave user data empty since not used in
// this table. (use only node data)
final Map nodeData = new HashMap();
// indent
nodeData.put(AssessmentHelper.KEY_INDENT, new Integer(recursionLevel));
// course node data
nodeData.put(AssessmentHelper.KEY_TYPE, courseNode.getType());
nodeData.put(AssessmentHelper.KEY_TITLE_SHORT, courseNode.getShortTitle());
nodeData.put(AssessmentHelper.KEY_TITLE_LONG, courseNode.getLongTitle());
nodeData.put(AssessmentHelper.KEY_IDENTIFYER, courseNode.getIdent());
if (courseNode.getType().equals(nodeType.getType())) {
nodeData.put(AssessmentHelper.KEY_SELECTABLE, Boolean.TRUE);
} else {
nodeData.put(AssessmentHelper.KEY_SELECTABLE, Boolean.FALSE);
}
final List nodeAndChildren = new ArrayList();
nodeAndChildren.add(nodeData);
nodeAndChildren.addAll(childrenData);
return nodeAndChildren;
}
return null;
} | @SuppressWarnings(STR) List function(final int recursionLevel, final CourseNode courseNode) { final List childrenData = new ArrayList(); for (int i = 0; i < courseNode.getChildCount(); i++) { final CourseNode child = (CourseNode) courseNode.getChildAt(i); final List childData = addNodesAndParentsToList((recursionLevel + 1), child); if (childData != null) { childrenData.addAll(childData); } } final String nodent = nodeType.getType(); if (childrenData.size() > 0 courseNode.getType().equals(nodeType.getType())) { final Map nodeData = new HashMap(); nodeData.put(AssessmentHelper.KEY_INDENT, new Integer(recursionLevel)); nodeData.put(AssessmentHelper.KEY_TYPE, courseNode.getType()); nodeData.put(AssessmentHelper.KEY_TITLE_SHORT, courseNode.getShortTitle()); nodeData.put(AssessmentHelper.KEY_TITLE_LONG, courseNode.getLongTitle()); nodeData.put(AssessmentHelper.KEY_IDENTIFYER, courseNode.getIdent()); if (courseNode.getType().equals(nodeType.getType())) { nodeData.put(AssessmentHelper.KEY_SELECTABLE, Boolean.TRUE); } else { nodeData.put(AssessmentHelper.KEY_SELECTABLE, Boolean.FALSE); } final List nodeAndChildren = new ArrayList(); nodeAndChildren.add(nodeData); nodeAndChildren.addAll(childrenData); return nodeAndChildren; } return null; } | /**
* Recursive method that adds nodes and all its parents to a list
*
* @param recursionLevel
* @param courseNode
* @return A list of maps containing the node data
*/ | Recursive method that adds nodes and all its parents to a list | addNodesAndParentsToList | {
"repo_name": "huihoo/olat",
"path": "olat7.8/src/main/java/org/olat/presentation/course/archiver/GenericArchiveController.java",
"license": "apache-2.0",
"size": 9300
} | [
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.olat.lms.course.assessment.AssessmentHelper",
"org.olat.lms.course.nodes.CourseNode"
] | import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.olat.lms.course.assessment.AssessmentHelper; import org.olat.lms.course.nodes.CourseNode; | import java.util.*; import org.olat.lms.course.assessment.*; import org.olat.lms.course.nodes.*; | [
"java.util",
"org.olat.lms"
] | java.util; org.olat.lms; | 2,410,440 |
@Test
public void testAccept() {
UrlItem item = new UrlItem();
MenuVisitorMockUp visitor = new MenuVisitorMockUp();
item.accept(visitor);
assertEquals("Wrong UrlItem", item, visitor.getUrlItem());
} | void function() { UrlItem item = new UrlItem(); MenuVisitorMockUp visitor = new MenuVisitorMockUp(); item.accept(visitor); assertEquals(STR, item, visitor.getUrlItem()); } | /**
* Test the accept method.
*/ | Test the accept method | testAccept | {
"repo_name": "NCIP/calims",
"path": "calims2-uic/test/unit/java/gov/nih/nci/calims2/uic/menu/UrlItemTest.java",
"license": "bsd-3-clause",
"size": 2459
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 911,282 |
private void renderWestFace(final Block par1Block, final double par2,
final double par4, final double par6, int par8,
final RenderBlocks renderer) {
final Tessellator var9 = Tessellator.instance;
if (renderer.overrideBlockTexture >= 0) {
par8 = renderer.overrideBlockTexture;
}
final int var10 = (par8 & 15) << 4;
final int var11 = par8 & 240;
double var12 = (var10 + renderer.renderMinX * 16.0D) / 256.0D;
double var14 = (var10 + renderer.renderMaxX * 16.0D - 0.01D) / 256.0D;
double var16 = (var11 + 16 - renderer.renderMaxY * 16.0D) / 256.0D;
double var18 = (var11 + 16 - renderer.renderMinY * 16.0D - 0.01D) / 256.0D;
double var20;
if (renderer.flipTexture) {
var20 = var12;
var12 = var14;
var14 = var20;
}
if (renderer.renderMinX < 0.0D || renderer.renderMaxX > 1.0D) {
var12 = (var10 + 0.0F) / 256.0F;
var14 = (var10 + 15.99F) / 256.0F;
}
if (renderer.renderMinY < 0.0D || renderer.renderMaxY > 1.0D) {
var16 = (var11 + 0.0F) / 256.0F;
var18 = (var11 + 15.99F) / 256.0F;
}
var20 = var14;
double var22 = var12;
double var24 = var16;
double var26 = var18;
if (renderer.uvRotateWest == 1) {
var12 = (var10 + renderer.renderMinY * 16.0D) / 256.0D;
var18 = (var11 + 16 - renderer.renderMinX * 16.0D) / 256.0D;
var14 = (var10 + renderer.renderMaxY * 16.0D) / 256.0D;
var16 = (var11 + 16 - renderer.renderMaxX * 16.0D) / 256.0D;
var24 = var16;
var26 = var18;
var20 = var12;
var22 = var14;
var16 = var18;
var18 = var24;
} else if (renderer.uvRotateWest == 2) {
var12 = (var10 + 16 - renderer.renderMaxY * 16.0D) / 256.0D;
var16 = (var11 + renderer.renderMinX * 16.0D) / 256.0D;
var14 = (var10 + 16 - renderer.renderMinY * 16.0D) / 256.0D;
var18 = (var11 + renderer.renderMaxX * 16.0D) / 256.0D;
var20 = var14;
var22 = var12;
var12 = var14;
var14 = var22;
var24 = var18;
var26 = var16;
} else if (renderer.uvRotateWest == 3) {
var12 = (var10 + 16 - renderer.renderMinX * 16.0D) / 256.0D;
var14 = (var10 + 16 - renderer.renderMaxX * 16.0D - 0.01D) / 256.0D;
var16 = (var11 + renderer.renderMaxY * 16.0D) / 256.0D;
var18 = (var11 + renderer.renderMinY * 16.0D - 0.01D) / 256.0D;
var20 = var14;
var22 = var12;
var24 = var16;
var26 = var18;
}
final double var28 = par2 + renderer.renderMinX;
final double var30 = par2 + renderer.renderMaxX;
final double var32 = par4 + renderer.renderMinY;
final double var34 = par4 + renderer.renderMaxY;
final double var36 = par6 + renderer.renderMaxZ;
if (renderer.enableAO) {
var9.setBrightness(renderer.brightnessTopLeft);
var9.addVertexWithUV(var28, var34, var36 - 0.2, var12, var16);
var9.setBrightness(renderer.brightnessBottomLeft);
var9.addVertexWithUV(var28, var32, var36 - 0.2, var22, var26);
var9.setBrightness(renderer.brightnessBottomRight);
var9.addVertexWithUV(var30, var32, var36 - 0.2, var14, var18);
var9.setBrightness(renderer.brightnessTopRight);
var9.addVertexWithUV(var30, var34, var36 - 0.2, var20, var24);
} else {
var9.addVertexWithUV(var28, var34, var36 - 0.2, var12, var16);
var9.addVertexWithUV(var28, var32, var36 + 0.3, var22, var26);
var9.addVertexWithUV(var30, var32, var36 + 0.3, var14, var18);
var9.addVertexWithUV(var30, var34, var36 - 0.2, var20, var24);
}
} | void function(final Block par1Block, final double par2, final double par4, final double par6, int par8, final RenderBlocks renderer) { final Tessellator var9 = Tessellator.instance; if (renderer.overrideBlockTexture >= 0) { par8 = renderer.overrideBlockTexture; } final int var10 = (par8 & 15) << 4; final int var11 = par8 & 240; double var12 = (var10 + renderer.renderMinX * 16.0D) / 256.0D; double var14 = (var10 + renderer.renderMaxX * 16.0D - 0.01D) / 256.0D; double var16 = (var11 + 16 - renderer.renderMaxY * 16.0D) / 256.0D; double var18 = (var11 + 16 - renderer.renderMinY * 16.0D - 0.01D) / 256.0D; double var20; if (renderer.flipTexture) { var20 = var12; var12 = var14; var14 = var20; } if (renderer.renderMinX < 0.0D renderer.renderMaxX > 1.0D) { var12 = (var10 + 0.0F) / 256.0F; var14 = (var10 + 15.99F) / 256.0F; } if (renderer.renderMinY < 0.0D renderer.renderMaxY > 1.0D) { var16 = (var11 + 0.0F) / 256.0F; var18 = (var11 + 15.99F) / 256.0F; } var20 = var14; double var22 = var12; double var24 = var16; double var26 = var18; if (renderer.uvRotateWest == 1) { var12 = (var10 + renderer.renderMinY * 16.0D) / 256.0D; var18 = (var11 + 16 - renderer.renderMinX * 16.0D) / 256.0D; var14 = (var10 + renderer.renderMaxY * 16.0D) / 256.0D; var16 = (var11 + 16 - renderer.renderMaxX * 16.0D) / 256.0D; var24 = var16; var26 = var18; var20 = var12; var22 = var14; var16 = var18; var18 = var24; } else if (renderer.uvRotateWest == 2) { var12 = (var10 + 16 - renderer.renderMaxY * 16.0D) / 256.0D; var16 = (var11 + renderer.renderMinX * 16.0D) / 256.0D; var14 = (var10 + 16 - renderer.renderMinY * 16.0D) / 256.0D; var18 = (var11 + renderer.renderMaxX * 16.0D) / 256.0D; var20 = var14; var22 = var12; var12 = var14; var14 = var22; var24 = var18; var26 = var16; } else if (renderer.uvRotateWest == 3) { var12 = (var10 + 16 - renderer.renderMinX * 16.0D) / 256.0D; var14 = (var10 + 16 - renderer.renderMaxX * 16.0D - 0.01D) / 256.0D; var16 = (var11 + renderer.renderMaxY * 16.0D) / 256.0D; var18 = (var11 + renderer.renderMinY * 16.0D - 0.01D) / 256.0D; var20 = var14; var22 = var12; var24 = var16; var26 = var18; } final double var28 = par2 + renderer.renderMinX; final double var30 = par2 + renderer.renderMaxX; final double var32 = par4 + renderer.renderMinY; final double var34 = par4 + renderer.renderMaxY; final double var36 = par6 + renderer.renderMaxZ; if (renderer.enableAO) { var9.setBrightness(renderer.brightnessTopLeft); var9.addVertexWithUV(var28, var34, var36 - 0.2, var12, var16); var9.setBrightness(renderer.brightnessBottomLeft); var9.addVertexWithUV(var28, var32, var36 - 0.2, var22, var26); var9.setBrightness(renderer.brightnessBottomRight); var9.addVertexWithUV(var30, var32, var36 - 0.2, var14, var18); var9.setBrightness(renderer.brightnessTopRight); var9.addVertexWithUV(var30, var34, var36 - 0.2, var20, var24); } else { var9.addVertexWithUV(var28, var34, var36 - 0.2, var12, var16); var9.addVertexWithUV(var28, var32, var36 + 0.3, var22, var26); var9.addVertexWithUV(var30, var32, var36 + 0.3, var14, var18); var9.addVertexWithUV(var30, var34, var36 - 0.2, var20, var24); } } | /**
* Renders the given texture to the west (z-positive) face of the block.
* Args: block, x, y, z, texture
*/ | Renders the given texture to the west (z-positive) face of the block. Args: block, x, y, z, texture | renderWestFace | {
"repo_name": "Lastorder4339/UsefulFlower",
"path": "src/net/squarep/mcmods/ps147/flower/Renderer/RendererFlowerDouble.java",
"license": "mit",
"size": 9164
} | [
"net.minecraft.block.Block",
"net.minecraft.client.renderer.RenderBlocks",
"net.minecraft.client.renderer.Tessellator"
] | import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; | import net.minecraft.block.*; import net.minecraft.client.renderer.*; | [
"net.minecraft.block",
"net.minecraft.client"
] | net.minecraft.block; net.minecraft.client; | 854,093 |
private JSONWriter end(char m, char c) throws JSONException {
if (m_mode != m) {
throw new JSONException(m == 'o' ? "Misplaced endObject." : "Misplaced endArray.");
}
pop(m);
try {
m_writer.write(c);
} catch (IOException e) {
throw new JSONException(e);
}
m_comma = true;
return this;
} | JSONWriter function(char m, char c) throws JSONException { if (m_mode != m) { throw new JSONException(m == 'o' ? STR : STR); } pop(m); try { m_writer.write(c); } catch (IOException e) { throw new JSONException(e); } m_comma = true; return this; } | /**
* End something.<p>
*
* @param m mode
* @param c closing character
* @return this
* @throws JSONException if unbalanced
*/ | End something | end | {
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/json/JSONWriter.java",
"license": "lgpl-2.1",
"size": 11345
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 462,760 |
@Override public void visitErrorNode(@NotNull ErrorNode node) { } | @Override public void visitErrorNode(@NotNull ErrorNode node) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | visitTerminal | {
"repo_name": "helipilot50/language-parsers",
"path": "go/GoLangBaseListener.java",
"license": "apache-2.0",
"size": 5748
} | [
"org.antlr.v4.runtime.misc.NotNull",
"org.antlr.v4.runtime.tree.ErrorNode"
] | import org.antlr.v4.runtime.misc.NotNull; import org.antlr.v4.runtime.tree.ErrorNode; | import org.antlr.v4.runtime.misc.*; import org.antlr.v4.runtime.tree.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,620,407 |
public void addButton(GenericButton button) {
button = getButton(button);
this.table.add(button, this.buttonColumn , 1);
this.buttonColumn++;
}
| void function(GenericButton button) { button = getButton(button); this.table.add(button, this.buttonColumn , 1); this.buttonColumn++; } | /**
* Adds a button to the panel.
*/ | Adds a button to the panel | addButton | {
"repo_name": "idega/se.idega.idegaweb.commune.accounting",
"path": "src/java/se/idega/idegaweb/commune/accounting/presentation/ButtonPanel.java",
"license": "gpl-3.0",
"size": 5325
} | [
"com.idega.presentation.ui.GenericButton"
] | import com.idega.presentation.ui.GenericButton; | import com.idega.presentation.ui.*; | [
"com.idega.presentation"
] | com.idega.presentation; | 1,679,675 |
public void addToPlayerScore(Entity par1Entity, int par2)
{
this.addScore(par2);
Collection collection = this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.totalKillCount);
if (par1Entity instanceof EntityPlayer)
{
this.addStat(StatList.playerKillsStat, 1);
collection.addAll(this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.playerKillCount));
}
else
{
this.addStat(StatList.mobKillsStat, 1);
}
Iterator iterator = collection.iterator();
while (iterator.hasNext())
{
ScoreObjective scoreobjective = (ScoreObjective)iterator.next();
Score score = this.getWorldScoreboard().func_96529_a(this.getEntityName(), scoreobjective);
score.func_96648_a();
}
} | void function(Entity par1Entity, int par2) { this.addScore(par2); Collection collection = this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.totalKillCount); if (par1Entity instanceof EntityPlayer) { this.addStat(StatList.playerKillsStat, 1); collection.addAll(this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.playerKillCount)); } else { this.addStat(StatList.mobKillsStat, 1); } Iterator iterator = collection.iterator(); while (iterator.hasNext()) { ScoreObjective scoreobjective = (ScoreObjective)iterator.next(); Score score = this.getWorldScoreboard().func_96529_a(this.getEntityName(), scoreobjective); score.func_96648_a(); } } | /**
* Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args:
* entity, scoreToAdd
*/ | Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, scoreToAdd | addToPlayerScore | {
"repo_name": "smallcampus/BetterNutritionMod",
"path": "Minecraft/minecraftSrc/net/minecraft/entity/player/EntityPlayer.java",
"license": "gpl-2.0",
"size": 81969
} | [
"java.util.Collection",
"java.util.Iterator",
"net.minecraft.entity.Entity",
"net.minecraft.scoreboard.Score",
"net.minecraft.scoreboard.ScoreObjective",
"net.minecraft.scoreboard.ScoreObjectiveCriteria",
"net.minecraft.stats.StatList"
] | import java.util.Collection; import java.util.Iterator; import net.minecraft.entity.Entity; import net.minecraft.scoreboard.Score; import net.minecraft.scoreboard.ScoreObjective; import net.minecraft.scoreboard.ScoreObjectiveCriteria; import net.minecraft.stats.StatList; | import java.util.*; import net.minecraft.entity.*; import net.minecraft.scoreboard.*; import net.minecraft.stats.*; | [
"java.util",
"net.minecraft.entity",
"net.minecraft.scoreboard",
"net.minecraft.stats"
] | java.util; net.minecraft.entity; net.minecraft.scoreboard; net.minecraft.stats; | 1,729,324 |
public Account getSingleGoogleAccount() {
Account[] googleAccounts = getGoogleAccounts();
assert googleAccounts.length == 1;
return googleAccounts[0];
} | Account function() { Account[] googleAccounts = getGoogleAccounts(); assert googleAccounts.length == 1; return googleAccounts[0]; } | /**
* Convenience method to get the single Google account on the device. Should only be
* called if it has been determined that there is exactly one account.
*
* @return The single account to sign into.
*/ | Convenience method to get the single Google account on the device. Should only be called if it has been determined that there is exactly one account | getSingleGoogleAccount | {
"repo_name": "Pluto-tv/chromium-crosswalk",
"path": "sync/android/java/src/org/chromium/sync/signin/AccountManagerHelper.java",
"license": "bsd-3-clause",
"size": 15088
} | [
"android.accounts.Account"
] | import android.accounts.Account; | import android.accounts.*; | [
"android.accounts"
] | android.accounts; | 1,536,662 |
public ClientConfig setProperties(final Properties properties) {
isNotNull(properties, "properties");
this.properties = properties;
return this;
} | ClientConfig function(final Properties properties) { isNotNull(properties, STR); this.properties = properties; return this; } | /**
* sets all properties
*
* @param properties {@link java.util.Properties} object
* @return configured {@link com.hazelcast.client.config.ClientConfig} for chaining
*/ | sets all properties | setProperties | {
"repo_name": "mesutcelik/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/client/config/ClientConfig.java",
"license": "apache-2.0",
"size": 37925
} | [
"com.hazelcast.internal.util.Preconditions",
"java.util.Properties"
] | import com.hazelcast.internal.util.Preconditions; import java.util.Properties; | import com.hazelcast.internal.util.*; import java.util.*; | [
"com.hazelcast.internal",
"java.util"
] | com.hazelcast.internal; java.util; | 1,806,893 |
@Override
public VEvent constructAvailableAppointment(AvailableBlock block,
IScheduleOwner owner, IScheduleVisitor visitor,
String eventDescription) {
VEvent event = super.constructAvailableAppointment(block, owner, visitor,
eventDescription);
if(isExplicitSetTimeZone() && _timeZone != null) {
DtStart start = event.getStartDate();
start.setTimeZone(_timeZone);
DtEnd end = event.getEndDate();
end.setTimeZone(_timeZone);
}
return event;
}
| VEvent function(AvailableBlock block, IScheduleOwner owner, IScheduleVisitor visitor, String eventDescription) { VEvent event = super.constructAvailableAppointment(block, owner, visitor, eventDescription); if(isExplicitSetTimeZone() && _timeZone != null) { DtStart start = event.getStartDate(); start.setTimeZone(_timeZone); DtEnd end = event.getEndDate(); end.setTimeZone(_timeZone); } return event; } | /**
* Calls the super implementation, and adds an {@link Organizer} and an {@link Uid}.
* If the explicitSetTimeZone field is true and the corresponding timeZone can be resolved,
* the {@link DtStart} and {@link DtEnd} are modified to include the corresponding TZID parameter.
*
* @see #constructOrganizer(ICalendarAccount)
* @see #generateNewUid()
* (non-Javadoc)
* @see org.jasig.schedassist.model.DefaultEventUtilsImpl#constructAvailableAppointment(org.jasig.schedassist.model.AvailableBlock, org.jasig.schedassist.model.IScheduleOwner, org.jasig.schedassist.model.IScheduleVisitor, java.lang.String)
*/ | Calls the super implementation, and adds an <code>Organizer</code> and an <code>Uid</code>. If the explicitSetTimeZone field is true and the corresponding timeZone can be resolved, the <code>DtStart</code> and <code>DtEnd</code> are modified to include the corresponding TZID parameter | constructAvailableAppointment | {
"repo_name": "nblair/sometime",
"path": "sometime-spi-caldav/src/main/java/org/jasig/schedassist/impl/caldav/CaldavEventUtilsImpl.java",
"license": "apache-2.0",
"size": 7997
} | [
"net.fortuna.ical4j.model.component.VEvent",
"net.fortuna.ical4j.model.property.DtEnd",
"net.fortuna.ical4j.model.property.DtStart",
"org.jasig.schedassist.model.AvailableBlock",
"org.jasig.schedassist.model.IScheduleOwner",
"org.jasig.schedassist.model.IScheduleVisitor"
] | import net.fortuna.ical4j.model.component.VEvent; import net.fortuna.ical4j.model.property.DtEnd; import net.fortuna.ical4j.model.property.DtStart; import org.jasig.schedassist.model.AvailableBlock; import org.jasig.schedassist.model.IScheduleOwner; import org.jasig.schedassist.model.IScheduleVisitor; | import net.fortuna.ical4j.model.component.*; import net.fortuna.ical4j.model.property.*; import org.jasig.schedassist.model.*; | [
"net.fortuna.ical4j",
"org.jasig.schedassist"
] | net.fortuna.ical4j; org.jasig.schedassist; | 1,318,239 |
public Collection<LBMember> listMembers(); | Collection<LBMember> function(); | /**
* List all current members.
*/ | List all current members | listMembers | {
"repo_name": "onebsv1/floodlight",
"path": "src/main/java/net/floodlightcontroller/loadbalancer/ILoadBalancerService.java",
"license": "apache-2.0",
"size": 6535
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,317,550 |
public static void writeLines(Collection<?> lines, String lineEnding,
Writer writer) throws IOException {
if (lines == null) {
return;
}
if (lineEnding == null) {
lineEnding = LINE_SEPARATOR;
}
for (Object line : lines) {
if (line != null) {
writer.write(line.toString());
}
writer.write(lineEnding);
}
} | static void function(Collection<?> lines, String lineEnding, Writer writer) throws IOException { if (lines == null) { return; } if (lineEnding == null) { lineEnding = LINE_SEPARATOR; } for (Object line : lines) { if (line != null) { writer.write(line.toString()); } writer.write(lineEnding); } } | /**
* Writes the <code>toString()</code> value of each item in a collection to
* a <code>Writer</code> line by line, using the specified line ending.
*
* @param lines the lines to write, null entries produce blank lines
* @param lineEnding the line separator to use, null is system default
* @param writer the <code>Writer</code> to write to, not null, not closed
* @throws NullPointerException if the input is null
* @throws IOException if an I/O error occurs
* @since 1.1
*/ | Writes the <code>toString()</code> value of each item in a collection to a <code>Writer</code> line by line, using the specified line ending | writeLines | {
"repo_name": "wspeirs/sop4j-base",
"path": "src/main/java/com/sop4j/base/apache/io/IOUtils.java",
"license": "apache-2.0",
"size": 97933
} | [
"java.io.IOException",
"java.io.Writer",
"java.util.Collection"
] | import java.io.IOException; import java.io.Writer; import java.util.Collection; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 186,638 |
public static void dismiss(Context context) {
try {
if (context instanceof Activity) {
if (((Activity) context).isFinishing()) {
loadDialog = null;
return;
}
}
if (loadDialog != null && loadDialog.isShowing()) {
Context loadContext = loadDialog.getContext();
if (loadContext != null && loadContext instanceof Activity) {
if (((Activity) loadContext).isFinishing()) {
loadDialog = null;
return;
}
}
loadDialog.dismiss();
loadDialog = null;
}
} catch (Exception e) {
e.printStackTrace();
loadDialog = null;
}
} | static void function(Context context) { try { if (context instanceof Activity) { if (((Activity) context).isFinishing()) { loadDialog = null; return; } } if (loadDialog != null && loadDialog.isShowing()) { Context loadContext = loadDialog.getContext(); if (loadContext != null && loadContext instanceof Activity) { if (((Activity) loadContext).isFinishing()) { loadDialog = null; return; } } loadDialog.dismiss(); loadDialog = null; } } catch (Exception e) { e.printStackTrace(); loadDialog = null; } } | /**
* dismiss the mDialogTextView
*/ | dismiss the mDialogTextView | dismiss | {
"repo_name": "zzbb1199/Medical-aid",
"path": "app/src/main/java/com/zxr/medicalaid/widget/LoadDialog.java",
"license": "apache-2.0",
"size": 4079
} | [
"android.app.Activity",
"android.content.Context"
] | import android.app.Activity; import android.content.Context; | import android.app.*; import android.content.*; | [
"android.app",
"android.content"
] | android.app; android.content; | 1,490,763 |
@Test
public void testStartNoOpIfAlreadyClosed() throws JMSException {
consumer.close();
consumer.startPrefetch();
verifyNoMoreInteractions(sqsMessageConsumerPrefetch);
} | void function() throws JMSException { consumer.close(); consumer.startPrefetch(); verifyNoMoreInteractions(sqsMessageConsumerPrefetch); } | /**
* Test Start is a no op if already closed
*/ | Test Start is a no op if already closed | testStartNoOpIfAlreadyClosed | {
"repo_name": "awslabs/amazon-sqs-java-messaging-lib",
"path": "src/test/java/com/amazon/sqs/javamessaging/SQSMessageConsumerTest.java",
"license": "apache-2.0",
"size": 16137
} | [
"javax.jms.JMSException",
"org.mockito.Mockito"
] | import javax.jms.JMSException; import org.mockito.Mockito; | import javax.jms.*; import org.mockito.*; | [
"javax.jms",
"org.mockito"
] | javax.jms; org.mockito; | 2,055,095 |
public static MozuClient<com.mozu.api.contracts.shippingadmin.profile.ShippingInclusionRule> updateShippingInclusionRuleClient(com.mozu.api.contracts.shippingadmin.profile.ShippingInclusionRule rule, String profilecode, String id) throws Exception
{
return updateShippingInclusionRuleClient( rule, profilecode, id, null);
} | static MozuClient<com.mozu.api.contracts.shippingadmin.profile.ShippingInclusionRule> function(com.mozu.api.contracts.shippingadmin.profile.ShippingInclusionRule rule, String profilecode, String id) throws Exception { return updateShippingInclusionRuleClient( rule, profilecode, id, null); } | /**
*
* <p><pre><code>
* MozuClient<com.mozu.api.contracts.shippingadmin.profile.ShippingInclusionRule> mozuClient=UpdateShippingInclusionRuleClient( rule, profilecode, id);
* client.setBaseAddress(url);
* client.executeRequest();
* ShippingInclusionRule shippingInclusionRule = client.Result();
* </code></pre></p>
* @param id
* @param profilecode
* @param dataViewMode DataViewMode
* @param rule
* @return Mozu.Api.MozuClient <com.mozu.api.contracts.shippingadmin.profile.ShippingInclusionRule>
* @see com.mozu.api.contracts.shippingadmin.profile.ShippingInclusionRule
* @see com.mozu.api.contracts.shippingadmin.profile.ShippingInclusionRule
*/ | <code><code> MozuClient mozuClient=UpdateShippingInclusionRuleClient( rule, profilecode, id); client.setBaseAddress(url); client.executeRequest(); ShippingInclusionRule shippingInclusionRule = client.Result(); </code></code> | updateShippingInclusionRuleClient | {
"repo_name": "bhewett/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/clients/commerce/shipping/admin/profiles/ShippingInclusionRuleClient.java",
"license": "mit",
"size": 11065
} | [
"com.mozu.api.MozuClient"
] | import com.mozu.api.MozuClient; | import com.mozu.api.*; | [
"com.mozu.api"
] | com.mozu.api; | 1,464,773 |
public LinkedList<Patch> patch_deepCopy(LinkedList<Patch> patches) {
LinkedList<Patch> patchesCopy = new LinkedList<Patch>();
for (Patch aPatch : patches) {
Patch patchCopy = new Patch();
for (Diff aDiff : aPatch.diffs) {
Diff diffCopy = new Diff(aDiff.operation, aDiff.text);
patchCopy.diffs.add(diffCopy);
}
patchCopy.start1 = aPatch.start1;
patchCopy.start2 = aPatch.start2;
patchCopy.length1 = aPatch.length1;
patchCopy.length2 = aPatch.length2;
patchesCopy.add(patchCopy);
}
return patchesCopy;
} | LinkedList<Patch> function(LinkedList<Patch> patches) { LinkedList<Patch> patchesCopy = new LinkedList<Patch>(); for (Patch aPatch : patches) { Patch patchCopy = new Patch(); for (Diff aDiff : aPatch.diffs) { Diff diffCopy = new Diff(aDiff.operation, aDiff.text); patchCopy.diffs.add(diffCopy); } patchCopy.start1 = aPatch.start1; patchCopy.start2 = aPatch.start2; patchCopy.length1 = aPatch.length1; patchCopy.length2 = aPatch.length2; patchesCopy.add(patchCopy); } return patchesCopy; } | /**
* Given an array of patches, return another array that is identical.
* @param patches Array of Patch objects.
* @return Array of Patch objects.
*/ | Given an array of patches, return another array that is identical | patch_deepCopy | {
"repo_name": "mischov/clj-diffmatchpatch",
"path": "src/java/google/dmp/DiffMatchPatch.java",
"license": "apache-2.0",
"size": 89116
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 1,974,491 |
public Note importNote(String sourceJson, String noteName) throws IOException {
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.setPrettyPrinting();
Gson gson = gsonBuilder.create();
JsonReader reader = new JsonReader(new StringReader(sourceJson));
reader.setLenient(true);
Note newNote;
try {
Note oldNote = gson.fromJson(reader, Note.class);
newNote = createNote();
if (noteName != null)
newNote.setName(noteName);
else
newNote.setName(oldNote.getName());
List<Paragraph> paragraphs = oldNote.getParagraphs();
for (Paragraph p : paragraphs) {
newNote.addCloneParagraph(p);
}
newNote.persist();
} catch (IOException e) {
logger.error(e.toString(), e);
throw e;
}
return newNote;
} | Note function(String sourceJson, String noteName) throws IOException { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.setPrettyPrinting(); Gson gson = gsonBuilder.create(); JsonReader reader = new JsonReader(new StringReader(sourceJson)); reader.setLenient(true); Note newNote; try { Note oldNote = gson.fromJson(reader, Note.class); newNote = createNote(); if (noteName != null) newNote.setName(noteName); else newNote.setName(oldNote.getName()); List<Paragraph> paragraphs = oldNote.getParagraphs(); for (Paragraph p : paragraphs) { newNote.addCloneParagraph(p); } newNote.persist(); } catch (IOException e) { logger.error(e.toString(), e); throw e; } return newNote; } | /**
* import JSON as a new note.
* @param sourceJson - the note JSON to import
* @param noteName - the name of the new note
* @return notebook ID
* @throws IOException
*/ | import JSON as a new note | importNote | {
"repo_name": "cris83/incubator-zeppelin",
"path": "zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java",
"license": "apache-2.0",
"size": 18370
} | [
"com.google.gson.Gson",
"com.google.gson.GsonBuilder",
"com.google.gson.stream.JsonReader",
"java.io.IOException",
"java.io.StringReader",
"java.util.List"
] | import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.stream.JsonReader; import java.io.IOException; import java.io.StringReader; import java.util.List; | import com.google.gson.*; import com.google.gson.stream.*; import java.io.*; import java.util.*; | [
"com.google.gson",
"java.io",
"java.util"
] | com.google.gson; java.io; java.util; | 6,735 |
public static void waitConnected(EventReceptor<?> eventReceptor, int timeout) throws InterruptedException {
if (!TestUtils.waitFor(new EventReceptorConnected(eventReceptor), timeout)) {
throw new AssertionError("EventReceptor not connected after " + timeout + " ms");
}
} | static void function(EventReceptor<?> eventReceptor, int timeout) throws InterruptedException { if (!TestUtils.waitFor(new EventReceptorConnected(eventReceptor), timeout)) { throw new AssertionError(STR + timeout + STR); } } | /**
* Waits until the specified {@link EventReceptor} is connected. It throws an
* assertion failure otherwise
*
* @param eventReceptor
* The event receptor
* @param timeout
* The maximum number of milliseconds to wait
* @throws InterruptedException
* If interrupted while waiting
*/ | Waits until the specified <code>EventReceptor</code> is connected. It throws an assertion failure otherwise | waitConnected | {
"repo_name": "Comcast/flume2storm",
"path": "test-impl/src/main/java/com/comcast/viper/flume2storm/connection/receptor/EventReceptorTestUtils.java",
"license": "apache-2.0",
"size": 4064
} | [
"com.comcast.viper.flume2storm.utility.test.TestUtils"
] | import com.comcast.viper.flume2storm.utility.test.TestUtils; | import com.comcast.viper.flume2storm.utility.test.*; | [
"com.comcast.viper"
] | com.comcast.viper; | 2,836,726 |
public static void sendDataFromPlugin(Context context, int pluginId, float data){
Intent intent = getPluginSendIntent(AmarinoIntent.FLOAT_EXTRA, pluginId);
intent.putExtra(AmarinoIntent.EXTRA_DATA, data);
context.sendBroadcast(intent);
}
| static void function(Context context, int pluginId, float data){ Intent intent = getPluginSendIntent(AmarinoIntent.FLOAT_EXTRA, pluginId); intent.putExtra(AmarinoIntent.EXTRA_DATA, data); context.sendBroadcast(intent); } | /**
* Used by plug-in developers to send a float value.
*
* <p>This method can only be used within a plugin!
* If you want to send data from your own standalone application, use
* {@link #sendDataToArduino(Context context, String address, char flag, float data)} instead.</p>
*
* @param context the context
* @param pluginId you received this id when
* @param data your data you want to send
*/ | Used by plug-in developers to send a float value. This method can only be used within a plugin! If you want to send data from your own standalone application, use <code>#sendDataToArduino(Context context, String address, char flag, float data)</code> instead | sendDataFromPlugin | {
"repo_name": "infomat/amarino",
"path": "amarino/src/at/abraxas/amarino/Amarino.java",
"license": "gpl-3.0",
"size": 27356
} | [
"android.content.Context",
"android.content.Intent"
] | import android.content.Context; import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 366,205 |
public OperationInfo setLastUpdatedDateTime(OffsetDateTime lastUpdatedDateTime) {
this.lastUpdatedDateTime = lastUpdatedDateTime;
return this;
} | OperationInfo function(OffsetDateTime lastUpdatedDateTime) { this.lastUpdatedDateTime = lastUpdatedDateTime; return this; } | /**
* Set the lastUpdatedDateTime property: Date and time (UTC) when the status was last updated.
*
* @param lastUpdatedDateTime the lastUpdatedDateTime value to set.
* @return the OperationInfo object itself.
*/ | Set the lastUpdatedDateTime property: Date and time (UTC) when the status was last updated | setLastUpdatedDateTime | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/implementation/models/OperationInfo.java",
"license": "mit",
"size": 6787
} | [
"java.time.OffsetDateTime"
] | import java.time.OffsetDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 61,686 |
@VisibleForTesting // for our own unit tests only.
synchronized Root findDerivedRoot(Path path) {
for (Root prefix : derivedRoots) {
if (path.startsWith(prefix.getPath())) {
return prefix;
}
}
return null;
}
// Non-final only because clear()ing a map does not actually free the memory it took up, so we
// assign it to a new map in lieu of clearing.
private ConcurrentMap<PathFragment, Artifact> deserializedArtifacts =
new ConcurrentHashMap<>(); | @VisibleForTesting synchronized Root findDerivedRoot(Path path) { for (Root prefix : derivedRoots) { if (path.startsWith(prefix.getPath())) { return prefix; } } return null; } private ConcurrentMap<PathFragment, Artifact> deserializedArtifacts = new ConcurrentHashMap<>(); | /**
* Finds the derived root for a full path by comparing against the known
* derived artifact roots.
*
* @param path a Path to resolve the root for
* @return the root for the path or null if no root can be determined
*/ | Finds the derived root for a full path by comparing against the known derived artifact roots | findDerivedRoot | {
"repo_name": "vt09/bazel",
"path": "src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java",
"license": "apache-2.0",
"size": 18462
} | [
"com.google.common.annotations.VisibleForTesting",
"com.google.devtools.build.lib.vfs.Path",
"com.google.devtools.build.lib.vfs.PathFragment",
"java.util.concurrent.ConcurrentHashMap",
"java.util.concurrent.ConcurrentMap"
] | import com.google.common.annotations.VisibleForTesting; import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; | import com.google.common.annotations.*; import com.google.devtools.build.lib.vfs.*; import java.util.concurrent.*; | [
"com.google.common",
"com.google.devtools",
"java.util"
] | com.google.common; com.google.devtools; java.util; | 2,425,231 |
public Bundle toBundle( T oSource )
throws SchematicException
{
Bundle bndl = new Bundle() ;
for( Column col : m_aColumns )
{
Refractor lens = col.getRefractor() ;
if( lens == null )
throw SchematicException.noLensForColumn( col, null ) ;
try
{
// noinspection unchecked - lens corresponds to field
lens.addToBundle( bndl, col.getName(),
lens.getValueFrom( oSource, col.getField() ) ) ;
}
catch( IllegalAccessException xAccess )
{
throw SchematicException.fieldWasInaccessible(
m_clsTable.getCanonicalName(),
col.getField().getName(),
xAccess
);
}
catch( SchematicException xSchema )
{
Log.e( LOG_TAG, (new StringBuilder())
.append( "Could not get value for field [" )
.append( col.getField().getName() )
.append( "] from a bundle:" )
.toString(),
xSchema
);
} // and continue
}
return bndl ;
} | Bundle function( T oSource ) throws SchematicException { Bundle bndl = new Bundle() ; for( Column col : m_aColumns ) { Refractor lens = col.getRefractor() ; if( lens == null ) throw SchematicException.noLensForColumn( col, null ) ; try { lens.addToBundle( bndl, col.getName(), lens.getValueFrom( oSource, col.getField() ) ) ; } catch( IllegalAccessException xAccess ) { throw SchematicException.fieldWasInaccessible( m_clsTable.getCanonicalName(), col.getField().getName(), xAccess ); } catch( SchematicException xSchema ) { Log.e( LOG_TAG, (new StringBuilder()) .append( STR ) .append( col.getField().getName() ) .append( STR ) .toString(), xSchema ); } } return bndl ; } | /**
* Extracts the values of all known fields, corresponding to database
* table columns, from a schematic class instance, and returns a
* {@link Bundle} instance containing those values.
* @param oSource the object to be processed
* @return the values that would be stored in the database
* @throws SchematicException if no {@link Refractor} implementation can
* be found for one of the column's fields
*/ | Extracts the values of all known fields, corresponding to database table columns, from a schematic class instance, and returns a <code>Bundle</code> instance containing those values | toBundle | {
"repo_name": "zerobandwidth-net/android",
"path": "libZeroAndroid/src/main/java/net/zer0bandwidth/android/lib/database/sqlitehouse/SQLightable.java",
"license": "mit",
"size": 37470
} | [
"android.os.Bundle",
"android.util.Log",
"net.zer0bandwidth.android.lib.database.sqlitehouse.exceptions.SchematicException",
"net.zer0bandwidth.android.lib.database.sqlitehouse.refractor.Refractor"
] | import android.os.Bundle; import android.util.Log; import net.zer0bandwidth.android.lib.database.sqlitehouse.exceptions.SchematicException; import net.zer0bandwidth.android.lib.database.sqlitehouse.refractor.Refractor; | import android.os.*; import android.util.*; import net.zer0bandwidth.android.lib.database.sqlitehouse.exceptions.*; import net.zer0bandwidth.android.lib.database.sqlitehouse.refractor.*; | [
"android.os",
"android.util",
"net.zer0bandwidth.android"
] | android.os; android.util; net.zer0bandwidth.android; | 2,011,946 |
@Override // NamespaceService
public void format(GiraffaConfiguration conf) throws IOException {
LOG.info("Format started...");
String tableName = conf.get(GiraffaConfiguration.GRFA_TABLE_NAME_KEY,
GiraffaConfiguration.GRFA_TABLE_NAME_DEFAULT);
URI gURI = FileSystem.getDefaultUri(conf);
if( ! GiraffaConfiguration.GRFA_URI_SCHEME.equals(gURI.getScheme()))
throw new IOException("Cannot format. Non-Giraffa URI found: " + gURI);
HBaseAdmin hbAdmin = new HBaseAdmin(HBaseConfiguration.create(conf));
if(hbAdmin.tableExists(tableName)) {
// remove existing table to renew it
if(hbAdmin.isTableEnabled(tableName)) {
hbAdmin.disableTable(tableName);
}
hbAdmin.deleteTable(tableName);
}
HTableDescriptor htd = buildGiraffaTable(conf);
hbAdmin.createTable(htd);
LOG.info("Created " + tableName);
hbAdmin.close();
LOG.info("Format ended... adding work directory.");
} | @Override void function(GiraffaConfiguration conf) throws IOException { LOG.info(STR); String tableName = conf.get(GiraffaConfiguration.GRFA_TABLE_NAME_KEY, GiraffaConfiguration.GRFA_TABLE_NAME_DEFAULT); URI gURI = FileSystem.getDefaultUri(conf); if( ! GiraffaConfiguration.GRFA_URI_SCHEME.equals(gURI.getScheme())) throw new IOException(STR + gURI); HBaseAdmin hbAdmin = new HBaseAdmin(HBaseConfiguration.create(conf)); if(hbAdmin.tableExists(tableName)) { if(hbAdmin.isTableEnabled(tableName)) { hbAdmin.disableTable(tableName); } hbAdmin.deleteTable(tableName); } HTableDescriptor htd = buildGiraffaTable(conf); hbAdmin.createTable(htd); LOG.info(STR + tableName); hbAdmin.close(); LOG.info(STR); } | /**
* Must be called before FileSystem can be used!
*
* @param conf
*
* @throws IOException
*/ | Must be called before FileSystem can be used | format | {
"repo_name": "rvs/giraffa",
"path": "giraffa-core/src/main/java/org/apache/giraffa/hbase/NamespaceAgent.java",
"license": "apache-2.0",
"size": 23754
} | [
"java.io.IOException",
"org.apache.giraffa.GiraffaConfiguration",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.hbase.HBaseConfiguration",
"org.apache.hadoop.hbase.HTableDescriptor",
"org.apache.hadoop.hbase.client.HBaseAdmin"
] | import java.io.IOException; import org.apache.giraffa.GiraffaConfiguration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.client.HBaseAdmin; | import java.io.*; import org.apache.giraffa.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"org.apache.giraffa",
"org.apache.hadoop"
] | java.io; org.apache.giraffa; org.apache.hadoop; | 2,072,039 |
void vtDial (String address, int clirMode, UUSInfo uusInfo, Message result); | void vtDial (String address, int clirMode, UUSInfo uusInfo, Message result); | /**
* returned message
* retMsg.obj = AsyncResult ar
* ar.exception carries exception on failure
* ar.userObject contains the orignal value of result.obj
* ar.result is null on success and failure
*
* CLIR_DEFAULT == on "use subscription default value"
* CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation)
* CLIR_INVOCATION == on "CLIR invocation" (restrict CLI presentation)
*/ | returned message retMsg.obj = AsyncResult ar ar.exception carries exception on failure ar.userObject contains the orignal value of result.obj ar.result is null on success and failure CLIR_DEFAULT == on "use subscription default value" CLIR_SUPPRESSION == on "CLIR suppression" (allow CLI presentation) CLIR_INVOCATION == on "CLIR invocation" (restrict CLI presentation) | vtDial | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "frameworks/opt/telephony/src/java/com/android/internal/telephony/CommandsInterface.java",
"license": "gpl-2.0",
"size": 86787
} | [
"android.os.Message"
] | import android.os.Message; | import android.os.*; | [
"android.os"
] | android.os; | 2,014,775 |
return Response.ok(VERSION).build();
}
/**
* Return the list of all groups if you have group manager permission, or all
* learning group that you particip with or owne.
* @response.representation.200.qname {http://www.example.com}groupVO
* @response.representation.200.mediaType application/xml, application/json
* @response.representation.200.doc This is the list of all groups in OLAT system
* @response.representation.200.example {@link org.olat.restapi.support.vo.Examples#SAMPLE_GROUPVOes} | return Response.ok(VERSION).build(); } /** * Return the list of all groups if you have group manager permission, or all * learning group that you particip with or owne. * @response.representation.200.qname {http: * @response.representation.200.mediaType application/xml, application/json * @response.representation.200.doc This is the list of all groups in OLAT system * @response.representation.200.example {@link org.olat.restapi.support.vo.Examples#SAMPLE_GROUPVOes} | /**
* Retrieves the version of the Group Web Service.
* @response.representation.200.mediaType text/plain
* @response.representation.200.doc The version of this specific Web Service
* @response.representation.200.example 1.0
* @return
*/ | Retrieves the version of the Group Web Service | getVersion | {
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/main/java/org/olat/restapi/group/LearningGroupWebService.java",
"license": "apache-2.0",
"size": 29153
} | [
"javax.ws.rs.core.Response"
] | import javax.ws.rs.core.Response; | import javax.ws.rs.core.*; | [
"javax.ws"
] | javax.ws; | 1,785,898 |
@Test
public void testAddPropertyOnTrackedNode()
{
NodeKeyResolver<ImmutableNode> resolver = createResolver(false);
NodeStructureHelper.expectResolveAddKeys(resolver);
EasyMock.replay(resolver);
model.trackNode(selector, resolver);
model.addProperty("fields.field(-1).name", selector,
Collections.singleton(NEW_FIELD), resolver);
checkForAddedField(fieldsNodeFromModel());
checkForAddedField(fieldsNodeFromTrackedNode());
} | void function() { NodeKeyResolver<ImmutableNode> resolver = createResolver(false); NodeStructureHelper.expectResolveAddKeys(resolver); EasyMock.replay(resolver); model.trackNode(selector, resolver); model.addProperty(STR, selector, Collections.singleton(NEW_FIELD), resolver); checkForAddedField(fieldsNodeFromModel()); checkForAddedField(fieldsNodeFromTrackedNode()); } | /**
* Tests whether an addProperty() operation works on a tracked node.
*/ | Tests whether an addProperty() operation works on a tracked node | testAddPropertyOnTrackedNode | {
"repo_name": "mohanaraosv/commons-configuration",
"path": "src/test/java/org/apache/commons/configuration2/tree/TestInMemoryNodeModelTrackedNodes.java",
"license": "apache-2.0",
"size": 36379
} | [
"java.util.Collections",
"org.easymock.EasyMock"
] | import java.util.Collections; import org.easymock.EasyMock; | import java.util.*; import org.easymock.*; | [
"java.util",
"org.easymock"
] | java.util; org.easymock; | 1,439,252 |
public GetReportRequestListRequest withRequestedToDate(XMLGregorianCalendar value) {
setRequestedToDate(value);
return this;
}
| GetReportRequestListRequest function(XMLGregorianCalendar value) { setRequestedToDate(value); return this; } | /**
* Sets the value of the RequestedToDate property.
*
* @param value
* @return
* this instance
*/ | Sets the value of the RequestedToDate property | withRequestedToDate | {
"repo_name": "kenyonduan/amazon-mws",
"path": "src/main/java/com/amazonservices/mws/reports/model/GetReportRequestListRequest.java",
"license": "mit",
"size": 17184
} | [
"javax.xml.datatype.XMLGregorianCalendar"
] | import javax.xml.datatype.XMLGregorianCalendar; | import javax.xml.datatype.*; | [
"javax.xml"
] | javax.xml; | 135,256 |
public void readListEnd()
throws IOException
{
int code = read();
if (code != 'z')
throw error("expected end of list ('z') at " + codeName(code));
} | void function() throws IOException { int code = read(); if (code != 'z') throw error(STR + codeName(code)); } | /**
* Reads the end byte.
*/ | Reads the end byte | readListEnd | {
"repo_name": "roidelapluie/yajsw",
"path": "src/hessian/src/main/java/com/caucho/hessian4/io/HessianInput.java",
"license": "lgpl-2.1",
"size": 32388
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 139,852 |
public void testReadXml() throws Exception {
CmsObject cms = getCmsObject();
CmsJspVfsAccessBean bean = CmsJspVfsAccessBean.create(cms);
Map readXml = bean.getReadXml();
// access XML content
CmsJspContentAccessBean content = (CmsJspContentAccessBean)readXml.get("/xmlcontent/article_0001.html");
assertEquals("Alkacon Software", content.getValue().get("Author").toString());
// access XML page
content = (CmsJspContentAccessBean)readXml.get("/index.html");
assertEquals(Boolean.TRUE, content.getHasValue().get("body"));
assertEquals(Boolean.FALSE, content.getHasValue().get("element"));
System.out.println(content.getValue().get("body"));
} | void function() throws Exception { CmsObject cms = getCmsObject(); CmsJspVfsAccessBean bean = CmsJspVfsAccessBean.create(cms); Map readXml = bean.getReadXml(); CmsJspContentAccessBean content = (CmsJspContentAccessBean)readXml.get(STR); assertEquals(STR, content.getValue().get(STR).toString()); content = (CmsJspContentAccessBean)readXml.get(STR); assertEquals(Boolean.TRUE, content.getHasValue().get("body")); assertEquals(Boolean.FALSE, content.getHasValue().get(STR)); System.out.println(content.getValue().get("body")); } | /**
* Tests for the {@link CmsJspVfsAccessBean#getReadXml()} method.<p>
*
* @throws Exception if the test fails
*/ | Tests for the <code>CmsJspVfsAccessBean#getReadXml()</code> method | testReadXml | {
"repo_name": "mediaworx/opencms-core",
"path": "test/org/opencms/jsp/util/TestCmsJspVfsAccessBean.java",
"license": "lgpl-2.1",
"size": 5680
} | [
"java.util.Map",
"org.opencms.file.CmsObject"
] | import java.util.Map; import org.opencms.file.CmsObject; | import java.util.*; import org.opencms.file.*; | [
"java.util",
"org.opencms.file"
] | java.util; org.opencms.file; | 892,197 |
private String bindParameters(String text, Map<String, String> merged) {
String bound = text;
for (String key : merged.keySet()) {
String value = merged.get(key);
if (value.startsWith("http://") || value.startsWith("https://")) {
bound = bound.replaceAll("([?$]" + key + ")([^a-zA-Z0-9_\\-])", "<" + value + ">$2");
} else {
bound = bound.replaceAll("([?$]" + key + ")([^a-zA-Z0-9_\\-])", value + "$2");
}
}
if (log.isDebugEnabled()) {
log.debug("parameters: " + merged);
log.debug("query before binding parameters:" + text);
log.debug("query after binding parameters: " + bound);
}
return bound;
} | String function(String text, Map<String, String> merged) { String bound = text; for (String key : merged.keySet()) { String value = merged.get(key); if (value.startsWith(STR([?$]STR)([^a-zA-Z0-9_\\-])STR<STR>$2STR([?$]STR)([^a-zA-Z0-9_\\-])STR$2STRparameters: STRquery before binding parameters:STRquery after binding parameters: " + bound); } return bound; } | /**
* InitialBindings don't always work, and besides, RDFService doesn't accept
* them. So do a text-based substitution.
*
* This assumes that every parameter is a URI. What if we want to substitute
* a string value?
*/ | InitialBindings don't always work, and besides, RDFService doesn't accept them. So do a text-based substitution. This assumes that every parameter is a URI. What if we want to substitute a string value | bindParameters | {
"repo_name": "vivo-project/Vitro",
"path": "api/src/main/java/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/SparqlQueryDataGetter.java",
"license": "bsd-3-clause",
"size": 10645
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 702,593 |
public void stop(){
if(mProgressDrawable != null)
((Animatable)mProgressDrawable).stop();
} | void function(){ if(mProgressDrawable != null) ((Animatable)mProgressDrawable).stop(); } | /**
* Stop showing progress.
*/ | Stop showing progress | stop | {
"repo_name": "android9527/AndroidDemo",
"path": "material/src/main/java/com/rey/material/widget/ProgressView.java",
"license": "apache-2.0",
"size": 7866
} | [
"android.graphics.drawable.Animatable"
] | import android.graphics.drawable.Animatable; | import android.graphics.drawable.*; | [
"android.graphics"
] | android.graphics; | 981,630 |
@Override
public Iterator<Integer> iterator() {
| Iterator<Integer> function() { | /**
* Will not fail fast. sorry.
*/ | Will not fail fast. sorry | iterator | {
"repo_name": "junminstorage/code4fun",
"path": "src/org/blueocean/CIntHashMap.java",
"license": "apache-2.0",
"size": 12423
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 1,155,831 |
public static FunctionCall convertSqlOperatorBindingToFunctionCall(final SqlOperatorBinding opBinding) {
final List<LogicalExpression> args = Lists.newArrayList();
for (int i = 0; i < opBinding.getOperandCount(); ++i) {
final RelDataType type = opBinding.getOperandType(i);
final TypeProtos.MinorType minorType = getDrillTypeFromCalciteType(type);
TypeProtos.DataMode dataMode =
type.isNullable() ? TypeProtos.DataMode.OPTIONAL : TypeProtos.DataMode.REQUIRED;
TypeProtos.MajorType.Builder builder =
TypeProtos.MajorType.newBuilder()
.setMode(dataMode)
.setMinorType(minorType);
if (Types.isDecimalType(minorType)) {
builder
.setScale(type.getScale())
.setPrecision(type.getPrecision());
}
args.add(new MajorTypeInLogicalExpression(builder.build()));
}
final String drillFuncName = FunctionCallFactory.replaceOpWithFuncName(opBinding.getOperator().getName());
return new FunctionCall(
drillFuncName,
args,
ExpressionPosition.UNKNOWN);
} | static FunctionCall function(final SqlOperatorBinding opBinding) { final List<LogicalExpression> args = Lists.newArrayList(); for (int i = 0; i < opBinding.getOperandCount(); ++i) { final RelDataType type = opBinding.getOperandType(i); final TypeProtos.MinorType minorType = getDrillTypeFromCalciteType(type); TypeProtos.DataMode dataMode = type.isNullable() ? TypeProtos.DataMode.OPTIONAL : TypeProtos.DataMode.REQUIRED; TypeProtos.MajorType.Builder builder = TypeProtos.MajorType.newBuilder() .setMode(dataMode) .setMinorType(minorType); if (Types.isDecimalType(minorType)) { builder .setScale(type.getScale()) .setPrecision(type.getPrecision()); } args.add(new MajorTypeInLogicalExpression(builder.build())); } final String drillFuncName = FunctionCallFactory.replaceOpWithFuncName(opBinding.getOperator().getName()); return new FunctionCall( drillFuncName, args, ExpressionPosition.UNKNOWN); } | /**
* Given a SqlOperatorBinding, convert it to FunctionCall
* @param opBinding the given SqlOperatorBinding
* @return FunctionCall the converted FunctionCall
*/ | Given a SqlOperatorBinding, convert it to FunctionCall | convertSqlOperatorBindingToFunctionCall | {
"repo_name": "nagix/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/TypeInferenceUtils.java",
"license": "apache-2.0",
"size": 42346
} | [
"com.google.common.collect.Lists",
"java.util.List",
"org.apache.calcite.rel.type.RelDataType",
"org.apache.calcite.sql.SqlOperatorBinding",
"org.apache.drill.common.expression.ExpressionPosition",
"org.apache.drill.common.expression.FunctionCall",
"org.apache.drill.common.expression.FunctionCallFactory",
"org.apache.drill.common.expression.LogicalExpression",
"org.apache.drill.common.expression.MajorTypeInLogicalExpression",
"org.apache.drill.common.types.TypeProtos",
"org.apache.drill.common.types.Types"
] | import com.google.common.collect.Lists; import java.util.List; import org.apache.calcite.rel.type.RelDataType; import org.apache.calcite.sql.SqlOperatorBinding; import org.apache.drill.common.expression.ExpressionPosition; import org.apache.drill.common.expression.FunctionCall; import org.apache.drill.common.expression.FunctionCallFactory; import org.apache.drill.common.expression.LogicalExpression; import org.apache.drill.common.expression.MajorTypeInLogicalExpression; import org.apache.drill.common.types.TypeProtos; import org.apache.drill.common.types.Types; | import com.google.common.collect.*; import java.util.*; import org.apache.calcite.rel.type.*; import org.apache.calcite.sql.*; import org.apache.drill.common.expression.*; import org.apache.drill.common.types.*; | [
"com.google.common",
"java.util",
"org.apache.calcite",
"org.apache.drill"
] | com.google.common; java.util; org.apache.calcite; org.apache.drill; | 553,072 |
@RequestMapping("/getJobDownloads.do")
public ModelAndView getJobDownloads(@RequestParam("jobId") Integer jobId) {
//Lookup the job
VEGLJob job;
try {
job = jobManager.getJobById(jobId);
} catch (Exception ex) {
logger.error("Error looking up job with id " + jobId + " :" + ex.getMessage());
logger.debug("Exception:", ex);
return generateJSONResponseMAV(false, null, "Unable to access job");
}
return generateJSONResponseMAV(true, job.getJobDownloads(), "");
} | @RequestMapping(STR) ModelAndView function(@RequestParam("jobId") Integer jobId) { VEGLJob job; try { job = jobManager.getJobById(jobId); } catch (Exception ex) { logger.error(STR + jobId + STR + ex.getMessage()); logger.debug(STR, ex); return generateJSONResponseMAV(false, null, STR); } return generateJSONResponseMAV(true, job.getJobDownloads(), ""); } | /**
* Given the ID of a job - lookup the appropriate job object and associated list of downloads objects.
*
* Return them as an array of JSON serialised VglDownload objects.
* @param jobId
* @return
*/ | Given the ID of a job - lookup the appropriate job object and associated list of downloads objects. Return them as an array of JSON serialised VglDownload objects | getJobDownloads | {
"repo_name": "AuScope/VEGL-Portal",
"path": "src/main/java/org/auscope/portal/server/web/controllers/JobBuilderController.java",
"license": "gpl-3.0",
"size": 43657
} | [
"org.auscope.portal.server.vegl.VEGLJob",
"org.springframework.web.bind.annotation.RequestMapping",
"org.springframework.web.bind.annotation.RequestParam",
"org.springframework.web.servlet.ModelAndView"
] | import org.auscope.portal.server.vegl.VEGLJob; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView; | import org.auscope.portal.server.vegl.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.*; | [
"org.auscope.portal",
"org.springframework.web"
] | org.auscope.portal; org.springframework.web; | 1,839,945 |
public static List<Tweet> getFakeTweets() {
final ArrayList<Tweet> tweets = new ArrayList<Tweet>();
// Build a TwitterUser
TwitterUser user = new TwitterUser();
user.name = "R&D Worldline";
user.screenName = "rd_aw";
user.profileImageUrl = "";
// Build 20 Tweets
for (int i = 0; i < 20; i++) {
final Tweet tweet = new Tweet();
tweet.text = "Tweet #" + i;
tweet.user = user;
tweets.add(tweet);
}
return tweets;
} | static List<Tweet> function() { final ArrayList<Tweet> tweets = new ArrayList<Tweet>(); TwitterUser user = new TwitterUser(); user.name = STR; user.screenName = "rd_aw"; user.profileImageUrl = STRTweet #" + i; tweet.user = user; tweets.add(tweet); } return tweets; } | /**
* Create a fake Tweet list
*
* @return
*/ | Create a fake Tweet list | getFakeTweets | {
"repo_name": "hugoatease/twitterapp",
"path": "app/src/main/java/worldline/ssm/rd/ux/wltwitter/helpers/TwitterHelper.java",
"license": "apache-2.0",
"size": 7267
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,801,441 |
@Override
public void execute() {
int count = 0, skip = 0;
int total = getTotal();
while (count < total) {
JsonNode jsonNode = getData(baseURL, batchLimit, skip);
if (jsonNode != null) {
ArrayNode results = (ArrayNode)jsonNode.get("results");
if (results != null) {
for (JsonNode result: results) {
JsonNode openFDA = result.get("openfda").get("substance_name");
if (openFDA != null || nonOpenFDA) {
String record = result.toString();
logger.debug(record);
SendJMSMessage(record);
}
count++;skip++;
}
}
}
logger.info("Current record count: " + count);
}
logger.info("Total records retrieved: " + count);
}
| void function() { int count = 0, skip = 0; int total = getTotal(); while (count < total) { JsonNode jsonNode = getData(baseURL, batchLimit, skip); if (jsonNode != null) { ArrayNode results = (ArrayNode)jsonNode.get(STR); if (results != null) { for (JsonNode result: results) { JsonNode openFDA = result.get(STR).get(STR); if (openFDA != null nonOpenFDA) { String record = result.toString(); logger.debug(record); SendJMSMessage(record); } count++;skip++; } } } logger.info(STR + count); } logger.info(STR + count); } | /**
* The public method invoked by the DigitalEdge pipeline to start the transport process of openFDA data
* into DigitalEdge. Calls the openFDA REST API to retrieve enforcement/recall data and sends it into
* DigitalEdge for processing.
*/ | The public method invoked by the DigitalEdge pipeline to start the transport process of openFDA data into DigitalEdge. Calls the openFDA REST API to retrieve enforcement/recall data and sends it into DigitalEdge for processing | execute | {
"repo_name": "deleidos/prototype-20150626",
"path": "transport-openfda-url/src/main/java/com/deleidos/rtws/transport/OpenFdaUrlTransportService.java",
"license": "apache-2.0",
"size": 5969
} | [
"org.codehaus.jackson.JsonNode",
"org.codehaus.jackson.node.ArrayNode"
] | import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.node.ArrayNode; | import org.codehaus.jackson.*; import org.codehaus.jackson.node.*; | [
"org.codehaus.jackson"
] | org.codehaus.jackson; | 1,545,569 |
protected Pointer getSingleNodePointerForSteps(EvalContext context) {
if (steps.length == 0) {
return context.getSingleNodePointer();
}
if (isSimplePath()) {
NodePointer ptr = (NodePointer) context.getSingleNodePointer();
return SimplePathInterpreter.interpretSimpleLocationPath(
context,
ptr,
steps);
}
return searchForPath(context);
} | Pointer function(EvalContext context) { if (steps.length == 0) { return context.getSingleNodePointer(); } if (isSimplePath()) { NodePointer ptr = (NodePointer) context.getSingleNodePointer(); return SimplePathInterpreter.interpretSimpleLocationPath( context, ptr, steps); } return searchForPath(context); } | /**
* Given a root context, walks a path therefrom and finds the
* pointer to the first element matching the path.
* @param context evaluation context
* @return Pointer
*/ | Given a root context, walks a path therefrom and finds the pointer to the first element matching the path | getSingleNodePointerForSteps | {
"repo_name": "apache/commons-jxpath",
"path": "src/main/java/org/apache/commons/jxpath/ri/compiler/Path.java",
"license": "apache-2.0",
"size": 12106
} | [
"org.apache.commons.jxpath.Pointer",
"org.apache.commons.jxpath.ri.EvalContext",
"org.apache.commons.jxpath.ri.axes.SimplePathInterpreter",
"org.apache.commons.jxpath.ri.model.NodePointer"
] | import org.apache.commons.jxpath.Pointer; import org.apache.commons.jxpath.ri.EvalContext; import org.apache.commons.jxpath.ri.axes.SimplePathInterpreter; import org.apache.commons.jxpath.ri.model.NodePointer; | import org.apache.commons.jxpath.*; import org.apache.commons.jxpath.ri.*; import org.apache.commons.jxpath.ri.axes.*; import org.apache.commons.jxpath.ri.model.*; | [
"org.apache.commons"
] | org.apache.commons; | 813,422 |
Iterator<CarbonRowBatch>[] sort(Iterator<CarbonRowBatch>[] iterators)
throws CarbonDataLoadingException; | Iterator<CarbonRowBatch>[] sort(Iterator<CarbonRowBatch>[] iterators) throws CarbonDataLoadingException; | /**
* Sorts the data of all iterators, this iterators can be
* read parallely depends on implementation.
*
* @param iterators array of iterators to read data.
* @return
* @throws CarbonDataLoadingException
*/ | Sorts the data of all iterators, this iterators can be read parallely depends on implementation | sort | {
"repo_name": "sgururajshetty/carbondata",
"path": "processing/src/main/java/org/apache/carbondata/processing/loading/sort/Sorter.java",
"license": "apache-2.0",
"size": 1801
} | [
"java.util.Iterator",
"org.apache.carbondata.processing.loading.exception.CarbonDataLoadingException",
"org.apache.carbondata.processing.loading.row.CarbonRowBatch"
] | import java.util.Iterator; import org.apache.carbondata.processing.loading.exception.CarbonDataLoadingException; import org.apache.carbondata.processing.loading.row.CarbonRowBatch; | import java.util.*; import org.apache.carbondata.processing.loading.exception.*; import org.apache.carbondata.processing.loading.row.*; | [
"java.util",
"org.apache.carbondata"
] | java.util; org.apache.carbondata; | 140,016 |
List<TileEntity> getTileEntities(); | List<TileEntity> getTileEntities(); | /**
* Get any tile entities contained in the object. The entities' coordinates
* should be relative to the object, not absolute.
*
* @return Any tile entities contained in the object. May be
* <code>null</code>.
*/ | Get any tile entities contained in the object. The entities' coordinates should be relative to the object, not absolute | getTileEntities | {
"repo_name": "forairan/WorldPainter",
"path": "WorldPainter/WPCore/src/main/java/org/pepsoft/worldpainter/objects/WPObject.java",
"license": "gpl-3.0",
"size": 8721
} | [
"java.util.List",
"org.pepsoft.minecraft.TileEntity"
] | import java.util.List; import org.pepsoft.minecraft.TileEntity; | import java.util.*; import org.pepsoft.minecraft.*; | [
"java.util",
"org.pepsoft.minecraft"
] | java.util; org.pepsoft.minecraft; | 290,730 |
public void setSelectedNavpoint(NavPoint selectedNavpoint) {
this.selectedNavpoint = selectedNavpoint;
}
| void function(NavPoint selectedNavpoint) { this.selectedNavpoint = selectedNavpoint; } | /**
* Sets a navpoint to be selected and displayed differently than the others.
*
* @param selectedNavpoint the selected navpoint.
*/ | Sets a navpoint to be selected and displayed differently than the others | setSelectedNavpoint | {
"repo_name": "mars-sim/mars-sim",
"path": "mars-sim-ui/src/main/java/org/mars_sim/msp/ui/swing/tool/map/NavpointMapLayer.java",
"license": "gpl-3.0",
"size": 4966
} | [
"org.mars_sim.msp.core.person.ai.mission.NavPoint"
] | import org.mars_sim.msp.core.person.ai.mission.NavPoint; | import org.mars_sim.msp.core.person.ai.mission.*; | [
"org.mars_sim.msp"
] | org.mars_sim.msp; | 1,195,814 |
public static AdminSQLiteOpenHelper instance(Context context) {
// Uso del contexto de aplicación para asegurarnos de que no se pierde el contexto de la actividad
if (sInstance == null) {
sInstance = new AdminSQLiteOpenHelper(context);
}
return sInstance;
}
| static AdminSQLiteOpenHelper function(Context context) { if (sInstance == null) { sInstance = new AdminSQLiteOpenHelper(context); } return sInstance; } | /**
* Singleton para la db
*/ | Singleton para la db | instance | {
"repo_name": "serpiko/LocalCommuter",
"path": "android/src/com/ingravido/localcommuter/AdminSQLiteOpenHelper.java",
"license": "gpl-3.0",
"size": 8531
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 1,898,958 |
private void useContent(ObjectWithIdentifier itemAtPosition) {
Intent intent = null;
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
// Select the activity for the data
switch (presenter.getType()) {
case UNIVERSE:
filter.setUniverseId(itemAtPosition.getId());
drawer.openDrawer(GravityCompat.START);
break;
case GAME:
filter.setGameId(itemAtPosition.getId());
drawer.openDrawer(GravityCompat.START);
break;
case WIKI:
editContent(itemAtPosition);
break;
case TIME_LINE:
editContent(itemAtPosition);
break;
}
if (intent != null) {
// Start activity
intent.putExtra(Constants.KEY_MODE_CONTENT, Constants.MODE_USE);
intent.putExtra(Constants.KEY_ID_CONTENT, itemAtPosition.getId());
startActivity(intent);
}
} | void function(ObjectWithIdentifier itemAtPosition) { Intent intent = null; DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); switch (presenter.getType()) { case UNIVERSE: filter.setUniverseId(itemAtPosition.getId()); drawer.openDrawer(GravityCompat.START); break; case GAME: filter.setGameId(itemAtPosition.getId()); drawer.openDrawer(GravityCompat.START); break; case WIKI: editContent(itemAtPosition); break; case TIME_LINE: editContent(itemAtPosition); break; } if (intent != null) { intent.putExtra(Constants.KEY_MODE_CONTENT, Constants.MODE_USE); intent.putExtra(Constants.KEY_ID_CONTENT, itemAtPosition.getId()); startActivity(intent); } } | /**
* Use a tuple from the data
*/ | Use a tuple from the data | useContent | {
"repo_name": "arkeine/SmartGM",
"path": "app/src/main/java/ch/arkeine/smartgm/view/MainActivity.java",
"license": "gpl-2.0",
"size": 15582
} | [
"android.content.Intent",
"android.support.v4.view.GravityCompat",
"android.support.v4.widget.DrawerLayout",
"ch.arkeine.smartgm.Constants",
"ch.arkeine.smartgm.model.dao.object.ObjectWithIdentifier"
] | import android.content.Intent; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import ch.arkeine.smartgm.Constants; import ch.arkeine.smartgm.model.dao.object.ObjectWithIdentifier; | import android.content.*; import android.support.v4.view.*; import android.support.v4.widget.*; import ch.arkeine.smartgm.*; import ch.arkeine.smartgm.model.dao.object.*; | [
"android.content",
"android.support",
"ch.arkeine.smartgm"
] | android.content; android.support; ch.arkeine.smartgm; | 1,186,532 |
boolean isBounded(){
return mDevice.getBondState()==BluetoothDevice.BOND_BONDED;
}
| boolean isBounded(){ return mDevice.getBondState()==BluetoothDevice.BOND_BONDED; } | /***
* tell if the node is pair with the device
* @return true if the node is bonded with the device
*/ | tell if the node is pair with the device | isBounded | {
"repo_name": "flyloong/BlueSTSDK",
"path": "BlueSTSDK/src/main/java/com/st/BlueSTSDK/Node.java",
"license": "bsd-3-clause",
"size": 73331
} | [
"android.bluetooth.BluetoothDevice"
] | import android.bluetooth.BluetoothDevice; | import android.bluetooth.*; | [
"android.bluetooth"
] | android.bluetooth; | 408,558 |
public final Property<LocalDate> valuationDate() {
return metaBean().valuationDate().createProperty(this);
} | final Property<LocalDate> function() { return metaBean().valuationDate().createProperty(this); } | /**
* Gets the the {@code valuationDate} property.
* @return the property, not null
*/ | Gets the the valuationDate property | valuationDate | {
"repo_name": "nssales/Strata",
"path": "modules/pricer/src/test/java/com/opengamma/strata/pricer/rate/SimpleRatesProvider.java",
"license": "apache-2.0",
"size": 21778
} | [
"java.time.LocalDate",
"org.joda.beans.Property"
] | import java.time.LocalDate; import org.joda.beans.Property; | import java.time.*; import org.joda.beans.*; | [
"java.time",
"org.joda.beans"
] | java.time; org.joda.beans; | 706,929 |
public Integer batchEligibilityCheck(
@PathParam("requests") @WebParam(name = "requests") EligibilityRequest[] requests); | Integer function( @PathParam(STR) @WebParam(name = STR) EligibilityRequest[] requests); | /**
* Insert batches of eligibility checks.
*
* @param requests
* @return
*/ | Insert batches of eligibility checks | batchEligibilityCheck | {
"repo_name": "freemed/remitt",
"path": "src/main/java/org/remitt/server/Service.java",
"license": "gpl-2.0",
"size": 8453
} | [
"javax.jws.WebParam",
"javax.ws.rs.PathParam",
"org.remitt.prototype.EligibilityRequest"
] | import javax.jws.WebParam; import javax.ws.rs.PathParam; import org.remitt.prototype.EligibilityRequest; | import javax.jws.*; import javax.ws.rs.*; import org.remitt.prototype.*; | [
"javax.jws",
"javax.ws",
"org.remitt.prototype"
] | javax.jws; javax.ws; org.remitt.prototype; | 942,230 |
public Observable<ServiceResponse<List<ClusterInner>>> listWithServiceResponseAsync() {
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<List<ClusterInner>>> function() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); } | /**
* Lists all Kusto clusters within a subscription.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<ClusterInner> object
*/ | Lists all Kusto clusters within a subscription | listWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/kusto/mgmt-v2020_02_15/src/main/java/com/microsoft/azure/management/kusto/v2020_02_15/implementation/ClustersInner.java",
"license": "mit",
"size": 159457
} | [
"com.microsoft.rest.ServiceResponse",
"java.util.List"
] | import com.microsoft.rest.ServiceResponse; import java.util.List; | import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.rest",
"java.util"
] | com.microsoft.rest; java.util; | 1,251,739 |
protected void loadOrganizationField(Contact contact, Cursor cur,
HashMap<String,List<Integer>> fieldsMap) throws IOException
{
long id = contact.getId();
if (Log.isLoggable(Log.TRACE)) {
Log.trace(TAG_LOG, "Load Organization Field for: " + id);
}
BusinessDetail bd = contact.getBusinessDetail();
int orgType = cur.getInt(cur.getColumnIndexOrThrow(CommonDataKinds.Organization.TYPE));
if (orgType == CommonDataKinds.Organization.TYPE_WORK) {
int colId = cur.getColumnIndexOrThrow(CommonDataKinds.Organization.COMPANY);
String company = cur.getString(colId);
if (company != null) {
Property companyProp = new Property(company);
bd.setCompany(companyProp);
}
colId = cur.getColumnIndexOrThrow(CommonDataKinds.Organization.TITLE);
String title = cur.getString(colId);
if (title != null) {
ArrayList titles = new ArrayList();
Title titleProp = new Title(title);
titles.add(titleProp);
bd.setTitles(titles);
}
colId = cur.getColumnIndexOrThrow(CommonDataKinds.Organization.DEPARTMENT);
String department = cur.getString(colId);
if (department != null) {
Property departmentProp = new Property(department);
bd.setDepartment(departmentProp);
}
colId = cur.getColumnIndexOrThrow(CommonDataKinds.Organization.OFFICE_LOCATION);
String location = cur.getString(colId);
if (location != null) {
bd.setOfficeLocation(location);
}
} else {
if (Log.isLoggable(Log.INFO)) {
Log.info(TAG_LOG, "Ignoring organization of type " + orgType);
}
}
loadFieldToMap(CommonDataKinds.Organization.CONTENT_ITEM_TYPE, 0, cur, fieldsMap);
} | void function(Contact contact, Cursor cur, HashMap<String,List<Integer>> fieldsMap) throws IOException { long id = contact.getId(); if (Log.isLoggable(Log.TRACE)) { Log.trace(TAG_LOG, STR + id); } BusinessDetail bd = contact.getBusinessDetail(); int orgType = cur.getInt(cur.getColumnIndexOrThrow(CommonDataKinds.Organization.TYPE)); if (orgType == CommonDataKinds.Organization.TYPE_WORK) { int colId = cur.getColumnIndexOrThrow(CommonDataKinds.Organization.COMPANY); String company = cur.getString(colId); if (company != null) { Property companyProp = new Property(company); bd.setCompany(companyProp); } colId = cur.getColumnIndexOrThrow(CommonDataKinds.Organization.TITLE); String title = cur.getString(colId); if (title != null) { ArrayList titles = new ArrayList(); Title titleProp = new Title(title); titles.add(titleProp); bd.setTitles(titles); } colId = cur.getColumnIndexOrThrow(CommonDataKinds.Organization.DEPARTMENT); String department = cur.getString(colId); if (department != null) { Property departmentProp = new Property(department); bd.setDepartment(departmentProp); } colId = cur.getColumnIndexOrThrow(CommonDataKinds.Organization.OFFICE_LOCATION); String location = cur.getString(colId); if (location != null) { bd.setOfficeLocation(location); } } else { if (Log.isLoggable(Log.INFO)) { Log.info(TAG_LOG, STR + orgType); } } loadFieldToMap(CommonDataKinds.Organization.CONTENT_ITEM_TYPE, 0, cur, fieldsMap); } | /**
* Retrieve the Organization fields from a Cursor
*/ | Retrieve the Organization fields from a Cursor | loadOrganizationField | {
"repo_name": "zjujunge/funambol",
"path": "src/com/funambol/android/source/pim/contact/ContactManager.java",
"license": "agpl-3.0",
"size": 96627
} | [
"android.database.Cursor",
"android.provider.ContactsContract",
"com.funambol.common.pim.model.common.Property",
"com.funambol.common.pim.model.contact.BusinessDetail",
"com.funambol.common.pim.model.contact.Title",
"com.funambol.util.Log",
"java.io.IOException",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List"
] | import android.database.Cursor; import android.provider.ContactsContract; import com.funambol.common.pim.model.common.Property; import com.funambol.common.pim.model.contact.BusinessDetail; import com.funambol.common.pim.model.contact.Title; import com.funambol.util.Log; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; | import android.database.*; import android.provider.*; import com.funambol.common.pim.model.common.*; import com.funambol.common.pim.model.contact.*; import com.funambol.util.*; import java.io.*; import java.util.*; | [
"android.database",
"android.provider",
"com.funambol.common",
"com.funambol.util",
"java.io",
"java.util"
] | android.database; android.provider; com.funambol.common; com.funambol.util; java.io; java.util; | 974,411 |
@org.junit.Test
public void testMultipleElements() throws Exception {
Document doc = SOAPUtil.toSOAPPart(SOAPMSG_MULTIPLE);
WSSecEncrypt encrypt = new WSSecEncrypt();
encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
List<WSEncryptionPart> parts = new ArrayList<WSEncryptionPart>();
WSEncryptionPart encP =
new WSEncryptionPart(
"testMethod",
"http://axis/service/security/test6/LogTestService8",
"");
parts.add(encP);
encrypt.setParts(parts);
Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
String outputString =
org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
if (LOG.isDebugEnabled()) {
LOG.debug(outputString);
}
assertTrue(!outputString.contains("testMethod"));
verify(encryptedDoc);
outputString =
org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
assertTrue(outputString.contains("asf1"));
assertTrue(outputString.contains("asf2"));
}
| @org.junit.Test void function() throws Exception { Document doc = SOAPUtil.toSOAPPart(SOAPMSG_MULTIPLE); WSSecEncrypt encrypt = new WSSecEncrypt(); encrypt.setUserInfo(STR, STR); encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL); WSSecHeader secHeader = new WSSecHeader(); secHeader.insertSecurityHeader(doc); List<WSEncryptionPart> parts = new ArrayList<WSEncryptionPart>(); WSEncryptionPart encP = new WSEncryptionPart( STR, STR"); parts.add(encP); encrypt.setParts(parts); Document encryptedDoc = encrypt.build(doc, crypto, secHeader); String outputString = org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc); if (LOG.isDebugEnabled()) { LOG.debug(outputString); } assertTrue(!outputString.contains(STR)); verify(encryptedDoc); outputString = org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc); assertTrue(outputString.contains("asf1STRasf2")); } | /**
* Test encrypting two SOAP Body elements with the same QName.
*/ | Test encrypting two SOAP Body elements with the same QName | testMultipleElements | {
"repo_name": "fatfredyy/wss4j-ecc",
"path": "src/test/java/org/apache/ws/security/message/EncryptionPartsTest.java",
"license": "apache-2.0",
"size": 17593
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.ws.security.WSConstants",
"org.apache.ws.security.WSEncryptionPart",
"org.apache.ws.security.common.SOAPUtil",
"org.w3c.dom.Document"
] | import java.util.ArrayList; import java.util.List; import org.apache.ws.security.WSConstants; import org.apache.ws.security.WSEncryptionPart; import org.apache.ws.security.common.SOAPUtil; import org.w3c.dom.Document; | import java.util.*; import org.apache.ws.security.*; import org.apache.ws.security.common.*; import org.w3c.dom.*; | [
"java.util",
"org.apache.ws",
"org.w3c.dom"
] | java.util; org.apache.ws; org.w3c.dom; | 1,436,911 |
Schema extractSchema(Connection connection, String sqlScript, String schemaName, String namespace)
throws SQLException; | Schema extractSchema(Connection connection, String sqlScript, String schemaName, String namespace) throws SQLException; | /**
* Extracts the schema based on a SQL query. This method can extract the schema of a table by
* selecting all columns from the table, e.g. SELECT * FROM TABLE.
*
* @param connection The JDBC connection to the database.
* @param sqlScript The complete SQL script to execute.
* @param schemaName The name of the output schema.
* @param namespace The namespace of the output schema.
* @return the schema in Avro format.
*/ | Extracts the schema based on a SQL query. This method can extract the schema of a table by selecting all columns from the table, e.g. SELECT * FROM TABLE | extractSchema | {
"repo_name": "google/dwh-assessment-extraction-tool",
"path": "src/java/com/google/cloud/bigquery/dwhassessment/extractiontool/db/ScriptRunner.java",
"license": "apache-2.0",
"size": 2084
} | [
"java.sql.Connection",
"java.sql.SQLException",
"org.apache.avro.Schema"
] | import java.sql.Connection; import java.sql.SQLException; import org.apache.avro.Schema; | import java.sql.*; import org.apache.avro.*; | [
"java.sql",
"org.apache.avro"
] | java.sql; org.apache.avro; | 588,447 |
private TunnelDescription buildTunnelDesc(K8sNode k8sNode,
String type, String intfName) {
TunnelKey<String> key = new TunnelKey<>(k8sNode.tunnelKey());
if (VXLAN.equals(type) || GRE.equals(type) || GENEVE.equals(type)) {
TunnelDescription.Builder tdBuilder =
DefaultTunnelDescription.builder()
.deviceId(k8sNode.tunBridgeName())
.ifaceName(intfName)
.remote(TunnelEndPoints.flowTunnelEndpoint())
.key(key);
switch (type) {
case VXLAN:
tdBuilder.type(TunnelDescription.Type.VXLAN);
break;
case GRE:
tdBuilder.type(TunnelDescription.Type.GRE);
break;
case GENEVE:
tdBuilder.type(TunnelDescription.Type.GENEVE);
break;
default:
return null;
}
return tdBuilder.build();
}
return null;
} | TunnelDescription function(K8sNode k8sNode, String type, String intfName) { TunnelKey<String> key = new TunnelKey<>(k8sNode.tunnelKey()); if (VXLAN.equals(type) GRE.equals(type) GENEVE.equals(type)) { TunnelDescription.Builder tdBuilder = DefaultTunnelDescription.builder() .deviceId(k8sNode.tunBridgeName()) .ifaceName(intfName) .remote(TunnelEndPoints.flowTunnelEndpoint()) .key(key); switch (type) { case VXLAN: tdBuilder.type(TunnelDescription.Type.VXLAN); break; case GRE: tdBuilder.type(TunnelDescription.Type.GRE); break; case GENEVE: tdBuilder.type(TunnelDescription.Type.GENEVE); break; default: return null; } return tdBuilder.build(); } return null; } | /**
* Builds tunnel description according to the network type.
*
* @param type network type
* @return tunnel description
*/ | Builds tunnel description according to the network type | buildTunnelDesc | {
"repo_name": "gkatsikas/onos",
"path": "apps/k8s-node/app/src/main/java/org/onosproject/k8snode/impl/DefaultK8sNodeHandler.java",
"license": "apache-2.0",
"size": 34942
} | [
"org.onosproject.k8snode.api.Constants",
"org.onosproject.k8snode.api.K8sNode",
"org.onosproject.net.behaviour.DefaultTunnelDescription",
"org.onosproject.net.behaviour.TunnelDescription",
"org.onosproject.net.behaviour.TunnelEndPoints",
"org.onosproject.net.behaviour.TunnelKey"
] | import org.onosproject.k8snode.api.Constants; import org.onosproject.k8snode.api.K8sNode; import org.onosproject.net.behaviour.DefaultTunnelDescription; import org.onosproject.net.behaviour.TunnelDescription; import org.onosproject.net.behaviour.TunnelEndPoints; import org.onosproject.net.behaviour.TunnelKey; | import org.onosproject.k8snode.api.*; import org.onosproject.net.behaviour.*; | [
"org.onosproject.k8snode",
"org.onosproject.net"
] | org.onosproject.k8snode; org.onosproject.net; | 1,629,423 |
public void addEmojiconGroup(List<EaseEmojiconGroupEntity> groupEntitieList){
for(int i= 0; i < groupEntitieList.size(); i++){
EaseEmojiconGroupEntity groupEntity = groupEntitieList.get(i);
emojiconGroupList.add(groupEntity);
pagerView.addEmojiconGroup(groupEntity, i == groupEntitieList.size()-1 ? true : false);
tabBar.addTab(groupEntity.getIcon());
}
} | void function(List<EaseEmojiconGroupEntity> groupEntitieList){ for(int i= 0; i < groupEntitieList.size(); i++){ EaseEmojiconGroupEntity groupEntity = groupEntitieList.get(i); emojiconGroupList.add(groupEntity); pagerView.addEmojiconGroup(groupEntity, i == groupEntitieList.size()-1 ? true : false); tabBar.addTab(groupEntity.getIcon()); } } | /**
* add emojicon group list
* @param groupEntitieList
*/ | add emojicon group list | addEmojiconGroup | {
"repo_name": "cowthan/Ayo2022",
"path": "ProjWechat/easeuilibrary/src/com/fanxin/easeui/widget/emojicon/EaseEmojiconMenu.java",
"license": "mit",
"size": 5510
} | [
"com.fanxin.easeui.domain.EaseEmojiconGroupEntity",
"java.util.List"
] | import com.fanxin.easeui.domain.EaseEmojiconGroupEntity; import java.util.List; | import com.fanxin.easeui.domain.*; import java.util.*; | [
"com.fanxin.easeui",
"java.util"
] | com.fanxin.easeui; java.util; | 1,256,572 |
private void processConfigurationForm(DataForm completedForm, MUCRole senderRole)
throws ForbiddenException, ConflictException {
List<String> values;
String booleanValue;
FormField field;
// Get the new list of admins
field = completedForm.getField("muc#roomconfig_roomadmins");
boolean adminsSent = field != null;
List<String> admins = new ArrayList<String>();
if (field != null) {
admins.addAll(field.getValues());
}
// Get the new list of owners
field = completedForm.getField("muc#roomconfig_roomowners");
boolean ownersSent = field != null;
List<String> owners = new ArrayList<String>();
if (field != null) {
owners.addAll(field.getValues());
}
// Answer a conflic error if all the current owners will be removed
if (ownersSent && owners.isEmpty()) {
throw new ConflictException();
}
// Keep a registry of the updated presences
List<Presence> presences = new ArrayList<Presence>(admins.size() + owners.size());
field = completedForm.getField("muc#roomconfig_roomname");
if (field != null) {
final String value = field.getFirstValue();
room.setNaturalLanguageName((value != null ? value : " "));
}
field = completedForm.getField("muc#roomconfig_roomdesc");
if (field != null) {
final String value = field.getFirstValue();
room.setDescription((value != null ? value : " "));
}
field = completedForm.getField("muc#roomconfig_changesubject");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setCanOccupantsChangeSubject(("1".equals(booleanValue)));
}
field = completedForm.getField("muc#roomconfig_maxusers");
if (field != null) {
final String value = field.getFirstValue();
room.setMaxUsers((value != null ? Integer.parseInt(value) : 30));
}
field = completedForm.getField("muc#roomconfig_presencebroadcast");
if (field != null) {
values = new ArrayList<String>(field.getValues());
room.setRolesToBroadcastPresence(values);
}
field = completedForm.getField("muc#roomconfig_publicroom");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setPublicRoom(("1".equals(booleanValue)));
}
field = completedForm.getField("muc#roomconfig_persistentroom");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
boolean isPersistent = ("1".equals(booleanValue));
// Delete the room from the DB if it's no longer persistent
if (room.isPersistent() && !isPersistent) {
MUCPersistenceManager.deleteFromDB(room);
}
room.setPersistent(isPersistent);
}
field = completedForm.getField("muc#roomconfig_moderatedroom");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setModerated(("1".equals(booleanValue)));
}
field = completedForm.getField("muc#roomconfig_membersonly");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
presences.addAll(room.setMembersOnly(("1".equals(booleanValue))));
}
field = completedForm.getField("muc#roomconfig_allowinvites");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setCanOccupantsInvite(("1".equals(booleanValue)));
}
field = completedForm.getField("muc#roomconfig_passwordprotectedroom");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
boolean isPasswordProtected = "1".equals(booleanValue);
if (isPasswordProtected) {
// The room is password protected so set the new password
field = completedForm.getField("muc#roomconfig_roomsecret");
if (field != null) {
final String secret = completedForm.getField("muc#roomconfig_roomsecret").getFirstValue();
room.setPassword(secret);
}
}
else {
// The room is not password protected so remove any previous password
room.setPassword(null);
}
}
field = completedForm.getField("muc#roomconfig_whois");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setCanAnyoneDiscoverJID(("anyone".equals(booleanValue)));
}
field = completedForm.getField("muc#roomconfig_enablelogging");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setLogEnabled(("1".equals(booleanValue)));
}
field = completedForm.getField("x-muc#roomconfig_reservednick");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setLoginRestrictedToNickname(("1".equals(booleanValue)));
}
field = completedForm.getField("x-muc#roomconfig_canchangenick");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setChangeNickname(("1".equals(booleanValue)));
}
field = completedForm.getField("x-muc#roomconfig_registration");
if (field != null) {
final String value = field.getFirstValue();
booleanValue = ((value != null ? value : "1"));
room.setRegistrationEnabled(("1".equals(booleanValue)));
}
// Update the modification date to reflect the last time when the room's configuration
// was modified
room.setModificationDate(new Date());
if (room.isPersistent()) {
room.saveToDB();
}
// Set the new owners and admins of the room
presences.addAll(room.addOwners(owners, senderRole));
presences.addAll(room.addAdmins(admins, senderRole));
if (ownersSent) {
// Change the affiliation to "member" for the current owners that won't be neither
// owner nor admin (if the form included the owners field)
List<String> ownersToRemove = new ArrayList<String>(room.owners);
ownersToRemove.removeAll(admins);
ownersToRemove.removeAll(owners);
for (String jid : ownersToRemove) {
presences.addAll(room.addMember(new JID(jid), null, senderRole));
}
}
if (adminsSent) {
// Change the affiliation to "member" for the current admins that won't be neither
// owner nor admin (if the form included the admins field)
List<String> adminsToRemove = new ArrayList<String>(room.admins);
adminsToRemove.removeAll(admins);
adminsToRemove.removeAll(owners);
for (String jid : adminsToRemove) {
presences.addAll(room.addMember(new JID(jid), null, senderRole));
}
}
// Destroy the room if the room is no longer persistent and there are no occupants in
// the room
if (!room.isPersistent() && room.getOccupantsCount() == 0) {
room.destroyRoom(null, null);
}
// Send the updated presences to the room occupants
for (Object presence : presences) {
room.send((Presence) presence);
}
} | void function(DataForm completedForm, MUCRole senderRole) throws ForbiddenException, ConflictException { List<String> values; String booleanValue; FormField field; field = completedForm.getField(STR); boolean adminsSent = field != null; List<String> admins = new ArrayList<String>(); if (field != null) { admins.addAll(field.getValues()); } field = completedForm.getField(STR); boolean ownersSent = field != null; List<String> owners = new ArrayList<String>(); if (field != null) { owners.addAll(field.getValues()); } if (ownersSent && owners.isEmpty()) { throw new ConflictException(); } List<Presence> presences = new ArrayList<Presence>(admins.size() + owners.size()); field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); room.setNaturalLanguageName((value != null ? value : " ")); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); room.setDescription((value != null ? value : " ")); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setCanOccupantsChangeSubject(("1".equals(booleanValue))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); room.setMaxUsers((value != null ? Integer.parseInt(value) : 30)); } field = completedForm.getField(STR); if (field != null) { values = new ArrayList<String>(field.getValues()); room.setRolesToBroadcastPresence(values); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setPublicRoom(("1".equals(booleanValue))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); boolean isPersistent = ("1".equals(booleanValue)); if (room.isPersistent() && !isPersistent) { MUCPersistenceManager.deleteFromDB(room); } room.setPersistent(isPersistent); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setModerated(("1".equals(booleanValue))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); presences.addAll(room.setMembersOnly(("1".equals(booleanValue)))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setCanOccupantsInvite(("1".equals(booleanValue))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); boolean isPasswordProtected = "1".equals(booleanValue); if (isPasswordProtected) { field = completedForm.getField(STR); if (field != null) { final String secret = completedForm.getField(STR).getFirstValue(); room.setPassword(secret); } } else { room.setPassword(null); } } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setCanAnyoneDiscoverJID((STR.equals(booleanValue))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setLogEnabled(("1".equals(booleanValue))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setLoginRestrictedToNickname(("1".equals(booleanValue))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setChangeNickname(("1".equals(booleanValue))); } field = completedForm.getField(STR); if (field != null) { final String value = field.getFirstValue(); booleanValue = ((value != null ? value : "1")); room.setRegistrationEnabled(("1".equals(booleanValue))); } room.setModificationDate(new Date()); if (room.isPersistent()) { room.saveToDB(); } presences.addAll(room.addOwners(owners, senderRole)); presences.addAll(room.addAdmins(admins, senderRole)); if (ownersSent) { List<String> ownersToRemove = new ArrayList<String>(room.owners); ownersToRemove.removeAll(admins); ownersToRemove.removeAll(owners); for (String jid : ownersToRemove) { presences.addAll(room.addMember(new JID(jid), null, senderRole)); } } if (adminsSent) { List<String> adminsToRemove = new ArrayList<String>(room.admins); adminsToRemove.removeAll(admins); adminsToRemove.removeAll(owners); for (String jid : adminsToRemove) { presences.addAll(room.addMember(new JID(jid), null, senderRole)); } } if (!room.isPersistent() && room.getOccupantsCount() == 0) { room.destroyRoom(null, null); } for (Object presence : presences) { room.send((Presence) presence); } } | /**
* Processes the completed form sent by an owner of the room. This will modify the room's
* configuration as well as the list of owners and admins.
*
* @param completedForm the completed form sent by an owner of the room.
* @param senderRole the role of the user that sent the completed form.
* @throws ForbiddenException if the user does not have enough privileges.
* @throws ConflictException If the room was going to lose all of its owners.
*/ | Processes the completed form sent by an owner of the room. This will modify the room's configuration as well as the list of owners and admins | processConfigurationForm | {
"repo_name": "AndrewChanChina/pps1",
"path": "src/java/org/jivesoftware/openfire/muc/spi/IQOwnerHandler.java",
"license": "apache-2.0",
"size": 34359
} | [
"java.util.ArrayList",
"java.util.Date",
"java.util.List",
"org.jivesoftware.openfire.muc.ConflictException",
"org.jivesoftware.openfire.muc.ForbiddenException",
"org.jivesoftware.openfire.muc.MUCRole",
"org.xmpp.forms.DataForm",
"org.xmpp.forms.FormField",
"org.xmpp.packet.Presence"
] | import java.util.ArrayList; import java.util.Date; import java.util.List; import org.jivesoftware.openfire.muc.ConflictException; import org.jivesoftware.openfire.muc.ForbiddenException; import org.jivesoftware.openfire.muc.MUCRole; import org.xmpp.forms.DataForm; import org.xmpp.forms.FormField; import org.xmpp.packet.Presence; | import java.util.*; import org.jivesoftware.openfire.muc.*; import org.xmpp.forms.*; import org.xmpp.packet.*; | [
"java.util",
"org.jivesoftware.openfire",
"org.xmpp.forms",
"org.xmpp.packet"
] | java.util; org.jivesoftware.openfire; org.xmpp.forms; org.xmpp.packet; | 1,547,530 |
mPreviousViews = new ArrayList<Integer>();
}
class ViewAndMetaData {
View view;
int relativeIndex;
int adapterPosition;
long itemId;
ViewAndMetaData(View view, int relativeIndex, int adapterPosition, long itemId) {
this.view = view;
this.relativeIndex = relativeIndex;
this.adapterPosition = adapterPosition;
this.itemId = itemId;
} | mPreviousViews = new ArrayList<Integer>(); } class ViewAndMetaData { View view; int relativeIndex; int adapterPosition; long itemId; ViewAndMetaData(View view, int relativeIndex, int adapterPosition, long itemId) { this.view = view; this.relativeIndex = relativeIndex; this.adapterPosition = adapterPosition; this.itemId = itemId; } | /**
* Initialize this {@link AdapterViewAnimator}
*/ | Initialize this <code>AdapterViewAnimator</code> | initViewAnimator | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "frameworks/base/core/java/android/widget/AdapterViewAnimator.java",
"license": "gpl-2.0",
"size": 48751
} | [
"android.view.View",
"java.util.ArrayList"
] | import android.view.View; import java.util.ArrayList; | import android.view.*; import java.util.*; | [
"android.view",
"java.util"
] | android.view; java.util; | 2,125,103 |
BufferedImage getProjectedImage() { return browser.getProjectedImage(); } | BufferedImage getProjectedImage() { return browser.getProjectedImage(); } | /**
* Returns the original image returned by the image service.
*
* @return See above.
*/ | Returns the original image returned by the image service | getOriginalImage | {
"repo_name": "stelfrich/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerModel.java",
"license": "gpl-2.0",
"size": 80456
} | [
"java.awt.image.BufferedImage"
] | import java.awt.image.BufferedImage; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 592,036 |
public static Class<?> getMemberType(Member member) {
if (member instanceof Field) {
return ((Field) member).getType();
} else if (member instanceof Method) {
return ((Method) member).getReturnType();
} else if (member instanceof Constructor<?>) {
return ((Constructor<?>) member).getDeclaringClass();
} else {
throw new UnsupportedOperationException("Cannot operate on a member of type " + member.getClass());
}
} | static Class<?> function(Member member) { if (member instanceof Field) { return ((Field) member).getType(); } else if (member instanceof Method) { return ((Method) member).getReturnType(); } else if (member instanceof Constructor<?>) { return ((Constructor<?>) member).getDeclaringClass(); } else { throw new UnsupportedOperationException(STR + member.getClass()); } } | /**
* Get the type of the member
*
* @param member The member
* @return The type of the member
* @throws UnsupportedOperationException if the member is not a field, method, or constructor
*/ | Get the type of the member | getMemberType | {
"repo_name": "Repeid/repeid",
"path": "common/src/main/java/org/repeid/common/util/reflections/Reflections.java",
"license": "gpl-2.0",
"size": 38193
} | [
"java.lang.reflect.Constructor",
"java.lang.reflect.Field",
"java.lang.reflect.Member",
"java.lang.reflect.Method"
] | import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Member; import java.lang.reflect.Method; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 1,696,066 |
protected final InputStream getInputStream(final Source source) throws IOException {
if (isClasspath(source)) {
final String resource = source.getSourceFile().substring(CLASSPATH_PREFIX_LENGTH);
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
return classLoader.getResourceAsStream(resource);
} else {
final File file = new File(source.getSourceFile());
if (file.exists()) {
return new FileInputStream(file);
}
}
return null;
}
| final InputStream function(final Source source) throws IOException { if (isClasspath(source)) { final String resource = source.getSourceFile().substring(CLASSPATH_PREFIX_LENGTH); final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); return classLoader.getResourceAsStream(resource); } else { final File file = new File(source.getSourceFile()); if (file.exists()) { return new FileInputStream(file); } } return null; } | /**
* Get an input stream for the data set or script source.
*
* @param source The data set or script.
* @return An {@link InputStream} or {@code null} if the source cannot be found.
* @throws IOException If there was an error creating the input stream.
*/ | Get an input stream for the data set or script source | getInputStream | {
"repo_name": "bmatthews68/inmemdb-maven-plugin",
"path": "src/main/java/com/btmatthews/maven/plugins/inmemdb/ldr/AbstractLoader.java",
"license": "apache-2.0",
"size": 6684
} | [
"com.btmatthews.maven.plugins.inmemdb.Source",
"java.io.File",
"java.io.FileInputStream",
"java.io.IOException",
"java.io.InputStream"
] | import com.btmatthews.maven.plugins.inmemdb.Source; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; | import com.btmatthews.maven.plugins.inmemdb.*; import java.io.*; | [
"com.btmatthews.maven",
"java.io"
] | com.btmatthews.maven; java.io; | 1,291,317 |
private static List<String> fillMethods() throws Exception {
String string;
Field[] fields;
int modifiers;
//das Mapping wird initial eingerichtet
methods = new ArrayList<String>();
//alle Felder der Klasse werde ermittelt
fields = Status.class.getDeclaredFields();
for (Field field : fields) {
//die Modifiers zum Feld werden ermittelt
modifiers = field.getModifiers();
//das Feld muss als public final int deklariert sein
if (field.getType().equals(String.class)
&& Modifier.isFinal(modifiers)
&& Modifier.isPrivate(modifiers)
&& Modifier.isStatic(modifiers)
&& field.getName().startsWith("METHOD_")) {
//der Name der Methode wird vereinfacht
string = (String)field.get(null);
string = (string == null) ? "" : string.trim().toUpperCase();
//die Methode wird uebernommen, wenn sie nicht enthalten ist
if (string.length() > 0 && !methods.contains(string)) methods.add(string);
}
}
return methods;
}
| static List<String> function() throws Exception { String string; Field[] fields; int modifiers; methods = new ArrayList<String>(); fields = Status.class.getDeclaredFields(); for (Field field : fields) { modifiers = field.getModifiers(); if (field.getType().equals(String.class) && Modifier.isFinal(modifiers) && Modifier.isPrivate(modifiers) && Modifier.isStatic(modifiers) && field.getName().startsWith(STR)) { string = (String)field.get(null); string = (string == null) ? "" : string.trim().toUpperCase(); if (string.length() > 0 && !methods.contains(string)) methods.add(string); } } return methods; } | /**
* Ermittelt die verfügbaren HTTP-Methoden.
* @return die verfügbaren HTTP-Methoden
* @throws Exception bei unerwarteten Laufzeitfehlern
*/ | Ermittelt die verfügbaren HTTP-Methoden | fillMethods | {
"repo_name": "seanox/webdav",
"path": "sources/com/seanox/webdav/Connector.java",
"license": "gpl-2.0",
"size": 86927
} | [
"java.lang.reflect.Field",
"java.lang.reflect.Modifier",
"java.util.ArrayList",
"java.util.List"
] | import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 1,901,223 |
public static boolean intentIsForTwaWithSplashScreen(Intent intent) {
boolean isTrustedWebActivity = IntentUtils.safeGetBooleanExtra(
intent, TrustedWebUtils.EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY, false);
boolean requestsSplashScreen =
IntentUtils.safeGetParcelableExtra(intent, EXTRA_SPLASH_SCREEN_PARAMS) != null;
return isTrustedWebActivity && requestsSplashScreen;
} | static boolean function(Intent intent) { boolean isTrustedWebActivity = IntentUtils.safeGetBooleanExtra( intent, TrustedWebUtils.EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY, false); boolean requestsSplashScreen = IntentUtils.safeGetParcelableExtra(intent, EXTRA_SPLASH_SCREEN_PARAMS) != null; return isTrustedWebActivity && requestsSplashScreen; } | /**
* Returns true if the intent corresponds to a TWA with a splash screen.
*/ | Returns true if the intent corresponds to a TWA with a splash screen | intentIsForTwaWithSplashScreen | {
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/chrome/android/java/src/org/chromium/chrome/browser/browserservices/ui/splashscreen/trustedwebactivity/TwaSplashController.java",
"license": "bsd-3-clause",
"size": 8032
} | [
"android.content.Intent",
"androidx.browser.customtabs.TrustedWebUtils",
"org.chromium.base.IntentUtils"
] | import android.content.Intent; import androidx.browser.customtabs.TrustedWebUtils; import org.chromium.base.IntentUtils; | import android.content.*; import androidx.browser.customtabs.*; import org.chromium.base.*; | [
"android.content",
"androidx.browser",
"org.chromium.base"
] | android.content; androidx.browser; org.chromium.base; | 1,285,913 |
public void parse(InputStream in)
throws IOException
{
LineInputStream lin = (in instanceof LineInputStream) ?
(LineInputStream) in : new LineInputStream(in);
String name = null;
CPStringBuilder value = new CPStringBuilder();
while (true)
{
String line = lin.readLine();
if (line == null)
{
if (name != null)
{
addValue(name, value.toString());
}
break;
}
int len = line.length();
if (len < 2)
{
if (name != null)
{
addValue(name, value.toString());
}
break;
}
char c1 = line.charAt(0);
if (c1 == ' ' || c1 == '\t')
{
// Continuation
int last = len - 1;
if (line.charAt(last) != '\r')
++last;
value.append(line.substring(0, last));
}
else
{
if (name != null)
{
addValue(name, value.toString());
}
int di = line.indexOf(':');
name = line.substring(0, di);
value.setLength(0);
do
{
di++;
}
while (di < len && line.charAt(di) == ' ');
int last = len - 1;
if (line.charAt(last) != '\r')
++last;
value.append(line.substring(di, last));
}
}
} | void function(InputStream in) throws IOException { LineInputStream lin = (in instanceof LineInputStream) ? (LineInputStream) in : new LineInputStream(in); String name = null; CPStringBuilder value = new CPStringBuilder(); while (true) { String line = lin.readLine(); if (line == null) { if (name != null) { addValue(name, value.toString()); } break; } int len = line.length(); if (len < 2) { if (name != null) { addValue(name, value.toString()); } break; } char c1 = line.charAt(0); if (c1 == ' ' c1 == '\t') { int last = len - 1; if (line.charAt(last) != '\r') ++last; value.append(line.substring(0, last)); } else { if (name != null) { addValue(name, value.toString()); } int di = line.indexOf(':'); name = line.substring(0, di); value.setLength(0); do { di++; } while (di < len && line.charAt(di) == ' '); int last = len - 1; if (line.charAt(last) != '\r') ++last; value.append(line.substring(di, last)); } } } | /**
* Parse the specified InputStream, adding headers to this collection.
*
* @param in the InputStream.
* @throws IOException if I/O error occured.
*/ | Parse the specified InputStream, adding headers to this collection | parse | {
"repo_name": "SanDisk-Open-Source/SSD_Dashboard",
"path": "uefi/gcc/gcc-4.6.3/libjava/classpath/gnu/java/net/protocol/http/Headers.java",
"license": "gpl-2.0",
"size": 11416
} | [
"gnu.java.lang.CPStringBuilder",
"gnu.java.net.LineInputStream",
"java.io.IOException",
"java.io.InputStream"
] | import gnu.java.lang.CPStringBuilder; import gnu.java.net.LineInputStream; import java.io.IOException; import java.io.InputStream; | import gnu.java.lang.*; import gnu.java.net.*; import java.io.*; | [
"gnu.java.lang",
"gnu.java.net",
"java.io"
] | gnu.java.lang; gnu.java.net; java.io; | 632,814 |
CacheServiceMBeanBase getMBean(); | CacheServiceMBeanBase getMBean(); | /**
* Returns the MBean associated with this server
*
* @return the MBean associated with this server
*/ | Returns the MBean associated with this server | getMBean | {
"repo_name": "smgoller/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/CacheService.java",
"license": "apache-2.0",
"size": 2053
} | [
"org.apache.geode.management.internal.beans.CacheServiceMBeanBase"
] | import org.apache.geode.management.internal.beans.CacheServiceMBeanBase; | import org.apache.geode.management.internal.beans.*; | [
"org.apache.geode"
] | org.apache.geode; | 1,173,590 |
public boolean validateParticipant2_validateContextControlCode(Participant2 participant2,
DiagnosticChain diagnostics, Map<Object, Object> context) {
return participant2.validateContextControlCode(diagnostics, context);
}
| boolean function(Participant2 participant2, DiagnosticChain diagnostics, Map<Object, Object> context) { return participant2.validateContextControlCode(diagnostics, context); } | /**
* Validates the validateContextControlCode constraint of '<em>Participant2</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Validates the validateContextControlCode constraint of 'Participant2'. | validateParticipant2_validateContextControlCode | {
"repo_name": "drbgfc/mdht",
"path": "cda/plugins/org.openhealthtools.mdht.uml.cda/src/org/openhealthtools/mdht/uml/cda/util/CDAValidator.java",
"license": "epl-1.0",
"size": 206993
} | [
"java.util.Map",
"org.eclipse.emf.common.util.DiagnosticChain",
"org.openhealthtools.mdht.uml.cda.Participant2"
] | import java.util.Map; import org.eclipse.emf.common.util.DiagnosticChain; import org.openhealthtools.mdht.uml.cda.Participant2; | import java.util.*; import org.eclipse.emf.common.util.*; import org.openhealthtools.mdht.uml.cda.*; | [
"java.util",
"org.eclipse.emf",
"org.openhealthtools.mdht"
] | java.util; org.eclipse.emf; org.openhealthtools.mdht; | 1,728,505 |
public void prettyPrint (OutputType outputType, Writer writer) throws IOException {
PrettyPrintSettings settings = new PrettyPrintSettings();
settings.outputType = outputType;
prettyPrint(this, writer, 0, settings);
}
| void function (OutputType outputType, Writer writer) throws IOException { PrettyPrintSettings settings = new PrettyPrintSettings(); settings.outputType = outputType; prettyPrint(this, writer, 0, settings); } | /** More efficient than {@link #prettyPrint(PrettyPrintSettings)} but {@link PrettyPrintSettings#singleLineColumns} and
* {@link PrettyPrintSettings#wrapNumericArrays} are not supported. */ | More efficient than <code>#prettyPrint(PrettyPrintSettings)</code> but <code>PrettyPrintSettings#singleLineColumns</code> and | prettyPrint | {
"repo_name": "MikkelTAndersen/libgdx",
"path": "gdx/src/com/badlogic/gdx/utils/JsonValue.java",
"license": "apache-2.0",
"size": 41377
} | [
"com.badlogic.gdx.utils.JsonWriter",
"java.io.IOException",
"java.io.Writer"
] | import com.badlogic.gdx.utils.JsonWriter; import java.io.IOException; import java.io.Writer; | import com.badlogic.gdx.utils.*; import java.io.*; | [
"com.badlogic.gdx",
"java.io"
] | com.badlogic.gdx; java.io; | 1,175,024 |
public com.google.longrunning.Operation updateCluster(com.google.bigtable.admin.v2.Cluster request) {
return blockingUnaryCall(
getChannel(), getUpdateClusterMethodHelper(), getCallOptions(), request);
} | com.google.longrunning.Operation function(com.google.bigtable.admin.v2.Cluster request) { return blockingUnaryCall( getChannel(), getUpdateClusterMethodHelper(), getCallOptions(), request); } | /**
* <pre>
* Updates a cluster within an instance.
* </pre>
*/ | <code> Updates a cluster within an instance. </code> | updateCluster | {
"repo_name": "pongad/api-client-staging",
"path": "generated/java/grpc-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BigtableInstanceAdminGrpc.java",
"license": "bsd-3-clause",
"size": 106367
} | [
"io.grpc.stub.ClientCalls"
] | import io.grpc.stub.ClientCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 278,344 |
public int draw() {
if (!this.isDrawing) {
throw new IllegalStateException("Not tesselating!");
} else {
this.isDrawing = false;
int offs = 0;
while (offs < this.vertexCount) {
int vtc = 0;
if ((this.drawMode == 7) && convertQuadsToTriangles) {
vtc = Math.min(this.vertexCount - offs, trivertsInBuffer);
} else {
vtc = Math.min(this.vertexCount - offs, nativeBufferSize >> 5);
}
Tessellator.intBuffer.clear();
Tessellator.intBuffer.put(this.rawBuffer, offs * 8, vtc * 8);
Tessellator.byteBuffer.position(0);
Tessellator.byteBuffer.limit(vtc * 32);
offs += vtc;
if (Tessellator.useVBO) {
this.vboIndex = (this.vboIndex + 1) % Tessellator.vboCount;
ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, Tessellator.vertexBuffers.get(this.vboIndex));
ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, Tessellator.byteBuffer, ARBBufferObject.GL_STREAM_DRAW_ARB);
}
if (this.hasTexture) {
if (Tessellator.useVBO) {
GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 32, 12L);
} else {
Tessellator.floatBuffer.position(3);
GL11.glTexCoordPointer(2, 32, Tessellator.floatBuffer);
}
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
}
if (this.hasColor) {
if (Tessellator.useVBO) {
GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 32, 20L);
} else {
Tessellator.byteBuffer.position(20);
GL11.glColorPointer(4, true, 32, Tessellator.byteBuffer);
}
GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
}
if (Tessellator.useVBO) {
GL11.glVertexPointer(3, GL11.GL_FLOAT, 32, 0L);
} else {
Tessellator.floatBuffer.position(0);
GL11.glVertexPointer(3, 32, Tessellator.floatBuffer);
}
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
if ((this.drawMode == 7) && convertQuadsToTriangles) {
GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, vtc);
} else {
GL11.glDrawArrays(this.drawMode, 0, vtc);
}
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
if (this.hasTexture) {
GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
}
if (this.hasColor) {
GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
}
}
if ((this.rawBufferSize > 0x20000) && (this.rawBufferIndex < (this.rawBufferSize << 3))) {
this.rawBufferSize = 0;
this.rawBuffer = null;
}
int i = this.rawBufferIndex * 4;
this.reset();
return i;
}
} | int function() { if (!this.isDrawing) { throw new IllegalStateException(STR); } else { this.isDrawing = false; int offs = 0; while (offs < this.vertexCount) { int vtc = 0; if ((this.drawMode == 7) && convertQuadsToTriangles) { vtc = Math.min(this.vertexCount - offs, trivertsInBuffer); } else { vtc = Math.min(this.vertexCount - offs, nativeBufferSize >> 5); } Tessellator.intBuffer.clear(); Tessellator.intBuffer.put(this.rawBuffer, offs * 8, vtc * 8); Tessellator.byteBuffer.position(0); Tessellator.byteBuffer.limit(vtc * 32); offs += vtc; if (Tessellator.useVBO) { this.vboIndex = (this.vboIndex + 1) % Tessellator.vboCount; ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, Tessellator.vertexBuffers.get(this.vboIndex)); ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, Tessellator.byteBuffer, ARBBufferObject.GL_STREAM_DRAW_ARB); } if (this.hasTexture) { if (Tessellator.useVBO) { GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 32, 12L); } else { Tessellator.floatBuffer.position(3); GL11.glTexCoordPointer(2, 32, Tessellator.floatBuffer); } GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); } if (this.hasColor) { if (Tessellator.useVBO) { GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 32, 20L); } else { Tessellator.byteBuffer.position(20); GL11.glColorPointer(4, true, 32, Tessellator.byteBuffer); } GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); } if (Tessellator.useVBO) { GL11.glVertexPointer(3, GL11.GL_FLOAT, 32, 0L); } else { Tessellator.floatBuffer.position(0); GL11.glVertexPointer(3, 32, Tessellator.floatBuffer); } GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); if ((this.drawMode == 7) && convertQuadsToTriangles) { GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, vtc); } else { GL11.glDrawArrays(this.drawMode, 0, vtc); } GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); if (this.hasTexture) { GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); } if (this.hasColor) { GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); } } if ((this.rawBufferSize > 0x20000) && (this.rawBufferIndex < (this.rawBufferSize << 3))) { this.rawBufferSize = 0; this.rawBuffer = null; } int i = this.rawBufferIndex * 4; this.reset(); return i; } } | /**
* Draws the data set up in this tessellator and resets the state to prepare
* for new drawing.
*/ | Draws the data set up in this tessellator and resets the state to prepare for new drawing | draw | {
"repo_name": "tfsthiago1112/Tecnocraft-Launcher",
"path": "Launcher/src/main/java/tk/tfsthiago1112/Tecnocraft/Launcher/gui/utils/Tessellator.java",
"license": "epl-1.0",
"size": 14188
} | [
"org.lwjgl.opengl.ARBBufferObject",
"org.lwjgl.opengl.ARBVertexBufferObject"
] | import org.lwjgl.opengl.ARBBufferObject; import org.lwjgl.opengl.ARBVertexBufferObject; | import org.lwjgl.opengl.*; | [
"org.lwjgl.opengl"
] | org.lwjgl.opengl; | 147,935 |
XAResource getXAResource(); | XAResource getXAResource(); | /**
* Returns the XAResource associated to the session.
*
* @return the XAResource associated to the session
*/ | Returns the XAResource associated to the session | getXAResource | {
"repo_name": "willr3/activemq-artemis",
"path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ClientSession.java",
"license": "apache-2.0",
"size": 41343
} | [
"javax.transaction.xa.XAResource"
] | import javax.transaction.xa.XAResource; | import javax.transaction.xa.*; | [
"javax.transaction"
] | javax.transaction; | 1,943,116 |
public Element getXmlDescription ()
{
description.setAttribute ("about", getAbout (), Utils.rdfNS);
return description;
}
| Element function () { description.setAttribute ("about", getAbout (), Utils.rdfNS); return description; } | /**
* Get the XML description of {@link #getAbout()}.
*
* @return the XML subtree rooting the description
*/ | Get the XML description of <code>#getAbout()</code> | getXmlDescription | {
"repo_name": "binfalse/CombineArchive",
"path": "src/main/java/de/unirostock/sems/cbarchive/meta/MetaDataObject.java",
"license": "bsd-3-clause",
"size": 5821
} | [
"de.unirostock.sems.cbarchive.Utils",
"org.jdom2.Element"
] | import de.unirostock.sems.cbarchive.Utils; import org.jdom2.Element; | import de.unirostock.sems.cbarchive.*; import org.jdom2.*; | [
"de.unirostock.sems",
"org.jdom2"
] | de.unirostock.sems; org.jdom2; | 1,168,435 |
private void loadExtensions(Collection<Resource> javaScriptResources,
Collection<Resource> cssResources) {
// Retrieve and validate extensions directory
File extensionsDir = new File(environment.getGuacamoleHome(), EXTENSIONS_DIRECTORY);
if (!extensionsDir.isDirectory())
return;
// Retrieve list of all extension files within extensions directory
File[] extensionFiles = extensionsDir.listFiles(new FileFilter() { | void function(Collection<Resource> javaScriptResources, Collection<Resource> cssResources) { File extensionsDir = new File(environment.getGuacamoleHome(), EXTENSIONS_DIRECTORY); if (!extensionsDir.isDirectory()) return; File[] extensionFiles = extensionsDir.listFiles(new FileFilter() { | /**
* Loads all extensions within the GUACAMOLE_HOME/extensions directory, if
* any, adding their static resource to the given resoure collections.
*
* @param javaScriptResources
* A modifiable collection of static JavaScript resources which may
* receive new JavaScript resources from extensions.
*
* @param cssResources
* A modifiable collection of static CSS resources which may receive
* new CSS resources from extensions.
*/ | Loads all extensions within the GUACAMOLE_HOME/extensions directory, if any, adding their static resource to the given resoure collections | loadExtensions | {
"repo_name": "Calvin-CS/Agora",
"path": "guacamole-client/guacamole/src/main/java/org/glyptodon/guacamole/net/basic/extension/ExtensionModule.java",
"license": "gpl-3.0",
"size": 18008
} | [
"java.io.File",
"java.io.FileFilter",
"java.util.Collection",
"org.glyptodon.guacamole.net.basic.resource.Resource"
] | import java.io.File; import java.io.FileFilter; import java.util.Collection; import org.glyptodon.guacamole.net.basic.resource.Resource; | import java.io.*; import java.util.*; import org.glyptodon.guacamole.net.basic.resource.*; | [
"java.io",
"java.util",
"org.glyptodon.guacamole"
] | java.io; java.util; org.glyptodon.guacamole; | 701,922 |
public void setBelongsTo(Organisation belongsTo) {
this.belongsTo = belongsTo;
} | void function(Organisation belongsTo) { this.belongsTo = belongsTo; } | /**
* Sets the organisation to which this reward belongs to.
*
* @param belongsTo
* The reward's organisation. This parameter must not be null.
*/ | Sets the organisation to which this reward belongs to | setBelongsTo | {
"repo_name": "InteractiveSystemsGroup/GamificationEngine-Kinben",
"path": "src/main/java/info/interactivesystems/gamificationengine/entities/rewards/Reward.java",
"license": "lgpl-3.0",
"size": 5800
} | [
"info.interactivesystems.gamificationengine.entities.Organisation"
] | import info.interactivesystems.gamificationengine.entities.Organisation; | import info.interactivesystems.gamificationengine.entities.*; | [
"info.interactivesystems.gamificationengine"
] | info.interactivesystems.gamificationengine; | 35,353 |
protected static int[] adjustResultBuffer(NodeState state, int result, boolean bootstrapMode){
int resultBuffer[] = state.getFromKeyWithDefault(INTERNAL_RESULTS_BUFFER_KEY, INTERNAL_RESULTS_BUFFER_DEF);;
//So adding 1 value to the end and removing (currentBufferLength + 1) - maxBufferLength from the beginning.
final int maxResultBufferLength = state.getFromKeyWithDefault(BUFFER_SIZE_KEY, BUFFER_SIZE_DEF);
final int numValuesToRemoveFromBeginning = bootstrapMode? 0 : Math.max(0, resultBuffer.length + 1 - maxResultBufferLength);
int newBuffer[] = new int[resultBuffer.length + 1 - numValuesToRemoveFromBeginning];
//Setting first values
System.arraycopy(resultBuffer, numValuesToRemoveFromBeginning, newBuffer, 0, newBuffer.length - 1);
newBuffer[newBuffer.length-1] = result;
state.setFromKey(INTERNAL_RESULTS_BUFFER_KEY, Type.INT_ARRAY, newBuffer);
return newBuffer;
} | static int[] function(NodeState state, int result, boolean bootstrapMode){ int resultBuffer[] = state.getFromKeyWithDefault(INTERNAL_RESULTS_BUFFER_KEY, INTERNAL_RESULTS_BUFFER_DEF);; final int maxResultBufferLength = state.getFromKeyWithDefault(BUFFER_SIZE_KEY, BUFFER_SIZE_DEF); final int numValuesToRemoveFromBeginning = bootstrapMode? 0 : Math.max(0, resultBuffer.length + 1 - maxResultBufferLength); int newBuffer[] = new int[resultBuffer.length + 1 - numValuesToRemoveFromBeginning]; System.arraycopy(resultBuffer, numValuesToRemoveFromBeginning, newBuffer, 0, newBuffer.length - 1); newBuffer[newBuffer.length-1] = result; state.setFromKey(INTERNAL_RESULTS_BUFFER_KEY, Type.INT_ARRAY, newBuffer); return newBuffer; } | /**
* Adds new value to reuslt buffer. Removes value(s) from beginning (if necessary).
*
* @param state Node state to get/set proeprties
* @param result New class label to be added to result buffer
* @param bootstrapMode New bootstrap mode
* @return New reuslt buffer
*/ | Adds new value to reuslt buffer. Removes value(s) from beginning (if necessary) | adjustResultBuffer | {
"repo_name": "datathings/greycat",
"path": "plugins/incub/mlx/src/main/java/org/mwg/mlx/algorithm/AbstractClassifierSlidingWindowManagingNode.java",
"license": "apache-2.0",
"size": 11229
} | [
"org.mwg.Type",
"org.mwg.plugin.NodeState"
] | import org.mwg.Type; import org.mwg.plugin.NodeState; | import org.mwg.*; import org.mwg.plugin.*; | [
"org.mwg",
"org.mwg.plugin"
] | org.mwg; org.mwg.plugin; | 2,769,645 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.