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
void setServerSocket(ServerSocket serverSocket);
void setServerSocket(ServerSocket serverSocket);
/** * Sets the {@link ServerSocket} for the server. * * @param serverSocket for the server * @see ServerSocket * @since 0.0.1 */
Sets the <code>ServerSocket</code> for the server
setServerSocket
{ "repo_name": "slaubenberger/wichtel", "path": "src/main/java/net/laubenberger/wichtel/controller/net/server/Server.java", "license": "lgpl-3.0", "size": 2969 }
[ "java.net.ServerSocket" ]
import java.net.ServerSocket;
import java.net.*;
[ "java.net" ]
java.net;
2,185,050
@Override public String toString() { boolean connected = isConnected(); if (strValConnected == connected && strVal != null) { return strVal; } StringBuilder buf = new StringBuilder(128); buf.append("[id: 0x"); buf.append(getIdString()); SocketAddress localAddress = getLocalAddress(); SocketAddress remoteAddress = getRemoteAddress(); if (remoteAddress != null) { buf.append(", "); if (getParent() == null) { buf.append(localAddress); buf.append(connected? " => " : " :> "); buf.append(remoteAddress); } else { buf.append(remoteAddress); buf.append(connected? " => " : " :> "); buf.append(localAddress); } } else if (localAddress != null) { buf.append(", "); buf.append(localAddress); } buf.append(']'); String strVal = buf.toString(); this.strVal = strVal; strValConnected = connected; return strVal; }
String function() { boolean connected = isConnected(); if (strValConnected == connected && strVal != null) { return strVal; } StringBuilder buf = new StringBuilder(128); buf.append(STR); buf.append(getIdString()); SocketAddress localAddress = getLocalAddress(); SocketAddress remoteAddress = getRemoteAddress(); if (remoteAddress != null) { buf.append(STR); if (getParent() == null) { buf.append(localAddress); buf.append(connected? STR : STR); buf.append(remoteAddress); } else { buf.append(remoteAddress); buf.append(connected? STR : STR); buf.append(localAddress); } } else if (localAddress != null) { buf.append(STR); buf.append(localAddress); } buf.append(']'); String strVal = buf.toString(); this.strVal = strVal; strValConnected = connected; return strVal; }
/** * Returns the {@link String} representation of this channel. The returned * string contains the {@linkplain #getId() ID}, {@linkplain #getLocalAddress() local address}, * and {@linkplain #getRemoteAddress() remote address} of this channel for * easier identification. */
Returns the <code>String</code> representation of this channel. The returned string contains the #getId() ID, #getLocalAddress() local address, and #getRemoteAddress() remote address of this channel for easier identification
toString
{ "repo_name": "xiexingguang/simple-netty-source", "path": "src/main/java/org/jboss/netty/channel/core/impl/AbstractChannel.java", "license": "apache-2.0", "size": 11034 }
[ "java.net.SocketAddress" ]
import java.net.SocketAddress;
import java.net.*;
[ "java.net" ]
java.net;
2,705,081
public void tearDown() throws IOException { objInputStream.close(); objOutputStream.close(); socket.close(); }
void function() throws IOException { objInputStream.close(); objOutputStream.close(); socket.close(); }
/** * Closes the <code>Socket</code> and the object streams obtained * from it. * * @throws IOException if an exception occurs while trying to close * the socket or the streams. */
Closes the <code>Socket</code> and the object streams obtained from it
tearDown
{ "repo_name": "gemxd/gemfirexd-oss", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/impl/store/replication/net/SocketConnection.java", "license": "apache-2.0", "size": 4103 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,961,848
private ITreeNode createITreeNode(Competency c) { ITreeNode node = new TreeNode(); node.setId(c.getId().toString()); if (isSetLocale()) { // change name only when the locale is actually set c.setName(cpm.getName(c, this.locale.getLanguage())); } node.setName(c.getName()); node.setObject(c); if (c instanceof CompetencyProcess) { node.setType("process"); } if (c instanceof ConcreteCompetency) { node.setType("competency"); } return node; }
ITreeNode function(Competency c) { ITreeNode node = new TreeNode(); node.setId(c.getId().toString()); if (isSetLocale()) { c.setName(cpm.getName(c, this.locale.getLanguage())); } node.setName(c.getName()); node.setObject(c); if (c instanceof CompetencyProcess) { node.setType(STR); } if (c instanceof ConcreteCompetency) { node.setType(STR); } return node; }
/** * Create a an ITree representation of a competency process. * * @param c * @return */
Create a an ITree representation of a competency process
createITreeNode
{ "repo_name": "i2geo/CompEd", "path": "comped/src/main/java/net/i2geo/comped/service/impl/CompetencyITreeManagerImpl.java", "license": "apache-2.0", "size": 10691 }
[ "com.jenkov.prizetags.tree.impl.TreeNode", "com.jenkov.prizetags.tree.itf.ITreeNode", "net.i2geo.comped.model.Competency", "net.i2geo.comped.model.CompetencyProcess", "net.i2geo.comped.model.ConcreteCompetency" ]
import com.jenkov.prizetags.tree.impl.TreeNode; import com.jenkov.prizetags.tree.itf.ITreeNode; import net.i2geo.comped.model.Competency; import net.i2geo.comped.model.CompetencyProcess; import net.i2geo.comped.model.ConcreteCompetency;
import com.jenkov.prizetags.tree.impl.*; import com.jenkov.prizetags.tree.itf.*; import net.i2geo.comped.model.*;
[ "com.jenkov.prizetags", "net.i2geo.comped" ]
com.jenkov.prizetags; net.i2geo.comped;
1,810,657
@Override public int[] getGlyphCharIndices(int beginGlyphIndex, int numEntries, int[] codeReturn) { if ((beginGlyphIndex < 0) || (beginGlyphIndex >= this.getNumGlyphs())) { // awt.44=beginGlyphIndex is out of vector's range throw new IllegalArgumentException(Messages.getString("awt.44")); //$NON-NLS-1$ } if ((numEntries < 0) || ((numEntries + beginGlyphIndex) > this.getNumGlyphs())) { // awt.45=numEntries is out of vector's range throw new IllegalArgumentException(Messages.getString("awt.45")); //$NON-NLS-1$ } if (codeReturn == null) { codeReturn = new int[numEntries]; } for (int i = 0; i < numEntries; i++) { codeReturn[i] = this.getGlyphCharIndex(i + beginGlyphIndex); } return codeReturn; }
int[] function(int beginGlyphIndex, int numEntries, int[] codeReturn) { if ((beginGlyphIndex < 0) (beginGlyphIndex >= this.getNumGlyphs())) { throw new IllegalArgumentException(Messages.getString(STR)); } if ((numEntries < 0) ((numEntries + beginGlyphIndex) > this.getNumGlyphs())) { throw new IllegalArgumentException(Messages.getString(STR)); } if (codeReturn == null) { codeReturn = new int[numEntries]; } for (int i = 0; i < numEntries; i++) { codeReturn[i] = this.getGlyphCharIndex(i + beginGlyphIndex); } return codeReturn; }
/** * Returns an array of numEntries character indices for the specified glyphs. * * @param beginGlyphIndex the start index * @param numEntries the number of glyph codes to get * @param codeReturn the array that receives glyph codes' values * @return an array that receives glyph char indices */
Returns an array of numEntries character indices for the specified glyphs
getGlyphCharIndices
{ "repo_name": "shannah/cn1", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/CommonGlyphVector.java", "license": "gpl-2.0", "size": 32407 }
[ "org.apache.harmony.awt.internal.nls.Messages" ]
import org.apache.harmony.awt.internal.nls.Messages;
import org.apache.harmony.awt.internal.nls.*;
[ "org.apache.harmony" ]
org.apache.harmony;
989,139
public static boolean isPseudoHeader(AsciiString header) { return PSEUDO_HEADERS.contains(header); } }
static boolean function(AsciiString header) { return PSEUDO_HEADERS.contains(header); } }
/** * Indicates whether the given header name is a valid HTTP/2 pseudo header. */
Indicates whether the given header name is a valid HTTP/2 pseudo header
isPseudoHeader
{ "repo_name": "Sandyarathi/Lab2gRPC", "path": "lib/netty/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2Headers.java", "license": "bsd-3-clause", "size": 6206 }
[ "io.netty.handler.codec.AsciiString" ]
import io.netty.handler.codec.AsciiString;
import io.netty.handler.codec.*;
[ "io.netty.handler" ]
io.netty.handler;
730,643
public DeploymentMode deploymentMode() { return this.deploymentMode; }
DeploymentMode function() { return this.deploymentMode; }
/** * Get describes the type of ARM deployment to be performed on the resource. Possible values include: 'Incremental', 'Complete'. * * @return the deploymentMode value */
Get describes the type of ARM deployment to be performed on the resource. Possible values include: 'Incremental', 'Complete'
deploymentMode
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/deploymentmanager/mgmt-v2019_11_01_preview/src/main/java/com/microsoft/azure/management/deploymentmanager/v2019_11_01_preview/implementation/ServiceUnitResourceInner.java", "license": "mit", "size": 3421 }
[ "com.microsoft.azure.management.deploymentmanager.v2019_11_01_preview.DeploymentMode" ]
import com.microsoft.azure.management.deploymentmanager.v2019_11_01_preview.DeploymentMode;
import com.microsoft.azure.management.deploymentmanager.v2019_11_01_preview.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,159,471
void processResourceRequirements(ResourceRequirements resourceRequirements);
void processResourceRequirements(ResourceRequirements resourceRequirements);
/** * Notifies the slot manager about the resource requirements of a job. * * @param resourceRequirements resource requirements of a job */
Notifies the slot manager about the resource requirements of a job
processResourceRequirements
{ "repo_name": "aljoscha/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java", "license": "apache-2.0", "size": 7178 }
[ "org.apache.flink.runtime.slots.ResourceRequirements" ]
import org.apache.flink.runtime.slots.ResourceRequirements;
import org.apache.flink.runtime.slots.*;
[ "org.apache.flink" ]
org.apache.flink;
2,846,047
private Object evaluate( MethodContext ctx ) { String s = ctx.getChild( 1 ).getText(); int pos = s.indexOf( '.' ); String type = s.substring( 0, pos ); String method = s.substring( pos + 1 ); ParametersContext pc = (ParametersContext) ctx.getChild( 2 ); List<Object> params = new ArrayList<Object>(); for ( int i = 1, count = pc.getChildCount() - 1; i < count; i++ ) { if ( pc.getChild( i ) instanceof ParameterContext ) { ParserRuleContext p = (ParserRuleContext) pc.getChild( i ).getChild( 0 ); switch ( p.getRuleIndex() ) { case ExpressionLanguageParser.RULE_literal: params.add( evaluate( (LiteralContext) p ) ); break; case ExpressionLanguageParser.RULE_method: params.add( evaluate( (MethodContext) p ) ); break; case ExpressionLanguageParser.RULE_property: params.add( evaluate( (PropertyContext) p ) ); break; } } } return MockContext.get().getEvaluator( type ).evaluate( method, params.toArray() ); }
Object function( MethodContext ctx ) { String s = ctx.getChild( 1 ).getText(); int pos = s.indexOf( '.' ); String type = s.substring( 0, pos ); String method = s.substring( pos + 1 ); ParametersContext pc = (ParametersContext) ctx.getChild( 2 ); List<Object> params = new ArrayList<Object>(); for ( int i = 1, count = pc.getChildCount() - 1; i < count; i++ ) { if ( pc.getChild( i ) instanceof ParameterContext ) { ParserRuleContext p = (ParserRuleContext) pc.getChild( i ).getChild( 0 ); switch ( p.getRuleIndex() ) { case ExpressionLanguageParser.RULE_literal: params.add( evaluate( (LiteralContext) p ) ); break; case ExpressionLanguageParser.RULE_method: params.add( evaluate( (MethodContext) p ) ); break; case ExpressionLanguageParser.RULE_property: params.add( evaluate( (PropertyContext) p ) ); break; } } } return MockContext.get().getEvaluator( type ).evaluate( method, params.toArray() ); }
/** * Evaluate an EL method. * <p> * @param ctx the EL method context. * @return the resolved value. * @throws IllegalStateException if the EL method specifies an unknown evaluator. */
Evaluate an EL method.
evaluate
{ "repo_name": "rnott/rnott.org", "path": "mock/src/main/java/org/rnott/mock/ExpressionLanguageEvaluator.java", "license": "apache-2.0", "size": 5202 }
[ "java.util.ArrayList", "java.util.List", "org.antlr.v4.runtime.ParserRuleContext", "org.rnott.mock.ExpressionLanguageParser" ]
import java.util.ArrayList; import java.util.List; import org.antlr.v4.runtime.ParserRuleContext; import org.rnott.mock.ExpressionLanguageParser;
import java.util.*; import org.antlr.v4.runtime.*; import org.rnott.mock.*;
[ "java.util", "org.antlr.v4", "org.rnott.mock" ]
java.util; org.antlr.v4; org.rnott.mock;
2,060,202
protected void startActivityForResult(Intent intent, int code) { if (fragment == null) { activity.startActivityForResult(intent, code); } else { fragment.startActivityForResult(intent, code); } }
void function(Intent intent, int code) { if (fragment == null) { activity.startActivityForResult(intent, code); } else { fragment.startActivityForResult(intent, code); } }
/** * Start an activity. This method is defined to allow different methods of activity starting for * newer versions of Android and for compatibility library. * * @param intent Intent to start. * @param code Request code for the activity * @see Activity#startActivityForResult(Intent, int) * @see Fragment#startActivityForResult(Intent, int) */
Start an activity. This method is defined to allow different methods of activity starting for newer versions of Android and for compatibility library
startActivityForResult
{ "repo_name": "JimSeker/AudioVideo", "path": "qrDemo/app/src/main/java/edu/cs4730/qrDemo/IntentIntegrator.java", "license": "apache-2.0", "size": 20372 }
[ "android.content.Intent" ]
import android.content.Intent;
import android.content.*;
[ "android.content" ]
android.content;
2,566,860
@NonNull Self containsKey(@NonNull String key);
Self containsKey(@NonNull String key);
/** * Assert the subject bundle contains key. */
Assert the subject bundle contains key
containsKey
{ "repo_name": "busybusy/DBC-Android", "path": "lib/src/main/java/com/busybusy/dbc/checks/BundleChecks.java", "license": "apache-2.0", "size": 1094 }
[ "androidx.annotation.NonNull" ]
import androidx.annotation.NonNull;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
1,042,678
synchronized void enterSafeMode() throws IOException { if (!isInSafeMode()) { safeMode = new SafeModeInfo(); return; } safeMode.setManual(); getEditLog().logSync(); NameNode.stateChangeLog.info("STATE* Safe mode is ON. " + safeMode.getTurnOffTip()); }
synchronized void enterSafeMode() throws IOException { if (!isInSafeMode()) { safeMode = new SafeModeInfo(); return; } safeMode.setManual(); getEditLog().logSync(); NameNode.stateChangeLog.info(STR + safeMode.getTurnOffTip()); }
/** * Enter safe mode manually. * @throws IOException */
Enter safe mode manually
enterSafeMode
{ "repo_name": "wzhuo918/release-1.1.2-MDP", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java", "license": "apache-2.0", "size": 226670 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,605,780
public void setMenu(int res) { setMenu(LayoutInflater.from(getContext()).inflate(res, null)); }
void function(int res) { setMenu(LayoutInflater.from(getContext()).inflate(res, null)); }
/** * Set the behind view (menu) content from a layout resource. The resource will be inflated, adding all top-level views * to the behind view. * * @param res the new content */
Set the behind view (menu) content from a layout resource. The resource will be inflated, adding all top-level views to the behind view
setMenu
{ "repo_name": "kkooff114/LJWCommon", "path": "src/com/slidingmenu/lib/SlidingMenu.java", "license": "gpl-3.0", "size": 28137 }
[ "android.view.LayoutInflater" ]
import android.view.LayoutInflater;
import android.view.*;
[ "android.view" ]
android.view;
1,048,555
public void initWindow() { //setLocationRelativeTo(null); setAlwaysOnTop(false); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setLayout(new BorderLayout()); add(renderSurface, BorderLayout.CENTER); Logger.info("Game window initialized."); }
void function() { setAlwaysOnTop(false); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setLayout(new BorderLayout()); add(renderSurface, BorderLayout.CENTER); Logger.info(STR); }
/** * Initialize window components */
Initialize window components
initWindow
{ "repo_name": "bwyap/java-familyfeud", "path": "src/bwyap/familyfeud/gui/window/GameWindow.java", "license": "mit", "size": 2588 }
[ "java.awt.BorderLayout", "javax.swing.JFrame" ]
import java.awt.BorderLayout; import javax.swing.JFrame;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,260,982
this.conf = conf; // Grab the agent names we advertise to robots files. String agentName = conf.get("http.agent.name"); if (agentName == null || (agentName = agentName.trim()).isEmpty()) { throw new RuntimeException("Agent name not configured!"); } agentNames = agentName; // If there are any other agents specified, append those to the list of // agents String otherAgents = conf.get("http.robots.agents"); if (otherAgents != null && !otherAgents.trim().isEmpty()) { StringTokenizer tok = new StringTokenizer(otherAgents, ","); StringBuilder sb = new StringBuilder(agentNames); while (tok.hasMoreTokens()) { String str = tok.nextToken().trim(); if (str.equals("*") || str.equals(agentName)) { // skip wildcard "*" or agent name itself // (required for backward compatibility, cf. NUTCH-1715 and // NUTCH-1718) } else { sb.append(",").append(str); } } agentNames = sb.toString(); } }
this.conf = conf; String agentName = conf.get(STR); if (agentName == null (agentName = agentName.trim()).isEmpty()) { throw new RuntimeException(STR); } agentNames = agentName; String otherAgents = conf.get(STR); if (otherAgents != null && !otherAgents.trim().isEmpty()) { StringTokenizer tok = new StringTokenizer(otherAgents, ","); StringBuilder sb = new StringBuilder(agentNames); while (tok.hasMoreTokens()) { String str = tok.nextToken().trim(); if (str.equals("*") str.equals(agentName)) { } else { sb.append(",").append(str); } } agentNames = sb.toString(); } }
/** * Set the {@link Configuration} object */
Set the <code>Configuration</code> object
setConf
{ "repo_name": "supermy/nutch2", "path": "src/java/org/apache/nutch/protocol/RobotRulesParser.java", "license": "apache-2.0", "size": 6297 }
[ "java.util.StringTokenizer" ]
import java.util.StringTokenizer;
import java.util.*;
[ "java.util" ]
java.util;
389,571
@Test() public void testErrorBehaviors() throws Exception { for (final MultiUpdateErrorBehavior b : MultiUpdateErrorBehavior.values()) { assertNotNull(b); assertEquals(MultiUpdateErrorBehavior.valueOf(b.intValue()), b); assertEquals(MultiUpdateErrorBehavior.valueOf(b.name()), b); } }
@Test() void function() throws Exception { for (final MultiUpdateErrorBehavior b : MultiUpdateErrorBehavior.values()) { assertNotNull(b); assertEquals(MultiUpdateErrorBehavior.valueOf(b.intValue()), b); assertEquals(MultiUpdateErrorBehavior.valueOf(b.name()), b); } }
/** * Provides basic test coverage for each of the error behaviors. * * @throws Exception If an unexpected problem occurs. */
Provides basic test coverage for each of the error behaviors
testErrorBehaviors
{ "repo_name": "UnboundID/ldapsdk", "path": "tests/unit/src/com/unboundid/ldap/sdk/unboundidds/extensions/MultiUpdateErrorBehaviorTestCase.java", "license": "gpl-2.0", "size": 4862 }
[ "org.testng.annotations.Test" ]
import org.testng.annotations.Test;
import org.testng.annotations.*;
[ "org.testng.annotations" ]
org.testng.annotations;
1,844,229
public List<SubResource> loadBalancerBackendAddressPools() { return this.innerProperties() == null ? null : this.innerProperties().loadBalancerBackendAddressPools(); }
List<SubResource> function() { return this.innerProperties() == null ? null : this.innerProperties().loadBalancerBackendAddressPools(); }
/** * Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of * load balancers. A scale set can reference backend address pools of one public and one internal load balancer. * Multiple scale sets cannot use the same basic sku load balancer. * * @return the loadBalancerBackendAddressPools value. */
Get the loadBalancerBackendAddressPools property: Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same basic sku load balancer
loadBalancerBackendAddressPools
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/models/VirtualMachineScaleSetIpConfiguration.java", "license": "mit", "size": 12249 }
[ "com.azure.core.management.SubResource", "java.util.List" ]
import com.azure.core.management.SubResource; import java.util.List;
import com.azure.core.management.*; import java.util.*;
[ "com.azure.core", "java.util" ]
com.azure.core; java.util;
1,485,384
public synchronized Client smartClient() { NodeAndClient randomNodeAndClient = getRandomNodeAndClient(); if (randomNodeAndClient != null) { return randomNodeAndClient.nodeClient(); } Assert.fail("No smart client found"); return null; // can't happen }
synchronized Client function() { NodeAndClient randomNodeAndClient = getRandomNodeAndClient(); if (randomNodeAndClient != null) { return randomNodeAndClient.nodeClient(); } Assert.fail(STR); return null; }
/** * Returns a "smart" node client to a random node in the cluster */
Returns a "smart" node client to a random node in the cluster
smartClient
{ "repo_name": "zkidkid/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java", "license": "apache-2.0", "size": 85193 }
[ "org.elasticsearch.client.Client", "org.junit.Assert" ]
import org.elasticsearch.client.Client; import org.junit.Assert;
import org.elasticsearch.client.*; import org.junit.*;
[ "org.elasticsearch.client", "org.junit" ]
org.elasticsearch.client; org.junit;
58,235
protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { return super.createTestEnvironment(Param, log); }
synchronized TestEnvironment function(TestParameters Param, PrintWriter log) { return super.createTestEnvironment(Param, log); }
/** * calls <CODE>createTestEnvironment()</CODE> from it's super class * @param Param the test parameter * @param log the log writer * @return lib.TestEnvironment */
calls <code>createTestEnvironment()</code> from it's super class
createTestEnvironment
{ "repo_name": "qt-haiku/LibreOffice", "path": "qadevOOo/tests/java/mod/_forms/OEditModel.java", "license": "gpl-3.0", "size": 6242 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
2,154,301
private static <K, V> SetMultimap<K, V> filterFiltered( FilteredSetMultimap<K, V> multimap, Predicate<? super Entry<K, V>> entryPredicate) { Predicate<Entry<K, V>> predicate = Predicates.and(multimap.entryPredicate(), entryPredicate); return new FilteredEntrySetMultimap<K, V>(multimap.unfiltered(), predicate); }
static <K, V> SetMultimap<K, V> function( FilteredSetMultimap<K, V> multimap, Predicate<? super Entry<K, V>> entryPredicate) { Predicate<Entry<K, V>> predicate = Predicates.and(multimap.entryPredicate(), entryPredicate); return new FilteredEntrySetMultimap<K, V>(multimap.unfiltered(), predicate); }
/** * Support removal operations when filtering a filtered multimap. Since a filtered multimap has * iterators that don't support remove, passing one to the FilteredEntryMultimap constructor would * lead to a multimap whose removal operations would fail. This method combines the predicates to * avoid that problem. */
Support removal operations when filtering a filtered multimap. Since a filtered multimap has iterators that don't support remove, passing one to the FilteredEntryMultimap constructor would lead to a multimap whose removal operations would fail. This method combines the predicates to avoid that problem
filterFiltered
{ "repo_name": "oneliang/third-party-lib", "path": "google/com/google/common/collect/Multimaps.java", "license": "apache-2.0", "size": 78476 }
[ "com.google.common.base.Predicate", "com.google.common.base.Predicates", "java.util.Map" ]
import com.google.common.base.Predicate; import com.google.common.base.Predicates; import java.util.Map;
import com.google.common.base.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
1,691,808
public List getLocalBucketsListTestOnly() { List localBucketList = null; if (this.dataStore != null) { localBucketList = this.dataStore.getLocalBucketsListTestOnly(); } return localBucketList; }
List function() { List localBucketList = null; if (this.dataStore != null) { localBucketList = this.dataStore.getLocalBucketsListTestOnly(); } return localBucketList; }
/** * A test method to get the list of all the bucket ids for the partitioned region in the data * Store. */
A test method to get the list of all the bucket ids for the partitioned region in the data Store
getLocalBucketsListTestOnly
{ "repo_name": "PurelyApplied/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java", "license": "apache-2.0", "size": 379321 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
762,280
public void deleteColumn(K key, String familyName, ByteBuffer columnName) { synchronized(mutator) { HectorUtils.deleteColumn(mutator, key, familyName, columnName); } }
void function(K key, String familyName, ByteBuffer columnName) { synchronized(mutator) { HectorUtils.deleteColumn(mutator, key, familyName, columnName); } }
/** * Delete a row within the keyspace. * @param key * @param fieldName * @param columnName */
Delete a row within the keyspace
deleteColumn
{ "repo_name": "infospace/gora", "path": "gora-cassandra/src/main/java/org/apache/gora/cassandra/store/CassandraClient.java", "license": "apache-2.0", "size": 25042 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,606,150
protected List<BelDocument> getBelDocuments(KamHandle kamHandle) { GetBelDocumentsRequest getBelDocumentsRequest = new GetBelDocumentsRequest(); getBelDocumentsRequest.setHandle(kamHandle); GetBelDocumentsResponse response = api.getBelDocuments(getBelDocumentsRequest); return response.getDocuments(); }
List<BelDocument> function(KamHandle kamHandle) { GetBelDocumentsRequest getBelDocumentsRequest = new GetBelDocumentsRequest(); getBelDocumentsRequest.setHandle(kamHandle); GetBelDocumentsResponse response = api.getBelDocuments(getBelDocumentsRequest); return response.getDocuments(); }
/** * Gets a list of documents used in a KAM * @param kam * @return */
Gets a list of documents used in a KAM
getBelDocuments
{ "repo_name": "OpenBEL/openbel-framework-examples", "path": "web-api/java/KamSummarizerExample.java", "license": "apache-2.0", "size": 9281 }
[ "com.selventa.belframework.ws.client.BelDocument", "com.selventa.belframework.ws.client.GetBelDocumentsRequest", "com.selventa.belframework.ws.client.GetBelDocumentsResponse", "com.selventa.belframework.ws.client.KamHandle", "java.util.List" ]
import com.selventa.belframework.ws.client.BelDocument; import com.selventa.belframework.ws.client.GetBelDocumentsRequest; import com.selventa.belframework.ws.client.GetBelDocumentsResponse; import com.selventa.belframework.ws.client.KamHandle; import java.util.List;
import com.selventa.belframework.ws.client.*; import java.util.*;
[ "com.selventa.belframework", "java.util" ]
com.selventa.belframework; java.util;
2,688,791
public void testGetDatasetCount() { XYPlot plot = new XYPlot(); assertEquals(0, plot.getDatasetCount()); }
void function() { XYPlot plot = new XYPlot(); assertEquals(0, plot.getDatasetCount()); }
/** * Added this test in response to a bug report. */
Added this test in response to a bug report
testGetDatasetCount
{ "repo_name": "raedle/univis", "path": "lib/jfreechart-1.0.1/src/org/jfree/chart/plot/junit/XYPlotTests.java", "license": "lgpl-2.1", "size": 30048 }
[ "org.jfree.chart.plot.XYPlot" ]
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.plot.*;
[ "org.jfree.chart" ]
org.jfree.chart;
791,849
public void displayAlert(final String title, final String text, final AlertType type);
void function(final String title, final String text, final AlertType type);
/** * Utility function to show a Java ME alert, as used for informing the user * about events in this demo app. * @param title title text to use for the message box. * @param text text to show as the main message in the box. * @param type one of the available alert types, defining the icon, sound * and display length. */
Utility function to show a Java ME alert, as used for informing the user about events in this demo app
displayAlert
{ "repo_name": "andijakl/nfccreator", "path": "src/com/nokia/examples/InfoInterface.java", "license": "gpl-3.0", "size": 2114 }
[ "javax.microedition.lcdui.AlertType" ]
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.*;
[ "javax.microedition" ]
javax.microedition;
2,769,890
public String getAdjustmentTotalScore() { return Validator.check(adjustmentTotalScore, "N/A"); }
String function() { return Validator.check(adjustmentTotalScore, "N/A"); }
/** * get the adjustment to the total score * * @return the total score */
get the adjustment to the total score
getAdjustmentTotalScore
{ "repo_name": "eemirtekin/Sakai-10.6-TR", "path": "samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/evaluation/TotalScoresBean.java", "license": "apache-2.0", "size": 32286 }
[ "org.sakaiproject.tool.assessment.ui.bean.util.Validator" ]
import org.sakaiproject.tool.assessment.ui.bean.util.Validator;
import org.sakaiproject.tool.assessment.ui.bean.util.*;
[ "org.sakaiproject.tool" ]
org.sakaiproject.tool;
2,744,425
protected NBTTagList newFloatNBTList(float... numbers) { NBTTagList nbttaglist = new NBTTagList(); for (float f : numbers) { nbttaglist.appendTag(new NBTTagFloat(f)); } return nbttaglist; }
NBTTagList function(float... numbers) { NBTTagList nbttaglist = new NBTTagList(); for (float f : numbers) { nbttaglist.appendTag(new NBTTagFloat(f)); } return nbttaglist; }
/** * Returns a new NBTTagList filled with the specified floats */
Returns a new NBTTagList filled with the specified floats
newFloatNBTList
{ "repo_name": "SkidJava/BaseClient", "path": "new_1.8.8/net/minecraft/entity/Entity.java", "license": "gpl-2.0", "size": 87662 }
[ "net.minecraft.nbt.NBTTagFloat", "net.minecraft.nbt.NBTTagList" ]
import net.minecraft.nbt.NBTTagFloat; import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.*;
[ "net.minecraft.nbt" ]
net.minecraft.nbt;
1,785,056
protected boolean updateAttachmentPoint() { if (attachmentPoints == null || attachmentPoints.isEmpty()) return false; boolean moved = false; Map<Long, AttachmentPoint> newMap = getAPMap(this.attachmentPoints); if ( newMap.size() != this.attachmentPoints.size() ) { moved = true; } // Prepare the new attachment point list. if (moved) { if ( newMap != null ) { this.attachmentPoints.retainAll( newMap.values() ); this.attachmentPoints.addAllAbsent( newMap.values() ); } } // empty the old ap list. this.oldAPs.clear(); return moved; }
boolean function() { if (attachmentPoints == null attachmentPoints.isEmpty()) return false; boolean moved = false; Map<Long, AttachmentPoint> newMap = getAPMap(this.attachmentPoints); if ( newMap.size() != this.attachmentPoints.size() ) { moved = true; } if (moved) { if ( newMap != null ) { this.attachmentPoints.retainAll( newMap.values() ); this.attachmentPoints.addAllAbsent( newMap.values() ); } } this.oldAPs.clear(); return moved; }
/** * Updates the known attachment points. This method is called whenever * topology changes. * * @return true if there is any change to the list of attachment points * -- which indicates a possible device move */
Updates the known attachment points. This method is called whenever topology changes
updateAttachmentPoint
{ "repo_name": "justin-labry/IRIS", "path": "Torpedo/src/etri/sdn/controller/module/devicemanager/Device.java", "license": "apache-2.0", "size": 19357 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,133,171
public FeatureSet loadFeatureSet(File featureFile) throws IOException;
FeatureSet function(File featureFile) throws IOException;
/** * Load a FeatureSet * @param featureFile * @return * @throws IOException */
Load a FeatureSet
loadFeatureSet
{ "repo_name": "dhmay/msInspect", "path": "src/org/fhcrc/cpl/toolbox/proteomics/feature/filehandler/FeatureSetFileHandler.java", "license": "apache-2.0", "size": 2045 }
[ "java.io.File", "java.io.IOException", "org.fhcrc.cpl.toolbox.proteomics.feature.FeatureSet" ]
import java.io.File; import java.io.IOException; import org.fhcrc.cpl.toolbox.proteomics.feature.FeatureSet;
import java.io.*; import org.fhcrc.cpl.toolbox.proteomics.feature.*;
[ "java.io", "org.fhcrc.cpl" ]
java.io; org.fhcrc.cpl;
2,233,982
public void verifySamlProfileRequestIfNeeded(final RequestAbstractType profileRequest, final MetadataResolver resolver, final HttpServletRequest request, final MessageContext context) throws Exception { val roleDescriptorResolver = getRoleDescriptorResolver(resolver, context, profileRequest); LOGGER.debug("Validating signature for [{}]", profileRequest.getClass().getName()); val signature = profileRequest.getSignature(); if (signature != null) { validateSignatureOnProfileRequest(profileRequest, signature, roleDescriptorResolver); } else { validateSignatureOnAuthenticationRequest(profileRequest, request, context, roleDescriptorResolver); } }
void function(final RequestAbstractType profileRequest, final MetadataResolver resolver, final HttpServletRequest request, final MessageContext context) throws Exception { val roleDescriptorResolver = getRoleDescriptorResolver(resolver, context, profileRequest); LOGGER.debug(STR, profileRequest.getClass().getName()); val signature = profileRequest.getSignature(); if (signature != null) { validateSignatureOnProfileRequest(profileRequest, signature, roleDescriptorResolver); } else { validateSignatureOnAuthenticationRequest(profileRequest, request, context, roleDescriptorResolver); } }
/** * Verify saml profile request if needed. * * @param profileRequest the profile request * @param resolver the resolver * @param request the request * @param context the context * @throws Exception the exception */
Verify saml profile request if needed
verifySamlProfileRequestIfNeeded
{ "repo_name": "rrenomeron/cas", "path": "support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/builders/enc/validate/SamlObjectSignatureValidator.java", "license": "apache-2.0", "size": 14268 }
[ "javax.servlet.http.HttpServletRequest", "org.opensaml.messaging.context.MessageContext", "org.opensaml.saml.metadata.resolver.MetadataResolver", "org.opensaml.saml.saml2.core.RequestAbstractType" ]
import javax.servlet.http.HttpServletRequest; import org.opensaml.messaging.context.MessageContext; import org.opensaml.saml.metadata.resolver.MetadataResolver; import org.opensaml.saml.saml2.core.RequestAbstractType;
import javax.servlet.http.*; import org.opensaml.messaging.context.*; import org.opensaml.saml.metadata.resolver.*; import org.opensaml.saml.saml2.core.*;
[ "javax.servlet", "org.opensaml.messaging", "org.opensaml.saml" ]
javax.servlet; org.opensaml.messaging; org.opensaml.saml;
185,166
public synchronized void applyRule(TpsControlRule newControlRule) { Loggers.TPS_CONTROL.info("Apply tps control rule parse start,pointName=[{}] ", this.getPointName()); //1.reset all monitor point for null. if (newControlRule == null) { Loggers.TPS_CONTROL.info("Clear all tps control rule ,pointName=[{}] ", this.getPointName()); this.tpsRecorder.clearLimitRule(); this.stopAllMonitorClient(); return; } //2.check point rule. TpsControlRule.Rule newPointRule = newControlRule.getPointRule(); if (newPointRule == null) { Loggers.TPS_CONTROL.info("Clear point control rule ,pointName=[{}] ", this.getPointName()); this.tpsRecorder.clearLimitRule(); } else { Loggers.TPS_CONTROL.info("Update point control rule ,pointName=[{}],original maxTps={}, new maxTps={}" + ",original monitorType={}, original monitorType={}, ", this.getPointName(), this.tpsRecorder.getMaxCount(), newPointRule.maxCount, this.tpsRecorder.getMonitorType(), newPointRule.monitorType); this.tpsRecorder.setMaxCount(newPointRule.maxCount); this.tpsRecorder.setMonitorType(newPointRule.monitorType); } //3.check monitor key rules. Map<String, TpsControlRule.Rule> newMonitorKeyRules = newControlRule.getMonitorKeyRule(); //3.1 clear all monitor keys. if (newMonitorKeyRules == null || newMonitorKeyRules.isEmpty()) { Loggers.TPS_CONTROL .info("Clear point control rule for monitorKeys, pointName=[{}] ", this.getPointName()); this.stopAllMonitorClient(); } else { Map<String, TpsRecorder> monitorKeysRecorderCurrent = this.monitorKeysRecorder; for (Map.Entry<String, TpsControlRule.Rule> newMonitorRule : newMonitorKeyRules.entrySet()) { if (newMonitorRule.getValue() == null) { continue; } boolean checkPattern = newMonitorRule.getKey() != null; if (!checkPattern) { Loggers.TPS_CONTROL.info("Invalid monitor rule, pointName=[{}] ,monitorRule={} ,Ignore this.", this.getPointName(), newMonitorRule.getKey()); continue; } TpsControlRule.Rule newRule = newMonitorRule.getValue(); if (newRule.period == null) { newRule.period = TimeUnit.SECONDS; } if (newRule.model == null) { newRule.model = TpsControlRule.Rule.MODEL_FUZZY; } //update rule. if (monitorKeysRecorderCurrent.containsKey(newMonitorRule.getKey())) { TpsRecorder tpsRecorder = monitorKeysRecorderCurrent.get(newMonitorRule.getKey()); Loggers.TPS_CONTROL .info("Update point control rule for client ip ,pointName=[{}],monitorKey=[{}],original maxTps={}" + ", new maxTps={},original monitorType={}, new monitorType={}, ", this.getPointName(), newMonitorRule.getKey(), tpsRecorder.getMaxCount(), newRule.maxCount, tpsRecorder.getMonitorType(), newRule.monitorType); if (!Objects.equals(tpsRecorder.period, newRule.period) || !Objects .equals(tpsRecorder.getModel(), newRule.model)) { TpsRecorder tpsRecorderNew = new TpsRecorder(startTime, newRule.period, newRule.model, DEFAULT_RECORD_SIZE); tpsRecorderNew.setMaxCount(newRule.maxCount); tpsRecorderNew.setMonitorType(newRule.monitorType); monitorKeysRecorderCurrent.put(newMonitorRule.getKey(), tpsRecorderNew); } else { tpsRecorder.setMaxCount(newRule.maxCount); tpsRecorder.setMonitorType(newRule.monitorType); } } else { Loggers.TPS_CONTROL .info("Add point control rule for client ip ,pointName=[{}],monitorKey=[{}], new maxTps={}, new monitorType={}, ", this.getPointName(), newMonitorRule.getKey(), newMonitorRule.getValue().maxCount, newMonitorRule.getValue().monitorType); // add rule TpsRecorder tpsRecorderAdd = new TpsRecorder(startTime, newRule.period, newRule.model, DEFAULT_RECORD_SIZE); tpsRecorderAdd.setMaxCount(newRule.maxCount); tpsRecorderAdd.setMonitorType(newRule.monitorType); monitorKeysRecorderCurrent.put(newMonitorRule.getKey(), tpsRecorderAdd); } } //delete rule. Iterator<Map.Entry<String, TpsRecorder>> iteratorCurrent = monitorKeysRecorderCurrent.entrySet().iterator(); while (iteratorCurrent.hasNext()) { Map.Entry<String, TpsRecorder> next1 = iteratorCurrent.next(); if (!newMonitorKeyRules.containsKey(next1.getKey())) { Loggers.TPS_CONTROL.info("Delete point control rule for pointName=[{}] ,monitorKey=[{}]", this.getPointName(), next1.getKey()); iteratorCurrent.remove(); } } } }
synchronized void function(TpsControlRule newControlRule) { Loggers.TPS_CONTROL.info(STR, this.getPointName()); if (newControlRule == null) { Loggers.TPS_CONTROL.info(STR, this.getPointName()); this.tpsRecorder.clearLimitRule(); this.stopAllMonitorClient(); return; } TpsControlRule.Rule newPointRule = newControlRule.getPointRule(); if (newPointRule == null) { Loggers.TPS_CONTROL.info(STR, this.getPointName()); this.tpsRecorder.clearLimitRule(); } else { Loggers.TPS_CONTROL.info(STR + STR, this.getPointName(), this.tpsRecorder.getMaxCount(), newPointRule.maxCount, this.tpsRecorder.getMonitorType(), newPointRule.monitorType); this.tpsRecorder.setMaxCount(newPointRule.maxCount); this.tpsRecorder.setMonitorType(newPointRule.monitorType); } Map<String, TpsControlRule.Rule> newMonitorKeyRules = newControlRule.getMonitorKeyRule(); if (newMonitorKeyRules == null newMonitorKeyRules.isEmpty()) { Loggers.TPS_CONTROL .info(STR, this.getPointName()); this.stopAllMonitorClient(); } else { Map<String, TpsRecorder> monitorKeysRecorderCurrent = this.monitorKeysRecorder; for (Map.Entry<String, TpsControlRule.Rule> newMonitorRule : newMonitorKeyRules.entrySet()) { if (newMonitorRule.getValue() == null) { continue; } boolean checkPattern = newMonitorRule.getKey() != null; if (!checkPattern) { Loggers.TPS_CONTROL.info(STR, this.getPointName(), newMonitorRule.getKey()); continue; } TpsControlRule.Rule newRule = newMonitorRule.getValue(); if (newRule.period == null) { newRule.period = TimeUnit.SECONDS; } if (newRule.model == null) { newRule.model = TpsControlRule.Rule.MODEL_FUZZY; } if (monitorKeysRecorderCurrent.containsKey(newMonitorRule.getKey())) { TpsRecorder tpsRecorder = monitorKeysRecorderCurrent.get(newMonitorRule.getKey()); Loggers.TPS_CONTROL .info(STR + STR, this.getPointName(), newMonitorRule.getKey(), tpsRecorder.getMaxCount(), newRule.maxCount, tpsRecorder.getMonitorType(), newRule.monitorType); if (!Objects.equals(tpsRecorder.period, newRule.period) !Objects .equals(tpsRecorder.getModel(), newRule.model)) { TpsRecorder tpsRecorderNew = new TpsRecorder(startTime, newRule.period, newRule.model, DEFAULT_RECORD_SIZE); tpsRecorderNew.setMaxCount(newRule.maxCount); tpsRecorderNew.setMonitorType(newRule.monitorType); monitorKeysRecorderCurrent.put(newMonitorRule.getKey(), tpsRecorderNew); } else { tpsRecorder.setMaxCount(newRule.maxCount); tpsRecorder.setMonitorType(newRule.monitorType); } } else { Loggers.TPS_CONTROL .info(STR, this.getPointName(), newMonitorRule.getKey(), newMonitorRule.getValue().maxCount, newMonitorRule.getValue().monitorType); TpsRecorder tpsRecorderAdd = new TpsRecorder(startTime, newRule.period, newRule.model, DEFAULT_RECORD_SIZE); tpsRecorderAdd.setMaxCount(newRule.maxCount); tpsRecorderAdd.setMonitorType(newRule.monitorType); monitorKeysRecorderCurrent.put(newMonitorRule.getKey(), tpsRecorderAdd); } } Iterator<Map.Entry<String, TpsRecorder>> iteratorCurrent = monitorKeysRecorderCurrent.entrySet().iterator(); while (iteratorCurrent.hasNext()) { Map.Entry<String, TpsRecorder> next1 = iteratorCurrent.next(); if (!newMonitorKeyRules.containsKey(next1.getKey())) { Loggers.TPS_CONTROL.info(STR, this.getPointName(), next1.getKey()); iteratorCurrent.remove(); } } } }
/** * apply tps control rule to this point. * * @param newControlRule controlRule. */
apply tps control rule to this point
applyRule
{ "repo_name": "alibaba/nacos", "path": "core/src/main/java/com/alibaba/nacos/core/remote/control/TpsMonitorPoint.java", "license": "apache-2.0", "size": 12959 }
[ "com.alibaba.nacos.core.utils.Loggers", "java.util.Iterator", "java.util.Map", "java.util.Objects", "java.util.concurrent.TimeUnit" ]
import com.alibaba.nacos.core.utils.Loggers; import java.util.Iterator; import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeUnit;
import com.alibaba.nacos.core.utils.*; import java.util.*; import java.util.concurrent.*;
[ "com.alibaba.nacos", "java.util" ]
com.alibaba.nacos; java.util;
1,130,452
MessageMetaData move(Mailbox<Id> mailbox,Message<Id> original) throws MailboxException; /** * Return the last uid which were used for storing a Message in the {@link Mailbox}
MessageMetaData move(Mailbox<Id> mailbox,Message<Id> original) throws MailboxException; /** * Return the last uid which were used for storing a Message in the {@link Mailbox}
/** * Move the given {@link Message} to a new mailbox and return the uid of the moved. Be aware that the given uid is just a suggestion for the uid of the moved * message. Implementation may choose to use a different one, so only depend on the returned uid! * * @param mailbox the Mailbox to move to * @param original the original to move * @throws StorageException */
Move the given <code>Message</code> to a new mailbox and return the uid of the moved. Be aware that the given uid is just a suggestion for the uid of the moved message. Implementation may choose to use a different one, so only depend on the returned uid
move
{ "repo_name": "aduprat/james-mailbox", "path": "store/src/main/java/org/apache/james/mailbox/store/mail/MessageMapper.java", "license": "apache-2.0", "size": 8449 }
[ "org.apache.james.mailbox.exception.MailboxException", "org.apache.james.mailbox.model.MessageMetaData", "org.apache.james.mailbox.store.mail.model.Mailbox", "org.apache.james.mailbox.store.mail.model.Message" ]
import org.apache.james.mailbox.exception.MailboxException; import org.apache.james.mailbox.model.MessageMetaData; import org.apache.james.mailbox.store.mail.model.Mailbox; import org.apache.james.mailbox.store.mail.model.Message;
import org.apache.james.mailbox.exception.*; import org.apache.james.mailbox.model.*; import org.apache.james.mailbox.store.mail.model.*;
[ "org.apache.james" ]
org.apache.james;
1,244,343
static PrimaryKey[] pathToKey(Collection<Path> paths) { if (paths == null) { return null; } final PrimaryKey[] keys = new PrimaryKey[paths.size()]; int i = 0; for (Path p : paths) { keys[i++] = pathToKey(p); } return keys; } private PathMetadataDynamoDBTranslation() { }
static PrimaryKey[] pathToKey(Collection<Path> paths) { if (paths == null) { return null; } final PrimaryKey[] keys = new PrimaryKey[paths.size()]; int i = 0; for (Path p : paths) { keys[i++] = pathToKey(p); } return keys; } private PathMetadataDynamoDBTranslation() { }
/** * Converts a collection of {@link Path} to a collection of DynamoDB keys. * * @see #pathToKey(Path) */
Converts a collection of <code>Path</code> to a collection of DynamoDB keys
pathToKey
{ "repo_name": "plusplusjiajia/hadoop", "path": "hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/PathMetadataDynamoDBTranslation.java", "license": "apache-2.0", "size": 14184 }
[ "com.amazonaws.services.dynamodbv2.document.PrimaryKey", "java.util.Collection", "org.apache.hadoop.fs.Path" ]
import com.amazonaws.services.dynamodbv2.document.PrimaryKey; import java.util.Collection; import org.apache.hadoop.fs.Path;
import com.amazonaws.services.dynamodbv2.document.*; import java.util.*; import org.apache.hadoop.fs.*;
[ "com.amazonaws.services", "java.util", "org.apache.hadoop" ]
com.amazonaws.services; java.util; org.apache.hadoop;
2,312,349
public String exportTemplateAsXml(String key, Locale locale);
String function(String key, Locale locale);
/** * Export a given template as xml * @param key * @param locale * @return */
Export a given template as xml
exportTemplateAsXml
{ "repo_name": "pushyamig/sakai", "path": "emailtemplateservice/api/src/java/org/sakaiproject/emailtemplateservice/service/EmailTemplateService.java", "license": "apache-2.0", "size": 6070 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
952,989
List<GraphvizNode> getGraphvizNodes();
List<GraphvizNode> getGraphvizNodes();
/** * Retrieve a list of nodes in the graph. * * @return A list of nodes in the graph. */
Retrieve a list of nodes in the graph
getGraphvizNodes
{ "repo_name": "johan/closure-compiler", "path": "src/com/google/javascript/jscomp/graph/GraphvizGraph.java", "license": "apache-2.0", "size": 2587 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,281,037
private boolean areDifferent(JournalHeader oldJournal, CalendarEntry element) { if (oldJournal.getClassification().isPrivate() != Classification.PRIVATE.equals(element .getClassification())) { return true; } else if (!oldJournal.getDescription().equals(element.getDescription())) { return true; } else if (!oldJournal.getEndDay().equals(element.getEndDay())) { return true; } else if (!oldJournal.getStartDay().equals(element.getStartDay())) { return true; } else if ((oldJournal.getStartHour() == null) && (element.getStartHour() != null)) { return true; } else if ((oldJournal.getStartHour() != null) && (element.getStartHour() == null)) { return true; } else if ((oldJournal.getStartHour() != null) && (element.getStartHour() != null) && (!oldJournal.getStartHour().equals(element.getStartHour()))) { return true; } else if ((oldJournal.getEndHour() != null) && (element.getEndHour() != null) && (!oldJournal .getEndHour().equals(element.getEndHour()))) { return true; } else if (!oldJournal.getName().equals(element.getName())) { return true; } else if (oldJournal.getPriority().getValue() != element.getPriority()) { return true; } else { return false; } }
boolean function(JournalHeader oldJournal, CalendarEntry element) { if (oldJournal.getClassification().isPrivate() != Classification.PRIVATE.equals(element .getClassification())) { return true; } else if (!oldJournal.getDescription().equals(element.getDescription())) { return true; } else if (!oldJournal.getEndDay().equals(element.getEndDay())) { return true; } else if (!oldJournal.getStartDay().equals(element.getStartDay())) { return true; } else if ((oldJournal.getStartHour() == null) && (element.getStartHour() != null)) { return true; } else if ((oldJournal.getStartHour() != null) && (element.getStartHour() == null)) { return true; } else if ((oldJournal.getStartHour() != null) && (element.getStartHour() != null) && (!oldJournal.getStartHour().equals(element.getStartHour()))) { return true; } else if ((oldJournal.getEndHour() != null) && (element.getEndHour() != null) && (!oldJournal .getEndHour().equals(element.getEndHour()))) { return true; } else if (!oldJournal.getName().equals(element.getName())) { return true; } else if (oldJournal.getPriority().getValue() != element.getPriority()) { return true; } else { return false; } }
/** * Check if event has changed * * @param oldJournal event in Silverpeas * @param element event from external application * @return */
Check if event has changed
areDifferent
{ "repo_name": "ebonnet/Silverpeas-Core", "path": "core-war/src/main/java/org/silverpeas/web/calendar/OutlookSyncCalendarServlet.java", "license": "agpl-3.0", "size": 10919 }
[ "org.silverpeas.core.calendar.model.Classification", "org.silverpeas.core.calendar.model.JournalHeader" ]
import org.silverpeas.core.calendar.model.Classification; import org.silverpeas.core.calendar.model.JournalHeader;
import org.silverpeas.core.calendar.model.*;
[ "org.silverpeas.core" ]
org.silverpeas.core;
2,675,391
private void requestRefLocation(int flags) { TelephonyManager phone = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); final int phoneType = phone.getPhoneType(); if (phoneType == TelephonyManager.PHONE_TYPE_GSM) { GsmCellLocation gsm_cell = (GsmCellLocation) phone.getCellLocation(); if ((gsm_cell != null) && (phone.getNetworkOperator() != null) && (phone.getNetworkOperator().length() > 3)) { int type; int mcc = Integer.parseInt(phone.getNetworkOperator().substring(0,3)); int mnc = Integer.parseInt(phone.getNetworkOperator().substring(3)); int networkType = phone.getNetworkType(); if (networkType == TelephonyManager.NETWORK_TYPE_UMTS || networkType == TelephonyManager.NETWORK_TYPE_HSDPA || networkType == TelephonyManager.NETWORK_TYPE_HSUPA || networkType == TelephonyManager.NETWORK_TYPE_HSPA || networkType == TelephonyManager.NETWORK_TYPE_HSPAP) { type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID; } else { type = AGPS_REF_LOCATION_TYPE_GSM_CELLID; } native_agps_set_ref_location_cellid(type, mcc, mnc, gsm_cell.getLac(), gsm_cell.getCid()); } else { Log.e(TAG,"Error getting cell location info."); } } else if (phoneType == TelephonyManager.PHONE_TYPE_CDMA) { Log.e(TAG, "CDMA not supported."); } }
void function(int flags) { TelephonyManager phone = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); final int phoneType = phone.getPhoneType(); if (phoneType == TelephonyManager.PHONE_TYPE_GSM) { GsmCellLocation gsm_cell = (GsmCellLocation) phone.getCellLocation(); if ((gsm_cell != null) && (phone.getNetworkOperator() != null) && (phone.getNetworkOperator().length() > 3)) { int type; int mcc = Integer.parseInt(phone.getNetworkOperator().substring(0,3)); int mnc = Integer.parseInt(phone.getNetworkOperator().substring(3)); int networkType = phone.getNetworkType(); if (networkType == TelephonyManager.NETWORK_TYPE_UMTS networkType == TelephonyManager.NETWORK_TYPE_HSDPA networkType == TelephonyManager.NETWORK_TYPE_HSUPA networkType == TelephonyManager.NETWORK_TYPE_HSPA networkType == TelephonyManager.NETWORK_TYPE_HSPAP) { type = AGPS_REF_LOCATION_TYPE_UMTS_CELLID; } else { type = AGPS_REF_LOCATION_TYPE_GSM_CELLID; } native_agps_set_ref_location_cellid(type, mcc, mnc, gsm_cell.getLac(), gsm_cell.getCid()); } else { Log.e(TAG,STR); } } else if (phoneType == TelephonyManager.PHONE_TYPE_CDMA) { Log.e(TAG, STR); } }
/** * Called from native code to request reference location info */
Called from native code to request reference location info
requestRefLocation
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/com/android/server/location/GpsLocationProvider.java", "license": "gpl-3.0", "size": 92285 }
[ "android.content.Context", "android.telephony.TelephonyManager", "android.telephony.gsm.GsmCellLocation", "android.util.Log" ]
import android.content.Context; import android.telephony.TelephonyManager; import android.telephony.gsm.GsmCellLocation; import android.util.Log;
import android.content.*; import android.telephony.*; import android.telephony.gsm.*; import android.util.*;
[ "android.content", "android.telephony", "android.util" ]
android.content; android.telephony; android.util;
706,303
protected void putTriggerInfo( InputActionEvent event, int invocationIndex ) { event.setTriggerName( name ); event.setTriggerAllowsRepeats( allowRepeats ); event.setTriggerDevice( getDeviceName() ); event.setTriggerCharacter( '\0' ); event.setTriggerDelta( 0 ); event.setTriggerIndex( 0 ); event.setTriggerPosition( 0 ); event.setTriggerPressed( false ); }
void function( InputActionEvent event, int invocationIndex ) { event.setTriggerName( name ); event.setTriggerAllowsRepeats( allowRepeats ); event.setTriggerDevice( getDeviceName() ); event.setTriggerCharacter( '\0' ); event.setTriggerDelta( 0 ); event.setTriggerIndex( 0 ); event.setTriggerPosition( 0 ); event.setTriggerPressed( false ); }
/** * Called by InputHandler to fill info about the trigger into an event. Commonly overwritten by trigger * implementations to provide additional info. * * @param event where to put the information * @param invocationIndex index to distinct multiple action invocations per trigger activation * @see #getActionInvocationCount() */
Called by InputHandler to fill info about the trigger into an event. Commonly overwritten by trigger implementations to provide additional info
putTriggerInfo
{ "repo_name": "accelazh/ThreeBodyProblem", "path": "lib/jME2_0_1-Stable/src/com/jme/input/ActionTrigger.java", "license": "mit", "size": 11088 }
[ "com.jme.input.action.InputActionEvent" ]
import com.jme.input.action.InputActionEvent;
import com.jme.input.action.*;
[ "com.jme.input" ]
com.jme.input;
1,946,934
public java.util.List<Proxy> select(URI uri) { if (uri == null) { throw new IllegalArgumentException("URI can't be null."); } String protocol = uri.getScheme(); String host = uri.getHost(); if (host == null) { // This is a hack to ensure backward compatibility in two // cases: 1. hostnames contain non-ascii characters, // internationalized domain names. in which case, URI will // return null, see BugID 4957669; 2. Some hostnames can // contain '_' chars even though it's not supposed to be // legal, in which case URI will return null for getHost, // but not for getAuthority() See BugID 4913253 String auth = uri.getAuthority(); if (auth != null) { int i; i = auth.indexOf('@'); if (i >= 0) { auth = auth.substring(i+1); } i = auth.lastIndexOf(':'); if (i >= 0) { auth = auth.substring(0,i); } host = auth; } } if (protocol == null || host == null) { throw new IllegalArgumentException("protocol = "+protocol+" host = "+host); } List<Proxy> proxyl = new ArrayList<Proxy>(1); NonProxyInfo pinfo = null; if ("http".equalsIgnoreCase(protocol)) { pinfo = NonProxyInfo.httpNonProxyInfo; } else if ("https".equalsIgnoreCase(protocol)) { // HTTPS uses the same property as HTTP, for backward // compatibility pinfo = NonProxyInfo.httpNonProxyInfo; } else if ("ftp".equalsIgnoreCase(protocol)) { pinfo = NonProxyInfo.ftpNonProxyInfo; } final String proto = protocol; final NonProxyInfo nprop = pinfo; final String urlhost = host.toLowerCase();
java.util.List<Proxy> function(URI uri) { if (uri == null) { throw new IllegalArgumentException(STR); } String protocol = uri.getScheme(); String host = uri.getHost(); if (host == null) { String auth = uri.getAuthority(); if (auth != null) { int i; i = auth.indexOf('@'); if (i >= 0) { auth = auth.substring(i+1); } i = auth.lastIndexOf(':'); if (i >= 0) { auth = auth.substring(0,i); } host = auth; } } if (protocol == null host == null) { throw new IllegalArgumentException(STR+protocol+STR+host); } List<Proxy> proxyl = new ArrayList<Proxy>(1); NonProxyInfo pinfo = null; if ("http".equalsIgnoreCase(protocol)) { pinfo = NonProxyInfo.httpNonProxyInfo; } else if ("https".equalsIgnoreCase(protocol)) { pinfo = NonProxyInfo.httpNonProxyInfo; } else if ("ftp".equalsIgnoreCase(protocol)) { pinfo = NonProxyInfo.ftpNonProxyInfo; } final String proto = protocol; final NonProxyInfo nprop = pinfo; final String urlhost = host.toLowerCase();
/** * select() method. Where all the hard work is done. * Build a list of proxies depending on URI. * Since we're only providing compatibility with the system properties * from previous releases (see list above), that list will always * contain 1 single proxy, default being NO_PROXY. */
select() method. Where all the hard work is done. Build a list of proxies depending on URI. Since we're only providing compatibility with the system properties from previous releases (see list above), that list will always contain 1 single proxy, default being NO_PROXY
select
{ "repo_name": "openjdk-mirror/jdk7u-jdk", "path": "src/share/classes/sun/net/spi/DefaultProxySelector.java", "license": "gpl-2.0", "size": 15466 }
[ "java.net.Proxy", "java.util.ArrayList", "java.util.List" ]
import java.net.Proxy; import java.util.ArrayList; import java.util.List;
import java.net.*; import java.util.*;
[ "java.net", "java.util" ]
java.net; java.util;
482,012
public void dragLeave(DropTargetEvent event) { setCurrentEvent(event); }
void function(DropTargetEvent event) { setCurrentEvent(event); }
/** * Override of the leave because the for some reason * SWT call it before the drop action when the mouse button is * released. and this normally call the unload (removed from the override) * that set the target to null */
Override of the leave because the for some reason SWT call it before the drop action when the mouse button is released. and this normally call the unload (removed from the override) that set the target to null
dragLeave
{ "repo_name": "OpenSoftwareSolutions/PDFReporter-Studio", "path": "com.jaspersoft.studio/src/com/jaspersoft/studio/editor/report/ReportUnitDropTargetListener.java", "license": "lgpl-3.0", "size": 4978 }
[ "org.eclipse.swt.dnd.DropTargetEvent" ]
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
1,330,335
public synchronized void contextDestroyed(ServletContextEvent event) { servletContext = null; users = null; counter = 0; }
synchronized void function(ServletContextEvent event) { servletContext = null; users = null; counter = 0; }
/** * Set the servletContext, users and counter to null * * @param event The servletContextEvent */
Set the servletContext, users and counter to null
contextDestroyed
{ "repo_name": "bangqu/EShow", "path": "eshow-web-common/src/main/java/cn/org/eshow/webapp/listener/UserCounterListener.java", "license": "apache-2.0", "size": 6709 }
[ "javax.servlet.ServletContextEvent" ]
import javax.servlet.ServletContextEvent;
import javax.servlet.*;
[ "javax.servlet" ]
javax.servlet;
713,712
void notifyCreation(Object obj) throws DAOException;
void notifyCreation(Object obj) throws DAOException;
/** * Notify all the DAO that a new Object has been added. * * @param obj an object */
Notify all the DAO that a new Object has been added
notifyCreation
{ "repo_name": "hgdev-ch/toposuite-android", "path": "app/src/main/java/ch/hgdev/toposuite/dao/interfaces/DAOMapper.java", "license": "gpl-2.0", "size": 704 }
[ "ch.hgdev.toposuite.dao.DAOException" ]
import ch.hgdev.toposuite.dao.DAOException;
import ch.hgdev.toposuite.dao.*;
[ "ch.hgdev.toposuite" ]
ch.hgdev.toposuite;
1,869,032
@ServiceMethod(returns = ReturnType.SINGLE) public Mono<Response<MetadataResults>> getWithResponseAsync(String workspaceId, Context context) { if (this.client.getHost() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getHost() is required and cannot be null.")); } if (workspaceId == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); } final String accept = "application/json"; return service.get(this.client.getHost(), workspaceId, accept, context); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<MetadataResults>> function(String workspaceId, Context context) { if (this.client.getHost() == null) { return Mono.error( new IllegalArgumentException(STR)); } if (workspaceId == null) { return Mono.error(new IllegalArgumentException(STR)); } final String accept = STR; return service.get(this.client.getHost(), workspaceId, accept, context); }
/** * Retrieve the metadata information for the workspace, including its schema, functions, workspace info, categories * etc. * * @param workspaceId ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ErrorResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the metadata response for the app, including available tables, etc. */
Retrieve the metadata information for the workspace, including its schema, functions, workspace info, categories etc
getWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/logs/MetadatasImpl.java", "license": "mit", "size": 16297 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.monitor.query.implementation.logs.models.MetadataResults" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.monitor.query.implementation.logs.models.MetadataResults;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.monitor.query.implementation.logs.models.*;
[ "com.azure.core", "com.azure.monitor" ]
com.azure.core; com.azure.monitor;
2,529,245
IndexRequest createIndexRequest( String index, String docType, XContentType contentType, byte[] document);
IndexRequest createIndexRequest( String index, String docType, XContentType contentType, byte[] document);
/** * Creates an index request to be added to a {@link RequestIndexer}. * Note: the type field has been deprecated since Elasticsearch 7.x and it would not take any effort. */
Creates an index request to be added to a <code>RequestIndexer</code>. Note: the type field has been deprecated since Elasticsearch 7.x and it would not take any effort
createIndexRequest
{ "repo_name": "gyfora/flink", "path": "flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchUpsertTableSinkBase.java", "license": "apache-2.0", "size": 16703 }
[ "org.elasticsearch.action.index.IndexRequest", "org.elasticsearch.common.xcontent.XContentType" ]
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.action.index.*; import org.elasticsearch.common.xcontent.*;
[ "org.elasticsearch.action", "org.elasticsearch.common" ]
org.elasticsearch.action; org.elasticsearch.common;
1,141,674
private void registerSwiftCompileAction( Artifact sourceFile, Artifact objFile, IntermediateArtifacts intermediateArtifacts, ObjcProvider objcProvider) { ObjcConfiguration objcConfiguration = ObjcRuleClasses.objcConfiguration(ruleContext); AppleConfiguration appleConfiguration = ruleContext.getFragment(AppleConfiguration.class); // Compiling a single swift file requires knowledge of all of the other // swift files in the same module. The primary file ({@code sourceFile}) is // compiled to an object file, while the remaining files are used to resolve // symbols (they behave like c/c++ headers in this context). ImmutableSet.Builder<Artifact> otherSwiftSourcesBuilder = ImmutableSet.builder(); for (Artifact otherSourceFile : compilationArtifacts(ruleContext).getSrcs()) { if (ObjcRuleClasses.SWIFT_SOURCES.matches(otherSourceFile.getFilename()) && otherSourceFile != sourceFile) { otherSwiftSourcesBuilder.add(otherSourceFile); } } ImmutableSet<Artifact> otherSwiftSources = otherSwiftSourcesBuilder.build(); CustomCommandLine.Builder commandLine = new CustomCommandLine.Builder() .add(SWIFT) .add("-frontend") .add("-emit-object") .add("-target").add(swiftTarget(appleConfiguration)) .add("-sdk").add(AppleToolchain.sdkDir()) .add("-enable-objc-interop"); if (objcConfiguration.generateDebugSymbols()) { commandLine.add("-g"); } commandLine .add("-Onone") .add("-module-name").add(getModuleName()) .add("-parse-as-library"); addSource("-primary-file", commandLine, objcConfiguration, sourceFile) .addExecPaths(otherSwiftSources) .addExecPath("-o", objFile) .addExecPath("-emit-module-path", intermediateArtifacts.swiftModuleFile(sourceFile)) // The swift compiler will invoke clang itself when compiling module maps. This invocation // does not include the current working directory, causing cwd-relative imports to fail. // Including the current working directory to the header search paths ensures that these // relative imports will work. .add("-Xcc").add("-I."); // Using addExecPathBefore here adds unnecessary quotes around '-Xcc -I', which trips the // compiler. Using two add() calls generates a correctly formed command line. for (PathFragment directory : objcProvider.get(INCLUDE).toList()) { commandLine.add("-Xcc").add(String.format("-I%s", directory.toString())); } ImmutableList.Builder<Artifact> inputHeaders = ImmutableList.<Artifact>builder() .addAll(attributes.hdrs()) .addAll(attributes.textualHdrs()); Optional<Artifact> bridgingHeader = attributes.bridgingHeader(); if (bridgingHeader.isPresent()) { commandLine.addExecPath("-import-objc-header", bridgingHeader.get()); inputHeaders.add(bridgingHeader.get()); } // Import the Objective-C module map. // TODO(bazel-team): Find a way to import the module map directly, instead of the parent // directory? if (objcConfiguration.moduleMapsEnabled()) { PathFragment moduleMapPath = intermediateArtifacts.moduleMap().getArtifact().getExecPath(); commandLine.add("-I").add(moduleMapPath.getParentDirectory().toString()); commandLine.add("-import-underlying-module"); } ruleContext.registerAction( ObjcRuleClasses.spawnOnDarwinActionBuilder(ruleContext) .setMnemonic("SwiftCompile") .setExecutable(xcrunwrapper(ruleContext)) .setCommandLine(commandLine.build()) .addInput(sourceFile) .addInputs(otherSwiftSources) .addInputs(inputHeaders.build()) .addTransitiveInputs(objcProvider.get(HEADER)) .addTransitiveInputs(objcProvider.get(MODULE_MAP)) .addOutput(objFile) .addOutput(intermediateArtifacts.swiftModuleFile(sourceFile)) .build(ruleContext)); }
void function( Artifact sourceFile, Artifact objFile, IntermediateArtifacts intermediateArtifacts, ObjcProvider objcProvider) { ObjcConfiguration objcConfiguration = ObjcRuleClasses.objcConfiguration(ruleContext); AppleConfiguration appleConfiguration = ruleContext.getFragment(AppleConfiguration.class); ImmutableSet.Builder<Artifact> otherSwiftSourcesBuilder = ImmutableSet.builder(); for (Artifact otherSourceFile : compilationArtifacts(ruleContext).getSrcs()) { if (ObjcRuleClasses.SWIFT_SOURCES.matches(otherSourceFile.getFilename()) && otherSourceFile != sourceFile) { otherSwiftSourcesBuilder.add(otherSourceFile); } } ImmutableSet<Artifact> otherSwiftSources = otherSwiftSourcesBuilder.build(); CustomCommandLine.Builder commandLine = new CustomCommandLine.Builder() .add(SWIFT) .add(STR) .add(STR) .add(STR).add(swiftTarget(appleConfiguration)) .add("-sdk").add(AppleToolchain.sdkDir()) .add(STR); if (objcConfiguration.generateDebugSymbols()) { commandLine.add("-g"); } commandLine .add(STR) .add(STR).add(getModuleName()) .add(STR); addSource(STR, commandLine, objcConfiguration, sourceFile) .addExecPaths(otherSwiftSources) .addExecPath("-o", objFile) .addExecPath(STR, intermediateArtifacts.swiftModuleFile(sourceFile)) .add("-Xcc").add("-I."); for (PathFragment directory : objcProvider.get(INCLUDE).toList()) { commandLine.add("-Xcc").add(String.format("-I%s", directory.toString())); } ImmutableList.Builder<Artifact> inputHeaders = ImmutableList.<Artifact>builder() .addAll(attributes.hdrs()) .addAll(attributes.textualHdrs()); Optional<Artifact> bridgingHeader = attributes.bridgingHeader(); if (bridgingHeader.isPresent()) { commandLine.addExecPath(STR, bridgingHeader.get()); inputHeaders.add(bridgingHeader.get()); } if (objcConfiguration.moduleMapsEnabled()) { PathFragment moduleMapPath = intermediateArtifacts.moduleMap().getArtifact().getExecPath(); commandLine.add("-I").add(moduleMapPath.getParentDirectory().toString()); commandLine.add(STR); } ruleContext.registerAction( ObjcRuleClasses.spawnOnDarwinActionBuilder(ruleContext) .setMnemonic(STR) .setExecutable(xcrunwrapper(ruleContext)) .setCommandLine(commandLine.build()) .addInput(sourceFile) .addInputs(otherSwiftSources) .addInputs(inputHeaders.build()) .addTransitiveInputs(objcProvider.get(HEADER)) .addTransitiveInputs(objcProvider.get(MODULE_MAP)) .addOutput(objFile) .addOutput(intermediateArtifacts.swiftModuleFile(sourceFile)) .build(ruleContext)); }
/** * Compiles a single swift file. * * @param sourceFile the artifact to compile * @param objFile the resulting object artifact * @param intermediateArtifacts intermediary artifacts * @param objcProvider ObjcProvider instance for this invocation */
Compiles a single swift file
registerSwiftCompileAction
{ "repo_name": "dinowernli/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java", "license": "apache-2.0", "size": 60692 }
[ "com.google.common.base.Optional", "com.google.common.collect.ImmutableList", "com.google.common.collect.ImmutableSet", "com.google.devtools.build.lib.actions.Artifact", "com.google.devtools.build.lib.analysis.actions.CustomCommandLine", "com.google.devtools.build.lib.rules.apple.AppleConfiguration", "com.google.devtools.build.lib.rules.apple.AppleToolchain", "com.google.devtools.build.lib.rules.objc.XcodeProvider", "com.google.devtools.build.lib.vfs.PathFragment" ]
import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.actions.CustomCommandLine; import com.google.devtools.build.lib.rules.apple.AppleConfiguration; import com.google.devtools.build.lib.rules.apple.AppleToolchain; import com.google.devtools.build.lib.rules.objc.XcodeProvider; import com.google.devtools.build.lib.vfs.PathFragment;
import com.google.common.base.*; import com.google.common.collect.*; import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.actions.*; import com.google.devtools.build.lib.rules.apple.*; import com.google.devtools.build.lib.rules.objc.*; import com.google.devtools.build.lib.vfs.*;
[ "com.google.common", "com.google.devtools" ]
com.google.common; com.google.devtools;
1,739,685
public void writeEntityToNBT(NBTTagCompound tagCompound) { super.writeEntityToNBT(tagCompound); tagCompound.setBoolean("Saddle", this.getSaddled()); }
void function(NBTTagCompound tagCompound) { super.writeEntityToNBT(tagCompound); tagCompound.setBoolean(STR, this.getSaddled()); }
/** * (abstract) Protected helper method to write subclass entity data to NBT. */
(abstract) Protected helper method to write subclass entity data to NBT
writeEntityToNBT
{ "repo_name": "TorchPowered/CraftBloom", "path": "src/net/minecraft/entity/passive/EntityPig.java", "license": "mit", "size": 7659 }
[ "net.minecraft.nbt.NBTTagCompound" ]
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.*;
[ "net.minecraft.nbt" ]
net.minecraft.nbt;
2,841,686
public List getList(int current, String methodValue) throws HibernateSearchException { if (current != 0 && current != 1 && current != 2) { if (current == 3) { if ("previous".equalsIgnoreCase(methodValue)) { removeFromCacheMap(current + 3); if (!(cacheMap.containsKey(Integer.valueOf(1)))) { addFromObject(0, 1); } } } else { remove(current, methodValue); add(current, methodValue); } } return getDataFromCache(current); }
List function(int current, String methodValue) throws HibernateSearchException { if (current != 0 && current != 1 && current != 2) { if (current == 3) { if (STR.equalsIgnoreCase(methodValue)) { removeFromCacheMap(current + 3); if (!(cacheMap.containsKey(Integer.valueOf(1)))) { addFromObject(0, 1); } } } else { remove(current, methodValue); add(current, methodValue); } } return getDataFromCache(current); }
/** * Function to set the cache repository size. we are putting 5 pages in * cache anytime. * * @param current * current page number. * @param methodValue * method value whether it is previous or next. * @throws HibernateSearchException */
Function to set the cache repository size. we are putting 5 pages in cache anytime
getList
{ "repo_name": "maduhu/mifos-head", "path": "application/src/main/java/org/mifos/framework/util/helpers/Cache.java", "license": "apache-2.0", "size": 6935 }
[ "java.util.List", "org.mifos.framework.exceptions.HibernateSearchException" ]
import java.util.List; import org.mifos.framework.exceptions.HibernateSearchException;
import java.util.*; import org.mifos.framework.exceptions.*;
[ "java.util", "org.mifos.framework" ]
java.util; org.mifos.framework;
567,826
public static TickUnitSource createStandardTickUnits(Locale locale) { TickUnits units = new TickUnits(); NumberFormat numberFormat = NumberFormat.getNumberInstance(locale); // we can add the units in any order, the TickUnits collection will // sort them... units.add(new NumberTickUnit(0.0000001, numberFormat, 2)); units.add(new NumberTickUnit(0.000001, numberFormat, 2)); units.add(new NumberTickUnit(0.00001, numberFormat, 2)); units.add(new NumberTickUnit(0.0001, numberFormat, 2)); units.add(new NumberTickUnit(0.001, numberFormat, 2)); units.add(new NumberTickUnit(0.01, numberFormat, 2)); units.add(new NumberTickUnit(0.1, numberFormat, 2)); units.add(new NumberTickUnit(1, numberFormat, 2)); units.add(new NumberTickUnit(10, numberFormat, 2)); units.add(new NumberTickUnit(100, numberFormat, 2)); units.add(new NumberTickUnit(1000, numberFormat, 2)); units.add(new NumberTickUnit(10000, numberFormat, 2)); units.add(new NumberTickUnit(100000, numberFormat, 2)); units.add(new NumberTickUnit(1000000, numberFormat, 2)); units.add(new NumberTickUnit(10000000, numberFormat, 2)); units.add(new NumberTickUnit(100000000, numberFormat, 2)); units.add(new NumberTickUnit(1000000000, numberFormat, 2)); units.add(new NumberTickUnit(10000000000.0, numberFormat, 2)); units.add(new NumberTickUnit(0.00000025, numberFormat, 5)); units.add(new NumberTickUnit(0.0000025, numberFormat, 5)); units.add(new NumberTickUnit(0.000025, numberFormat, 5)); units.add(new NumberTickUnit(0.00025, numberFormat, 5)); units.add(new NumberTickUnit(0.0025, numberFormat, 5)); units.add(new NumberTickUnit(0.025, numberFormat, 5)); units.add(new NumberTickUnit(0.25, numberFormat, 5)); units.add(new NumberTickUnit(2.5, numberFormat, 5)); units.add(new NumberTickUnit(25, numberFormat, 5)); units.add(new NumberTickUnit(250, numberFormat, 5)); units.add(new NumberTickUnit(2500, numberFormat, 5)); units.add(new NumberTickUnit(25000, numberFormat, 5)); units.add(new NumberTickUnit(250000, numberFormat, 5)); units.add(new NumberTickUnit(2500000, numberFormat, 5)); units.add(new NumberTickUnit(25000000, numberFormat, 5)); units.add(new NumberTickUnit(250000000, numberFormat, 5)); units.add(new NumberTickUnit(2500000000.0, numberFormat, 5)); units.add(new NumberTickUnit(25000000000.0, numberFormat, 5)); units.add(new NumberTickUnit(0.0000005, numberFormat, 5)); units.add(new NumberTickUnit(0.000005, numberFormat, 5)); units.add(new NumberTickUnit(0.00005, numberFormat, 5)); units.add(new NumberTickUnit(0.0005, numberFormat, 5)); units.add(new NumberTickUnit(0.005, numberFormat, 5)); units.add(new NumberTickUnit(0.05, numberFormat, 5)); units.add(new NumberTickUnit(0.5, numberFormat, 5)); units.add(new NumberTickUnit(5L, numberFormat, 5)); units.add(new NumberTickUnit(50L, numberFormat, 5)); units.add(new NumberTickUnit(500L, numberFormat, 5)); units.add(new NumberTickUnit(5000L, numberFormat, 5)); units.add(new NumberTickUnit(50000L, numberFormat, 5)); units.add(new NumberTickUnit(500000L, numberFormat, 5)); units.add(new NumberTickUnit(5000000L, numberFormat, 5)); units.add(new NumberTickUnit(50000000L, numberFormat, 5)); units.add(new NumberTickUnit(500000000L, numberFormat, 5)); units.add(new NumberTickUnit(5000000000L, numberFormat, 5)); units.add(new NumberTickUnit(50000000000L, numberFormat, 5)); return units; }
static TickUnitSource function(Locale locale) { TickUnits units = new TickUnits(); NumberFormat numberFormat = NumberFormat.getNumberInstance(locale); units.add(new NumberTickUnit(0.0000001, numberFormat, 2)); units.add(new NumberTickUnit(0.000001, numberFormat, 2)); units.add(new NumberTickUnit(0.00001, numberFormat, 2)); units.add(new NumberTickUnit(0.0001, numberFormat, 2)); units.add(new NumberTickUnit(0.001, numberFormat, 2)); units.add(new NumberTickUnit(0.01, numberFormat, 2)); units.add(new NumberTickUnit(0.1, numberFormat, 2)); units.add(new NumberTickUnit(1, numberFormat, 2)); units.add(new NumberTickUnit(10, numberFormat, 2)); units.add(new NumberTickUnit(100, numberFormat, 2)); units.add(new NumberTickUnit(1000, numberFormat, 2)); units.add(new NumberTickUnit(10000, numberFormat, 2)); units.add(new NumberTickUnit(100000, numberFormat, 2)); units.add(new NumberTickUnit(1000000, numberFormat, 2)); units.add(new NumberTickUnit(10000000, numberFormat, 2)); units.add(new NumberTickUnit(100000000, numberFormat, 2)); units.add(new NumberTickUnit(1000000000, numberFormat, 2)); units.add(new NumberTickUnit(10000000000.0, numberFormat, 2)); units.add(new NumberTickUnit(0.00000025, numberFormat, 5)); units.add(new NumberTickUnit(0.0000025, numberFormat, 5)); units.add(new NumberTickUnit(0.000025, numberFormat, 5)); units.add(new NumberTickUnit(0.00025, numberFormat, 5)); units.add(new NumberTickUnit(0.0025, numberFormat, 5)); units.add(new NumberTickUnit(0.025, numberFormat, 5)); units.add(new NumberTickUnit(0.25, numberFormat, 5)); units.add(new NumberTickUnit(2.5, numberFormat, 5)); units.add(new NumberTickUnit(25, numberFormat, 5)); units.add(new NumberTickUnit(250, numberFormat, 5)); units.add(new NumberTickUnit(2500, numberFormat, 5)); units.add(new NumberTickUnit(25000, numberFormat, 5)); units.add(new NumberTickUnit(250000, numberFormat, 5)); units.add(new NumberTickUnit(2500000, numberFormat, 5)); units.add(new NumberTickUnit(25000000, numberFormat, 5)); units.add(new NumberTickUnit(250000000, numberFormat, 5)); units.add(new NumberTickUnit(2500000000.0, numberFormat, 5)); units.add(new NumberTickUnit(25000000000.0, numberFormat, 5)); units.add(new NumberTickUnit(0.0000005, numberFormat, 5)); units.add(new NumberTickUnit(0.000005, numberFormat, 5)); units.add(new NumberTickUnit(0.00005, numberFormat, 5)); units.add(new NumberTickUnit(0.0005, numberFormat, 5)); units.add(new NumberTickUnit(0.005, numberFormat, 5)); units.add(new NumberTickUnit(0.05, numberFormat, 5)); units.add(new NumberTickUnit(0.5, numberFormat, 5)); units.add(new NumberTickUnit(5L, numberFormat, 5)); units.add(new NumberTickUnit(50L, numberFormat, 5)); units.add(new NumberTickUnit(500L, numberFormat, 5)); units.add(new NumberTickUnit(5000L, numberFormat, 5)); units.add(new NumberTickUnit(50000L, numberFormat, 5)); units.add(new NumberTickUnit(500000L, numberFormat, 5)); units.add(new NumberTickUnit(5000000L, numberFormat, 5)); units.add(new NumberTickUnit(50000000L, numberFormat, 5)); units.add(new NumberTickUnit(500000000L, numberFormat, 5)); units.add(new NumberTickUnit(5000000000L, numberFormat, 5)); units.add(new NumberTickUnit(50000000000L, numberFormat, 5)); return units; }
/** * Creates a collection of standard tick units. The supplied locale is * used to create the number formatter (a localised instance of * <code>NumberFormat</code>). * <P> * If you don't like these defaults, create your own instance of * {@link TickUnits} and then pass it to the * <code>setStandardTickUnits()</code> method. * * @param locale the locale. * * @return A tick unit collection. * * @see #setStandardTickUnits(TickUnitSource) */
Creates a collection of standard tick units. The supplied locale is used to create the number formatter (a localised instance of <code>NumberFormat</code>). If you don't like these defaults, create your own instance of <code>TickUnits</code> and then pass it to the <code>setStandardTickUnits()</code> method
createStandardTickUnits
{ "repo_name": "apetresc/JFreeChart", "path": "src/main/java/org/jfree/chart/axis/NumberAxis.java", "license": "lgpl-2.1", "size": 56557 }
[ "java.text.NumberFormat", "java.util.Locale" ]
import java.text.NumberFormat; import java.util.Locale;
import java.text.*; import java.util.*;
[ "java.text", "java.util" ]
java.text; java.util;
472,281
EReference getClassContent__Comment_1();
EReference getClassContent__Comment_1();
/** * Returns the meta object for the containment reference list '{@link cruise.umple.umple.ClassContent_#getComment_1 <em>Comment 1</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Comment 1</em>'. * @see cruise.umple.umple.ClassContent_#getComment_1() * @see #getClassContent_() * @generated */
Returns the meta object for the containment reference list '<code>cruise.umple.umple.ClassContent_#getComment_1 Comment 1</code>'.
getClassContent__Comment_1
{ "repo_name": "ahmedvc/umple", "path": "cruise.umple.xtext/src-gen/cruise/umple/umple/UmplePackage.java", "license": "mit", "size": 485842 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
392,006
T transform(TypeDescription instrumentedType, T target); enum NoOp implements Transformer<Object> { INSTANCE;
T transform(TypeDescription instrumentedType, T target); enum NoOp implements Transformer<Object> { INSTANCE;
/** * Transforms the supplied target. * * @param instrumentedType The instrumented type that declares the target being transformed. * @param target The target entity that is being transformed. * @return The transformed instance. */
Transforms the supplied target
transform
{ "repo_name": "DALDEI/byte-buddy", "path": "byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/Transformer.java", "license": "apache-2.0", "size": 23320 }
[ "net.bytebuddy.description.type.TypeDescription" ]
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.description.type.*;
[ "net.bytebuddy.description" ]
net.bytebuddy.description;
202,289
public void saveCssAttrs(String... cssProps) { for (Element e : elements) { for (String a : cssProps) { data(OLD_DATA_PREFIX + a, getStyleImpl().curCSS(e, a, false)); } } }
void function(String... cssProps) { for (Element e : elements) { for (String a : cssProps) { data(OLD_DATA_PREFIX + a, getStyleImpl().curCSS(e, a, false)); } } }
/** * Restore a set of previously saved Css properties in every matched element. */
Restore a set of previously saved Css properties in every matched element
saveCssAttrs
{ "repo_name": "stori-es/stori_es", "path": "dashboard/src/main/java/com/google/gwt/query/client/GQuery.java", "license": "apache-2.0", "size": 177285 }
[ "com.google.gwt.dom.client.Element" ]
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
2,364,352
public static void Scharr(Mat src, Mat dst, int ddepth, int dx, int dy, double scale, double delta, int borderType) { Scharr_0(src.nativeObj, dst.nativeObj, ddepth, dx, dy, scale, delta, borderType); return; }
static void function(Mat src, Mat dst, int ddepth, int dx, int dy, double scale, double delta, int borderType) { Scharr_0(src.nativeObj, dst.nativeObj, ddepth, dx, dy, scale, delta, borderType); return; }
/** * <p>Calculates the first x- or y- image derivative using Scharr operator.</p> * * <p>The function computes the first x- or y- spatial image derivative using the * Scharr operator. The call</p> * * <p><em>Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)</em></p> * * <p>is equivalent to</p> * * <p><em>Sobel(src, dst, ddepth, dx, dy, CV_SCHARR, scale, delta, * borderType).</em></p> * * @param src input image. * @param dst output image of the same size and the same number of channels as * <code>src</code>. * @param ddepth output image depth (see "Sobel" for the list of supported * combination of <code>src.depth()</code> and <code>ddepth</code>). * @param dx order of the derivative x. * @param dy order of the derivative y. * @param scale optional scale factor for the computed derivative values; by * default, no scaling is applied (see "getDerivKernels" for details). * @param delta optional delta value that is added to the results prior to * storing them in <code>dst</code>. * @param borderType pixel extrapolation method (see "borderInterpolate" for * details). * * @see <a href="http://docs.opencv.org/modules/imgproc/doc/filtering.html#scharr">org.opencv.imgproc.Imgproc.Scharr</a> * @see org.opencv.core.Core#cartToPolar */
Calculates the first x- or y- image derivative using Scharr operator. The function computes the first x- or y- spatial image derivative using the Scharr operator. The call Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType) is equivalent to Sobel(src, dst, ddepth, dx, dy, CV_SCHARR, scale, delta, borderType)
Scharr
{ "repo_name": "OSCAV/cvRecognition", "path": "src/cvrecognition/openCVLibrary249/src/main/java/org/opencv/imgproc/Imgproc.java", "license": "gpl-3.0", "size": 420353 }
[ "org.opencv.core.Mat" ]
import org.opencv.core.Mat;
import org.opencv.core.*;
[ "org.opencv.core" ]
org.opencv.core;
2,719,397
public Builder columnByMetadata( String columnName, String serializableTypeString, @Nullable String metadataKey, boolean isVirtual) { return columnByMetadata( columnName, DataTypes.of(serializableTypeString), metadataKey, isVirtual); } /** * Declares that the given column should serve as an event-time (i.e. rowtime) attribute and * specifies a corresponding watermark strategy as an expression. * * <p>The column must be of type {@code TIMESTAMP(3)} or {@code TIMESTAMP_LTZ(3)} and be a * top-level column in the schema. It may be a computed column. * * <p>The watermark generation expression is evaluated by the framework for every record * during runtime. The framework will periodically emit the largest generated watermark. If * the current watermark is still identical to the previous one, or is null, or the value of * the returned watermark is smaller than that of the last emitted one, then no new * watermark will be emitted. A watermark is emitted in an interval defined by the * configuration. * * <p>Any scalar expression can be used for declaring a watermark strategy for * in-memory/temporary tables. However, currently, only SQL expressions can be persisted in * a catalog. The expression's return data type must be {@code TIMESTAMP(3)}. User-defined * functions (also defined in different catalogs) are supported. * * <p>Example: {@code .watermark("ts", $("ts).minus(lit(5).seconds())}
Builder function( String columnName, String serializableTypeString, @Nullable String metadataKey, boolean isVirtual) { return columnByMetadata( columnName, DataTypes.of(serializableTypeString), metadataKey, isVirtual); } /** * Declares that the given column should serve as an event-time (i.e. rowtime) attribute and * specifies a corresponding watermark strategy as an expression. * * <p>The column must be of type {@code TIMESTAMP(3)} or {@code TIMESTAMP_LTZ(3)} and be a * top-level column in the schema. It may be a computed column. * * <p>The watermark generation expression is evaluated by the framework for every record * during runtime. The framework will periodically emit the largest generated watermark. If * the current watermark is still identical to the previous one, or is null, or the value of * the returned watermark is smaller than that of the last emitted one, then no new * watermark will be emitted. A watermark is emitted in an interval defined by the * configuration. * * <p>Any scalar expression can be used for declaring a watermark strategy for * in-memory/temporary tables. However, currently, only SQL expressions can be persisted in * a catalog. The expression's return data type must be {@code TIMESTAMP(3)}. User-defined * functions (also defined in different catalogs) are supported. * * <p>Example: {@code .watermark("ts", $("ts).minus(lit(5).seconds())}
/** * Declares a metadata column that is appended to this schema. * * <p>See {@link #columnByMetadata(String, AbstractDataType, String, boolean)} for a * detailed explanation. * * <p>This method uses a type string that can be easily persisted in a durable catalog. * * @param columnName column name * @param serializableTypeString data type of the column * @param metadataKey identifying metadata key, if null the column name will be used as * metadata key * @param isVirtual whether the column should be persisted or not */
Declares a metadata column that is appended to this schema. See <code>#columnByMetadata(String, AbstractDataType, String, boolean)</code> for a detailed explanation. This method uses a type string that can be easily persisted in a durable catalog
columnByMetadata
{ "repo_name": "rmetzger/flink", "path": "flink-table/flink-table-common/src/main/java/org/apache/flink/table/api/Schema.java", "license": "apache-2.0", "size": 40275 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,210,522
public void longPressView(View v, int x, int y) { int location[] = getAbsoluteLocationFromRelative(v, x, y); int absoluteX = location[0]; int absoluteY = location[1]; longPress(absoluteX, absoluteY); }
void function(View v, int x, int y) { int location[] = getAbsoluteLocationFromRelative(v, x, y); int absoluteX = location[0]; int absoluteY = location[1]; longPress(absoluteX, absoluteY); }
/** * Sends (synchronously) a long press to the View at the specified coordinates. * * @param v The view to be clicked. * @param x Relative x location to v * @param y Relative y location to v */
Sends (synchronously) a long press to the View at the specified coordinates
longPressView
{ "repo_name": "imesong/chromium_webview", "path": "testshell/javatests/src/org/chromium/content/browser/test/util/TouchCommon.java", "license": "bsd-3-clause", "size": 8106 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,286,630
public ComplexObsHandler getHandler(Obs obs) throws APIException;
ComplexObsHandler function(Obs obs) throws APIException;
/** * Get the ComplexObsHandler associated with a complex observation * Returns the ComplexObsHandler. * Returns null if the Obs.isComplexObs() is false or there is an error * instantiating the handler class. * * @param obs A complex Obs. * @return ComplexObsHandler for the complex Obs. or null on error. * @since 1.12 * @should get handler associated with complex observation */
Get the ComplexObsHandler associated with a complex observation Returns the ComplexObsHandler. Returns null if the Obs.isComplexObs() is false or there is an error instantiating the handler class
getHandler
{ "repo_name": "jamesfeshner/openmrs-module", "path": "api/src/main/java/org/openmrs/api/ObsService.java", "license": "mpl-2.0", "size": 22252 }
[ "org.openmrs.Obs", "org.openmrs.obs.ComplexObsHandler" ]
import org.openmrs.Obs; import org.openmrs.obs.ComplexObsHandler;
import org.openmrs.*; import org.openmrs.obs.*;
[ "org.openmrs", "org.openmrs.obs" ]
org.openmrs; org.openmrs.obs;
2,408,464
public T caseEnumValue(EnumValue object) { return null; }
T function(EnumValue object) { return null; }
/** * Returns the result of interpreting the object as an instance of '<em>Enum Value</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Enum Value</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) * @generated */
Returns the result of interpreting the object as an instance of 'Enum Value'. This implementation returns null; returning a non-null result will terminate the switch.
caseEnumValue
{ "repo_name": "RobertWalter83/DialogScriptDSL", "path": "plugins/de.unidue.ecg.characterScript/src-gen/de/unidue/ecg/characterScript/characterScript/util/CharacterScriptSwitch.java", "license": "apache-2.0", "size": 17301 }
[ "de.unidue.ecg.characterScript.characterScript.EnumValue" ]
import de.unidue.ecg.characterScript.characterScript.EnumValue;
import de.unidue.ecg.*;
[ "de.unidue.ecg" ]
de.unidue.ecg;
243,619
public final Uri insert(Uri url, ContentValues values) { IContentProvider provider = acquireProvider(url); if (provider == null) { throw new IllegalArgumentException("Unknown URL " + url); } try { long startTime = SystemClock.uptimeMillis(); Uri createdRow = provider.insert(url, values); long durationMillis = SystemClock.uptimeMillis() - startTime; maybeLogUpdateToEventLog(durationMillis, url, "insert", null ); return createdRow; } catch (RemoteException e) { return null; } finally { releaseProvider(provider); } }
final Uri function(Uri url, ContentValues values) { IContentProvider provider = acquireProvider(url); if (provider == null) { throw new IllegalArgumentException(STR + url); } try { long startTime = SystemClock.uptimeMillis(); Uri createdRow = provider.insert(url, values); long durationMillis = SystemClock.uptimeMillis() - startTime; maybeLogUpdateToEventLog(durationMillis, url, STR, null ); return createdRow; } catch (RemoteException e) { return null; } finally { releaseProvider(provider); } }
/** * Inserts a row into a table at the given URL. * * If the content provider supports transactions the insertion will be atomic. * * @param url The URL of the table to insert into. * @param values The initial values for the newly inserted row. The key is the column name for * the field. Passing an empty ContentValues will create an empty row. * @return the URL of the newly created row. */
Inserts a row into a table at the given URL. If the content provider supports transactions the insertion will be atomic
insert
{ "repo_name": "lynnlyc/for-honeynet-reviewers", "path": "CallbackDroid/android-environment/src/base/core/java/android/content/ContentResolver.java", "license": "gpl-3.0", "size": 59446 }
[ "android.net.Uri", "android.os.RemoteException", "android.os.SystemClock" ]
import android.net.Uri; import android.os.RemoteException; import android.os.SystemClock;
import android.net.*; import android.os.*;
[ "android.net", "android.os" ]
android.net; android.os;
2,414,280
@Test public void nestedZipInZipInputStream() throws Exception { ICloseableDirectory outer = FileSystem.getFSRoot(new FileInputStream("fileSystemTest/outer.zip")); try { IFile innerFile = outer.getFile("app2.zip"); assertNotNull(innerFile); IDirectory inner = innerFile.convertNested(); assertNotNull(inner); File desiredFile = new File(new File(getTestResourceDir(), "/app1"), "META-INF/APPLICATION.MF"); // no size information when stream reading :( runBasicDirTest(inner, "app2.zip/", -1, desiredFile.lastModified()); runBasicDirTest(inner.toCloseable(), "app2.zip/", desiredFile.length(), desiredFile.lastModified()); } finally { outer.close(); Field f = outer.getClass().getDeclaredField("tempFile"); f.setAccessible(true); assertFalse(((File)f.get(outer)).exists()); } }
void function() throws Exception { ICloseableDirectory outer = FileSystem.getFSRoot(new FileInputStream(STR)); try { IFile innerFile = outer.getFile(STR); assertNotNull(innerFile); IDirectory inner = innerFile.convertNested(); assertNotNull(inner); File desiredFile = new File(new File(getTestResourceDir(), "/app1"), STR); runBasicDirTest(inner, STR, -1, desiredFile.lastModified()); runBasicDirTest(inner.toCloseable(), STR, desiredFile.length(), desiredFile.lastModified()); } finally { outer.close(); Field f = outer.getClass().getDeclaredField(STR); f.setAccessible(true); assertFalse(((File)f.get(outer)).exists()); } }
/** * Make sure that the operations work with zip files inside other zip files. Performance is not going to be great though :) */
Make sure that the operations work with zip files inside other zip files. Performance is not going to be great though :)
nestedZipInZipInputStream
{ "repo_name": "WouterBanckenACA/aries", "path": "util/util-r42/src/test/java/org/apache/aries/util/filesystem/FileSystemTest.java", "license": "apache-2.0", "size": 17083 }
[ "java.io.File", "java.io.FileInputStream", "java.lang.reflect.Field", "org.junit.Assert" ]
import java.io.File; import java.io.FileInputStream; import java.lang.reflect.Field; import org.junit.Assert;
import java.io.*; import java.lang.reflect.*; import org.junit.*;
[ "java.io", "java.lang", "org.junit" ]
java.io; java.lang; org.junit;
1,826,738
public static BgpAttrOpaqueNode read(ChannelBuffer cb) throws BgpParseException { byte[] opaqueNodeAttribute; short lsAttrLength = cb.readShort(); if (cb.readableBytes() < lsAttrLength) { Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR, lsAttrLength); } opaqueNodeAttribute = new byte[lsAttrLength]; cb.readBytes(opaqueNodeAttribute); return BgpAttrOpaqueNode.of(opaqueNodeAttribute); }
static BgpAttrOpaqueNode function(ChannelBuffer cb) throws BgpParseException { byte[] opaqueNodeAttribute; short lsAttrLength = cb.readShort(); if (cb.readableBytes() < lsAttrLength) { Validation.validateLen(BgpErrorType.UPDATE_MESSAGE_ERROR, BgpErrorType.ATTRIBUTE_LENGTH_ERROR, lsAttrLength); } opaqueNodeAttribute = new byte[lsAttrLength]; cb.readBytes(opaqueNodeAttribute); return BgpAttrOpaqueNode.of(opaqueNodeAttribute); }
/** * Reads the Opaque Node Properties. * * @param cb ChannelBuffer * @return object of BgpAttrOpaqueNode * @throws BgpParseException while parsing BgpAttrOpaqueNode */
Reads the Opaque Node Properties
read
{ "repo_name": "donNewtonAlpha/onos", "path": "protocols/bgp/bgpio/src/main/java/org/onosproject/bgpio/types/attr/BgpAttrOpaqueNode.java", "license": "apache-2.0", "size": 3973 }
[ "org.jboss.netty.buffer.ChannelBuffer", "org.onosproject.bgpio.exceptions.BgpParseException", "org.onosproject.bgpio.types.BgpErrorType", "org.onosproject.bgpio.util.Validation" ]
import org.jboss.netty.buffer.ChannelBuffer; import org.onosproject.bgpio.exceptions.BgpParseException; import org.onosproject.bgpio.types.BgpErrorType; import org.onosproject.bgpio.util.Validation;
import org.jboss.netty.buffer.*; import org.onosproject.bgpio.exceptions.*; import org.onosproject.bgpio.types.*; import org.onosproject.bgpio.util.*;
[ "org.jboss.netty", "org.onosproject.bgpio" ]
org.jboss.netty; org.onosproject.bgpio;
1,504,389
public static boolean onGenericMotionEvent(MotionEvent event) { if (!isGamepadEvent(event)) return false; return getInstance().handleMotionEvent(event); }
static boolean function(MotionEvent event) { if (!isGamepadEvent(event)) return false; return getInstance().handleMotionEvent(event); }
/** * Handles motion events from the gamepad devices. * @return True if the event has been consumed. */
Handles motion events from the gamepad devices
onGenericMotionEvent
{ "repo_name": "guorendong/iridium-browser-ubuntu", "path": "content/public/android/java/src/org/chromium/content/browser/input/GamepadList.java", "license": "bsd-3-clause", "size": 11062 }
[ "android.view.MotionEvent" ]
import android.view.MotionEvent;
import android.view.*;
[ "android.view" ]
android.view;
1,610,337
void readToken() throws IOException { Token t; int ch; enlarging: while (true) { t = tokenMatches(); if (t != null) break enlarging; else { ch = reader.read(); readerPosition++; if (ch == ETX) ch = ' '; if (ch < 0) { if (buffer.length() == 0) { queue.add(eofToken()); return; } else { if (buffer.charAt(buffer.length() - 1) != ETX) buffer.append(ETX, readerPosition++); else { // Discard terminating ETX buffer.setLength(buffer.length() - 1); if (buffer.length() > 0) { t = new Token(OTHER, buffer.toString(), buffer.getLocation(0, buffer.length()) ); queue.add(t); buffer.setLength(0); } return; } } } else buffer.append((char) ch, readerPosition); } } }
void readToken() throws IOException { Token t; int ch; enlarging: while (true) { t = tokenMatches(); if (t != null) break enlarging; else { ch = reader.read(); readerPosition++; if (ch == ETX) ch = ' '; if (ch < 0) { if (buffer.length() == 0) { queue.add(eofToken()); return; } else { if (buffer.charAt(buffer.length() - 1) != ETX) buffer.append(ETX, readerPosition++); else { buffer.setLength(buffer.length() - 1); if (buffer.length() > 0) { t = new Token(OTHER, buffer.toString(), buffer.getLocation(0, buffer.length()) ); queue.add(t); buffer.setLength(0); } return; } } } else buffer.append((char) ch, readerPosition); } } }
/** * Read next token from the reader, add it to the queue */
Read next token from the reader, add it to the queue
readToken
{ "repo_name": "taciano-perez/JamVM-PH", "path": "src/classpath/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java", "license": "gpl-2.0", "size": 9653 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,036,728
void validate(Factory factory) throws ForbiddenException, ServerException;
void validate(Factory factory) throws ForbiddenException, ServerException;
/** * Validates given factory by checking the current user is granted to edit the factory. * * @param factory * factory object to validate * @throws ForbiddenException * when the current user is not granted to edit the factory * @throws ServerException * when any other error occurs */
Validates given factory by checking the current user is granted to edit the factory
validate
{ "repo_name": "Mirage20/che", "path": "wsmaster/che-core-api-factory/src/main/java/org/eclipse/che/api/factory/server/FactoryEditValidator.java", "license": "epl-1.0", "size": 1364 }
[ "org.eclipse.che.api.core.ForbiddenException", "org.eclipse.che.api.core.ServerException", "org.eclipse.che.api.core.model.factory.Factory" ]
import org.eclipse.che.api.core.ForbiddenException; import org.eclipse.che.api.core.ServerException; import org.eclipse.che.api.core.model.factory.Factory;
import org.eclipse.che.api.core.*; import org.eclipse.che.api.core.model.factory.*;
[ "org.eclipse.che" ]
org.eclipse.che;
2,152,636
public Map<String[], String> getWarnings(String entityId) { return m_warnings != null ? m_warnings.get(entityId) : null; }
Map<String[], String> function(String entityId) { return m_warnings != null ? m_warnings.get(entityId) : null; }
/** * Returns the warning messages for the given entity.<p> * * @param entityId the entity id * * @return the warning messages for the given entity */
Returns the warning messages for the given entity
getWarnings
{ "repo_name": "sbonoc/opencms-core", "path": "src/org/opencms/acacia/shared/CmsValidationResult.java", "license": "lgpl-2.1", "size": 4534 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,887,769
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(TextLocation.class)) { case MappingPackage.TEXT_LOCATION__START_OFFSET: case MappingPackage.TEXT_LOCATION__END_OFFSET: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(TextLocation.class)) { case MappingPackage.TEXT_LOCATION__START_OFFSET: case MappingPackage.TEXT_LOCATION__END_OFFSET: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached children and * by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc * --> <!-- end-user-doc --> * * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "ModelWriter/Source", "path": "plugins/org.eclipse.mylyn.docs.intent.mapping.emf.edit/src-gen/org/eclipse/mylyn/docs/intent/mapping/provider/TextLocationItemProvider.java", "license": "epl-1.0", "size": 5177 }
[ "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification", "org.eclipse.mylyn.docs.intent.mapping.MappingPackage", "org.eclipse.mylyn.docs.intent.mapping.TextLocation" ]
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.mylyn.docs.intent.mapping.MappingPackage; import org.eclipse.mylyn.docs.intent.mapping.TextLocation;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; import org.eclipse.mylyn.docs.intent.mapping.*;
[ "org.eclipse.emf", "org.eclipse.mylyn" ]
org.eclipse.emf; org.eclipse.mylyn;
61,797
//------------------------------------------------------------------------- public LogContext withError (final Throwable aError) { Validate.isTrue(m_aParent != null, "Error can be defined only, in case you called forLevel() before."); m_aError = aError; return this; }
LogContext function (final Throwable aError) { Validate.isTrue(m_aParent != null, STR); m_aError = aError; return this; }
/** define an error (exception) for a new spawned log level. * * Can be called as often as you want ... * but the last error will be used only for logging. * * @param aError [IN] * the error. * * @return the current log item for adding further details. */
define an error (exception) for a new spawned log level. Can be called as often as you want ... but the last error will be used only for logging
withError
{ "repo_name": "andreas-schluens-asdev/asdk", "path": "tools-logging/src/main/java/net/as_development/asdk/tools/logging/impl/LogContext.java", "license": "unlicense", "size": 17098 }
[ "org.apache.commons.lang3.Validate" ]
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.*;
[ "org.apache.commons" ]
org.apache.commons;
126,593
void clear() { if (mViewTypeCount == 1) { final ArrayList<View> scrap = mCurrentScrap; final int scrapCount = scrap.size(); for (int i = 0; i < scrapCount; i++) { removeDetachedView(scrap.remove(scrapCount - 1 - i), false); } } else { final int typeCount = mViewTypeCount; for (int i = 0; i < typeCount; i++) { final ArrayList<View> scrap = mScrapViews[i]; final int scrapCount = scrap.size(); for (int j = 0; j < scrapCount; j++) { removeDetachedView(scrap.remove(scrapCount - 1 - j), false); } } } }
void clear() { if (mViewTypeCount == 1) { final ArrayList<View> scrap = mCurrentScrap; final int scrapCount = scrap.size(); for (int i = 0; i < scrapCount; i++) { removeDetachedView(scrap.remove(scrapCount - 1 - i), false); } } else { final int typeCount = mViewTypeCount; for (int i = 0; i < typeCount; i++) { final ArrayList<View> scrap = mScrapViews[i]; final int scrapCount = scrap.size(); for (int j = 0; j < scrapCount; j++) { removeDetachedView(scrap.remove(scrapCount - 1 - j), false); } } } }
/** * Clears the scrap heap. */
Clears the scrap heap
clear
{ "repo_name": "ogunwale/yaps", "path": "yaps/src/com/jess/ui/TwoWayAbsListView.java", "license": "mit", "size": 162391 }
[ "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;
1,683,718
public void pauseScheduledJob(String name) { ISchedulingService service = (ISchedulingService) ScopeUtils.getScopeService(scope, ISchedulingService.class, QuartzSchedulingService.class, false); service.pauseScheduledJob(name); }
void function(String name) { ISchedulingService service = (ISchedulingService) ScopeUtils.getScopeService(scope, ISchedulingService.class, QuartzSchedulingService.class, false); service.pauseScheduledJob(name); }
/** * Pauses a scheduled job * * @param name * Scheduled job name */
Pauses a scheduled job
pauseScheduledJob
{ "repo_name": "cantren/red5-server", "path": "src/main/java/org/red5/server/adapter/MultiThreadedApplicationAdapter.java", "license": "apache-2.0", "size": 46463 }
[ "org.red5.server.api.scheduling.ISchedulingService", "org.red5.server.scheduling.QuartzSchedulingService", "org.red5.server.util.ScopeUtils" ]
import org.red5.server.api.scheduling.ISchedulingService; import org.red5.server.scheduling.QuartzSchedulingService; import org.red5.server.util.ScopeUtils;
import org.red5.server.api.scheduling.*; import org.red5.server.scheduling.*; import org.red5.server.util.*;
[ "org.red5.server" ]
org.red5.server;
117,909
@Test (timeout=180000) public void testFixAssignmentsAndNoHdfsChecking() throws Exception { TableName table = TableName.valueOf("testFixAssignmentsAndNoHdfsChecking"); try { setupTable(table); assertEquals(ROWKEYS.length, countRows()); // Mess it up by closing a region deleteRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes("A"), Bytes.toBytes("B"), true, false, false, false, HRegionInfo.DEFAULT_REPLICA_ID); // verify there is no other errors HBaseFsck hbck = doFsck(conf, false); assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.NOT_DEPLOYED, ERROR_CODE.HOLE_IN_REGION_CHAIN}); // verify that noHdfsChecking report the same errors HBaseFsck fsck = new HBaseFsck(conf, hbfsckExecutorService); fsck.connect(); fsck.setDisplayFullReport(); // i.e. -details fsck.setTimeLag(0); fsck.setCheckHdfs(false); fsck.onlineHbck(); assertErrors(fsck, new ERROR_CODE[] { ERROR_CODE.NOT_DEPLOYED, ERROR_CODE.HOLE_IN_REGION_CHAIN}); fsck.close(); // verify that fixAssignments works fine with noHdfsChecking fsck = new HBaseFsck(conf, hbfsckExecutorService); fsck.connect(); fsck.setDisplayFullReport(); // i.e. -details fsck.setTimeLag(0); fsck.setCheckHdfs(false); fsck.setFixAssignments(true); fsck.onlineHbck(); assertTrue(fsck.shouldRerun()); fsck.onlineHbck(); assertNoErrors(fsck); assertEquals(ROWKEYS.length, countRows()); fsck.close(); } finally { cleanupTable(table); } }
@Test (timeout=180000) void function() throws Exception { TableName table = TableName.valueOf(STR); try { setupTable(table); assertEquals(ROWKEYS.length, countRows()); deleteRegion(conf, tbl.getTableDescriptor(), Bytes.toBytes("A"), Bytes.toBytes("B"), true, false, false, false, HRegionInfo.DEFAULT_REPLICA_ID); HBaseFsck hbck = doFsck(conf, false); assertErrors(hbck, new ERROR_CODE[] { ERROR_CODE.NOT_DEPLOYED, ERROR_CODE.HOLE_IN_REGION_CHAIN}); HBaseFsck fsck = new HBaseFsck(conf, hbfsckExecutorService); fsck.connect(); fsck.setDisplayFullReport(); fsck.setTimeLag(0); fsck.setCheckHdfs(false); fsck.onlineHbck(); assertErrors(fsck, new ERROR_CODE[] { ERROR_CODE.NOT_DEPLOYED, ERROR_CODE.HOLE_IN_REGION_CHAIN}); fsck.close(); fsck = new HBaseFsck(conf, hbfsckExecutorService); fsck.connect(); fsck.setDisplayFullReport(); fsck.setTimeLag(0); fsck.setCheckHdfs(false); fsck.setFixAssignments(true); fsck.onlineHbck(); assertTrue(fsck.shouldRerun()); fsck.onlineHbck(); assertNoErrors(fsck); assertEquals(ROWKEYS.length, countRows()); fsck.close(); } finally { cleanupTable(table); } }
/** * Test -noHdfsChecking option can detect and fix assignments issue. */
Test -noHdfsChecking option can detect and fix assignments issue
testFixAssignmentsAndNoHdfsChecking
{ "repo_name": "joshelser/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java", "license": "apache-2.0", "size": 98829 }
[ "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.TableName", "org.apache.hadoop.hbase.util.hbck.HbckTestingUtil", "org.junit.Assert", "org.junit.Test" ]
import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.util.hbck.HbckTestingUtil; import org.junit.Assert; import org.junit.Test;
import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.util.hbck.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
509,540
protected void createDataSourceInstance() throws SQLException { PoolingDataSource pds = new PoolingDataSource(connectionPool); pds.setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); pds.setLogWriter(logWriter); dataSource = pds; }
void function() throws SQLException { PoolingDataSource pds = new PoolingDataSource(connectionPool); pds.setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed()); pds.setLogWriter(logWriter); dataSource = pds; }
/** * Creates the actual data source instance. This method only exists so * subclasses can replace the implementation class. * * @throws SQLException if unable to create a datasource instance */
Creates the actual data source instance. This method only exists so subclasses can replace the implementation class
createDataSourceInstance
{ "repo_name": "WilliamRen/bbossgroups-3.5", "path": "bboss-persistent/src-jdk6/com/frameworkset/commons/dbcp/BasicDataSource.java", "license": "apache-2.0", "size": 58050 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,906,592
public Iterator<OutlierList> iterator() { return this.outlierLists.iterator(); }
Iterator<OutlierList> function() { return this.outlierLists.iterator(); }
/** * Returns an iterator for the outlier lists. * * @return An iterator. */
Returns an iterator for the outlier lists
iterator
{ "repo_name": "oskopek/jfreechart-fse", "path": "src/main/java/org/jfree/chart/renderer/OutlierListCollection.java", "license": "lgpl-2.1", "size": 6107 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,628,180
public void addInfos(List<DeviceAlarm> infos){ this.infos.clear(); for (DeviceAlarm deviceAlarm : infos) { this.infos.add(deviceAlarm); } adapter.notifyDataSetInvalidated(); }
void function(List<DeviceAlarm> infos){ this.infos.clear(); for (DeviceAlarm deviceAlarm : infos) { this.infos.add(deviceAlarm); } adapter.notifyDataSetInvalidated(); }
/** * update alarm infos datas * @param infos */
update alarm infos datas
addInfos
{ "repo_name": "gizwits/Gizwits-AirPurifier_Android", "path": "src/com/gizwits/airpurifier/activity/advanced/AlarmFragment.java", "license": "mit", "size": 1432 }
[ "com.gizwits.framework.entity.DeviceAlarm", "java.util.List" ]
import com.gizwits.framework.entity.DeviceAlarm; import java.util.List;
import com.gizwits.framework.entity.*; import java.util.*;
[ "com.gizwits.framework", "java.util" ]
com.gizwits.framework; java.util;
1,232,962
public String start(String path) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); super.start(printWriter, path); return stringWriter.toString(); }
String function(String path) { StringWriter stringWriter = new StringWriter(); PrintWriter printWriter = new PrintWriter(stringWriter); super.start(printWriter, path); return stringWriter.toString(); }
/** * Start the web application at the specified context path. * * @see ManagerServlet#start(PrintWriter, String) * * @param path Context path of the application to be started * @return message String */
Start the web application at the specified context path
start
{ "repo_name": "plumer/codana", "path": "tomcat_files/6.0.43/HTMLManagerServlet.java", "license": "mit", "size": 47560 }
[ "java.io.PrintWriter", "java.io.StringWriter" ]
import java.io.PrintWriter; import java.io.StringWriter;
import java.io.*;
[ "java.io" ]
java.io;
768,040
public Cursor fetchAllUnreadPsuedo() { String sql = "SELECT 'Unread' as " + KEY_ROWID + "" + " UNION SELECT 'Read' as " + KEY_ROWID + ""; return mDb.rawQuery(sql, new String[]{}); }
Cursor function() { String sql = STR + KEY_ROWID + STR UNION SELECT 'Read' as STR"; return mDb.rawQuery(sql, new String[]{}); }
/** * This will return a list consisting of "Read" and "Unread" * * @return Cursor over all the psuedo list */
This will return a list consisting of "Read" and "Unread"
fetchAllUnreadPsuedo
{ "repo_name": "jgaldo/Book-Catalogue", "path": "src/com/eleybourn/bookcatalogue/CatalogueDBAdapter.java", "license": "gpl-3.0", "size": 238306 }
[ "android.database.Cursor" ]
import android.database.Cursor;
import android.database.*;
[ "android.database" ]
android.database;
487,234
public DateTime timeCreated() { return this.timeCreated; }
DateTime function() { return this.timeCreated; }
/** * Get the time when the disk was created. * * @return the timeCreated value */
Get the time when the disk was created
timeCreated
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2018_09_30/src/main/java/com/microsoft/azure/management/compute/v2018_09_30/implementation/DiskInner.java", "license": "mit", "size": 10989 }
[ "org.joda.time.DateTime" ]
import org.joda.time.DateTime;
import org.joda.time.*;
[ "org.joda.time" ]
org.joda.time;
149,016
@ResponseStatus(HttpStatus.OK) @RequestMapping(value = UrlHelpers.CERTIFIED_USER_TEST_RESPONSE_WITH_ID, method = RequestMethod.DELETE) public void deleteQuizResponse( @RequestParam(value = AuthorizationConstants.USER_ID_PARAM) Long userId, @PathVariable(value = ID_PATH_VARIABLE) Long responseId ) throws NotFoundException { serviceProvider.getCertifiedUserService().deleteQuizResponse(userId, responseId); }
@ResponseStatus(HttpStatus.OK) @RequestMapping(value = UrlHelpers.CERTIFIED_USER_TEST_RESPONSE_WITH_ID, method = RequestMethod.DELETE) void function( @RequestParam(value = AuthorizationConstants.USER_ID_PARAM) Long userId, @PathVariable(value = ID_PATH_VARIABLE) Long responseId ) throws NotFoundException { serviceProvider.getCertifiedUserService().deleteQuizResponse(userId, responseId); }
/** * Delete a test response. Note: This service is available to Synapse administrators only. * @param userId * @param responseId * @throws NotFoundException */
Delete a test response. Note: This service is available to Synapse administrators only
deleteQuizResponse
{ "repo_name": "hhu94/Synapse-Repository-Services", "path": "services/repository/src/main/java/org/sagebionetworks/repo/web/controller/CertifiedUserController.java", "license": "apache-2.0", "size": 6629 }
[ "org.sagebionetworks.repo.model.AuthorizationConstants", "org.sagebionetworks.repo.web.NotFoundException", "org.sagebionetworks.repo.web.UrlHelpers", "org.springframework.http.HttpStatus", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod", "org.springframework.web.bind.annotation.RequestParam", "org.springframework.web.bind.annotation.ResponseStatus" ]
import org.sagebionetworks.repo.model.AuthorizationConstants; import org.sagebionetworks.repo.web.NotFoundException; import org.sagebionetworks.repo.web.UrlHelpers; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseStatus;
import org.sagebionetworks.repo.model.*; import org.sagebionetworks.repo.web.*; import org.springframework.http.*; import org.springframework.web.bind.annotation.*;
[ "org.sagebionetworks.repo", "org.springframework.http", "org.springframework.web" ]
org.sagebionetworks.repo; org.springframework.http; org.springframework.web;
1,249,963
@RequestMapping("/getFilteredCSWRecords.do") public ModelAndView getFilteredCSWRecords( @RequestParam(value="cswServiceId", required=false) String cswServiceId, @RequestParam(value="anyText", required=false) String anyText, @RequestParam(value="westBoundLongitude", required=false) Double westBoundLongitude, @RequestParam(value="eastBoundLongitude", required=false) Double eastBoundLongitude, @RequestParam(value="northBoundLatitude", required=false) Double northBoundLatitude, @RequestParam(value="southBoundLatitude", required=false) Double southBoundLatitude, @RequestParam(value="keyword", required=false) String[] keywords, @RequestParam(value="keywordMatchType", required=false) KeywordMatchType keywordMatchType, @RequestParam(value="capturePlatform", required=false) String capturePlatform, @RequestParam(value="sensor", required=false) String sensor, @RequestParam(value="limit", required=false) Integer maxRecords, @RequestParam(value="start", required=false, defaultValue="1") Integer startPosition) { //CSW uses a 1 based index if (startPosition == null) { startPosition = 1; } else { startPosition = startPosition + 1; } //Firstly generate our filter FilterBoundingBox filterBbox = attemptParseBBox(westBoundLongitude, eastBoundLongitude, northBoundLatitude, southBoundLatitude); CSWGetDataRecordsFilter filter = new CSWGetDataRecordsFilter(anyText, filterBbox, keywords, capturePlatform, sensor, keywordMatchType); log.debug(String.format("filter '%1$s'", filter)); //Then make our requests to all of CSW's List<CSWRecord> records = null; int matchedResults = 0; try { //We may be requesting from all CSW's or just a specific one if (cswServiceId == null || cswServiceId.isEmpty()) { records = new ArrayList<CSWRecord>(); CSWGetRecordResponse[] responses = cswFilterService.getFilteredRecords(filter, maxRecords == null ? DEFAULT_MAX_RECORDS : maxRecords); for (CSWGetRecordResponse response : responses) { records.addAll(response.getRecords()); matchedResults += response.getRecordsMatched(); } } else { CSWGetRecordResponse response = cswFilterService.getFilteredRecords(cswServiceId, filter, maxRecords == null ? DEFAULT_MAX_RECORDS : maxRecords, startPosition); records = response.getRecords(); matchedResults = response.getRecordsMatched(); } return generateJSONResponseMAV(records.toArray(new CSWRecord[records.size()]), matchedResults); } catch (Exception ex) { log.warn(String.format("Error fetching filtered records for filter '%1$s'", filter), ex); return generateJSONResponseMAV(false, null, "Error fetching filtered records"); } }
@RequestMapping(STR) ModelAndView function( @RequestParam(value=STR, required=false) String cswServiceId, @RequestParam(value=STR, required=false) String anyText, @RequestParam(value=STR, required=false) Double westBoundLongitude, @RequestParam(value=STR, required=false) Double eastBoundLongitude, @RequestParam(value=STR, required=false) Double northBoundLatitude, @RequestParam(value=STR, required=false) Double southBoundLatitude, @RequestParam(value=STR, required=false) String[] keywords, @RequestParam(value=STR, required=false) KeywordMatchType keywordMatchType, @RequestParam(value=STR, required=false) String capturePlatform, @RequestParam(value=STR, required=false) String sensor, @RequestParam(value="limit", required=false) Integer maxRecords, @RequestParam(value="start", required=false, defaultValue="1") Integer startPosition) { if (startPosition == null) { startPosition = 1; } else { startPosition = startPosition + 1; } FilterBoundingBox filterBbox = attemptParseBBox(westBoundLongitude, eastBoundLongitude, northBoundLatitude, southBoundLatitude); CSWGetDataRecordsFilter filter = new CSWGetDataRecordsFilter(anyText, filterBbox, keywords, capturePlatform, sensor, keywordMatchType); log.debug(String.format(STR, filter)); List<CSWRecord> records = null; int matchedResults = 0; try { if (cswServiceId == null cswServiceId.isEmpty()) { records = new ArrayList<CSWRecord>(); CSWGetRecordResponse[] responses = cswFilterService.getFilteredRecords(filter, maxRecords == null ? DEFAULT_MAX_RECORDS : maxRecords); for (CSWGetRecordResponse response : responses) { records.addAll(response.getRecords()); matchedResults += response.getRecordsMatched(); } } else { CSWGetRecordResponse response = cswFilterService.getFilteredRecords(cswServiceId, filter, maxRecords == null ? DEFAULT_MAX_RECORDS : maxRecords, startPosition); records = response.getRecords(); matchedResults = response.getRecordsMatched(); } return generateJSONResponseMAV(records.toArray(new CSWRecord[records.size()]), matchedResults); } catch (Exception ex) { log.warn(String.format(STR, filter), ex); return generateJSONResponseMAV(false, null, STR); } }
/** * Gets a list of CSWRecord view objects filtered by the specified values from all internal * CSW's * @param cswServiceId [Optional] The ID of a CSWService to query (if omitted ALL CSWServices will be queried) * @param westBoundLongitude [Optional] Spatial bbox constraint * @param eastBoundLongitude [Optional] Spatial bbox constraint * @param northBoundLatitude [Optional] Spatial bbox constraint * @param southBoundLatitude [Optional] Spatial bbox constraint * @param keywords [Optional] One or more keywords to filter by * @param keywordMatchType [Optional] how the keyword list will be matched against records * @param capturePlatform [Optional] A capture platform filter * @param sensor [Optional] A sensor filter * @param startPosition [Optional] 0 based index indicating what index to start reading records from (only applicable if cswServiceId is specified) * @return */
Gets a list of CSWRecord view objects filtered by the specified values from all internal CSW's
getFilteredCSWRecords
{ "repo_name": "AuScope/GA-eResearch-Portal", "path": "src/main/java/org/auscope/portal/server/web/controllers/CSWFilterController.java", "license": "gpl-3.0", "size": 10593 }
[ "java.util.ArrayList", "java.util.List", "org.auscope.portal.csw.CSWGetDataRecordsFilter", "org.auscope.portal.csw.CSWGetRecordResponse", "org.auscope.portal.csw.record.CSWRecord", "org.auscope.portal.server.domain.filter.FilterBoundingBox", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestParam", "org.springframework.web.servlet.ModelAndView" ]
import java.util.ArrayList; import java.util.List; import org.auscope.portal.csw.CSWGetDataRecordsFilter; import org.auscope.portal.csw.CSWGetRecordResponse; import org.auscope.portal.csw.record.CSWRecord; import org.auscope.portal.server.domain.filter.FilterBoundingBox; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.servlet.ModelAndView;
import java.util.*; import org.auscope.portal.csw.*; import org.auscope.portal.csw.record.*; import org.auscope.portal.server.domain.filter.*; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.*;
[ "java.util", "org.auscope.portal", "org.springframework.web" ]
java.util; org.auscope.portal; org.springframework.web;
2,012,368
public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) { mViewPagerPageChangeListener = listener; }
void function(ViewPager.OnPageChangeListener listener) { mViewPagerPageChangeListener = listener; }
/** * Set the {@link ViewPager.OnPageChangeListener}. When using {@link SlidingTabLayout} you are * required to set any {@link ViewPager.OnPageChangeListener} through this method. This is so * that the layout can update it's scroll position correctly. * * @see ViewPager#setOnPageChangeListener(ViewPager.OnPageChangeListener) */
Set the <code>ViewPager.OnPageChangeListener</code>. When using <code>SlidingTabLayout</code> you are required to set any <code>ViewPager.OnPageChangeListener</code> through this method. This is so that the layout can update it's scroll position correctly
setOnPageChangeListener
{ "repo_name": "CE-KMITL-OOAD-2015/make-me-smile", "path": "madeMeSmile/app/src/main/java/tabs/SlidingTabLayout.java", "license": "apache-2.0", "size": 11102 }
[ "android.support.v4.view.ViewPager" ]
import android.support.v4.view.ViewPager;
import android.support.v4.view.*;
[ "android.support" ]
android.support;
54,469
public static AbstractFileSaver getSaverForFile(File file) { return getSaverForFile(file.getAbsolutePath()); }
static AbstractFileSaver function(File file) { return getSaverForFile(file.getAbsolutePath()); }
/** * tries to determine the saver to use for this kind of file, returns * null if none can be found. * * @param file the file to return a converter for * @return the converter if one was found, null otherwise */
tries to determine the saver to use for this kind of file, returns null if none can be found
getSaverForFile
{ "repo_name": "goddesss/DataModeling", "path": "src/weka/core/converters/ConverterUtils.java", "license": "gpl-2.0", "size": 34301 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
602,683
Set<SubscribedAPI> getSubscribedAPIsByApplicationId(Subscriber subscriber, int applicationId, String groupingId) throws APIManagementException;
Set<SubscribedAPI> getSubscribedAPIsByApplicationId(Subscriber subscriber, int applicationId, String groupingId) throws APIManagementException;
/** * Returns a set of SubscribedAPIs filtered by the given application id. * * @param subscriber Subscriber * @param applicationId Application Id * @param groupingId the groupId of the subscriber * @return Set<API> * @throws APIManagementException if failed to get API for subscriber */
Returns a set of SubscribedAPIs filtered by the given application id
getSubscribedAPIsByApplicationId
{ "repo_name": "bhathiya/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/APIConsumer.java", "license": "apache-2.0", "size": 44201 }
[ "java.util.Set", "org.wso2.carbon.apimgt.api.model.SubscribedAPI", "org.wso2.carbon.apimgt.api.model.Subscriber" ]
import java.util.Set; import org.wso2.carbon.apimgt.api.model.SubscribedAPI; import org.wso2.carbon.apimgt.api.model.Subscriber;
import java.util.*; import org.wso2.carbon.apimgt.api.model.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
1,751,064
@Override public void setHost(String host) throws URISyntaxException { super.setHost(host); }
void function(String host) throws URISyntaxException { super.setHost(host); }
/** * The URI of the MQTT broker to connect too - this component also supports SSL - e.g. ssl://127.0.0.1:8883 */
The URI of the MQTT broker to connect too - this component also supports SSL - e.g. ssl://127.0.0.1:8883
setHost
{ "repo_name": "askannon/camel", "path": "components/camel-mqtt/src/main/java/org/apache/camel/component/mqtt/MQTTConfiguration.java", "license": "apache-2.0", "size": 18180 }
[ "java.net.URISyntaxException" ]
import java.net.URISyntaxException;
import java.net.*;
[ "java.net" ]
java.net;
1,179,066
public void setNextElementAction(IDisplayableAction nextElementAction) { this.nextElementAction = nextElementAction; }
void function(IDisplayableAction nextElementAction) { this.nextElementAction = nextElementAction; }
/** * Sets next element action. * * @param nextElementAction * the next element action */
Sets next element action
setNextElementAction
{ "repo_name": "jspresso/jspresso-ce", "path": "remote/application/src/main/java/org/jspresso/framework/view/remote/mobile/MobileRemoteViewFactory.java", "license": "lgpl-3.0", "size": 49973 }
[ "org.jspresso.framework.view.action.IDisplayableAction" ]
import org.jspresso.framework.view.action.IDisplayableAction;
import org.jspresso.framework.view.action.*;
[ "org.jspresso.framework" ]
org.jspresso.framework;
2,706,019
public synchronized Relationship addWeakRelationship(Primitive type, Primitive target, float correctnessMultiplier) { return addWeakRelationship(this.network.createVertex(type), this.network.createVertex(target), correctnessMultiplier); }
synchronized Relationship function(Primitive type, Primitive target, float correctnessMultiplier) { return addWeakRelationship(this.network.createVertex(type), this.network.createVertex(target), correctnessMultiplier); }
/** * Add the relation of the relationship type to the target vertex. * The correctness decreases the correctness of the relation. */
Add the relation of the relationship type to the target vertex. The correctness decreases the correctness of the relation
addWeakRelationship
{ "repo_name": "BOTlibre/BOTlibre", "path": "micro-ai-engine/android/source/org/botlibre/knowledge/BasicVertex.java", "license": "epl-1.0", "size": 152940 }
[ "org.botlibre.api.knowledge.Relationship" ]
import org.botlibre.api.knowledge.Relationship;
import org.botlibre.api.knowledge.*;
[ "org.botlibre.api" ]
org.botlibre.api;
909,977
protected LabelPeer createLabel(Label label) { return new SwingLabelPeer(label); }
LabelPeer function(Label label) { return new SwingLabelPeer(label); }
/** * Creates a SwingLabelPeer. * * @param label the AWT label * * @return the Swing label peer */
Creates a SwingLabelPeer
createLabel
{ "repo_name": "SanDisk-Open-Source/SSD_Dashboard", "path": "uefi/gcc/gcc-4.6.3/libjava/classpath/gnu/java/awt/peer/swing/SwingToolkit.java", "license": "gpl-2.0", "size": 4677 }
[ "java.awt.Label", "java.awt.peer.LabelPeer" ]
import java.awt.Label; import java.awt.peer.LabelPeer;
import java.awt.*; import java.awt.peer.*;
[ "java.awt" ]
java.awt;
1,097,614
private void checkNotFinished() throws CmsUgcException { if (m_finished) { String message = Messages.get().container(Messages.ERR_FORM_SESSION_ALREADY_FINISHED_0).key( getCmsObject().getRequestContext().getLocale()); throw new CmsUgcException(CmsUgcConstants.ErrorCode.errInvalidAction, message); } }
void function() throws CmsUgcException { if (m_finished) { String message = Messages.get().container(Messages.ERR_FORM_SESSION_ALREADY_FINISHED_0).key( getCmsObject().getRequestContext().getLocale()); throw new CmsUgcException(CmsUgcConstants.ErrorCode.errInvalidAction, message); } }
/** * Checks that the session is not finished, and throws an exception otherwise.<p> * * @throws CmsUgcException if the session is finished */
Checks that the session is not finished, and throws an exception otherwise
checkNotFinished
{ "repo_name": "gallardo/opencms-core", "path": "src/org/opencms/ugc/CmsUgcSession.java", "license": "lgpl-2.1", "size": 29917 }
[ "org.opencms.ugc.shared.CmsUgcConstants", "org.opencms.ugc.shared.CmsUgcException" ]
import org.opencms.ugc.shared.CmsUgcConstants; import org.opencms.ugc.shared.CmsUgcException;
import org.opencms.ugc.shared.*;
[ "org.opencms.ugc" ]
org.opencms.ugc;
976,820
public static <T extends Component> void setComponentsPropertyDeep(List<T> components, String propertyPath, Object propertyValue) { if (components == null || components.isEmpty()) { return; } Set<Class<?>> skipTypes = null; @SuppressWarnings("unchecked") Queue<LifecycleElement> elementQueue = RecycleUtils.getInstance( LinkedList.class); elementQueue.addAll(components); try { while (!elementQueue.isEmpty()) { LifecycleElement currentElement = elementQueue.poll(); if (currentElement == null) { continue; } elementQueue.addAll(ViewLifecycleUtils.getElementsForLifecycle(currentElement).values()); Class<?> componentClass = currentElement.getClass(); if (skipTypes != null && skipTypes.contains(componentClass)) { continue; } if (!ObjectPropertyUtils.isWritableProperty(currentElement, propertyPath)) { if (skipTypes == null) { skipTypes = new HashSet<Class<?>>(); } skipTypes.add(componentClass); continue; } ObjectPropertyUtils.setPropertyValue(currentElement, propertyPath, propertyValue, true); } } finally { elementQueue.clear(); RecycleUtils.recycle(elementQueue); } }
static <T extends Component> void function(List<T> components, String propertyPath, Object propertyValue) { if (components == null components.isEmpty()) { return; } Set<Class<?>> skipTypes = null; @SuppressWarnings(STR) Queue<LifecycleElement> elementQueue = RecycleUtils.getInstance( LinkedList.class); elementQueue.addAll(components); try { while (!elementQueue.isEmpty()) { LifecycleElement currentElement = elementQueue.poll(); if (currentElement == null) { continue; } elementQueue.addAll(ViewLifecycleUtils.getElementsForLifecycle(currentElement).values()); Class<?> componentClass = currentElement.getClass(); if (skipTypes != null && skipTypes.contains(componentClass)) { continue; } if (!ObjectPropertyUtils.isWritableProperty(currentElement, propertyPath)) { if (skipTypes == null) { skipTypes = new HashSet<Class<?>>(); } skipTypes.add(componentClass); continue; } ObjectPropertyUtils.setPropertyValue(currentElement, propertyPath, propertyValue, true); } } finally { elementQueue.clear(); RecycleUtils.recycle(elementQueue); } }
/** * Traverse a component tree, setting a property on all components for which the property is writable. * * @param <T> component type * @param <T> component type * @param components The components to traverse. * @param propertyPath The property path to set. * @param propertyValue The property value to set. * @see ObjectPropertyUtils#isWritableProperty(Object, String) * @see ObjectPropertyUtils#setPropertyValue(Object, String, Object) */
Traverse a component tree, setting a property on all components for which the property is writable
setComponentsPropertyDeep
{ "repo_name": "ricepanda/rice-git3", "path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/util/ComponentUtils.java", "license": "apache-2.0", "size": 39745 }
[ "java.util.HashSet", "java.util.LinkedList", "java.util.List", "java.util.Queue", "java.util.Set", "org.kuali.rice.krad.uif.component.Component", "org.kuali.rice.krad.uif.lifecycle.ViewLifecycleUtils" ]
import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Queue; import java.util.Set; import org.kuali.rice.krad.uif.component.Component; import org.kuali.rice.krad.uif.lifecycle.ViewLifecycleUtils;
import java.util.*; import org.kuali.rice.krad.uif.component.*; import org.kuali.rice.krad.uif.lifecycle.*;
[ "java.util", "org.kuali.rice" ]
java.util; org.kuali.rice;
1,756,499
public void callMappingOnView(CarpaccioAction action, View view, Object mappedObject) { if (action.isCallMapping()) { CarpaccioLogger.d(TAG, "callMappingOnView mapping=" + mappedObject + " action=" + action.getCompleteCall() + " view=" + view.getClass().getName()); String arg = action.getArgs()[0]; //only map the first argument String objectName = null; String call; if (arg.contains(".")) { //"$user.getName()" call = arg.substring(1, arg.length()); // "user.getName()" objectName = call.substring(0, arg.indexOf(".") - 1); // "user" } else { objectName = arg.substring(1, arg.length()); // "user" call = objectName; // "user" } //if you already have the object if (mappedObject != null) { String value = evaluate(mappedObject, call); CarpaccioLogger.d(TAG, "callMappingOnView evaluate(" + call + ")" + " on " + mappedObject.getClass().getName() + " returned " + value); action.setValues(new String[]{value}); //TODO mappingManagerCallback.callActionOnView(action, view); } else { //add to waiting List<MappingWaiting> waitings = mappingWaitings.get(objectName); //["user"] = List<MappingWaiting> if (waitings == null) waitings = new ArrayList<>(); waitings.add(new MappingWaiting(view, action, call, objectName)); CarpaccioLogger.d(TAG, "added to waiting " + call + " for " + view.getClass().getName()); mappingWaitings.put(objectName, waitings); } } }
void function(CarpaccioAction action, View view, Object mappedObject) { if (action.isCallMapping()) { CarpaccioLogger.d(TAG, STR + mappedObject + STR + action.getCompleteCall() + STR + view.getClass().getName()); String arg = action.getArgs()[0]; String objectName = null; String call; if (arg.contains(".")) { call = arg.substring(1, arg.length()); objectName = call.substring(0, arg.indexOf(".") - 1); } else { objectName = arg.substring(1, arg.length()); call = objectName; } if (mappedObject != null) { String value = evaluate(mappedObject, call); CarpaccioLogger.d(TAG, STR + call + ")" + STR + mappedObject.getClass().getName() + STR + value); action.setValues(new String[]{value}); mappingManagerCallback.callActionOnView(action, view); } else { List<MappingWaiting> waitings = mappingWaitings.get(objectName); if (waitings == null) waitings = new ArrayList<>(); waitings.add(new MappingWaiting(view, action, call, objectName)); CarpaccioLogger.d(TAG, STR + call + STR + view.getClass().getName()); mappingWaitings.put(objectName, waitings); } } }
/** * Called when a view loaded and call a mapping function * * @param view the calling view * @param mappedObject If available, the object to map with the view. Else add the view to mappingWaitings */
Called when a view loaded and call a mapping function
callMappingOnView
{ "repo_name": "tianyutingxy/Carpaccio", "path": "carpaccio/src/main/java/com/github/florent37/carpaccio/mapping/MappingManager.java", "license": "apache-2.0", "size": 7629 }
[ "android.view.View", "com.github.florent37.carpaccio.CarpaccioLogger", "com.github.florent37.carpaccio.model.CarpaccioAction", "java.util.ArrayList", "java.util.List" ]
import android.view.View; import com.github.florent37.carpaccio.CarpaccioLogger; import com.github.florent37.carpaccio.model.CarpaccioAction; import java.util.ArrayList; import java.util.List;
import android.view.*; import com.github.florent37.carpaccio.*; import com.github.florent37.carpaccio.model.*; import java.util.*;
[ "android.view", "com.github.florent37", "java.util" ]
android.view; com.github.florent37; java.util;
1,660,698
public IndexMetadata getIndexMetadata() { return indexMetadata; } public int getNumberOfShards() { return numberOfShards; }
IndexMetadata function() { return indexMetadata; } public int getNumberOfShards() { return numberOfShards; }
/** * Returns the current IndexMetadata for this index */
Returns the current IndexMetadata for this index
getIndexMetadata
{ "repo_name": "HonzaKral/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/IndexSettings.java", "license": "apache-2.0", "size": 44817 }
[ "org.elasticsearch.cluster.metadata.IndexMetadata" ]
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.*;
[ "org.elasticsearch.cluster" ]
org.elasticsearch.cluster;
158,787
private void roundRobinAssignment(Cluster cluster, List<HRegionInfo> regions, List<HRegionInfo> unassignedRegions, List<ServerName> servers, Map<ServerName, List<HRegionInfo>> assignments) { int numServers = servers.size(); int numRegions = regions.size(); int max = (int) Math.ceil((float) numRegions / numServers); int serverIdx = 0; if (numServers > 1) { serverIdx = RANDOM.nextInt(numServers); } int regionIdx = 0; for (int j = 0; j < numServers; j++) { ServerName server = servers.get((j + serverIdx) % numServers); List<HRegionInfo> serverRegions = new ArrayList<>(max); for (int i = regionIdx; i < numRegions; i += numServers) { HRegionInfo region = regions.get(i % numRegions); if (cluster.wouldLowerAvailability(region, server)) { unassignedRegions.add(region); } else { serverRegions.add(region); cluster.doAssignRegion(region, server); } } assignments.put(server, serverRegions); regionIdx++; } }
void function(Cluster cluster, List<HRegionInfo> regions, List<HRegionInfo> unassignedRegions, List<ServerName> servers, Map<ServerName, List<HRegionInfo>> assignments) { int numServers = servers.size(); int numRegions = regions.size(); int max = (int) Math.ceil((float) numRegions / numServers); int serverIdx = 0; if (numServers > 1) { serverIdx = RANDOM.nextInt(numServers); } int regionIdx = 0; for (int j = 0; j < numServers; j++) { ServerName server = servers.get((j + serverIdx) % numServers); List<HRegionInfo> serverRegions = new ArrayList<>(max); for (int i = regionIdx; i < numRegions; i += numServers) { HRegionInfo region = regions.get(i % numRegions); if (cluster.wouldLowerAvailability(region, server)) { unassignedRegions.add(region); } else { serverRegions.add(region); cluster.doAssignRegion(region, server); } } assignments.put(server, serverRegions); regionIdx++; } }
/** * Round robin a list of regions to a list of servers */
Round robin a list of regions to a list of servers
roundRobinAssignment
{ "repo_name": "gustavoanatoly/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java", "license": "apache-2.0", "size": 65936 }
[ "java.util.ArrayList", "java.util.List", "java.util.Map", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.ServerName" ]
import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName;
import java.util.*; import org.apache.hadoop.hbase.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
2,381,525
public Map<HmDatapointInfo, HmDatapoint> getDatapoints() { return datapoints; }
Map<HmDatapointInfo, HmDatapoint> function() { return datapoints; }
/** * Returns all datapoints. */
Returns all datapoints
getDatapoints
{ "repo_name": "beowulfe/openhab2", "path": "addons/binding/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/HmChannel.java", "license": "epl-1.0", "size": 4011 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
276,670
protected char scanWhitespace(StringBuffer result) throws IOException { for (;;) { char ch = this.readChar(); switch (ch) { case ' ': case '\t': case '\n': result.append(ch); case '\r': break; default: return ch; } } }
char function(StringBuffer result) throws IOException { for (;;) { char ch = this.readChar(); switch (ch) { case ' ': case '\t': case '\n': result.append(ch); case '\r': break; default: return ch; } } }
/** * This method scans an identifier from the current reader. * The scanned whitespace is appended to <code>result</code>. * * @return the next character following the whitespace. * * </dl><dl><dt><b>Preconditions:</b></dt><dd> * <ul><li><code>result != null</code> * </ul></dd></dl> */
This method scans an identifier from the current reader. The scanned whitespace is appended to <code>result</code>
scanWhitespace
{ "repo_name": "TheProjecter/sharedmind", "path": "freemind/main/XMLElement.java", "license": "gpl-2.0", "size": 102420 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,861,058
@Test public void whenRemoveAllWithKeysIsUsed_thenNearCacheShouldBeInvalidated_onNearCacheAdapter() { whenEntryIsRemoved_thenNearCacheShouldBeInvalidated(false, DataStructureMethods.REMOVE_ALL_WITH_KEYS); }
void function() { whenEntryIsRemoved_thenNearCacheShouldBeInvalidated(false, DataStructureMethods.REMOVE_ALL_WITH_KEYS); }
/** * Checks that the Near Cache is eventually invalidated when {@link DataStructureMethods#REMOVE_ALL_WITH_KEYS)} is used. */
Checks that the Near Cache is eventually invalidated when <code>DataStructureMethods#REMOVE_ALL_WITH_KEYS)</code> is used
whenRemoveAllWithKeysIsUsed_thenNearCacheShouldBeInvalidated_onNearCacheAdapter
{ "repo_name": "emrahkocaman/hazelcast", "path": "hazelcast/src/test/java/com/hazelcast/internal/nearcache/AbstractNearCacheBasicTest.java", "license": "apache-2.0", "size": 46469 }
[ "com.hazelcast.internal.adapter.DataStructureAdapter" ]
import com.hazelcast.internal.adapter.DataStructureAdapter;
import com.hazelcast.internal.adapter.*;
[ "com.hazelcast.internal" ]
com.hazelcast.internal;
657,310
public static String getPrev(String type, String iconName) { ArrayList<String> tempList = getListForType(type); if (tempList.isEmpty()) { return iconName; } else { int idx = iconName.equals("") ? tempList.size() - 1 : tempList.indexOf(iconName) - 1; return tempList.get(idx < 0 ? tempList.size() - 1 : idx); } }
static String function(String type, String iconName) { ArrayList<String> tempList = getListForType(type); if (tempList.isEmpty()) { return iconName; } else { int idx = iconName.equals("") ? tempList.size() - 1 : tempList.indexOf(iconName) - 1; return tempList.get(idx < 0 ? tempList.size() - 1 : idx); } }
/** * Returns name of previous tile in list. */
Returns name of previous tile in list
getPrev
{ "repo_name": "Nuchaz/carpentersblocks", "path": "src/main/java/com/carpentersblocks/util/handler/DesignHandler.java", "license": "lgpl-2.1", "size": 8727 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,593,996
@Override public Adapter createPublishEventMediatorAdapter() { if (publishEventMediatorItemProvider == null) { publishEventMediatorItemProvider = new PublishEventMediatorItemProvider(this); } return publishEventMediatorItemProvider; } protected PublishEventMediatorInputConnectorItemProvider publishEventMediatorInputConnectorItemProvider;
Adapter function() { if (publishEventMediatorItemProvider == null) { publishEventMediatorItemProvider = new PublishEventMediatorItemProvider(this); } return publishEventMediatorItemProvider; } protected PublishEventMediatorInputConnectorItemProvider publishEventMediatorInputConnectorItemProvider;
/** * This creates an adapter for a {@link org.wso2.developerstudio.eclipse.gmf.esb.PublishEventMediator}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This creates an adapter for a <code>org.wso2.developerstudio.eclipse.gmf.esb.PublishEventMediator</code>.
createPublishEventMediatorAdapter
{ "repo_name": "prabushi/devstudio-tooling-esb", "path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/EsbItemProviderAdapterFactory.java", "license": "apache-2.0", "size": 339597 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,300,282
@ApiModelProperty(value = "Link to the next subset of resources qualified. \n " + "Empty if no more resources are to be returned.") @JsonProperty("next") public String getNext() { return next; }
@ApiModelProperty(value = STR + STR) @JsonProperty("next") String function() { return next; }
/** * Link to the next subset of resources qualified. \nEmpty if no more resources are to be returned. */
Link to the next subset of resources qualified. \nEmpty if no more resources are to be returned
getNext
{ "repo_name": "Kamidu/carbon-device-mgt", "path": "components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/NotificationList.java", "license": "apache-2.0", "size": 3135 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "io.swagger.annotations.ApiModelProperty" ]
import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.*; import io.swagger.annotations.*;
[ "com.fasterxml.jackson", "io.swagger.annotations" ]
com.fasterxml.jackson; io.swagger.annotations;
2,312,971
public Locator nonEmptyOptionLocator() { return nonEmptyOption; }
Locator function() { return nonEmptyOption; }
/** * Returns the nonEmptyOption. * * @return the nonEmptyOption */
Returns the nonEmptyOption
nonEmptyOptionLocator
{ "repo_name": "tripu/validator", "path": "src/nu/validator/checker/schematronequiv/Assertions.java", "license": "mit", "size": 135371 }
[ "org.xml.sax.Locator" ]
import org.xml.sax.Locator;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
524,593
public static Map<String, Object> handleWindowCoveringSupportedGet(byte[] payload) { // Create our response map Map<String, Object> response = new HashMap<String, Object>(); // Return the map of processed response data; return response; } /** * Creates a new message with the WINDOW_COVERING_SUPPORTED_REPORT command. * <p> * Window Covering Supported Report * * @param parameterMask {@link List<Integer>}
static Map<String, Object> function(byte[] payload) { Map<String, Object> response = new HashMap<String, Object>(); return response; } /** * Creates a new message with the WINDOW_COVERING_SUPPORTED_REPORT command. * <p> * Window Covering Supported Report * * @param parameterMask {@link List<Integer>}
/** * Processes a received frame with the WINDOW_COVERING_SUPPORTED_GET command. * <p> * Window Covering Supported Get * * @param payload the {@link byte[]} payload data to process * @return a {@link Map} of processed response data */
Processes a received frame with the WINDOW_COVERING_SUPPORTED_GET command. Window Covering Supported Get
handleWindowCoveringSupportedGet
{ "repo_name": "zsmartsystems/com.zsmartsystems.zwave", "path": "com.zsmartsystems.zwave/src/main/java/com/zsmartsystems/zwave/commandclass/impl/CommandClassWindowCoveringV1.java", "license": "epl-1.0", "size": 35748 }
[ "java.util.HashMap", "java.util.List", "java.util.Map" ]
import java.util.HashMap; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,044,185
public PresentValueSABRSensitivityDataBundle priceSABRSensitivity(final InterestRateFutureOptionMarginSecurity security, final SABRSTIRFuturesProviderInterface sabrData) { final PresentValueSABRSensitivityDataBundle sensi = new PresentValueSABRSensitivityDataBundle(); // Forward sweep final double priceFuture = METHOD_FUTURE.price(security.getUnderlyingFuture(), sabrData.getMulticurveProvider()); final double rateStrike = 1.0 - security.getStrike(); final EuropeanVanillaOption option = new EuropeanVanillaOption(rateStrike, security.getExpirationTime(), !security.isCall()); final double forward = 1 - priceFuture; final double delay = security.getUnderlyingFuture().getTradingLastTime() - security.getExpirationTime(); final double[] volatilityAdjoint = sabrData.getSABRParameters().getVolatilityAdjoint(security.getExpirationTime(), delay, rateStrike, forward); final BlackFunctionData dataBlack = new BlackFunctionData(forward, 1.0, volatilityAdjoint[0]); final double[] priceAdjoint = BLACK_FUNCTION.getPriceAdjoint(option, dataBlack); // Backward sweep final double priceBar = 1.0; final double volatilityBar = priceAdjoint[2] * priceBar; final DoublesPair expiryDelay = DoublesPair.of(security.getExpirationTime(), delay); sensi.addAlpha(expiryDelay, volatilityAdjoint[3] * volatilityBar); sensi.addBeta(expiryDelay, volatilityAdjoint[4] * volatilityBar); sensi.addRho(expiryDelay, volatilityAdjoint[5] * volatilityBar); sensi.addNu(expiryDelay, volatilityAdjoint[6] * volatilityBar); return sensi; }
PresentValueSABRSensitivityDataBundle function(final InterestRateFutureOptionMarginSecurity security, final SABRSTIRFuturesProviderInterface sabrData) { final PresentValueSABRSensitivityDataBundle sensi = new PresentValueSABRSensitivityDataBundle(); final double priceFuture = METHOD_FUTURE.price(security.getUnderlyingFuture(), sabrData.getMulticurveProvider()); final double rateStrike = 1.0 - security.getStrike(); final EuropeanVanillaOption option = new EuropeanVanillaOption(rateStrike, security.getExpirationTime(), !security.isCall()); final double forward = 1 - priceFuture; final double delay = security.getUnderlyingFuture().getTradingLastTime() - security.getExpirationTime(); final double[] volatilityAdjoint = sabrData.getSABRParameters().getVolatilityAdjoint(security.getExpirationTime(), delay, rateStrike, forward); final BlackFunctionData dataBlack = new BlackFunctionData(forward, 1.0, volatilityAdjoint[0]); final double[] priceAdjoint = BLACK_FUNCTION.getPriceAdjoint(option, dataBlack); final double priceBar = 1.0; final double volatilityBar = priceAdjoint[2] * priceBar; final DoublesPair expiryDelay = DoublesPair.of(security.getExpirationTime(), delay); sensi.addAlpha(expiryDelay, volatilityAdjoint[3] * volatilityBar); sensi.addBeta(expiryDelay, volatilityAdjoint[4] * volatilityBar); sensi.addRho(expiryDelay, volatilityAdjoint[5] * volatilityBar); sensi.addNu(expiryDelay, volatilityAdjoint[6] * volatilityBar); return sensi; }
/** * Computes the option security price curve sensitivity. The future price is computed without convexity adjustment. * * @param security * The future option security. * @param sabrData * The SABR data bundle. * @return The security price curve sensitivity. */
Computes the option security price curve sensitivity. The future price is computed without convexity adjustment
priceSABRSensitivity
{ "repo_name": "McLeodMoores/starling", "path": "projects/analytics/src/main/java/com/opengamma/analytics/financial/interestrate/future/provider/InterestRateFutureOptionMarginSecuritySABRMethod.java", "license": "apache-2.0", "size": 8087 }
[ "com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle", "com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginSecurity", "com.opengamma.analytics.financial.model.option.pricing.analytic.formula.BlackFunctionData", "com.opengamma.analytics.financial.model.option.pricing.analytic.formula.EuropeanVanillaOption", "com.opengamma.analytics.financial.provider.description.interestrate.SABRSTIRFuturesProviderInterface", "com.opengamma.util.tuple.DoublesPair" ]
import com.opengamma.analytics.financial.interestrate.PresentValueSABRSensitivityDataBundle; import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginSecurity; import com.opengamma.analytics.financial.model.option.pricing.analytic.formula.BlackFunctionData; import com.opengamma.analytics.financial.model.option.pricing.analytic.formula.EuropeanVanillaOption; import com.opengamma.analytics.financial.provider.description.interestrate.SABRSTIRFuturesProviderInterface; import com.opengamma.util.tuple.DoublesPair;
import com.opengamma.analytics.financial.interestrate.*; import com.opengamma.analytics.financial.interestrate.future.derivative.*; import com.opengamma.analytics.financial.model.option.pricing.analytic.formula.*; import com.opengamma.analytics.financial.provider.description.interestrate.*; import com.opengamma.util.tuple.*;
[ "com.opengamma.analytics", "com.opengamma.util" ]
com.opengamma.analytics; com.opengamma.util;
1,525,092
public void setIsUsingBigIcon() { LayoutParams lp = (LayoutParams) mIconView.getLayoutParams(); lp.width = mBigIconSize; lp.height = mBigIconSize; lp.endMargin = mBigIconMargin; Resources res = getContext().getResources(); String typeface = res.getString(R.string.infobar_message_typeface); int textStyle = res.getInteger(R.integer.infobar_message_textstyle); float textSize = res.getDimension(R.dimen.infobar_big_icon_message_size); mMessageTextView.setTypeface(Typeface.create(typeface, textStyle)); mMessageTextView.setMaxLines(1); mMessageTextView.setEllipsize(TextUtils.TruncateAt.END); mMessageTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); }
void function() { LayoutParams lp = (LayoutParams) mIconView.getLayoutParams(); lp.width = mBigIconSize; lp.height = mBigIconSize; lp.endMargin = mBigIconMargin; Resources res = getContext().getResources(); String typeface = res.getString(R.string.infobar_message_typeface); int textStyle = res.getInteger(R.integer.infobar_message_textstyle); float textSize = res.getDimension(R.dimen.infobar_big_icon_message_size); mMessageTextView.setTypeface(Typeface.create(typeface, textStyle)); mMessageTextView.setMaxLines(1); mMessageTextView.setEllipsize(TextUtils.TruncateAt.END); mMessageTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize); }
/** * Adjusts styling to account for the big icon layout. */
Adjusts styling to account for the big icon layout
setIsUsingBigIcon
{ "repo_name": "axinging/chromium-crosswalk", "path": "chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBarLayout.java", "license": "bsd-3-clause", "size": 21414 }
[ "android.content.res.Resources", "android.graphics.Typeface", "android.text.TextUtils", "android.util.TypedValue" ]
import android.content.res.Resources; import android.graphics.Typeface; import android.text.TextUtils; import android.util.TypedValue;
import android.content.res.*; import android.graphics.*; import android.text.*; import android.util.*;
[ "android.content", "android.graphics", "android.text", "android.util" ]
android.content; android.graphics; android.text; android.util;
2,365,597
public static boolean validatePlanOfCareActivityProcedureTemplateId(PlanOfCareActivityProcedure planOfCareActivityProcedure, DiagnosticChain diagnostics, Map<Object, Object> context) { if (VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setContext(CCDPackage.Literals.PLAN_OF_CARE_ACTIVITY_PROCEDURE); try { VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } if (!EOCL_ENV.createQuery(VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(planOfCareActivityProcedure)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, CCDValidator.DIAGNOSTIC_SOURCE, CCDValidator.PLAN_OF_CARE_ACTIVITY_PROCEDURE__PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID, CCDPlugin.INSTANCE.getString("PlanOfCareActivityProcedureTemplateId"), new Object [] { planOfCareActivityProcedure })); } return false; } return true; } protected static final String VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = "not self.id->isEmpty()"; protected static Constraint VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV;
static boolean function(PlanOfCareActivityProcedure planOfCareActivityProcedure, DiagnosticChain diagnostics, Map<Object, Object> context) { if (VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setContext(CCDPackage.Literals.PLAN_OF_CARE_ACTIVITY_PROCEDURE); try { VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } if (!EOCL_ENV.createQuery(VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(planOfCareActivityProcedure)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, CCDValidator.DIAGNOSTIC_SOURCE, CCDValidator.PLAN_OF_CARE_ACTIVITY_PROCEDURE__PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID, CCDPlugin.INSTANCE.getString(STR), new Object [] { planOfCareActivityProcedure })); } return false; } return true; } protected static final String VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP = STR; protected static Constraint VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV;
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * <!-- begin-model-doc --> * self.templateId->exists(id : datatypes::II | id.root = '2.16.840.1.113883.10.20.1.25') * @param planOfCareActivityProcedure The receiving '<em><b>Plan Of Care Activity Procedure</b></em>' model object. * @param diagnostics The chain of diagnostics to which problems are to be appended. * @param context The cache of context-specific information. * <!-- end-model-doc --> * @generated */
self.templateId->exists(id : datatypes::II | id.root = '2.16.840.1.113883.10.20.1.25')
validatePlanOfCareActivityProcedureTemplateId
{ "repo_name": "drbgfc/mdht", "path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.ccd/src/org/openhealthtools/mdht/uml/cda/ccd/operations/PlanOfCareActivityProcedureOperations.java", "license": "epl-1.0", "size": 15129 }
[ "java.util.Map", "org.eclipse.emf.common.util.BasicDiagnostic", "org.eclipse.emf.common.util.Diagnostic", "org.eclipse.emf.common.util.DiagnosticChain", "org.eclipse.ocl.ParserException", "org.eclipse.ocl.ecore.Constraint", "org.openhealthtools.mdht.uml.cda.ccd.CCDPackage", "org.openhealthtools.mdht.uml.cda.ccd.CCDPlugin", "org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityProcedure", "org.openhealthtools.mdht.uml.cda.ccd.util.CCDValidator" ]
import java.util.Map; import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.ocl.ParserException; import org.eclipse.ocl.ecore.Constraint; import org.openhealthtools.mdht.uml.cda.ccd.CCDPackage; import org.openhealthtools.mdht.uml.cda.ccd.CCDPlugin; import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityProcedure; import org.openhealthtools.mdht.uml.cda.ccd.util.CCDValidator;
import java.util.*; import org.eclipse.emf.common.util.*; import org.eclipse.ocl.*; import org.eclipse.ocl.ecore.*; import org.openhealthtools.mdht.uml.cda.ccd.*; import org.openhealthtools.mdht.uml.cda.ccd.util.*;
[ "java.util", "org.eclipse.emf", "org.eclipse.ocl", "org.openhealthtools.mdht" ]
java.util; org.eclipse.emf; org.eclipse.ocl; org.openhealthtools.mdht;
2,377,602
protected void sequence_UiTabSheet(EObject context, UiTabSheet semanticObject) { genericSequencer.createSequence(context, semanticObject); }
void function(EObject context, UiTabSheet semanticObject) { genericSequencer.createSequence(context, semanticObject); }
/** * Constraint: * ( * (i18nInfo=UiI18nInfo? styles=STRING?)? * name=ID? * tabs+=UiTabAssignment* * bindings+=UiBinding* * processorAssignments+=UiVisibilityProcessorAssignment* * ) */
Constraint: ( (i18nInfo=UiI18nInfo? styles=STRING?)? name=ID? tabs+=UiTabAssignment bindings+=UiBinding processorAssignments+=UiVisibilityProcessorAssignment )
sequence_UiTabSheet
{ "repo_name": "lunifera/lunifera-ecview-addons", "path": "org.lunifera.ecview.dsl/src-gen/org/lunifera/ecview/dsl/serializer/UIGrammarSemanticSequencer.java", "license": "epl-1.0", "size": 151691 }
[ "org.eclipse.emf.ecore.EObject", "org.lunifera.ecview.semantic.uimodel.UiTabSheet" ]
import org.eclipse.emf.ecore.EObject; import org.lunifera.ecview.semantic.uimodel.UiTabSheet;
import org.eclipse.emf.ecore.*; import org.lunifera.ecview.semantic.uimodel.*;
[ "org.eclipse.emf", "org.lunifera.ecview" ]
org.eclipse.emf; org.lunifera.ecview;
2,916,261