method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public List<GroupData> loadGroups(SecurityContext ctx, long id) throws DSOutOfServiceException, DSAccessException { return gateway.loadGroups(ctx, id); }
List<GroupData> function(SecurityContext ctx, long id) throws DSOutOfServiceException, DSAccessException { return gateway.loadGroups(ctx, id); }
/** * Implemented as specified by {@link AdminService}. * @see AdminService#loadGroups(SecurityContext, long) */
Implemented as specified by <code>AdminService</code>
loadGroups
{ "repo_name": "jballanc/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/AdminServiceImpl.java", "license": "gpl-2.0", "size": 27724 }
[ "java.util.List", "org.openmicroscopy.shoola.env.data.util.SecurityContext" ]
import java.util.List; import org.openmicroscopy.shoola.env.data.util.SecurityContext;
import java.util.*; import org.openmicroscopy.shoola.env.data.util.*;
[ "java.util", "org.openmicroscopy.shoola" ]
java.util; org.openmicroscopy.shoola;
577,213
public Shape getOutline() { if (outline == null) { outline = new GeneralPath(); for (int i = 0; i < glyphs.length; i++) { if (glyphVisible[i]) { Shape glyphOutline = glyphs[i].getOutline(); if (glyphOutline != null) { outline.append(glyphOutline, false); } } } } return outline; }
Shape function() { if (outline == null) { outline = new GeneralPath(); for (int i = 0; i < glyphs.length; i++) { if (glyphVisible[i]) { Shape glyphOutline = glyphs[i].getOutline(); if (glyphOutline != null) { outline.append(glyphOutline, false); } } } } return outline; }
/** * Returns a Shape whose interior corresponds to the visual representation * of this GlyphVector. */
Returns a Shape whose interior corresponds to the visual representation of this GlyphVector
getOutline
{ "repo_name": "sflyphotobooks/crp-batik", "path": "sources/org/apache/batik/gvt/font/SVGGVTGlyphVector.java", "license": "apache-2.0", "size": 27642 }
[ "java.awt.Shape", "java.awt.geom.GeneralPath" ]
import java.awt.Shape; import java.awt.geom.GeneralPath;
import java.awt.*; import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,903,757
private void renderSelected(Canvas canvas) { PointF p; for (Cell cell : selectedGroup.getCells()) { p = getPointByCell(cell); canvas.drawCircle(p.x, p.y, 0.5f * ballSize, selectedP); } }
void function(Canvas canvas) { PointF p; for (Cell cell : selectedGroup.getCells()) { p = getPointByCell(cell); canvas.drawCircle(p.x, p.y, 0.5f * ballSize, selectedP); } }
/** * Render the overlay on the group of marbles selected by user. * * @param canvas * canvas to draw onto */
Render the overlay on the group of marbles selected by user
renderSelected
{ "repo_name": "alexander-yakushev/abalone-android", "path": "src/com/bytopia/abalone/BoardRenderer.java", "license": "gpl-3.0", "size": 10057 }
[ "android.graphics.Canvas", "android.graphics.PointF", "com.bytopia.abalone.mechanics.Cell" ]
import android.graphics.Canvas; import android.graphics.PointF; import com.bytopia.abalone.mechanics.Cell;
import android.graphics.*; import com.bytopia.abalone.mechanics.*;
[ "android.graphics", "com.bytopia.abalone" ]
android.graphics; com.bytopia.abalone;
1,072,264
public static String getBetterToken( int tokenType, String defaultValue, LanguageLevelOption languageLevel ) { switch (languageLevel) { case DRL5: return getBetterTokenForDRL5(tokenType, defaultValue); case DRL6: return getBetterTokenForDRL6(tokenType, defaultValue); } throw new RuntimeException("Unknown language level"); }
static String function( int tokenType, String defaultValue, LanguageLevelOption languageLevel ) { switch (languageLevel) { case DRL5: return getBetterTokenForDRL5(tokenType, defaultValue); case DRL6: return getBetterTokenForDRL6(tokenType, defaultValue); } throw new RuntimeException(STR); }
/** * Helper method that creates a user friendly token definition * * @param tokenType * token type * @param defaultValue * default value for identifier token, may be null * @return user friendly token definition */
Helper method that creates a user friendly token definition
getBetterToken
{ "repo_name": "yurloc/drools", "path": "drools-compiler/src/main/java/org/drools/compiler/DRLFactory.java", "license": "apache-2.0", "size": 9614 }
[ "org.kie.builder.conf.LanguageLevelOption" ]
import org.kie.builder.conf.LanguageLevelOption;
import org.kie.builder.conf.*;
[ "org.kie.builder" ]
org.kie.builder;
1,226,766
public static List<Descriptor<RepositoryBrowser<?>>> filter(Class<? extends RepositoryBrowser> t) { List<Descriptor<RepositoryBrowser<?>>> r = new ArrayList<Descriptor<RepositoryBrowser<?>>>(); for (Descriptor<RepositoryBrowser<?>> d : RepositoryBrowser.all()) if(d.isSubTypeOf(t)) r.add(d); return r; }
static List<Descriptor<RepositoryBrowser<?>>> function(Class<? extends RepositoryBrowser> t) { List<Descriptor<RepositoryBrowser<?>>> r = new ArrayList<Descriptor<RepositoryBrowser<?>>>(); for (Descriptor<RepositoryBrowser<?>> d : RepositoryBrowser.all()) if(d.isSubTypeOf(t)) r.add(d); return r; }
/** * Only returns those {@link RepositoryBrowser} descriptors that extend from the given type. */
Only returns those <code>RepositoryBrowser</code> descriptors that extend from the given type
filter
{ "repo_name": "andresrc/jenkins", "path": "core/src/main/java/hudson/scm/RepositoryBrowsers.java", "license": "mit", "size": 3866 }
[ "hudson.model.Descriptor", "java.util.ArrayList", "java.util.List" ]
import hudson.model.Descriptor; import java.util.ArrayList; import java.util.List;
import hudson.model.*; import java.util.*;
[ "hudson.model", "java.util" ]
hudson.model; java.util;
1,978,032
JdbcOperations getJdbcOperations(); /** * Execute a JDBC data access operation, implemented as callback action * working on a JDBC PreparedStatement. This allows for implementing arbitrary * data access operations on a single Statement, within Spring's managed * JDBC environment: that is, participating in Spring-managed transactions * and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy. * <p>The callback action can return a result object, for example a * domain object or a collection of domain objects. * @param sql SQL to execute * @param paramSource container of arguments to bind to the query * @param action callback object that specifies the action * @return a result object returned by the action, or {@code null}
JdbcOperations getJdbcOperations(); /** * Execute a JDBC data access operation, implemented as callback action * working on a JDBC PreparedStatement. This allows for implementing arbitrary * data access operations on a single Statement, within Spring's managed * JDBC environment: that is, participating in Spring-managed transactions * and converting JDBC SQLExceptions into Spring's DataAccessException hierarchy. * <p>The callback action can return a result object, for example a * domain object or a collection of domain objects. * @param sql SQL to execute * @param paramSource container of arguments to bind to the query * @param action callback object that specifies the action * @return a result object returned by the action, or {@code null}
/** * Expose the classic Spring JdbcTemplate to allow invocation of * classic JDBC operations. */
Expose the classic Spring JdbcTemplate to allow invocation of classic JDBC operations
getJdbcOperations
{ "repo_name": "ftomassetti/effectivejava", "path": "test-resources/sample-codebases/spring-jdbc/src/main/java/org/springframework/jdbc/core/namedparam/NamedParameterJdbcOperations.java", "license": "apache-2.0", "size": 29021 }
[ "org.springframework.dao.DataAccessException", "org.springframework.jdbc.core.JdbcOperations" ]
import org.springframework.dao.DataAccessException; import org.springframework.jdbc.core.JdbcOperations;
import org.springframework.dao.*; import org.springframework.jdbc.core.*;
[ "org.springframework.dao", "org.springframework.jdbc" ]
org.springframework.dao; org.springframework.jdbc;
224,699
TabularData getGlobalMarkStats();
TabularData getGlobalMarkStats();
/** * Show details of the data Store garbage collection process. * * @return List of available repositories and their status */
Show details of the data Store garbage collection process
getGlobalMarkStats
{ "repo_name": "meggermo/jackrabbit-oak", "path": "oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/blob/BlobGCMBean.java", "license": "apache-2.0", "size": 3803 }
[ "javax.management.openmbean.TabularData" ]
import javax.management.openmbean.TabularData;
import javax.management.openmbean.*;
[ "javax.management" ]
javax.management;
1,510,534
public static <K extends Comparable<K>, V> void assertLeafNodeContains(Node<K, V> actual, K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) throws IOException { assertLeafNodeContains(actual, newMap(key1, value1, key2, value2, key3, value3, key4, value4)); }
static <K extends Comparable<K>, V> void function(Node<K, V> actual, K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) throws IOException { assertLeafNodeContains(actual, newMap(key1, value1, key2, value2, key3, value3, key4, value4)); }
/** * Assert that the specified node is a leaf node and contains the specified key-value pair. * * @param actual the actual node to check. * @param key1 the first key * @param value1 the value associated to the first key * @param key2 the second key * @param value2 the value associated to the second key * @param key3 the third key * @param value3 the value associated to the third key * @param key4 the fourth key * @param value4 the value associated to the fourth key * @throws IOException if an I/O problem occurs. */
Assert that the specified node is a leaf node and contains the specified key-value pair
assertLeafNodeContains
{ "repo_name": "blerer/horizondb", "path": "src/test/java/io/horizondb/db/btree/AssertNodes.java", "license": "apache-2.0", "size": 9782 }
[ "io.horizondb.db.btree.Node", "java.io.IOException" ]
import io.horizondb.db.btree.Node; import java.io.IOException;
import io.horizondb.db.btree.*; import java.io.*;
[ "io.horizondb.db", "java.io" ]
io.horizondb.db; java.io;
1,609,264
return new IAutoEditStrategy[] {new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestAutoEditStrategy()}; }
return new IAutoEditStrategy[] {new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestAutoEditStrategy()}; }
/** * Returns an instance of class * eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestAutoEditStrategy. */
Returns an instance of class eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestAutoEditStrategy
getAutoEditStrategies
{ "repo_name": "HyVar/DarwinSPL", "path": "plugins/eu.hyvar.mspl.manifest.resource.hymanifest.ui/src-gen/eu/hyvar/mspl/manifest/resource/hymanifest/ui/HymanifestSourceViewerConfiguration.java", "license": "apache-2.0", "size": 7902 }
[ "org.eclipse.jface.text.IAutoEditStrategy" ]
import org.eclipse.jface.text.IAutoEditStrategy;
import org.eclipse.jface.text.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
93,656
private boolean shouldBroadcastPresence(Presence presence){ if (presence == null) { return false; } if (hasToCheckRoleToBroadcastPresence()) { Element frag = presence.getChildElement("x", "http://jabber.org/protocol/muc#user"); // Check if we can broadcast the presence for this role if (!canBroadcastPresence(frag.element("item").attributeValue("role"))) { return false; } } return true; }
boolean function(Presence presence){ if (presence == null) { return false; } if (hasToCheckRoleToBroadcastPresence()) { Element frag = presence.getChildElement("x", STRitemSTRrole"))) { return false; } } return true; }
/** * Checks the role of the sender and returns true if the given presence should be broadcasted * * @param presence The presence to check * @return true if the presence should be broadcast to the rest of the room */
Checks the role of the sender and returns true if the given presence should be broadcasted
shouldBroadcastPresence
{ "repo_name": "AndrewChanChina/pps1", "path": "src/java/org/jivesoftware/openfire/muc/spi/LocalMUCRoom.java", "license": "apache-2.0", "size": 101368 }
[ "org.dom4j.Element", "org.xmpp.packet.Presence" ]
import org.dom4j.Element; import org.xmpp.packet.Presence;
import org.dom4j.*; import org.xmpp.packet.*;
[ "org.dom4j", "org.xmpp.packet" ]
org.dom4j; org.xmpp.packet;
1,096,539
VectorTransformation makeTransformation(long itemId, SparseVector vector);
VectorTransformation makeTransformation(long itemId, SparseVector vector);
/** * Make a vector transformation for an item. The resulting transformation will be applied * to item vectors to normalize and denormalize them. * * @param itemId The item id to normalize for. * @param vector The item's vector to use as the reference vector. * @return The vector transformaition normalizing for this item. */
Make a vector transformation for an item. The resulting transformation will be applied to item vectors to normalize and denormalize them
makeTransformation
{ "repo_name": "vijayvani/Lenskit", "path": "lenskit-core/src/main/java/org/grouplens/lenskit/transform/normalize/ItemVectorNormalizer.java", "license": "lgpl-2.1", "size": 2476 }
[ "org.grouplens.lenskit.vectors.SparseVector" ]
import org.grouplens.lenskit.vectors.SparseVector;
import org.grouplens.lenskit.vectors.*;
[ "org.grouplens.lenskit" ]
org.grouplens.lenskit;
763,328
List<TemplateModuleDependencies> getExperimentalTemplateModuleDependencies();
List<TemplateModuleDependencies> getExperimentalTemplateModuleDependencies();
/** * Returns a list of templates and the modules used in them along with their parameters. */
Returns a list of templates and the modules used in them along with their parameters
getExperimentalTemplateModuleDependencies
{ "repo_name": "forcedotcom/aura", "path": "aura/src/main/java/org/auraframework/def/module/ModuleDef.java", "license": "apache-2.0", "size": 4910 }
[ "java.util.List", "org.lwc.template.TemplateModuleDependencies" ]
import java.util.List; import org.lwc.template.TemplateModuleDependencies;
import java.util.*; import org.lwc.template.*;
[ "java.util", "org.lwc.template" ]
java.util; org.lwc.template;
1,101,035
public String[] getJobOptionsOnly() { List<String> options = new ArrayList<String>(); if (getCleanOutputDirectory()) { options.add("-clean"); } if (!DistributedJobConfig.isEmpty(getNumRandomizedDataChunks())) { options.add("-num-chunks"); options.add(getNumRandomizedDataChunks()); } if (!DistributedJobConfig.isEmpty(getNumInstancesPerRandomizedDataChunk())) { options.add("-num-instances-per-chunk"); options.add(getNumInstancesPerRandomizedDataChunk()); } if (!DistributedJobConfig.isEmpty(getClassAttribute())) { options.add("-class"); options.add(getClassAttribute()); } if (!DistributedJobConfig.isEmpty(getRandomSeed())) { options.add("-seed"); options.add(getRandomSeed()); } return options.toArray(new String[options.size()]); }
String[] function() { List<String> options = new ArrayList<String>(); if (getCleanOutputDirectory()) { options.add(STR); } if (!DistributedJobConfig.isEmpty(getNumRandomizedDataChunks())) { options.add(STR); options.add(getNumRandomizedDataChunks()); } if (!DistributedJobConfig.isEmpty(getNumInstancesPerRandomizedDataChunk())) { options.add(STR); options.add(getNumInstancesPerRandomizedDataChunk()); } if (!DistributedJobConfig.isEmpty(getClassAttribute())) { options.add(STR); options.add(getClassAttribute()); } if (!DistributedJobConfig.isEmpty(getRandomSeed())) { options.add("-seed"); options.add(getRandomSeed()); } return options.toArray(new String[options.size()]); }
/** * Get the options for this job only * * @return the options for this job only */
Get the options for this job only
getJobOptionsOnly
{ "repo_name": "mydzigear/weka.kmeanspp.silhouette_score", "path": "wekafiles/packages/distributedWekaHadoopCore/src/main/java/weka/distributed/hadoop/RandomizedDataChunkHadoopJob.java", "license": "gpl-3.0", "size": 25274 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,906,131
public void validateSetSchedule(final ValidationContext context) { MessageContext messages = context.getMessageContext(); BlockBuilderFormBackingObject command = this.toBlockBuilderFormBackingObject(); BlockBuilderFormBackingObjectValidator validator = new BlockBuilderFormBackingObjectValidator(); BeanPropertyBindingResult errors = new BeanPropertyBindingResult(command, "registration"); validator.validate(command, errors); if(errors.hasErrors()) { for(FieldError error: errors.getFieldErrors()){ messages.addMessage(new MessageBuilder().error().source(error.getField()) .defaultText(error.getDefaultMessage()).build()); } } else { this.scheduleSet = true; } }
void function(final ValidationContext context) { MessageContext messages = context.getMessageContext(); BlockBuilderFormBackingObject command = this.toBlockBuilderFormBackingObject(); BlockBuilderFormBackingObjectValidator validator = new BlockBuilderFormBackingObjectValidator(); BeanPropertyBindingResult errors = new BeanPropertyBindingResult(command, STR); validator.validate(command, errors); if(errors.hasErrors()) { for(FieldError error: errors.getFieldErrors()){ messages.addMessage(new MessageBuilder().error().source(error.getField()) .defaultText(error.getDefaultMessage()).build()); } } else { this.scheduleSet = true; } }
/** * Validate schedule related fields. * * Delegates to a {@link BlockBuilderFormBackingObject}. * @param context */
Validate schedule related fields. Delegates to a <code>BlockBuilderFormBackingObject</code>
validateSetSchedule
{ "repo_name": "Jasig/sched-assist", "path": "sched-assist-war/src/main/java/org/jasig/schedassist/web/register/Registration.java", "license": "apache-2.0", "size": 13381 }
[ "org.jasig.schedassist.web.owner.schedule.BlockBuilderFormBackingObject", "org.jasig.schedassist.web.owner.schedule.BlockBuilderFormBackingObjectValidator", "org.springframework.binding.message.MessageBuilder", "org.springframework.binding.message.MessageContext", "org.springframework.binding.validation.ValidationContext", "org.springframework.validation.BeanPropertyBindingResult", "org.springframework.validation.FieldError" ]
import org.jasig.schedassist.web.owner.schedule.BlockBuilderFormBackingObject; import org.jasig.schedassist.web.owner.schedule.BlockBuilderFormBackingObjectValidator; import org.springframework.binding.message.MessageBuilder; import org.springframework.binding.message.MessageContext; import org.springframework.binding.validation.ValidationContext; import org.springframework.validation.BeanPropertyBindingResult; import org.springframework.validation.FieldError;
import org.jasig.schedassist.web.owner.schedule.*; import org.springframework.binding.message.*; import org.springframework.binding.validation.*; import org.springframework.validation.*;
[ "org.jasig.schedassist", "org.springframework.binding", "org.springframework.validation" ]
org.jasig.schedassist; org.springframework.binding; org.springframework.validation;
1,391,098
Response responseFromBuffer(final ChannelBuffer buf) { switch (buf.readByte()) { case 58: return deserializeMultiPutResponse(buf); case 67: return deserializeMultiResponse(buf); } throw new NonRecoverableException("Couldn't de-serialize " + Bytes.pretty(buf)); }
Response responseFromBuffer(final ChannelBuffer buf) { switch (buf.readByte()) { case 58: return deserializeMultiPutResponse(buf); case 67: return deserializeMultiResponse(buf); } throw new NonRecoverableException(STR + Bytes.pretty(buf)); }
/** * De-serializes the response to a {@link MultiAction} RPC. * See HBase's {@code MultiResponse}. * Only used with HBase 0.94 and earlier. */
De-serializes the response to a <code>MultiAction</code> RPC. See HBase's MultiResponse. Only used with HBase 0.94 and earlier
responseFromBuffer
{ "repo_name": "manolama/asynchbase", "path": "src/MultiAction.java", "license": "bsd-3-clause", "size": 36341 }
[ "org.jboss.netty.buffer.ChannelBuffer" ]
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.*;
[ "org.jboss.netty" ]
org.jboss.netty;
1,446,271
this.delegate = presenter; for (Node node : projectExplorerPresenter.getRootNodes()) { if (node.getName().equals(appContext.getCurrentProject().getRootProject().getName())) { view.setStructure(Collections.singletonList(node)); break; } } view.show(); }
this.delegate = presenter; for (Node node : projectExplorerPresenter.getRootNodes()) { if (node.getName().equals(appContext.getCurrentProject().getRootProject().getName())) { view.setStructure(Collections.singletonList(node)); break; } } view.show(); }
/** * Show tree view with all needed nodes of the workspace. * * @param presenter * delegate from the page */
Show tree view with all needed nodes of the workspace
show
{ "repo_name": "stour/che", "path": "plugins/plugin-java/che-plugin-java-ext-lang-client/src/main/java/org/eclipse/che/ide/ext/java/client/command/mainclass/SelectNodePresenter.java", "license": "epl-1.0", "size": 2373 }
[ "java.util.Collections", "org.eclipse.che.ide.api.data.tree.Node" ]
import java.util.Collections; import org.eclipse.che.ide.api.data.tree.Node;
import java.util.*; import org.eclipse.che.ide.api.data.tree.*;
[ "java.util", "org.eclipse.che" ]
java.util; org.eclipse.che;
768,261
default BigDecimal getTotalPrepaidAmount() { return BigDecimal.ZERO; }
default BigDecimal getTotalPrepaidAmount() { return BigDecimal.ZERO; }
/** * get the TotalPrepaidAmount located in SpecifiedTradeSettlementMonetarySummation (v1) or SpecifiedTradeSettlementHeaderMonetarySummation (v2) * * @return the total sum (incl. VAT) of prepayments, i.e. the difference between GrandTotalAmount and DuePayableAmount */
get the TotalPrepaidAmount located in SpecifiedTradeSettlementMonetarySummation (v1) or SpecifiedTradeSettlementHeaderMonetarySummation (v2)
getTotalPrepaidAmount
{ "repo_name": "ZUGFeRD/mustangproject", "path": "library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java", "license": "apache-2.0", "size": 10692 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
471,628
public static void delete(File dir) { if (dir.isDirectory()) { File[] files = dir.listFiles(); for (File file : files) { delete(file); } } else { dir.delete(); } } /** * Returns the system-dependent line separator. * Used to split lines on text file. On Android, this is {@code "\n"}
static void function(File dir) { if (dir.isDirectory()) { File[] files = dir.listFiles(); for (File file : files) { delete(file); } } else { dir.delete(); } } /** * Returns the system-dependent line separator. * Used to split lines on text file. On Android, this is {@code "\n"}
/** * Clean and delete directory or file * * @param dir the dir to delete */
Clean and delete directory or file
delete
{ "repo_name": "EuphoriaDev/app-common", "path": "library/src/main/java/ru/euphoria/commons/io/FileStreams.java", "license": "mit", "size": 8284 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,434,426
@Override public Point move(int stones[][], PlayerIndex who, int onMove) throws Exception { this.stones = stones; this.who = who; this.onMove = onMove; if (stones == null) { throw (new Exception("Incorrect board!")); } if (who == null) { throw (new Exception("Incorrect player!")); } if (onMove < Board.NUMBER_OF_DEPLOYMENT_MOVES) { phaseOneMove(); } if (onMove < Board.NUMBER_OF_DEPLOYMENT_MOVES) { return (coordinates); } if (onMove >= Board.NUMBER_OF_DEPLOYMENT_MOVES) { phaseTwoMove(); } return (coordinates); }
Point function(int stones[][], PlayerIndex who, int onMove) throws Exception { this.stones = stones; this.who = who; this.onMove = onMove; if (stones == null) { throw (new Exception(STR)); } if (who == null) { throw (new Exception(STR)); } if (onMove < Board.NUMBER_OF_DEPLOYMENT_MOVES) { phaseOneMove(); } if (onMove < Board.NUMBER_OF_DEPLOYMENT_MOVES) { return (coordinates); } if (onMove >= Board.NUMBER_OF_DEPLOYMENT_MOVES) { phaseTwoMove(); } return (coordinates); }
/** * This method gathers all stages together and returns the result of them as * a valid move. * * @author Yuriy Stanchev * * @email i_stanchev@ml1.net * * @date 9 April 2012 */
This method gathers all stages together and returns the result of them as a valid move
move
{ "repo_name": "TodorBalabanov/ColorsOverflow", "path": "src/eu/veldsoft/colors/overflow/NormalAI.java", "license": "gpl-3.0", "size": 10154 }
[ "android.graphics.Point" ]
import android.graphics.Point;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,668,352
@Route("/load/newUrl") @MainThread public void loadNewUrl(Bundle in) { mAgentWeb.getUrlLoader().loadUrl(in.getString("url_key")); }
@Route(STR) void function(Bundle in) { mAgentWeb.getUrlLoader().loadUrl(in.getString(STR)); }
/** * follow this , you could invoke this method anywhere * * Pigeon pigeon = Pigeon.newBuilder(this.getApplicationContext()).setAuthority("WebServiceProvider.class").build(); * pigeon.route("/load/newUrl").withString("url_key", "http://baidu.com").fly(); * @param in */
follow this , you could invoke this method anywhere Pigeon pigeon = Pigeon.newBuilder(this.getApplicationContext()).setAuthority("WebServiceProvider.class").build(); pigeon.route("/load/newUrl").withString("url_key", "HREF").fly()
loadNewUrl
{ "repo_name": "Justson/AgentWeb", "path": "sample/src/main/java/com/just/agentweb/sample/activity/RemoteWebViewlActivity.java", "license": "apache-2.0", "size": 2015 }
[ "android.os.Bundle", "com.flyingpigeon.library.annotations.Route" ]
import android.os.Bundle; import com.flyingpigeon.library.annotations.Route;
import android.os.*; import com.flyingpigeon.library.annotations.*;
[ "android.os", "com.flyingpigeon.library" ]
android.os; com.flyingpigeon.library;
1,827,557
public Logger getLogger(Class<?> c);
Logger function(Class<?> c);
/** * Get a logger related to a specific class. * * @param c the class related to the logger. * @return a logger according to the class it refers to. */
Get a logger related to a specific class
getLogger
{ "repo_name": "essepuntato/EarmarkDataStructure", "path": "src/it/essepuntato/earmark/core/io/EARMARKIOLogger.java", "license": "apache-2.0", "size": 719 }
[ "java.util.logging.Logger" ]
import java.util.logging.Logger;
import java.util.logging.*;
[ "java.util" ]
java.util;
2,386,307
ConceptualScenarioMetaModelFactory getConceptualScenarioMetaModelFactory(); interface Literals { EClass ENTITY_CHARACTERISTIC = eINSTANCE.getEntityCharacteristic(); EAttribute ENTITY_CHARACTERISTIC__NAME = eINSTANCE.getEntityCharacteristic_Name(); EAttribute ENTITY_CHARACTERISTIC__TYPE = eINSTANCE.getEntityCharacteristic_Type(); EAttribute ENTITY_CHARACTERISTIC__VALUE = eINSTANCE.getEntityCharacteristic_Value(); EClass STATE_MACHINE = eINSTANCE.getStateMachine(); EAttribute STATE_MACHINE__NAME = eINSTANCE.getStateMachine_Name(); EReference STATE_MACHINE__CON_ENT = eINSTANCE.getStateMachine_ConEnt(); EReference STATE_MACHINE__STATES = eINSTANCE.getStateMachine_States(); EClass STATE = eINSTANCE.getState(); EAttribute STATE__NAME = eINSTANCE.getState_Name(); EReference STATE__GUARD = eINSTANCE.getState_Guard(); EClass CONCEPTUAL_ENTITY = eINSTANCE.getConceptualEntity(); EAttribute CONCEPTUAL_ENTITY__NAME = eINSTANCE.getConceptualEntity_Name(); EReference CONCEPTUAL_ENTITY__CHARACTERISTICS = eINSTANCE.getConceptualEntity_Characteristics(); EClass EXIT_CONDITION = eINSTANCE.getExitCondition(); EReference EXIT_CONDITION__NEXT_STATE = eINSTANCE.getExitCondition_NextState(); EReference EXIT_CONDITION__EXIT_ACTION = eINSTANCE.getExitCondition_ExitAction(); EClass PATTERN_ACTION = eINSTANCE.getPatternAction(); EAttribute PATTERN_ACTION__NAME = eINSTANCE.getPatternAction_Name(); EAttribute PATTERN_ACTION__SEQUENCE = eINSTANCE.getPatternAction_Sequence(); EReference PATTERN_ACTION__SENDERS = eINSTANCE.getPatternAction_Senders(); EReference PATTERN_ACTION__RECEIVERS = eINSTANCE.getPatternAction_Receivers(); EReference PATTERN_ACTION__EVENTS = eINSTANCE.getPatternAction_Events(); EReference PATTERN_ACTION__VARIATIONS = eINSTANCE.getPatternAction_Variations(); EReference PATTERN_ACTION__EXCEPTIONS = eINSTANCE.getPatternAction_Exceptions(); EClass PATTERN_OF_INTERPLAY = eINSTANCE.getPatternOfInterplay(); EReference PATTERN_OF_INTERPLAY__ACTIONS = eINSTANCE.getPatternOfInterplay_Actions(); EAttribute PATTERN_OF_INTERPLAY__NAME = eINSTANCE.getPatternOfInterplay_Name(); EClass EVENT = eINSTANCE.getEvent(); EAttribute EVENT__NAME = eINSTANCE.getEvent_Name(); EReference EVENT__SOUCE_CHARACTERISTIC = eINSTANCE.getEvent_SouceCharacteristic(); EReference EVENT__TARGET_CHARACTERISTIC = eINSTANCE.getEvent_TargetCharacteristic(); EReference EVENT__CONTENT_CHARACTERISTIC = eINSTANCE.getEvent_ContentCharacteristic(); EReference EVENT__TRIGGER = eINSTANCE.getEvent_Trigger(); EClass TRIGGER_CONDITION = eINSTANCE.getTriggerCondition(); EAttribute TRIGGER_CONDITION__CONDITION = eINSTANCE.getTriggerCondition_Condition(); EClass VARIATION = eINSTANCE.getVariation(); EAttribute VARIATION__NAME = eINSTANCE.getVariation_Name(); EAttribute VARIATION__CONDITION = eINSTANCE.getVariation_Condition(); EReference VARIATION__RECEIVERS = eINSTANCE.getVariation_Receivers(); EReference VARIATION__SENDERS = eINSTANCE.getVariation_Senders(); EClass EXCEPTION = eINSTANCE.getException(); EAttribute EXCEPTION__NAME = eINSTANCE.getException_Name(); EAttribute EXCEPTION__CONDITION = eINSTANCE.getException_Condition(); EReference EXCEPTION__RECEIVERS = eINSTANCE.getException_Receivers(); EReference EXCEPTION__SENDERS = eINSTANCE.getException_Senders(); EClass CONCEPTUAL_SCENARIO = eINSTANCE.getConceptualScenario(); EReference CONCEPTUAL_SCENARIO__ENTITIES = eINSTANCE.getConceptualScenario_Entities(); EReference CONCEPTUAL_SCENARIO__INTERPLAYS = eINSTANCE.getConceptualScenario_Interplays(); EReference CONCEPTUAL_SCENARIO__STATE_MACHINES = eINSTANCE.getConceptualScenario_StateMachines(); EReference CONCEPTUAL_SCENARIO__EVENTS = eINSTANCE.getConceptualScenario_Events(); EReference CONCEPTUAL_SCENARIO__INDENTIFICATION = eINSTANCE.getConceptualScenario_Indentification(); EClass SCENARIO_IDENTIFICATION = eINSTANCE.getScenarioIdentification(); EAttribute SCENARIO_IDENTIFICATION__POC_EMAIL = eINSTANCE.getScenarioIdentification_POCEmail(); EAttribute SCENARIO_IDENTIFICATION__POC_TELEPHONE = eINSTANCE.getScenarioIdentification_POCTelephone(); EAttribute SCENARIO_IDENTIFICATION__POC_ORGANISATION = eINSTANCE.getScenarioIdentification_POCOrganisation(); EAttribute SCENARIO_IDENTIFICATION__POC_NAME = eINSTANCE.getScenarioIdentification_POCName(); EAttribute SCENARIO_IDENTIFICATION__USE_HISTORY = eINSTANCE.getScenarioIdentification_UseHistory(); EAttribute SCENARIO_IDENTIFICATION__POC_TYPE = eINSTANCE.getScenarioIdentification_POCType(); EAttribute SCENARIO_IDENTIFICATION__USE_LIMITATIONS = eINSTANCE.getScenarioIdentification_UseLimitations(); EAttribute SCENARIO_IDENTIFICATION__NAME = eINSTANCE.getScenarioIdentification_Name(); EAttribute SCENARIO_IDENTIFICATION__VERSION = eINSTANCE.getScenarioIdentification_Version(); EAttribute SCENARIO_IDENTIFICATION__MODIFICATION_DATE = eINSTANCE.getScenarioIdentification_ModificationDate(); EAttribute SCENARIO_IDENTIFICATION__PURPOSE = eINSTANCE.getScenarioIdentification_Purpose(); EAttribute SCENARIO_IDENTIFICATION__DESCRIPTION = eINSTANCE.getScenarioIdentification_Description(); }
ConceptualScenarioMetaModelFactory getConceptualScenarioMetaModelFactory(); interface Literals { EClass ENTITY_CHARACTERISTIC = eINSTANCE.getEntityCharacteristic(); EAttribute ENTITY_CHARACTERISTIC__NAME = eINSTANCE.getEntityCharacteristic_Name(); EAttribute ENTITY_CHARACTERISTIC__TYPE = eINSTANCE.getEntityCharacteristic_Type(); EAttribute ENTITY_CHARACTERISTIC__VALUE = eINSTANCE.getEntityCharacteristic_Value(); EClass STATE_MACHINE = eINSTANCE.getStateMachine(); EAttribute STATE_MACHINE__NAME = eINSTANCE.getStateMachine_Name(); EReference STATE_MACHINE__CON_ENT = eINSTANCE.getStateMachine_ConEnt(); EReference STATE_MACHINE__STATES = eINSTANCE.getStateMachine_States(); EClass STATE = eINSTANCE.getState(); EAttribute STATE__NAME = eINSTANCE.getState_Name(); EReference STATE__GUARD = eINSTANCE.getState_Guard(); EClass CONCEPTUAL_ENTITY = eINSTANCE.getConceptualEntity(); EAttribute CONCEPTUAL_ENTITY__NAME = eINSTANCE.getConceptualEntity_Name(); EReference CONCEPTUAL_ENTITY__CHARACTERISTICS = eINSTANCE.getConceptualEntity_Characteristics(); EClass EXIT_CONDITION = eINSTANCE.getExitCondition(); EReference EXIT_CONDITION__NEXT_STATE = eINSTANCE.getExitCondition_NextState(); EReference EXIT_CONDITION__EXIT_ACTION = eINSTANCE.getExitCondition_ExitAction(); EClass PATTERN_ACTION = eINSTANCE.getPatternAction(); EAttribute PATTERN_ACTION__NAME = eINSTANCE.getPatternAction_Name(); EAttribute PATTERN_ACTION__SEQUENCE = eINSTANCE.getPatternAction_Sequence(); EReference PATTERN_ACTION__SENDERS = eINSTANCE.getPatternAction_Senders(); EReference PATTERN_ACTION__RECEIVERS = eINSTANCE.getPatternAction_Receivers(); EReference PATTERN_ACTION__EVENTS = eINSTANCE.getPatternAction_Events(); EReference PATTERN_ACTION__VARIATIONS = eINSTANCE.getPatternAction_Variations(); EReference PATTERN_ACTION__EXCEPTIONS = eINSTANCE.getPatternAction_Exceptions(); EClass PATTERN_OF_INTERPLAY = eINSTANCE.getPatternOfInterplay(); EReference PATTERN_OF_INTERPLAY__ACTIONS = eINSTANCE.getPatternOfInterplay_Actions(); EAttribute PATTERN_OF_INTERPLAY__NAME = eINSTANCE.getPatternOfInterplay_Name(); EClass EVENT = eINSTANCE.getEvent(); EAttribute EVENT__NAME = eINSTANCE.getEvent_Name(); EReference EVENT__SOUCE_CHARACTERISTIC = eINSTANCE.getEvent_SouceCharacteristic(); EReference EVENT__TARGET_CHARACTERISTIC = eINSTANCE.getEvent_TargetCharacteristic(); EReference EVENT__CONTENT_CHARACTERISTIC = eINSTANCE.getEvent_ContentCharacteristic(); EReference EVENT__TRIGGER = eINSTANCE.getEvent_Trigger(); EClass TRIGGER_CONDITION = eINSTANCE.getTriggerCondition(); EAttribute TRIGGER_CONDITION__CONDITION = eINSTANCE.getTriggerCondition_Condition(); EClass VARIATION = eINSTANCE.getVariation(); EAttribute VARIATION__NAME = eINSTANCE.getVariation_Name(); EAttribute VARIATION__CONDITION = eINSTANCE.getVariation_Condition(); EReference VARIATION__RECEIVERS = eINSTANCE.getVariation_Receivers(); EReference VARIATION__SENDERS = eINSTANCE.getVariation_Senders(); EClass EXCEPTION = eINSTANCE.getException(); EAttribute EXCEPTION__NAME = eINSTANCE.getException_Name(); EAttribute EXCEPTION__CONDITION = eINSTANCE.getException_Condition(); EReference EXCEPTION__RECEIVERS = eINSTANCE.getException_Receivers(); EReference EXCEPTION__SENDERS = eINSTANCE.getException_Senders(); EClass CONCEPTUAL_SCENARIO = eINSTANCE.getConceptualScenario(); EReference CONCEPTUAL_SCENARIO__ENTITIES = eINSTANCE.getConceptualScenario_Entities(); EReference CONCEPTUAL_SCENARIO__INTERPLAYS = eINSTANCE.getConceptualScenario_Interplays(); EReference CONCEPTUAL_SCENARIO__STATE_MACHINES = eINSTANCE.getConceptualScenario_StateMachines(); EReference CONCEPTUAL_SCENARIO__EVENTS = eINSTANCE.getConceptualScenario_Events(); EReference CONCEPTUAL_SCENARIO__INDENTIFICATION = eINSTANCE.getConceptualScenario_Indentification(); EClass SCENARIO_IDENTIFICATION = eINSTANCE.getScenarioIdentification(); EAttribute SCENARIO_IDENTIFICATION__POC_EMAIL = eINSTANCE.getScenarioIdentification_POCEmail(); EAttribute SCENARIO_IDENTIFICATION__POC_TELEPHONE = eINSTANCE.getScenarioIdentification_POCTelephone(); EAttribute SCENARIO_IDENTIFICATION__POC_ORGANISATION = eINSTANCE.getScenarioIdentification_POCOrganisation(); EAttribute SCENARIO_IDENTIFICATION__POC_NAME = eINSTANCE.getScenarioIdentification_POCName(); EAttribute SCENARIO_IDENTIFICATION__USE_HISTORY = eINSTANCE.getScenarioIdentification_UseHistory(); EAttribute SCENARIO_IDENTIFICATION__POC_TYPE = eINSTANCE.getScenarioIdentification_POCType(); EAttribute SCENARIO_IDENTIFICATION__USE_LIMITATIONS = eINSTANCE.getScenarioIdentification_UseLimitations(); EAttribute SCENARIO_IDENTIFICATION__NAME = eINSTANCE.getScenarioIdentification_Name(); EAttribute SCENARIO_IDENTIFICATION__VERSION = eINSTANCE.getScenarioIdentification_Version(); EAttribute SCENARIO_IDENTIFICATION__MODIFICATION_DATE = eINSTANCE.getScenarioIdentification_ModificationDate(); EAttribute SCENARIO_IDENTIFICATION__PURPOSE = eINSTANCE.getScenarioIdentification_Purpose(); EAttribute SCENARIO_IDENTIFICATION__DESCRIPTION = eINSTANCE.getScenarioIdentification_Description(); }
/** * Returns the factory that creates the instances of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the factory that creates the instances of the model. * @generated */
Returns the factory that creates the instances of the model.
getConceptualScenarioMetaModelFactory
{ "repo_name": "umutdurak/MDSceE", "path": "ConceptualScenarioMetaModel/src/ConceptualScenarioMetaModel/ConceptualScenarioMetaModelPackage.java", "license": "mit", "size": 68813 }
[ "org.eclipse.emf.ecore.EAttribute", "org.eclipse.emf.ecore.EClass", "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,477,547
static public void writeXmlNs(FileWriter fw, String prefix, String value) { try { if (prefix.equals("")) fw.write(" " + NamespaceModel.NAMESPACE_ATTRIBUTE + "=\"" + value + "\""); else fw.write(" " + NamespaceModel.NAMESPACE_ATTRIBUTE + ":" + prefix + "=\"" + value + "\""); } catch (Exception e) { Log.trace("xmlNS: error " + e.toString()); } }
static void function(FileWriter fw, String prefix, String value) { try { if (prefix.equals(STR STR=\STR\STR STR:STR=\STR\STRxmlNS: error " + e.toString()); } }
/** writes an XML namespace attribute to a file * @param fw * @param prefix * @param value */
writes an XML namespace attribute to a file
writeXmlNs
{ "repo_name": "cabralje/niem-tools", "path": "niemtools-bouml/src/com/infotrack/niemtools/XmlWriter.java", "license": "gpl-3.0", "size": 41433 }
[ "java.io.FileWriter" ]
import java.io.FileWriter;
import java.io.*;
[ "java.io" ]
java.io;
102,240
public void removedService(ServiceReference<S> reference, T service);
void function(ServiceReference<S> reference, T service);
/** * A service tracked by the {@code ServiceTracker} has been removed. * * <p> * This method is called after a service is no longer being tracked by the * {@code ServiceTracker}. * * @param reference The reference to the service that has been removed. * @param service The service object for the specified referenced service. */
A service tracked by the ServiceTracker has been removed. This method is called after a service is no longer being tracked by the ServiceTracker
removedService
{ "repo_name": "boneman1231/org.apache.felix", "path": "trunk/framework/src/main/java/org/osgi/util/tracker/ServiceTrackerCustomizer.java", "license": "apache-2.0", "size": 3887 }
[ "org.osgi.framework.ServiceReference" ]
import org.osgi.framework.ServiceReference;
import org.osgi.framework.*;
[ "org.osgi.framework" ]
org.osgi.framework;
2,245,724
public void setResourcesInBean(CmsOrgUnitBean orgUnitBean, List<CmsResource> resources) { List<String> resourceNames = new ArrayList<String>(); Iterator<CmsResource> itResources = resources.iterator(); while (itResources.hasNext()) { CmsResource resource = itResources.next(); resourceNames.add(getCms().getSitePath(resource)); } orgUnitBean.setResources(resourceNames); }
void function(CmsOrgUnitBean orgUnitBean, List<CmsResource> resources) { List<String> resourceNames = new ArrayList<String>(); Iterator<CmsResource> itResources = resources.iterator(); while (itResources.hasNext()) { CmsResource resource = itResources.next(); resourceNames.add(getCms().getSitePath(resource)); } orgUnitBean.setResources(resourceNames); }
/** * Sets the resources for the given orgUnitBean.<p> * * @param orgUnitBean the <code>CmsOrgUnitBean</code> object * @param resources the list of resources */
Sets the resources for the given orgUnitBean
setResourcesInBean
{ "repo_name": "mediaworx/opencms-core", "path": "src-modules/org/opencms/workplace/tools/accounts/A_CmsOrgUnitDialog.java", "license": "lgpl-2.1", "size": 8131 }
[ "java.util.ArrayList", "java.util.Iterator", "java.util.List", "org.opencms.file.CmsResource" ]
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.opencms.file.CmsResource;
import java.util.*; import org.opencms.file.*;
[ "java.util", "org.opencms.file" ]
java.util; org.opencms.file;
2,431,165
private VariableDeclaration variables(int declType, int pos, boolean isStatement) throws IOException { int end; VariableDeclaration pn = new VariableDeclaration(pos); pn.setType(declType); pn.setLineno(ts.lineno); Comment varjsdocNode = getAndResetJsDoc(); if (varjsdocNode != null) { pn.setJsDocNode(varjsdocNode); } // Example: // var foo = {a: 1, b: 2}, bar = [3, 4]; // var {b: s2, a: s1} = foo, x = 6, y, [s3, s4] = bar; for (;;) { AstNode destructuring = null; Name name = null; int tt = peekToken(), kidPos = ts.tokenBeg; end = ts.tokenEnd; if (tt == Token.LB || tt == Token.LC) { // Destructuring assignment, e.g., var [a,b] = ... destructuring = destructuringPrimaryExpr(); end = getNodeEnd(destructuring); if (!(destructuring instanceof DestructuringForm)) reportError("msg.bad.assign.left", kidPos, end - kidPos); markDestructuring(destructuring); } else { // Simple variable name mustMatchToken(Token.NAME, "msg.bad.var"); name = createNameNode(); name.setLineno(ts.getLineno()); if (inUseStrictDirective) { String id = ts.getString(); if ("eval".equals(id) || "arguments".equals(ts.getString())) { reportError("msg.bad.id.strict", id); } } defineSymbol(declType, ts.getString(), inForInit); } int lineno = ts.lineno; Comment jsdocNode = getAndResetJsDoc(); AstNode init = null; if (matchToken(Token.ASSIGN)) { init = assignExpr(); end = getNodeEnd(init); } VariableInitializer vi = new VariableInitializer(kidPos, end - kidPos); if (destructuring != null) { if (init == null && !inForInit) { reportError("msg.destruct.assign.no.init"); } vi.setTarget(destructuring); } else { vi.setTarget(name); } vi.setInitializer(init); vi.setType(declType); vi.setJsDocNode(jsdocNode); vi.setLineno(lineno); pn.addVariable(vi); if (!matchToken(Token.COMMA)) break; } pn.setLength(end - pos); pn.setIsStatement(isStatement); return pn; }
VariableDeclaration function(int declType, int pos, boolean isStatement) throws IOException { int end; VariableDeclaration pn = new VariableDeclaration(pos); pn.setType(declType); pn.setLineno(ts.lineno); Comment varjsdocNode = getAndResetJsDoc(); if (varjsdocNode != null) { pn.setJsDocNode(varjsdocNode); } for (;;) { AstNode destructuring = null; Name name = null; int tt = peekToken(), kidPos = ts.tokenBeg; end = ts.tokenEnd; if (tt == Token.LB tt == Token.LC) { destructuring = destructuringPrimaryExpr(); end = getNodeEnd(destructuring); if (!(destructuring instanceof DestructuringForm)) reportError(STR, kidPos, end - kidPos); markDestructuring(destructuring); } else { mustMatchToken(Token.NAME, STR); name = createNameNode(); name.setLineno(ts.getLineno()); if (inUseStrictDirective) { String id = ts.getString(); if ("eval".equals(id) STR.equals(ts.getString())) { reportError(STR, id); } } defineSymbol(declType, ts.getString(), inForInit); } int lineno = ts.lineno; Comment jsdocNode = getAndResetJsDoc(); AstNode init = null; if (matchToken(Token.ASSIGN)) { init = assignExpr(); end = getNodeEnd(init); } VariableInitializer vi = new VariableInitializer(kidPos, end - kidPos); if (destructuring != null) { if (init == null && !inForInit) { reportError(STR); } vi.setTarget(destructuring); } else { vi.setTarget(name); } vi.setInitializer(init); vi.setType(declType); vi.setJsDocNode(jsdocNode); vi.setLineno(lineno); pn.addVariable(vi); if (!matchToken(Token.COMMA)) break; } pn.setLength(end - pos); pn.setIsStatement(isStatement); return pn; }
/** * Parse a 'var' or 'const' statement, or a 'var' init list in a for * statement. * @param declType A token value: either VAR, CONST, or LET depending on * context. * @param pos the position where the node should start. It's sometimes * the var/const/let keyword, and other times the beginning of the first * token in the first variable declaration. * @return the parsed variable list */
Parse a 'var' or 'const' statement, or a 'var' init list in a for statement
variables
{ "repo_name": "guide-me/GuideMe", "path": "src/main/java/org/mozilla/javascript/Parser.java", "license": "mit", "size": 138659 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,664,923
public void enterJoin_type(SQLParser.Join_typeContext ctx) { }
public void enterJoin_type(SQLParser.Join_typeContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitUnion_join
{ "repo_name": "HEIG-GAPS/slasher", "path": "slasher.corrector/src/main/java/ch/gaps/slasher/corrector/SQLParserBaseListener.java", "license": "mit", "size": 73849 }
[ "ch.gaps.slasher.corrector.SQLParser" ]
import ch.gaps.slasher.corrector.SQLParser;
import ch.gaps.slasher.corrector.*;
[ "ch.gaps.slasher" ]
ch.gaps.slasher;
761,244
private void render(int start, int limit, FontInfo font, int flag, float[] advances, int advancesIndex, boolean draw) { // Since the metrics don't have anti-aliasing set, we create a new FontRenderContext with // the anti-aliasing set. FontRenderContext f = font.mMetrics.getFontRenderContext(); FontRenderContext frc = new FontRenderContext(f.getTransform(), mPaint.isAntiAliased(), f.usesFractionalMetrics()); GlyphVector gv = font.mFont.layoutGlyphVector(frc, mText, start, limit, flag); int ng = gv.getNumGlyphs(); int[] ci = gv.getGlyphCharIndices(0, ng, null); if (advances != null) { for (int i = 0; i < ng; i++) { int adv_idx = advancesIndex + ci[i]; advances[adv_idx] += gv.getGlyphMetrics(i).getAdvanceX(); } } if (draw && mGraphics != null) { mGraphics.drawGlyphVector(gv, mBounds.right, mBaseline); } // Update the bounds. Rectangle2D awtBounds = gv.getLogicalBounds(); RectF bounds = awtRectToAndroidRect(awtBounds, mBounds.right, mBaseline); // If the width of the bounds is zero, no text had been drawn earlier. Hence, use the // coordinates from the bounds as an offset. if (Math.abs(mBounds.right - mBounds.left) == 0) { mBounds = bounds; } else { mBounds.union(bounds); } } // --- Static helper methods ---
void function(int start, int limit, FontInfo font, int flag, float[] advances, int advancesIndex, boolean draw) { FontRenderContext f = font.mMetrics.getFontRenderContext(); FontRenderContext frc = new FontRenderContext(f.getTransform(), mPaint.isAntiAliased(), f.usesFractionalMetrics()); GlyphVector gv = font.mFont.layoutGlyphVector(frc, mText, start, limit, flag); int ng = gv.getNumGlyphs(); int[] ci = gv.getGlyphCharIndices(0, ng, null); if (advances != null) { for (int i = 0; i < ng; i++) { int adv_idx = advancesIndex + ci[i]; advances[adv_idx] += gv.getGlyphMetrics(i).getAdvanceX(); } } if (draw && mGraphics != null) { mGraphics.drawGlyphVector(gv, mBounds.right, mBaseline); } Rectangle2D awtBounds = gv.getLogicalBounds(); RectF bounds = awtRectToAndroidRect(awtBounds, mBounds.right, mBaseline); if (Math.abs(mBounds.right - mBounds.left) == 0) { mBounds = bounds; } else { mBounds.union(bounds); } }
/** * Renders the text to the right of the bounds with the given font. * @param font The font to render the text with. */
Renders the text to the right of the bounds with the given font
render
{ "repo_name": "JuudeDemos/android-sdk-20", "path": "src/android/graphics/BidiRenderer.java", "license": "apache-2.0", "size": 9744 }
[ "android.graphics.Paint_Delegate", "java.awt.font.FontRenderContext", "java.awt.font.GlyphVector", "java.awt.geom.Rectangle2D" ]
import android.graphics.Paint_Delegate; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.geom.Rectangle2D;
import android.graphics.*; import java.awt.font.*; import java.awt.geom.*;
[ "android.graphics", "java.awt" ]
android.graphics; java.awt;
839,882
public Adapter createDateAdapter() { return null; }
Adapter function() { return null; }
/** * Creates a new adapter for an object of class '{@link org.casa.dsltesting.Qt48Xmlschema.Date <em>Date</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> * @return the new adapter. * @see org.casa.dsltesting.Qt48Xmlschema.Date * @generated */
Creates a new adapter for an object of class '<code>org.casa.dsltesting.Qt48Xmlschema.Date Date</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
createDateAdapter
{ "repo_name": "pedromateo/tug_qt_unit_testing_fw", "path": "qt48_model/src/org/casa/dsltesting/Qt48Xmlschema/util/Qt48XmlschemaAdapterFactory.java", "license": "gpl-3.0", "size": 46616 }
[ "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;
33,094
private Account getAccount(String number) throws NotFoundException { try { Account account = accountService.getAccount(number); if (account == null) { throw new NotFoundException("Account not found"); } return account; } catch (Exception e) { throw new NotFoundException("Account not found"); } }
Account function(String number) throws NotFoundException { try { Account account = accountService.getAccount(number); if (account == null) { throw new NotFoundException(STR); } return account; } catch (Exception e) { throw new NotFoundException(STR); } }
/** * Schritt 2 * Account finden * * @param number * @return * @throws NotFoundException */
Schritt 2 Account finden
getAccount
{ "repo_name": "wip-bank/server", "path": "src/de/fhdw/wipbank/server/business/FindAccountByNumber.java", "license": "apache-2.0", "size": 1831 }
[ "de.fhdw.wipbank.server.exception.NotFoundException", "de.fhdw.wipbank.server.model.Account" ]
import de.fhdw.wipbank.server.exception.NotFoundException; import de.fhdw.wipbank.server.model.Account;
import de.fhdw.wipbank.server.exception.*; import de.fhdw.wipbank.server.model.*;
[ "de.fhdw.wipbank" ]
de.fhdw.wipbank;
336,697
public final Property<Integer> gangliaTtl() { return metaBean().gangliaTtl().createProperty(this); }
final Property<Integer> function() { return metaBean().gangliaTtl().createProperty(this); }
/** * Gets the the {@code gangliaTtl} property. * @return the property, not null */
Gets the the gangliaTtl property
gangliaTtl
{ "repo_name": "McLeodMoores/starling", "path": "projects/component/src/main/java/com/opengamma/component/factory/infrastructure/MetricsRepositoryComponentFactory.java", "license": "apache-2.0", "size": 26435 }
[ "org.joda.beans.Property" ]
import org.joda.beans.Property;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
2,528,122
public static Element clientError(String message) { logger.warning(message); if (FreeColDebugger.isInDebugMode(FreeColDebugger.DebugMode.COMMS)) { Thread.dumpStack(); } return createMessage("error", "messageID", "server.reject", "message", message); }
static Element function(String message) { logger.warning(message); if (FreeColDebugger.isInDebugMode(FreeColDebugger.DebugMode.COMMS)) { Thread.dumpStack(); } return createMessage("error", STR, STR, STR, message); }
/** * Creates an error message in response to bad client data. * * @param message The error in plain text. * @return The root <code>Element</code> of the error message. */
Creates an error message in response to bad client data
clientError
{ "repo_name": "edijman/SOEN_6431_Colonization_Game", "path": "src/net/sf/freecol/common/networking/DOMMessage.java", "license": "gpl-2.0", "size": 15850 }
[ "net.sf.freecol.common.debug.FreeColDebugger", "org.w3c.dom.Element" ]
import net.sf.freecol.common.debug.FreeColDebugger; import org.w3c.dom.Element;
import net.sf.freecol.common.debug.*; import org.w3c.dom.*;
[ "net.sf.freecol", "org.w3c.dom" ]
net.sf.freecol; org.w3c.dom;
2,395,364
if(map == null){ out.write("null"); return; } boolean first = true; Iterator<Object> iter = map.entrySet().iterator(); out.write('{'); while(iter.hasNext()){ if(first) first = false; else out.write(','); Map.Entry<Object, Object> entry=(Map.Entry<Object, Object>)iter.next(); out.write('\"'); out.write(escape(String.valueOf(entry.getKey()))); out.write('\"'); out.write(':'); JSONValue.writeJSONString(entry.getValue(), out); } out.write('}'); }
if(map == null){ out.write("null"); return; } boolean first = true; Iterator<Object> iter = map.entrySet().iterator(); out.write('{'); while(iter.hasNext()){ if(first) first = false; else out.write(','); Map.Entry<Object, Object> entry=(Map.Entry<Object, Object>)iter.next(); out.write('\STR'); out.write(':'); JSONValue.writeJSONString(entry.getValue(), out); } out.write('}'); }
/** * Encode a map into JSON text and write it to out. * If this map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviours will be ignored at this top level. * * @see org.json.simpleForBukkit.JSONValue#writeJSONString(Object, Writer) * * @param map * @param out */
Encode a map into JSON text and write it to out. If this map is also a JSONAware or JSONStreamAware, JSONAware or JSONStreamAware specific behaviours will be ignored at this top level
writeJSONString
{ "repo_name": "alecgorge/jsonapi", "path": "src/main/java/org/json/simpleForBukkit/JSONObject.java", "license": "mit", "size": 3645 }
[ "java.util.Iterator", "java.util.Map" ]
import java.util.Iterator; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,244,588
private void buildAgeRangeCrit(ClinicalDataQuery cghQuery, Criteria ageCrit ) { AgeCriteria crit = cghQuery.getAgeCriteria(); long lowerLmtInYrs = 0; long upperLmtInYrs = 0; if (crit != null) { if(crit.getLowerAgeLimit() != null && crit.getUpperAgeLimit() != null) { lowerLmtInYrs= crit.getLowerAgeLimit().getValueObject().longValue(); upperLmtInYrs = crit.getUpperAgeLimit().getValueObject().longValue(); } if(crit.getLowerAgeLimit() != null && crit.getUpperAgeLimit() == null) { lowerLmtInYrs= crit.getLowerAgeLimit().getValueObject().longValue(); upperLmtInYrs = 90; } if(crit.getLowerAgeLimit() == null && crit.getUpperAgeLimit() != null) { upperLmtInYrs = crit.getUpperAgeLimit().getValueObject().longValue(); } ageCrit.addBetween(PatientData.AGE, new Long(lowerLmtInYrs), new Long(upperLmtInYrs)); } }
void function(ClinicalDataQuery cghQuery, Criteria ageCrit ) { AgeCriteria crit = cghQuery.getAgeCriteria(); long lowerLmtInYrs = 0; long upperLmtInYrs = 0; if (crit != null) { if(crit.getLowerAgeLimit() != null && crit.getUpperAgeLimit() != null) { lowerLmtInYrs= crit.getLowerAgeLimit().getValueObject().longValue(); upperLmtInYrs = crit.getUpperAgeLimit().getValueObject().longValue(); } if(crit.getLowerAgeLimit() != null && crit.getUpperAgeLimit() == null) { lowerLmtInYrs= crit.getLowerAgeLimit().getValueObject().longValue(); upperLmtInYrs = 90; } if(crit.getLowerAgeLimit() == null && crit.getUpperAgeLimit() != null) { upperLmtInYrs = crit.getUpperAgeLimit().getValueObject().longValue(); } ageCrit.addBetween(PatientData.AGE, new Long(lowerLmtInYrs), new Long(upperLmtInYrs)); } }
/** * * private method used to add the age range to OJB criteria */
private method used to add the age range to OJB criteria
buildAgeRangeCrit
{ "repo_name": "NCIP/rembrandt", "path": "src/gov/nih/nci/rembrandt/queryservice/queryprocessing/clinical/ClinicalQueryHandler.java", "license": "bsd-3-clause", "size": 105681 }
[ "gov.nih.nci.caintegrator.dto.critieria.AgeCriteria", "gov.nih.nci.rembrandt.dbbean.PatientData", "gov.nih.nci.rembrandt.dto.query.ClinicalDataQuery", "org.apache.ojb.broker.query.Criteria" ]
import gov.nih.nci.caintegrator.dto.critieria.AgeCriteria; import gov.nih.nci.rembrandt.dbbean.PatientData; import gov.nih.nci.rembrandt.dto.query.ClinicalDataQuery; import org.apache.ojb.broker.query.Criteria;
import gov.nih.nci.caintegrator.dto.critieria.*; import gov.nih.nci.rembrandt.dbbean.*; import gov.nih.nci.rembrandt.dto.query.*; import org.apache.ojb.broker.query.*;
[ "gov.nih.nci", "org.apache.ojb" ]
gov.nih.nci; org.apache.ojb;
2,224,308
@Test(expected=IllegalArgumentException.class) public void testSendExplicitDataDestinationEndpointNegative() throws TimeoutException, XBeeException { xbeeDevice.sendExplicitDataAsync(XBEE_64BIT_ADDRESS, XBEE_16BIT_ADDRESS, SOURCE_ENDPOINT, -59, CLUSTER_ID, PROFILE_ID, DATA.getBytes()); }
@Test(expected=IllegalArgumentException.class) void function() throws TimeoutException, XBeeException { xbeeDevice.sendExplicitDataAsync(XBEE_64BIT_ADDRESS, XBEE_16BIT_ADDRESS, SOURCE_ENDPOINT, -59, CLUSTER_ID, PROFILE_ID, DATA.getBytes()); }
/** * Test method for {@link com.digi.xbee.api.XBeeDevice#sendExplicitDataAsync(XBee64BitAddress, XBee16BitAddress, int, int, int, int, byte[])}. * * <p>Verify that async. explicit data cannot be sent if the source endpoint is negative.</p> * * @throws XBeeException * @throws TimeoutException */
Test method for <code>com.digi.xbee.api.XBeeDevice#sendExplicitDataAsync(XBee64BitAddress, XBee16BitAddress, int, int, int, int, byte[])</code>. Verify that async. explicit data cannot be sent if the source endpoint is negative
testSendExplicitDataDestinationEndpointNegative
{ "repo_name": "digidotcom/XBeeJavaLibrary", "path": "library/src/test/java/com/digi/xbee/api/SendExplicitDataAsync6416Test.java", "license": "mpl-2.0", "size": 15799 }
[ "com.digi.xbee.api.exceptions.TimeoutException", "com.digi.xbee.api.exceptions.XBeeException", "org.junit.Test" ]
import com.digi.xbee.api.exceptions.TimeoutException; import com.digi.xbee.api.exceptions.XBeeException; import org.junit.Test;
import com.digi.xbee.api.exceptions.*; import org.junit.*;
[ "com.digi.xbee", "org.junit" ]
com.digi.xbee; org.junit;
2,631,335
@TimerJ public void startProcess(String queryId, ConnectorProcess connectorProcess) throws ExecutionException { if (processMap.containsKey(queryId)) { String msg = "The processMap with id " + queryId + " already exists "; logger.error(msg); throw new ExecutionException(msg); } Thread thread = new Thread(connectorProcess, "[StreamingQuery-" + queryId + "]"); processMap.put(queryId, new ThreadProcess(thread, connectorProcess)); thread.start(); }
void function(String queryId, ConnectorProcess connectorProcess) throws ExecutionException { if (processMap.containsKey(queryId)) { String msg = STR + queryId + STR; logger.error(msg); throw new ExecutionException(msg); } Thread thread = new Thread(connectorProcess, STR + queryId + "]"); processMap.put(queryId, new ThreadProcess(thread, connectorProcess)); thread.start(); }
/** * Start the process. * * @param queryId * the query id. * @param connectorProcess * a connector procces. * @throws ExecutionException * if the connection fail. */
Start the process
startProcess
{ "repo_name": "Stratio/stratio-connector-streaming", "path": "connector-streaming/src/main/java/com/stratio/connector/streaming/core/procces/ConnectorProcessHandler.java", "license": "apache-2.0", "size": 4126 }
[ "com.stratio.crossdata.common.exceptions.ExecutionException" ]
import com.stratio.crossdata.common.exceptions.ExecutionException;
import com.stratio.crossdata.common.exceptions.*;
[ "com.stratio.crossdata" ]
com.stratio.crossdata;
774,134
private void missingRequiredData(String msg) { if (alert) { return; } alert = true; MessageBox.alert(I18N.CONSTANTS.createProjectDisable(), msg, null); window.hide(); }
void function(String msg) { if (alert) { return; } alert = true; MessageBox.alert(I18N.CONSTANTS.createProjectDisable(), msg, null); window.hide(); }
/** * Informs the user that some required data cannot be recovered. The project * cannot be created. * * @param msg * The alert message. */
Informs the user that some required data cannot be recovered. The project cannot be created
missingRequiredData
{ "repo_name": "spMohanty/sigmah_svn_to_git_migration_test", "path": "sigmah/src/main/java/org/sigmah/client/page/dashboard/CreateProjectWindow.java", "license": "gpl-3.0", "size": 30599 }
[ "com.extjs.gxt.ui.client.widget.MessageBox" ]
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.*;
[ "com.extjs.gxt" ]
com.extjs.gxt;
1,573,914
ExtendedExchange ee = (ExtendedExchange) exchange; if (ee.isFailed() || ee.isRollbackOnly() || ee.isRollbackOnlyLast() || ee.isErrorHandlerHandled()) { // The errorErrorHandler is only set if satisfactory handling was done // by the error handler. It's still an exception, the exchange still failed. if (log.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); sb.append("Message exchange has failed: ").append(message).append(" for exchange: ").append(exchange); if (exchange.isRollbackOnly() || exchange.isRollbackOnlyLast()) { sb.append(" Marked as rollback only."); } if (exchange.getException() != null) { sb.append(" Exception: ").append(exchange.getException()); } if (ee.isErrorHandlerHandled()) { sb.append(" Handled by the error handler."); } log.debug(sb.toString()); } return false; } // check for stop if (ee.isRouteStop()) { if (log.isDebugEnabled()) { log.debug("ExchangeId: {} is marked to stop routing: {}", exchange.getExchangeId(), exchange); } return false; } return true; }
ExtendedExchange ee = (ExtendedExchange) exchange; if (ee.isFailed() ee.isRollbackOnly() ee.isRollbackOnlyLast() ee.isErrorHandlerHandled()) { if (log.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); sb.append(STR).append(message).append(STR).append(exchange); if (exchange.isRollbackOnly() exchange.isRollbackOnlyLast()) { sb.append(STR); } if (exchange.getException() != null) { sb.append(STR).append(exchange.getException()); } if (ee.isErrorHandlerHandled()) { sb.append(STR); } log.debug(sb.toString()); } return false; } if (ee.isRouteStop()) { if (log.isDebugEnabled()) { log.debug(STR, exchange.getExchangeId(), exchange); } return false; } return true; }
/** * Should we continue processing the exchange? * * @param exchange the next exchange * @param message a message to use when logging that we should not continue processing * @param log a logger * @return <tt>true</tt> to continue processing, <tt>false</tt> to break out, for example if an exception * occurred. */
Should we continue processing the exchange
continueProcessing
{ "repo_name": "adessaigne/camel", "path": "core/camel-base/src/main/java/org/apache/camel/processor/PipelineHelper.java", "license": "apache-2.0", "size": 3036 }
[ "org.apache.camel.ExtendedExchange" ]
import org.apache.camel.ExtendedExchange;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
597,698
public static final List<Class> scanForClassesWithAnnotation(Class<? extends Annotation> annType) { List<Class> classes = new ArrayList<Class>(); log.debug("scanForClassesWithAnnotation: packages "+packages); for (String pkg : packages.split(",")) classes.addAll(scanForClassesWithAnnotation(annType, pkg)); return classes; }
static final List<Class> function(Class<? extends Annotation> annType) { List<Class> classes = new ArrayList<Class>(); log.debug(STR+packages); for (String pkg : packages.split(",")) classes.addAll(scanForClassesWithAnnotation(annType, pkg)); return classes; }
/** * Retrieve a list of classes in the package list configured by #setAppPackages(String) * * @param annType annotation to search for * @return list of classes found, otherwise empty set */
Retrieve a list of classes in the package list configured by #setAppPackages(String)
scanForClassesWithAnnotation
{ "repo_name": "NetTap/inception", "path": "src/main/java/com/nettap/inception/util/Classes.java", "license": "gpl-3.0", "size": 8451 }
[ "java.lang.annotation.Annotation", "java.util.ArrayList", "java.util.List" ]
import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.List;
import java.lang.annotation.*; import java.util.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
2,212,172
public void waitTotalProcessedOrderedRequests(long total) { synchronized (muxStreamer) { while (totalProcessedOrderedReqs < total) { try { muxStreamer.wait(); } catch (InterruptedException e) { throw new IgniteException("Waiting for end of processing the last batch is interrupted", e); } } } }
void function(long total) { synchronized (muxStreamer) { while (totalProcessedOrderedReqs < total) { try { muxStreamer.wait(); } catch (InterruptedException e) { throw new IgniteException(STR, e); } } } }
/** * Waits when total processed ordered requests count to be equal to specified value. * @param total Expected total processed request. */
Waits when total processed ordered requests count to be equal to specified value
waitTotalProcessedOrderedRequests
{ "repo_name": "ptupitsyn/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/query/SqlClientContext.java", "license": "apache-2.0", "size": 9711 }
[ "org.apache.ignite.IgniteException" ]
import org.apache.ignite.IgniteException;
import org.apache.ignite.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,736,907
public FeatureResultSet queryFeaturesForChunk(boolean distinct, String[] columns, BoundingBox boundingBox, String where, String[] whereArgs, String orderBy, int limit, long offset) { return queryFeaturesForChunk(distinct, columns, boundingBox.buildEnvelope(), where, whereArgs, orderBy, limit, offset); }
FeatureResultSet function(boolean distinct, String[] columns, BoundingBox boundingBox, String where, String[] whereArgs, String orderBy, int limit, long offset) { return queryFeaturesForChunk(distinct, columns, boundingBox.buildEnvelope(), where, whereArgs, orderBy, limit, offset); }
/** * Query for features within the bounding box, starting at the offset and * returning no more than the limit * * @param distinct * distinct rows * @param columns * columns * @param boundingBox * bounding box * @param where * where clause * @param whereArgs * where arguments * @param orderBy * order by * @param limit * chunk limit * @param offset * chunk query offset * @return feature results * @since 6.2.0 */
Query for features within the bounding box, starting at the offset and returning no more than the limit
queryFeaturesForChunk
{ "repo_name": "ngageoint/geopackage-java", "path": "src/main/java/mil/nga/geopackage/extension/rtree/RTreeIndexTableDao.java", "license": "mit", "size": 349361 }
[ "mil.nga.geopackage.BoundingBox", "mil.nga.geopackage.features.user.FeatureResultSet" ]
import mil.nga.geopackage.BoundingBox; import mil.nga.geopackage.features.user.FeatureResultSet;
import mil.nga.geopackage.*; import mil.nga.geopackage.features.user.*;
[ "mil.nga.geopackage" ]
mil.nga.geopackage;
1,962,551
public int updateUserLayerCols(final UserLayer userLayer) { try { return getSqlMapClient().update( getNameSpace() + ".updateUserLayerCols", userLayer); } catch (SQLException e) { log.error(e, "Failed to update userLayer col mapping", userLayer); } return 0; }
int function(final UserLayer userLayer) { try { return getSqlMapClient().update( getNameSpace() + STR, userLayer); } catch (SQLException e) { log.error(e, STR, userLayer); } return 0; }
/** * update UserLayer table row field mapping * * @param userLayer */
update UserLayer table row field mapping
updateUserLayerCols
{ "repo_name": "uhef/Oskari-Routing", "path": "service-map/src/main/java/fi/nls/oskari/map/userlayer/service/UserLayerDbServiceIbatisImpl.java", "license": "mit", "size": 4097 }
[ "fi.nls.oskari.domain.map.userlayer.UserLayer", "java.sql.SQLException" ]
import fi.nls.oskari.domain.map.userlayer.UserLayer; import java.sql.SQLException;
import fi.nls.oskari.domain.map.userlayer.*; import java.sql.*;
[ "fi.nls.oskari", "java.sql" ]
fi.nls.oskari; java.sql;
1,487,502
public void addAttribute(String tableName, String attributeName, String attrType, int itemNumber) { // selecting table List<Map<String, String>> items = getOrCreateTable(tableName); // add attribute to item HashMap<String, String> itemAttribs = getOrCreateItemAttribs(items, itemNumber); itemAttribs.put(attributeName, attrType); //items.add(itemAttribs); // add item to table //tablesToItems.put(tableName, items); }
void function(String tableName, String attributeName, String attrType, int itemNumber) { List<Map<String, String>> items = getOrCreateTable(tableName); HashMap<String, String> itemAttribs = getOrCreateItemAttribs(items, itemNumber); itemAttribs.put(attributeName, attrType); }
/** * Adds an attribute to an specific item * @param tableName * @param attributeName * @param attrType * @param itemNumber */
Adds an attribute to an specific item
addAttribute
{ "repo_name": "thainb/GoraDynamoDB", "path": "gora-dynamodb/src/main/java/org/apache/gora/dynamodb/store/DynamoDBMapping.java", "license": "apache-2.0", "size": 10032 }
[ "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;
523,621
public IServer launch(IProject project, IProgressMonitor monitor) throws CoreException { try { monitor.beginTask("Launching " + project.getName(), IProgressMonitor.UNKNOWN); //$NON-NLS-1$ IServer server = createServer(new SubProgressMonitor(monitor, 1), NEVER_OVERWRITE); IServerWorkingCopy wc = server.createWorkingCopy(); IModule[] modules = ServerUtil.getModules(project); if (modules == null || modules.length == 0) { throw new CoreException( DockerFoundryPlugin.getErrorStatus("Sample project does not contain web modules: " + project)); //$NON-NLS-1$ } if (!Arrays.asList(wc.getModules()).contains(modules[0])) { wc.modifyModules(modules, new IModule[0], monitor); server = wc.save(true, monitor); } server.publish(IServer.PUBLISH_INCREMENTAL, monitor); restartServer(server, monitor); return server; } finally { monitor.done(); } }
IServer function(IProject project, IProgressMonitor monitor) throws CoreException { try { monitor.beginTask(STR + project.getName(), IProgressMonitor.UNKNOWN); IServer server = createServer(new SubProgressMonitor(monitor, 1), NEVER_OVERWRITE); IServerWorkingCopy wc = server.createWorkingCopy(); IModule[] modules = ServerUtil.getModules(project); if (modules == null modules.length == 0) { throw new CoreException( DockerFoundryPlugin.getErrorStatus(STR + project)); } if (!Arrays.asList(wc.getModules()).contains(modules[0])) { wc.modifyModules(modules, new IModule[0], monitor); server = wc.save(true, monitor); } server.publish(IServer.PUBLISH_INCREMENTAL, monitor); restartServer(server, monitor); return server; } finally { monitor.done(); } }
/** * Programmatic launch. Generally done by the WST framework (e.g. when a * user double clicks on the server instance in the Server's view or selects * "Connect"). This is generally used only for unit test cases. * @param project * @param monitor * @return * @throws CoreException */
Programmatic launch. Generally done by the WST framework (e.g. when a user double clicks on the server instance in the Server's view or selects "Connect"). This is generally used only for unit test cases
launch
{ "repo_name": "osswangxining/dockerfoundry", "path": "cn.dockerfoundry.ide.eclipse.server.ui/src/cn/dockerfoundry/ide/eclipse/server/ui/internal/ServerHandler.java", "license": "apache-2.0", "size": 12184 }
[ "cn.dockerfoundry.ide.eclipse.server.core.internal.DockerFoundryPlugin", "java.util.Arrays", "org.eclipse.core.resources.IProject", "org.eclipse.core.runtime.CoreException", "org.eclipse.core.runtime.IProgressMonitor", "org.eclipse.core.runtime.SubProgressMonitor", "org.eclipse.wst.server.core.IModule", "org.eclipse.wst.server.core.IServer", "org.eclipse.wst.server.core.IServerWorkingCopy", "org.eclipse.wst.server.core.ServerUtil" ]
import cn.dockerfoundry.ide.eclipse.server.core.internal.DockerFoundryPlugin; import java.util.Arrays; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.wst.server.core.IModule; import org.eclipse.wst.server.core.IServer; import org.eclipse.wst.server.core.IServerWorkingCopy; import org.eclipse.wst.server.core.ServerUtil;
import cn.dockerfoundry.ide.eclipse.server.core.internal.*; import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.wst.server.core.*;
[ "cn.dockerfoundry.ide", "java.util", "org.eclipse.core", "org.eclipse.wst" ]
cn.dockerfoundry.ide; java.util; org.eclipse.core; org.eclipse.wst;
423,854
private boolean isSelectionTemplate() { if (getContext() instanceof DocumentTemplateContext) { DocumentTemplateContext ctx= (DocumentTemplateContext) getContext(); if (ctx.getCompletionLength() > 0) return true; } return false; }
boolean function() { if (getContext() instanceof DocumentTemplateContext) { DocumentTemplateContext ctx= (DocumentTemplateContext) getContext(); if (ctx.getCompletionLength() > 0) return true; } return false; }
/** * Returns <code>true</code> if the proposal has a selection, e.g. will wrap some code. * * @return <code>true</code> if the proposals completion length is non zero * @since 3.2 */
Returns <code>true</code> if the proposal has a selection, e.g. will wrap some code
isSelectionTemplate
{ "repo_name": "johannesMatevosyan/goclipse", "path": "plugin_ide.ui/src-lang/melnorme/lang/ide/ui/templates/LangTemplateProposal.java", "license": "epl-1.0", "size": 4357 }
[ "org.eclipse.jface.text.templates.DocumentTemplateContext" ]
import org.eclipse.jface.text.templates.DocumentTemplateContext;
import org.eclipse.jface.text.templates.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
222,285
public ArrayList<MQTTSubscriber> getAllSubscribersFromTopic(String topic) { ArrayList<MQTTSubscriber> subscribers = new ArrayList<MQTTSubscriber>(); for (int i = 0; i < subscriberList.size(); i++) { MQTTSubscriber sub = subscriberList.get(i); if (sub.getTopic().equals(topic)) { subscribers.add(sub); } } return subscribers; }
ArrayList<MQTTSubscriber> function(String topic) { ArrayList<MQTTSubscriber> subscribers = new ArrayList<MQTTSubscriber>(); for (int i = 0; i < subscriberList.size(); i++) { MQTTSubscriber sub = subscriberList.get(i); if (sub.getTopic().equals(topic)) { subscribers.add(sub); } } return subscribers; }
/** * Returns all subscribers from a certain topic * @param topic the topic to return subscribers for * @return returns an ArrayList of MQTTSubscriber instances */
Returns all subscribers from a certain topic
getAllSubscribersFromTopic
{ "repo_name": "einhov/okse", "path": "broker/src/main/java/no/ntnu/okse/protocol/mqtt/MQTTSubscriptionManager.java", "license": "mit", "size": 7423 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,716,024
public Output<T> output() { return output; }
Output<T> function() { return output; }
/** * Gets output. * A complex tensor of the same shape as {@code input}. The inner-most * dimension of {@code input} is replaced with its inverse 1D Fourier transform. * <p>{@literal @}compatibility(numpy)<br> * Equivalent to np.fft.ifft * <br>{@literal @}end_compatibility * @return output. */
Gets output. A complex tensor of the same shape as input. The inner-most dimension of input is replaced with its inverse 1D Fourier transform. @compatibility(numpy) Equivalent to np.fft.ifft @end_compatibility
output
{ "repo_name": "tensorflow/java", "path": "tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/signal/Ifft.java", "license": "apache-2.0", "size": 3544 }
[ "org.tensorflow.Output" ]
import org.tensorflow.Output;
import org.tensorflow.*;
[ "org.tensorflow" ]
org.tensorflow;
1,084,894
Class<? extends PropertyResolver> impl();
Class<? extends PropertyResolver> impl();
/** * return impl() on the wrapped instance * */
return impl() on the wrapped instance
impl
{ "repo_name": "chrisruffalo/ee-config", "path": "src/main/java/com/github/chrisruffalo/eeconfig/wrapper/ResolverWrapper.java", "license": "apache-2.0", "size": 879 }
[ "com.github.chrisruffalo.eeconfig.strategy.property.PropertyResolver" ]
import com.github.chrisruffalo.eeconfig.strategy.property.PropertyResolver;
import com.github.chrisruffalo.eeconfig.strategy.property.*;
[ "com.github.chrisruffalo" ]
com.github.chrisruffalo;
1,059,340
public void scheduleFeedbackSessionResendPublishedEmail(String courseId, String feedbackSessionName, String[] usersToEmail, String requestingInstructorId) { FeedbackSessionRemindRequest remindRequest = new FeedbackSessionRemindRequest(courseId, feedbackSessionName, requestingInstructorId, usersToEmail); addTask(TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_QUEUE_NAME, TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL, new HashMap<>(), remindRequest); }
void function(String courseId, String feedbackSessionName, String[] usersToEmail, String requestingInstructorId) { FeedbackSessionRemindRequest remindRequest = new FeedbackSessionRemindRequest(courseId, feedbackSessionName, requestingInstructorId, usersToEmail); addTask(TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_QUEUE_NAME, TaskQueue.FEEDBACK_SESSION_RESEND_PUBLISHED_EMAIL_WORKER_URL, new HashMap<>(), remindRequest); }
/** * Schedules for feedback session publication reminders * for the specified feedback session for the specified group of users. * * @param courseId the course ID of the feedback session * @param feedbackSessionName the name of the feedback session * @param usersToEmail the group of users to send the reminders to * @param requestingInstructorId the ID of the instructor who sends the reminder */
Schedules for feedback session publication reminders for the specified feedback session for the specified group of users
scheduleFeedbackSessionResendPublishedEmail
{ "repo_name": "wkurniawan07/repo", "path": "src/main/java/teammates/logic/api/TaskQueuer.java", "license": "gpl-2.0", "size": 12025 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,504,864
Map<String, Map<String, Object>> featurePropertiesMap = new HashMap<>(); HashMap<String, Object> defaultFeatureCollectionProperties = new HashMap<>(); SimpleFeatureType routingFeatureType = new SimpleFeatureTypes(SimpleFeatureTypes.RouteFeatureType.ROUTE_FEATURE).create(); DefaultFeatureCollection defaultFeatureCollection = new DefaultFeatureCollection("routing", routingFeatureType); GeometryFactory geometryFactory = new GeometryFactory(); JSONObject jsonRoutes = JsonRoutingResponseWriter.toJson(rreq, routeResult); for (int i = 0; i < jsonRoutes.getJSONArray(KEY_ROUTES).length(); i++) { JSONObject route = jsonRoutes.getJSONArray(KEY_ROUTES).getJSONObject(i); SimpleFeatureBuilder routingFeatureBuilder = new SimpleFeatureBuilder(routingFeatureType); SimpleFeature routingFeature = null; HashMap<String, Object> routingFeatureProperties = new HashMap<>(); Coordinate[] coordinateArray = routeResult[i].getGeometry(); LineString lineString = geometryFactory.createLineString(coordinateArray); routingFeatureBuilder.set("geometry", lineString); JSONArray routeKeys = route.names(); for (int j = 0; j < routeKeys.length(); j++) { String key = routeKeys.getString(j); if (!key.equals("geometry_format") && !key.equals("geometry")) { routingFeatureProperties.put(key, route.get(key)); } } routingFeature = routingFeatureBuilder.buildFeature(null); defaultFeatureCollection.add(routingFeature); featurePropertiesMap.put(routingFeature.getID(), routingFeatureProperties); JSONArray jsonRouteKeys = jsonRoutes.names(); for (int j = 0; j < jsonRouteKeys.length(); j++) { String key = jsonRouteKeys.getString(j); if (!key.equals(KEY_ROUTES)) { defaultFeatureCollectionProperties.put(key, jsonRoutes.get(key)); } } } return addProperties(defaultFeatureCollection, featurePropertiesMap, defaultFeatureCollectionProperties); }
Map<String, Map<String, Object>> featurePropertiesMap = new HashMap<>(); HashMap<String, Object> defaultFeatureCollectionProperties = new HashMap<>(); SimpleFeatureType routingFeatureType = new SimpleFeatureTypes(SimpleFeatureTypes.RouteFeatureType.ROUTE_FEATURE).create(); DefaultFeatureCollection defaultFeatureCollection = new DefaultFeatureCollection(STR, routingFeatureType); GeometryFactory geometryFactory = new GeometryFactory(); JSONObject jsonRoutes = JsonRoutingResponseWriter.toJson(rreq, routeResult); for (int i = 0; i < jsonRoutes.getJSONArray(KEY_ROUTES).length(); i++) { JSONObject route = jsonRoutes.getJSONArray(KEY_ROUTES).getJSONObject(i); SimpleFeatureBuilder routingFeatureBuilder = new SimpleFeatureBuilder(routingFeatureType); SimpleFeature routingFeature = null; HashMap<String, Object> routingFeatureProperties = new HashMap<>(); Coordinate[] coordinateArray = routeResult[i].getGeometry(); LineString lineString = geometryFactory.createLineString(coordinateArray); routingFeatureBuilder.set(STR, lineString); JSONArray routeKeys = route.names(); for (int j = 0; j < routeKeys.length(); j++) { String key = routeKeys.getString(j); if (!key.equals(STR) && !key.equals(STR)) { routingFeatureProperties.put(key, route.get(key)); } } routingFeature = routingFeatureBuilder.buildFeature(null); defaultFeatureCollection.add(routingFeature); featurePropertiesMap.put(routingFeature.getID(), routingFeatureProperties); JSONArray jsonRouteKeys = jsonRoutes.names(); for (int j = 0; j < jsonRouteKeys.length(); j++) { String key = jsonRouteKeys.getString(j); if (!key.equals(KEY_ROUTES)) { defaultFeatureCollectionProperties.put(key, jsonRoutes.get(key)); } } } return addProperties(defaultFeatureCollection, featurePropertiesMap, defaultFeatureCollectionProperties); }
/** * The function transforms {@link RouteResult}'s in a ready-to-be-shipped {@link DefaultFeatureCollection} enriched with ORS specific information * The return value is a {@link JSONObject}. * The function is ready to process RouteResults[] Arrays with multiple Routes. * Results will always be {@link DefaultFeatureCollection} nevertheless the input consists of one ore more Routes. * * @param rreq A {@link RoutingRequest} holding the initial Request. * @param routeResult A {@link RouteResult}. * @return It will always return a {@link DefaultFeatureCollection} in a {@link JSONObject} representation. * @throws Exception Throws an error if the JsonRoute could not be calculated */
The function transforms <code>RouteResult</code>'s in a ready-to-be-shipped <code>DefaultFeatureCollection</code> enriched with ORS specific information The return value is a <code>JSONObject</code>. The function is ready to process RouteResults[] Arrays with multiple Routes. Results will always be <code>DefaultFeatureCollection</code> nevertheless the input consists of one ore more Routes
toGeoJson
{ "repo_name": "GIScience/openrouteservice-core", "path": "openrouteservice/src/main/java/org/heigit/ors/globalresponseprocessor/geojson/GeoJsonResponseWriter.java", "license": "mit", "size": 15229 }
[ "com.vividsolutions.jts.geom.Coordinate", "com.vividsolutions.jts.geom.GeometryFactory", "com.vividsolutions.jts.geom.LineString", "java.util.HashMap", "java.util.Map", "org.geotools.feature.DefaultFeatureCollection", "org.geotools.feature.simple.SimpleFeatureBuilder", "org.heigit.ors.services.routing.requestprocessors.json.JsonRoutingResponseWriter", "org.json.JSONArray", "org.json.JSONObject", "org.opengis.feature.simple.SimpleFeature", "org.opengis.feature.simple.SimpleFeatureType" ]
import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.LineString; import java.util.HashMap; import java.util.Map; import org.geotools.feature.DefaultFeatureCollection; import org.geotools.feature.simple.SimpleFeatureBuilder; import org.heigit.ors.services.routing.requestprocessors.json.JsonRoutingResponseWriter; import org.json.JSONArray; import org.json.JSONObject; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType;
import com.vividsolutions.jts.geom.*; import java.util.*; import org.geotools.feature.*; import org.geotools.feature.simple.*; import org.heigit.ors.services.routing.requestprocessors.json.*; import org.json.*; import org.opengis.feature.simple.*;
[ "com.vividsolutions.jts", "java.util", "org.geotools.feature", "org.heigit.ors", "org.json", "org.opengis.feature" ]
com.vividsolutions.jts; java.util; org.geotools.feature; org.heigit.ors; org.json; org.opengis.feature;
2,441,072
static public boolean isAssignableFrom (Class c1, Class c2) { Type c1Type = ReflectionCache.getType(c1); Type c2Type = ReflectionCache.getType(c2); return c1Type.isAssignableFrom(c2Type); }
static boolean function (Class c1, Class c2) { Type c1Type = ReflectionCache.getType(c1); Type c2Type = ReflectionCache.getType(c2); return c1Type.isAssignableFrom(c2Type); }
/** Determines if the class or interface represented by first Class parameter is either the same as, or is a superclass or * superinterface of, the class or interface represented by the second Class parameter. */
Determines if the class or interface represented by first Class parameter is either the same as, or is a superclass or
isAssignableFrom
{ "repo_name": "antag99/artemis-odb", "path": "artemis-gwt/src/main/java/com/artemis/backends/gwt/emu/com/artemis/utils/reflect/ClassReflection.java", "license": "apache-2.0", "size": 11114 }
[ "com.artemis.gwtref.client.ReflectionCache", "com.artemis.gwtref.client.Type" ]
import com.artemis.gwtref.client.ReflectionCache; import com.artemis.gwtref.client.Type;
import com.artemis.gwtref.client.*;
[ "com.artemis.gwtref" ]
com.artemis.gwtref;
1,234,340
public static AlgorithmMethod getCanonicalizationMethod(String algorithm, List<String> inclusiveNamespacePrefixes) { if (algorithm == null) { throw new IllegalArgumentException("algorithm is null"); } XmlSignatureTransform canonicalizationMethod = new XmlSignatureTransform(algorithm); if (inclusiveNamespacePrefixes != null) { ExcC14NParameterSpec parameters = new ExcC14NParameterSpec(inclusiveNamespacePrefixes); canonicalizationMethod.setParameterSpec(parameters); } return canonicalizationMethod; }
static AlgorithmMethod function(String algorithm, List<String> inclusiveNamespacePrefixes) { if (algorithm == null) { throw new IllegalArgumentException(STR); } XmlSignatureTransform canonicalizationMethod = new XmlSignatureTransform(algorithm); if (inclusiveNamespacePrefixes != null) { ExcC14NParameterSpec parameters = new ExcC14NParameterSpec(inclusiveNamespacePrefixes); canonicalizationMethod.setParameterSpec(parameters); } return canonicalizationMethod; }
/** * Returns a configuration for a canonicalization algorithm. * * @param algorithm * algorithm URI * @param inclusiveNamespacePrefixes * namespace prefixes which should be treated like in the * inclusive canonicalization, only relevant if the algorithm is * exclusive * @return canonicalization * @throws IllegalArgumentException * if <tt>algorithm</tt> is <code>null</code> */
Returns a configuration for a canonicalization algorithm
getCanonicalizationMethod
{ "repo_name": "objectiser/camel", "path": "components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureHelper.java", "license": "apache-2.0", "size": 21675 }
[ "java.util.List", "javax.xml.crypto.AlgorithmMethod", "javax.xml.crypto.dsig.spec.ExcC14NParameterSpec" ]
import java.util.List; import javax.xml.crypto.AlgorithmMethod; import javax.xml.crypto.dsig.spec.ExcC14NParameterSpec;
import java.util.*; import javax.xml.crypto.*; import javax.xml.crypto.dsig.spec.*;
[ "java.util", "javax.xml" ]
java.util; javax.xml;
2,625,126
@Test public void testSetVisible() { boolean valueOnly = true; FieldConfigTTF field = new FieldConfigTTF( new FieldConfigCommonData( String.class, FieldIdEnum.NAME, "test label", valueOnly, false), null, null, null); boolean expectedValue = true; field.setVisible(expectedValue); field.createUI(); expectedValue = false; field.setVisible(expectedValue); }
void function() { boolean valueOnly = true; FieldConfigTTF field = new FieldConfigTTF( new FieldConfigCommonData( String.class, FieldIdEnum.NAME, STR, valueOnly, false), null, null, null); boolean expectedValue = true; field.setVisible(expectedValue); field.createUI(); expectedValue = false; field.setVisible(expectedValue); }
/** * Test method for {@link * com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#setVisible(boolean)}. */
Test method for <code>com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF#setVisible(boolean)</code>
testSetVisible
{ "repo_name": "robward-scisys/sldeditor", "path": "modules/application/src/test/java/com/sldeditor/test/unit/ui/detail/config/symboltype/ttf/FieldConfigTTFTest.java", "license": "gpl-3.0", "size": 23976 }
[ "com.sldeditor.common.xml.ui.FieldIdEnum", "com.sldeditor.ui.detail.config.FieldConfigCommonData", "com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF" ]
import com.sldeditor.common.xml.ui.FieldIdEnum; import com.sldeditor.ui.detail.config.FieldConfigCommonData; import com.sldeditor.ui.detail.config.symboltype.ttf.FieldConfigTTF;
import com.sldeditor.common.xml.ui.*; import com.sldeditor.ui.detail.config.*; import com.sldeditor.ui.detail.config.symboltype.ttf.*;
[ "com.sldeditor.common", "com.sldeditor.ui" ]
com.sldeditor.common; com.sldeditor.ui;
99,114
public Vec3 toVec3() { return Vec3.createVectorHelper(this.x, this.y, this.z); }
Vec3 function() { return Vec3.createVectorHelper(this.x, this.y, this.z); }
/** * Converts this vector three into a Minecraft Vec3 object */
Converts this vector three into a Minecraft Vec3 object
toVec3
{ "repo_name": "tomasmartins/TMCraft", "path": "common/universalelectricity/core/vector/Vector3.java", "license": "gpl-3.0", "size": 7907 }
[ "net.minecraft.util.Vec3" ]
import net.minecraft.util.Vec3;
import net.minecraft.util.*;
[ "net.minecraft.util" ]
net.minecraft.util;
331,509
public void test_keyOrder() { final byte[] uri = fixture.value2Key(RDF.TYPE); final byte[] bnd = fixture.value2Key(new BNodeImpl("foo")); final byte[] lit = fixture.value2Key(new LiteralImpl("abc")); final byte[] lcl = fixture.value2Key(new LiteralImpl("abc", "en")); final byte[] dtl = fixture.value2Key(new LiteralImpl("abc", XSD.BOOLEAN)); // URIs before plain literals. assertTrue(UnsignedByteArrayComparator.INSTANCE.compare(uri, lit) < 0); // plain literals before language code literals. assertTrue(UnsignedByteArrayComparator.INSTANCE.compare(lit, lcl) < 0); // language code literals before datatype literals. assertTrue(UnsignedByteArrayComparator.INSTANCE.compare(lcl, dtl) < 0); // datatype literals before blank nodes. assertTrue(UnsignedByteArrayComparator.INSTANCE.compare(dtl, bnd) < 0); }
void function() { final byte[] uri = fixture.value2Key(RDF.TYPE); final byte[] bnd = fixture.value2Key(new BNodeImpl("foo")); final byte[] lit = fixture.value2Key(new LiteralImpl("abc")); final byte[] lcl = fixture.value2Key(new LiteralImpl("abc", "en")); final byte[] dtl = fixture.value2Key(new LiteralImpl("abc", XSD.BOOLEAN)); assertTrue(UnsignedByteArrayComparator.INSTANCE.compare(uri, lit) < 0); assertTrue(UnsignedByteArrayComparator.INSTANCE.compare(lit, lcl) < 0); assertTrue(UnsignedByteArrayComparator.INSTANCE.compare(lcl, dtl) < 0); assertTrue(UnsignedByteArrayComparator.INSTANCE.compare(dtl, bnd) < 0); }
/** * Tests the gross ordering over the different kinds of {@link Value}s but * deliberately does not pay attention to the sort key ordering for string * data. * * @see ITermIndexCodes */
Tests the gross ordering over the different kinds of <code>Value</code>s but deliberately does not pay attention to the sort key ordering for string data
test_keyOrder
{ "repo_name": "blazegraph/database", "path": "bigdata-rdf-test/src/test/java/com/bigdata/rdf/lexicon/TestLexiconKeyBuilder.java", "license": "gpl-2.0", "size": 22639 }
[ "com.bigdata.util.BytesUtil", "org.openrdf.model.impl.BNodeImpl", "org.openrdf.model.impl.LiteralImpl" ]
import com.bigdata.util.BytesUtil; import org.openrdf.model.impl.BNodeImpl; import org.openrdf.model.impl.LiteralImpl;
import com.bigdata.util.*; import org.openrdf.model.impl.*;
[ "com.bigdata.util", "org.openrdf.model" ]
com.bigdata.util; org.openrdf.model;
1,835,540
public void refreshContentUnderHost(Host host)throws DotReindexStateException;
void function(Host host)throws DotReindexStateException;
/** * Reindexes content under a given host + refreshes the content from cache * @param host * @throws DotReindexStateException */
Reindexes content under a given host + refreshes the content from cache
refreshContentUnderHost
{ "repo_name": "guhb/core", "path": "src/com/dotmarketing/portlets/contentlet/business/ContentletAPI.java", "license": "gpl-3.0", "size": 64730 }
[ "com.dotmarketing.beans.Host" ]
import com.dotmarketing.beans.Host;
import com.dotmarketing.beans.*;
[ "com.dotmarketing.beans" ]
com.dotmarketing.beans;
290,493
public static boolean backPay(Map<String, String> req, Map<String, Object> rsp) { // TODO check sign return req.getOrDefault(WxFields.F_result_code, "failure").equalsIgnoreCase("SUCCESS"); }
static boolean function(Map<String, String> req, Map<String, Object> rsp) { return req.getOrDefault(WxFields.F_result_code, STR).equalsIgnoreCase(STR); }
/** * check sign https://pay.weixin.qq.com/wiki/doc/api/app.php?chapter=4_3 * * @param req * @param rsp * @return */
check sign HREF
backPay
{ "repo_name": "dzh/jframe", "path": "jframe-pay/jframe-pay-plugin/jframe-pay-wx/src/main/java/jframe/pay/wx/http/client/WxServiceNew.java", "license": "apache-2.0", "size": 8400 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
963,124
public void processArguments() { // For most objects we'd handle the multiple possibilities for // initialization variables // as multiple constructors. For Fragments, however, it's customary to // use // setArguments / getArguments. if (getArguments() != null) { Bundle args = getArguments(); if (args.containsKey(TEXT_KEY)) { mText = args.getString(TEXT_KEY); Log.d("Constructor", "Added Text."); } else if (args.containsKey(TEXT_ID_KEY)) { mTextId = args.getInt(TEXT_ID_KEY); mText = getString(mTextId); } } }
void function() { if (getArguments() != null) { Bundle args = getArguments(); if (args.containsKey(TEXT_KEY)) { mText = args.getString(TEXT_KEY); Log.d(STR, STR); } else if (args.containsKey(TEXT_ID_KEY)) { mTextId = args.getInt(TEXT_ID_KEY); mText = getString(mTextId); } } }
/** * Processes the arguments passed into this Fragment via setArguments * method. Currently the method only looks for text or a textID, nothing * else. */
Processes the arguments passed into this Fragment via setArguments method. Currently the method only looks for text or a textID, nothing else
processArguments
{ "repo_name": "scottyab/androidkeystore", "path": "src/com/example/keystore/common/SimpleTextFragment.java", "license": "apache-2.0", "size": 3149 }
[ "android.os.Bundle", "android.util.Log" ]
import android.os.Bundle; import android.util.Log;
import android.os.*; import android.util.*;
[ "android.os", "android.util" ]
android.os; android.util;
444,470
public void testRead() { book = new WorkBookHandle( wd + finpath ); }
void function() { book = new WorkBookHandle( wd + finpath ); }
/** * Reads in the default file * ------------------------------------------------------------ */
Reads in the default file ------------------------------------------------------------
testRead
{ "repo_name": "Maxels88/openxls", "path": "src/test/java/docs/samples/Excel2007/Excel2007Test.java", "license": "gpl-3.0", "size": 3966 }
[ "org.openxls.ExtenXLS" ]
import org.openxls.ExtenXLS;
import org.openxls.*;
[ "org.openxls" ]
org.openxls;
2,577,467
public JobProperty exeParalleJob(T sourceObject, int parallelism_hint, FailEventListener failEventListener, Object... objects) throws ParallelException { return this.exeParalleJob(sourceObject, parallelism_hint, 0, failEventListener, objects); }
JobProperty function(T sourceObject, int parallelism_hint, FailEventListener failEventListener, Object... objects) throws ParallelException { return this.exeParalleJob(sourceObject, parallelism_hint, 0, failEventListener, objects); }
/** * exe big Paralle Job template * <p> * same return this.exeParalleJob(sourceObject, blockNum, 0, * failEventListener,objects); * * @param sourceObject * @param parallelism_hint * @param failEventListener * @param objects * @return * @throws ParallelException */
exe big Paralle Job template same return this.exeParalleJob(sourceObject, blockNum, 0, failEventListener,objects)
exeParalleJob
{ "repo_name": "suhuanzheng7784877/ParallelExecute", "path": "project/ParallelExecute/src/main/java/org/para/execute/ParallelExecute.java", "license": "apache-2.0", "size": 7112 }
[ "org.para.exception.ParallelException", "org.para.execute.model.JobProperty", "org.para.trace.listener.FailEventListener" ]
import org.para.exception.ParallelException; import org.para.execute.model.JobProperty; import org.para.trace.listener.FailEventListener;
import org.para.exception.*; import org.para.execute.model.*; import org.para.trace.listener.*;
[ "org.para.exception", "org.para.execute", "org.para.trace" ]
org.para.exception; org.para.execute; org.para.trace;
2,062,326
private void releaseHandler(EventHandler eventHandler) { if (eventHandler instanceof FancyTerminalEventHandler) { // Make sure that the terminal state of the old event handler is clear // before creating a new one. ((FancyTerminalEventHandler)eventHandler).resetTerminal(); } }
void function(EventHandler eventHandler) { if (eventHandler instanceof FancyTerminalEventHandler) { ((FancyTerminalEventHandler)eventHandler).resetTerminal(); } }
/** * Unsets the event handler. */
Unsets the event handler
releaseHandler
{ "repo_name": "JackSullivan/bazel", "path": "src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java", "license": "apache-2.0", "size": 26922 }
[ "com.google.devtools.build.lib.events.EventHandler" ]
import com.google.devtools.build.lib.events.EventHandler;
import com.google.devtools.build.lib.events.*;
[ "com.google.devtools" ]
com.google.devtools;
620,709
List<String> getPageNames();
List<String> getPageNames();
/** * Returns a list of all page names, in sorted order. */
Returns a list of all page names, in sorted order
getPageNames
{ "repo_name": "agileowl/tapestry-5", "path": "tapestry-core/src/main/java/org/apache/tapestry5/services/ComponentClassResolver.java", "license": "apache-2.0", "size": 6185 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
576,956
public static ims.emergency.domain.objects.DNWStatus extractDNWStatus(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.DNWStatusForAmendTimesVo valueObject) { return extractDNWStatus(domainFactory, valueObject, new HashMap()); }
static ims.emergency.domain.objects.DNWStatus function(ims.domain.ILightweightDomainFactory domainFactory, ims.emergency.vo.DNWStatusForAmendTimesVo valueObject) { return extractDNWStatus(domainFactory, valueObject, new HashMap()); }
/** * Create the domain object from the value object. * @param domainFactory - used to create existing (persistent) domain objects. * @param valueObject - extract the domain object fields from this. */
Create the domain object from the value object
extractDNWStatus
{ "repo_name": "FreudianNM/openMAXIMS", "path": "Source Library/openmaxims_workspace/ValueObjects/src/ims/emergency/vo/domain/DNWStatusForAmendTimesVoAssembler.java", "license": "agpl-3.0", "size": 17743 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,049,127
public void skipBytesEx(long count) throws IOException { if (count <= 0) { return; } bitPos = 0; is.seek(is.getPos() + count); if (is.available() < 0) { throw new EndOfStreamException(); } informListeners(); }
void function(long count) throws IOException { if (count <= 0) { return; } bitPos = 0; is.seek(is.getPos() + count); if (is.available() < 0) { throw new EndOfStreamException(); } informListeners(); }
/** * Skip bytes from the stream * * @param count Number of bytes to skip * @throws IOException */
Skip bytes from the stream
skipBytesEx
{ "repo_name": "jindrapetrik/jpexs-decompiler", "path": "libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFInputStream.java", "license": "gpl-3.0", "size": 130581 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,056,953
public final Iterable<java.lang.Long> queryKeysByFollowUpFileIds(java.lang.Object followUpFileIds) { final Filter filter = createEqualsFilter(COLUMN_NAME_FOLLOWUPFILEIDS, followUpFileIds); return queryIterableKeys(0, -1, null, null, null, false, null, false, filter); }
final Iterable<java.lang.Long> function(java.lang.Object followUpFileIds) { final Filter filter = createEqualsFilter(COLUMN_NAME_FOLLOWUPFILEIDS, followUpFileIds); return queryIterableKeys(0, -1, null, null, null, false, null, false, filter); }
/** * query-key-by method for attribute field followUpFileIds * @param followUpFileIds the specified attribute * @return an Iterable of keys to the DmMeetings with the specified attribute */
query-key-by method for attribute field followUpFileIds
queryKeysByFollowUpFileIds
{ "repo_name": "goldengekko/Meetr-Backend", "path": "src/main/java/com/goldengekko/meetr/dao/GeneratedDmMeetingDaoImpl.java", "license": "gpl-3.0", "size": 68599 }
[ "net.sf.mardao.core.Filter" ]
import net.sf.mardao.core.Filter;
import net.sf.mardao.core.*;
[ "net.sf.mardao" ]
net.sf.mardao;
2,138,736
public static Object getSessionAttribute(PortletRequest request, String name) { return getSessionAttribute(request, name, PortletSession.PORTLET_SCOPE); }
static Object function(PortletRequest request, String name) { return getSessionAttribute(request, name, PortletSession.PORTLET_SCOPE); }
/** * Check the given request for a session attribute of the given name under the * {@link javax.portlet.PortletSession#PORTLET_SCOPE}. * Returns {@code null} if there is no session or if the session has no such attribute in that scope. * Does not create a new session if none has existed before! * @param request current portlet request * @param name the name of the session attribute * @return the value of the session attribute, or {@code null} if not found */
Check the given request for a session attribute of the given name under the <code>javax.portlet.PortletSession#PORTLET_SCOPE</code>. Returns null if there is no session or if the session has no such attribute in that scope. Does not create a new session if none has existed before
getSessionAttribute
{ "repo_name": "kingtang/spring-learn", "path": "spring-webmvc-portlet/src/main/java/org/springframework/web/portlet/util/PortletUtils.java", "license": "gpl-3.0", "size": 21765 }
[ "javax.portlet.PortletRequest", "javax.portlet.PortletSession" ]
import javax.portlet.PortletRequest; import javax.portlet.PortletSession;
import javax.portlet.*;
[ "javax.portlet" ]
javax.portlet;
2,183,595
public static void logFailed(JobID jobid, long timestamp, int finishedMaps, int finishedReduces){ if (!disableHistory){ ArrayList<PrintWriter> writer = fileManager.getWriters(jobid); if (null != writer){ JobHistory.log(writer, RecordTypes.Job, new Keys[] {Keys.JOBID, Keys.FINISH_TIME, Keys.JOB_STATUS, Keys.FINISHED_MAPS, Keys.FINISHED_REDUCES }, new String[] {jobid.toString(), String.valueOf(timestamp), Values.FAILED.name(), String.valueOf(finishedMaps), String.valueOf(finishedReduces)}); for (PrintWriter out : writer) { out.close(); } } } }
static void function(JobID jobid, long timestamp, int finishedMaps, int finishedReduces){ if (!disableHistory){ ArrayList<PrintWriter> writer = fileManager.getWriters(jobid); if (null != writer){ JobHistory.log(writer, RecordTypes.Job, new Keys[] {Keys.JOBID, Keys.FINISH_TIME, Keys.JOB_STATUS, Keys.FINISHED_MAPS, Keys.FINISHED_REDUCES }, new String[] {jobid.toString(), String.valueOf(timestamp), Values.FAILED.name(), String.valueOf(finishedMaps), String.valueOf(finishedReduces)}); for (PrintWriter out : writer) { out.close(); } } } }
/** * Logs job failed event. Closes the job history log file. * @param jobid job id * @param timestamp time when job failure was detected in ms. * @param finishedMaps no finished map tasks. * @param finishedReduces no of finished reduce tasks. */
Logs job failed event. Closes the job history log file
logFailed
{ "repo_name": "jbellis/hadoop-common", "path": "src/mapred/org/apache/hadoop/mapred/JobHistory.java", "license": "apache-2.0", "size": 82113 }
[ "java.io.PrintWriter", "java.util.ArrayList" ]
import java.io.PrintWriter; import java.util.ArrayList;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,719,171
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<ApplicationSecurityGroupInner>, ApplicationSecurityGroupInner> beginCreateOrUpdateAsync( String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters);
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux<PollResult<ApplicationSecurityGroupInner>, ApplicationSecurityGroupInner> beginCreateOrUpdateAsync( String resourceGroupName, String applicationSecurityGroupName, ApplicationSecurityGroupInner parameters);
/** * Creates or updates an application security group. * * @param resourceGroupName The name of the resource group. * @param applicationSecurityGroupName The name of the application security group. * @param parameters Parameters supplied to the create or update ApplicationSecurityGroup operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of an application security group in a resource group. */
Creates or updates an application security group
beginCreateOrUpdateAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/ApplicationSecurityGroupsClient.java", "license": "mit", "size": 25248 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.polling.PollerFlux", "com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.PollerFlux; import com.azure.resourcemanager.network.fluent.models.ApplicationSecurityGroupInner;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,594,526
public final Property<Integer> port() { return metaBean().port().createProperty(this); }
final Property<Integer> function() { return metaBean().port().createProperty(this); }
/** * Gets the the {@code port} property. * @return the property, not null */
Gets the the port property
port
{ "repo_name": "DevStreet/FinanceAnalytics", "path": "projects/OG-Bloomberg/src/main/java/com/opengamma/bbg/component/BloombergConnectorComponentFactory.java", "license": "apache-2.0", "size": 19700 }
[ "org.joda.beans.Property" ]
import org.joda.beans.Property;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
912,043
public void setIndex(int index) { if (!FigureParam.FORMATS.containsKey(index)) index = FigureParam.DEFAULT_FORMAT; this.index = index; } public void setIcon(Icon icon) { this.icon = icon; }
void function(int index) { if (!FigureParam.FORMATS.containsKey(index)) index = FigureParam.DEFAULT_FORMAT; this.index = index; } public void setIcon(Icon icon) { this.icon = icon; }
/** * Sets the index. If the value is not supported, the default value * is used. * * @param index The value to set. */
Sets the index. If the value is not supported, the default value is used
setIndex
{ "repo_name": "emilroz/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/model/SaveAsParam.java", "license": "gpl-2.0", "size": 3871 }
[ "javax.swing.Icon" ]
import javax.swing.Icon;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
939,430
void setLocation(Location location, Iterable<? extends Path> searchPath) throws IOException;
void setLocation(Location location, Iterable<? extends Path> searchPath) throws IOException;
/** * Associate the given search path with the given location. Any * previous value will be discarded. * * @param location a location * @param searchPath a list of files, if {@code null} use the default * search path for this location * @see #getLocation * @throws IllegalArgumentException if location is an output * location and searchpath does not contain exactly one element * @throws IOException if location is an output location and searchpath * does not represent an existing directory */
Associate the given search path with the given location. Any previous value will be discarded
setLocation
{ "repo_name": "emil-wcislo/sbql4j8", "path": "sbql4j8/src/main/openjdk/sbql4j8/com/sun/tools/javac/nio/PathFileManager.java", "license": "apache-2.0", "size": 4856 }
[ "java.io.IOException", "java.nio.file.Path" ]
import java.io.IOException; import java.nio.file.Path;
import java.io.*; import java.nio.file.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
1,609,412
public final void register(Class<?>... annotatedClasses) { this.annotatedClasses = annotatedClasses; Assert.notEmpty(annotatedClasses, "At least one annotated class must be specified"); } /** * Perform a scan within the specified base packages. Note that {@link #refresh()}
final void function(Class<?>... annotatedClasses) { this.annotatedClasses = annotatedClasses; Assert.notEmpty(annotatedClasses, STR); } /** * Perform a scan within the specified base packages. Note that {@link #refresh()}
/** * Register one or more annotated classes to be processed. Note that * {@link #refresh()} must be called in order for the context to fully process the new * class. * <p> * Calls to {@link #register} are idempotent; adding the same annotated class more * than once has no additional effect. * @param annotatedClasses one or more annotated classes, e.g. {@link Configuration * <code>@Configuration</code>} classes * @see #scan(String...) * @see #refresh() */
Register one or more annotated classes to be processed. Note that <code>#refresh()</code> must be called in order for the context to fully process the new class. Calls to <code>#register</code> are idempotent; adding the same annotated class more than once has no additional effect
register
{ "repo_name": "gregturn/spring-boot", "path": "spring-boot/src/main/java/org/springframework/boot/context/embedded/AnnotationConfigEmbeddedWebApplicationContext.java", "license": "apache-2.0", "size": 7287 }
[ "org.springframework.util.Assert" ]
import org.springframework.util.Assert;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
2,601,740
public void setNormal(Vector2 normal) { this.normal = normal; }
void function(Vector2 normal) { this.normal = normal; }
/** * Sets the normal at the hit point. * @param normal the normal at the hit point */
Sets the normal at the hit point
setNormal
{ "repo_name": "dmitrykolesnikovich/dyn4j", "path": "src/org/dyn4j/collision/narrowphase/Raycast.java", "license": "bsd-3-clause", "size": 4170 }
[ "org.dyn4j.geometry.Vector2" ]
import org.dyn4j.geometry.Vector2;
import org.dyn4j.geometry.*;
[ "org.dyn4j.geometry" ]
org.dyn4j.geometry;
931,013
public Builder periodicallyCompoundedRateNodeIds(final Map<Tenor, CurveInstrumentProvider> periodicallyCompoundedRateNodeIds) { _periodicallyCompoundedRateNodeIds = periodicallyCompoundedRateNodeIds; return this; }
Builder function(final Map<Tenor, CurveInstrumentProvider> periodicallyCompoundedRateNodeIds) { _periodicallyCompoundedRateNodeIds = periodicallyCompoundedRateNodeIds; return this; }
/** * Curve instrument providers for periodically-compounded rate nodes * @param periodicallyCompoundedRateNodeIds the periodicallyCompoundedRateNodeIds * @return this */
Curve instrument providers for periodically-compounded rate nodes
periodicallyCompoundedRateNodeIds
{ "repo_name": "ChinaQuants/OG-Platform", "path": "projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/curve/CurveNodeIdMapper.java", "license": "apache-2.0", "size": 64618 }
[ "com.opengamma.financial.analytics.ircurve.CurveInstrumentProvider", "com.opengamma.util.time.Tenor", "java.util.Map" ]
import com.opengamma.financial.analytics.ircurve.CurveInstrumentProvider; import com.opengamma.util.time.Tenor; import java.util.Map;
import com.opengamma.financial.analytics.ircurve.*; import com.opengamma.util.time.*; import java.util.*;
[ "com.opengamma.financial", "com.opengamma.util", "java.util" ]
com.opengamma.financial; com.opengamma.util; java.util;
2,499,839
public ArrayList<NotificationHubResource> getValue() { return this.value; }
ArrayList<NotificationHubResource> function() { return this.value; }
/** * Optional. Gets or sets result of the List NotificationHub operation. * @return The Value value. */
Optional. Gets or sets result of the List NotificationHub operation
getValue
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-notificationhubs/src/main/java/com/microsoft/azure/management/notificationhubs/models/NotificationHubListResponse.java", "license": "apache-2.0", "size": 2386 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,119,570
public void start() throws IOException { lock.lock(); try { if (process != null) { return; } process = new CommandLine(this.executable, args.toArray(new String[] {})); process.setEnvironmentVariables(environment); process.copyOutputTo(getOutputStream()); process.executeAsync(); waitUntilAvailable(); } finally { lock.unlock(); } }
void function() throws IOException { lock.lock(); try { if (process != null) { return; } process = new CommandLine(this.executable, args.toArray(new String[] {})); process.setEnvironmentVariables(environment); process.copyOutputTo(getOutputStream()); process.executeAsync(); waitUntilAvailable(); } finally { lock.unlock(); } }
/** * Starts this service if it is not already running. This method will block until the server has * been fully started and is ready to handle commands. * * @throws IOException If an error occurs while spawning the child process. * @see #stop() */
Starts this service if it is not already running. This method will block until the server has been fully started and is ready to handle commands
start
{ "repo_name": "jabbrwcky/selenium", "path": "java/client/src/org/openqa/selenium/remote/service/DriverService.java", "license": "apache-2.0", "size": 10637 }
[ "java.io.IOException", "org.openqa.selenium.os.CommandLine" ]
import java.io.IOException; import org.openqa.selenium.os.CommandLine;
import java.io.*; import org.openqa.selenium.os.*;
[ "java.io", "org.openqa.selenium" ]
java.io; org.openqa.selenium;
2,360,642
public void testQuoteAlwaysButNotNeeded() { QuoteAlwaysDTO obj = new QuoteAlwaysDTO(); obj.fieldA = "the field A"; obj.fieldB = obj.fieldA; CsvConfiguration config = createConfig(EscapeMode.DOUBLING); String serializationResult = JSefaTestUtil.serialize(CSV, config, obj); assertTrue(serializationResult.charAt(0) == config.getQuoteCharacter()); JSefaTestUtil.assertRepeatedRoundTripSucceeds(CSV, config, obj); config = createConfig(EscapeMode.ESCAPE_CHARACTER); serializationResult = JSefaTestUtil.serialize(CSV, config, obj); assertTrue(serializationResult.charAt(0) == config.getQuoteCharacter()); JSefaTestUtil.assertRepeatedRoundTripSucceeds(CSV, config, obj); }
void function() { QuoteAlwaysDTO obj = new QuoteAlwaysDTO(); obj.fieldA = STR; obj.fieldB = obj.fieldA; CsvConfiguration config = createConfig(EscapeMode.DOUBLING); String serializationResult = JSefaTestUtil.serialize(CSV, config, obj); assertTrue(serializationResult.charAt(0) == config.getQuoteCharacter()); JSefaTestUtil.assertRepeatedRoundTripSucceeds(CSV, config, obj); config = createConfig(EscapeMode.ESCAPE_CHARACTER); serializationResult = JSefaTestUtil.serialize(CSV, config, obj); assertTrue(serializationResult.charAt(0) == config.getQuoteCharacter()); JSefaTestUtil.assertRepeatedRoundTripSucceeds(CSV, config, obj); }
/** * Test with mode "always" for the case the quotes are not needed. */
Test with mode "always" for the case the quotes are not needed
testQuoteAlwaysButNotNeeded
{ "repo_name": "Manmay/JSefa", "path": "standard/src/test/java/org/jsefa/test/csv/QuoteModeTest.java", "license": "apache-2.0", "size": 12281 }
[ "org.jsefa.csv.config.CsvConfiguration", "org.jsefa.csv.lowlevel.config.EscapeMode", "org.jsefa.test.common.JSefaTestUtil" ]
import org.jsefa.csv.config.CsvConfiguration; import org.jsefa.csv.lowlevel.config.EscapeMode; import org.jsefa.test.common.JSefaTestUtil;
import org.jsefa.csv.config.*; import org.jsefa.csv.lowlevel.config.*; import org.jsefa.test.common.*;
[ "org.jsefa.csv", "org.jsefa.test" ]
org.jsefa.csv; org.jsefa.test;
1,269,677
private static final void expandOrCollapseAllRows(final JTree tree, final TreePath path, final boolean expand) throws IllegalArgumentException { if (tree == null) { throw new IllegalArgumentException(new NullPointerException("tree")); } else if (path == null) { throw new IllegalArgumentException(new NullPointerException("path")); } // Get the last component of the given 'path' (should be a tree node.) final TreeNode node = (TreeNode) path.getLastPathComponent(); // Call this method for each child node. if (node.getChildCount() > 0) { @SuppressWarnings("unchecked") final Enumeration<TreeNode> e = node.children(); while (e.hasMoreElements()) { expandOrCollapseAllRows(tree, path.pathByAddingChild(e.nextElement()), expand); } } // Expand or collapse the given 'tree'. if (expand) { tree.expandPath(path); } else { tree.collapsePath(path); } }
static final void function(final JTree tree, final TreePath path, final boolean expand) throws IllegalArgumentException { if (tree == null) { throw new IllegalArgumentException(new NullPointerException("tree")); } else if (path == null) { throw new IllegalArgumentException(new NullPointerException("path")); } final TreeNode node = (TreeNode) path.getLastPathComponent(); if (node.getChildCount() > 0) { @SuppressWarnings(STR) final Enumeration<TreeNode> e = node.children(); while (e.hasMoreElements()) { expandOrCollapseAllRows(tree, path.pathByAddingChild(e.nextElement()), expand); } } if (expand) { tree.expandPath(path); } else { tree.collapsePath(path); } }
/** * Expand or collapse nodes in the given <code>tree</code> that match the given <code>path</code>. * * @param tree The tree to expand or collapse. * @param path The tree path. * @param expand If <code>true</code>, then the given <code>tree</code> will be expanded. * @throws IllegalArgumentException If <code>tree == null || path == null</code>. */
Expand or collapse nodes in the given <code>tree</code> that match the given <code>path</code>
expandOrCollapseAllRows
{ "repo_name": "markborkum/t2-json-activity", "path": "json-activity-ui/src/main/java/uk/ac/soton/mib104/t2/workbench/ui/TreeUtils.java", "license": "lgpl-2.1", "size": 7363 }
[ "java.util.Enumeration", "javax.swing.JTree", "javax.swing.tree.TreeNode", "javax.swing.tree.TreePath" ]
import java.util.Enumeration; import javax.swing.JTree; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath;
import java.util.*; import javax.swing.*; import javax.swing.tree.*;
[ "java.util", "javax.swing" ]
java.util; javax.swing;
829,158
public void extractNounParticipialModifiers(Collection<SentenceNode> extracted, SentenceNode input) { String tregexOpStr; TregexPattern matchPattern; TregexMatcher matcher; tregexOpStr = "ROOT < (S " + " [ << (NP < (NP=subj $++ (/,/ $+ (VP=modifier <# VBN|VBG|VP=tense )))) " //modifiers that appear after nouns + " | < (S !< NP|SBAR < (VP=modifier <# VBN|VBG|VP=tense) $+ (/,/ $+ NP=subj)) " //modifiers before the subject. e.g., Founded by John, the company... + " | < (SBAR < (S !< NP|SBAR < (VP=modifier <# VBN|VBG=tense)) $+ (/,/ $+ NP=subj)) " //e.g., While walking to the store, John saw Susan. + " | < (PP=modifier !< NP <# VBG=tense $+ (/,/ $+ NP=subj)) ] ) " // e.g., Walking to the store, John saw Susan. + " <<# /^VB.*$/=maintense "; //tense determined by top-most verb matchPattern = TregexPatternFactory.getPattern(tregexOpStr); matcher = matchPattern.matcher(input.getTree()); while(matcher.find()){ Tree nountree = matcher.getNode("subj").deepCopy(); Tree vptree = matcher.getNode("modifier"); Tree verb = matcher.getNode("tense"); utils.makeDeterminerDefinite(nountree); if(vptree.label().value().equals("PP")) vptree.label().setValue("VP"); String verbPOS = utils.findTense(matcher.getNode("maintense")); if(vptree == null || nountree == null) return; String newTreeStr; if(verb.label().value().equals("VBG")){ //for present partcipials, change the tense to the tense of the main verb //e.g., walking to the store -> walked to the store String verbLemma = AnalysisUtilities.getInstance().getLemma(verb.getChild(0).label().value(), verb.label().value()); String newVerb = AnalysisUtilities.getInstance().getSurfaceForm(verbLemma, verbPOS); int verbIndex = vptree.objectIndexOf(verb); vptree = vptree.deepCopy(); vptree.removeChild(verbIndex); vptree.addChild(verbIndex, AnalysisUtilities.getInstance().readTreeFromString("("+verbPOS+" "+newVerb+")")); newTreeStr = "(ROOT (S "+matcher.getNode("subj").toString()+" "+vptree.toString()+" (. .)))"; }else{ //for past participials, add a copula //e.g., John, exhausted, -> John was exhausted //(or for conjunctions, just add the copula---kind of a hack to make the moby dick sentence work out) String auxiliary; if(verbPOS.equals("VBP") || verbPOS.equals("VBD")){ if(utils.isPlural(nountree)) auxiliary = "(VBD were)"; else auxiliary = "(VBD was)"; }else{ if(utils.isPlural(nountree)) auxiliary = "(VB are)"; else auxiliary = "(VBZ is)"; } newTreeStr = "(ROOT (S "+nountree+" (VP "+auxiliary+" "+vptree+") (. .)))"; } Tree newTree = AnalysisUtilities.getInstance().readTreeFromString(newTreeStr); utils.correctTense(newTree.getChild(0).getChild(0), newTree.getChild(0)); utils.addQuotationMarksIfNeeded(newTree); if(GlobalProperties.getDebug()) System.err.println("extractNounParticipialModifiers: "+ newTree.toString()); SentenceNode newTreeWithFeatures = input.deepCopy(); newTreeWithFeatures.setTree(newTree); if(GlobalProperties.getComputeFeatures()) newTreeWithFeatures.setFeatureValue("extractedFromParticipial", 1.0); //old feature name if(GlobalProperties.getComputeFeatures()) newTreeWithFeatures.setFeatureValue("extractedFromNounParticipial", 1.0); extracted.add(newTreeWithFeatures); } }
void function(Collection<SentenceNode> extracted, SentenceNode input) { String tregexOpStr; TregexPattern matchPattern; TregexMatcher matcher; tregexOpStr = STR + STR + STR + STR + STR + STR; matchPattern = TregexPatternFactory.getPattern(tregexOpStr); matcher = matchPattern.matcher(input.getTree()); while(matcher.find()){ Tree nountree = matcher.getNode("subj").deepCopy(); Tree vptree = matcher.getNode(STR); Tree verb = matcher.getNode("tense"); utils.makeDeterminerDefinite(nountree); if(vptree.label().value().equals("PP")) vptree.label().setValue("VP"); String verbPOS = utils.findTense(matcher.getNode(STR)); if(vptree == null nountree == null) return; String newTreeStr; if(verb.label().value().equals("VBG")){ String verbLemma = AnalysisUtilities.getInstance().getLemma(verb.getChild(0).label().value(), verb.label().value()); String newVerb = AnalysisUtilities.getInstance().getSurfaceForm(verbLemma, verbPOS); int verbIndex = vptree.objectIndexOf(verb); vptree = vptree.deepCopy(); vptree.removeChild(verbIndex); vptree.addChild(verbIndex, AnalysisUtilities.getInstance().readTreeFromString("("+verbPOS+" "+newVerb+")")); newTreeStr = STR+matcher.getNode("subj").toString()+" "+vptree.toString()+STR; }else{ String auxiliary; if(verbPOS.equals("VBP") verbPOS.equals("VBD")){ if(utils.isPlural(nountree)) auxiliary = STR; else auxiliary = STR; }else{ if(utils.isPlural(nountree)) auxiliary = STR; else auxiliary = STR; } newTreeStr = STR+nountree+STR+auxiliary+" "+vptree+STR; } Tree newTree = AnalysisUtilities.getInstance().readTreeFromString(newTreeStr); utils.correctTense(newTree.getChild(0).getChild(0), newTree.getChild(0)); utils.addQuotationMarksIfNeeded(newTree); if(GlobalProperties.getDebug()) System.err.println(STR+ newTree.toString()); SentenceNode newTreeWithFeatures = input.deepCopy(); newTreeWithFeatures.setTree(newTree); if(GlobalProperties.getComputeFeatures()) newTreeWithFeatures.setFeatureValue(STR, 1.0); if(GlobalProperties.getComputeFeatures()) newTreeWithFeatures.setFeatureValue(STR, 1.0); extracted.add(newTreeWithFeatures); } }
/** * e.g., John, hoping to get a good grade, studied. -> John hoped to get a good grade. * Walking to the store, John saw Susan -> John was walking to the store. * * NOTE: This method produces false positives for sentences like, * "Broadly speaking, the project was successful." * where the participial phrase does not modify the subject. * * @param extracted * @param input */
e.g., John, hoping to get a good grade, studied. -> John hoped to get a good grade. Walking to the store, John saw Susan -> John was walking to the store. "Broadly speaking, the project was successful." where the participial phrase does not modify the subject
extractNounParticipialModifiers
{ "repo_name": "sanjaymeena/InformationExtractionSystem", "path": "src/com/asus/ctc/ie/nlptransformations/TranformationFunctions.java", "license": "apache-2.0", "size": 36790 }
[ "com.asus.ctc.ie.config.GlobalProperties", "com.asus.ctc.ie.datastructures.SentenceNode", "com.asus.ctc.ie.utilities.AnalysisUtilities", "com.asus.ctc.ie.utilities.TregexPatternFactory", "edu.stanford.nlp.trees.Tree", "edu.stanford.nlp.trees.tregex.TregexMatcher", "edu.stanford.nlp.trees.tregex.TregexPattern", "java.util.Collection" ]
import com.asus.ctc.ie.config.GlobalProperties; import com.asus.ctc.ie.datastructures.SentenceNode; import com.asus.ctc.ie.utilities.AnalysisUtilities; import com.asus.ctc.ie.utilities.TregexPatternFactory; import edu.stanford.nlp.trees.Tree; import edu.stanford.nlp.trees.tregex.TregexMatcher; import edu.stanford.nlp.trees.tregex.TregexPattern; import java.util.Collection;
import com.asus.ctc.ie.config.*; import com.asus.ctc.ie.datastructures.*; import com.asus.ctc.ie.utilities.*; import edu.stanford.nlp.trees.*; import edu.stanford.nlp.trees.tregex.*; import java.util.*;
[ "com.asus.ctc", "edu.stanford.nlp", "java.util" ]
com.asus.ctc; edu.stanford.nlp; java.util;
442,210
private Expression getIndexBasedForBodyAssignment(ASTRewrite rewrite, SimpleName loopVariableName) { AST ast= rewrite.getAST(); ITypeBinding loopOverType= extractElementType(ast); Assignment assignResolvedVariable= ast.newAssignment(); // left hand side SimpleName resolvedVariableName= resolveLinkedVariableNameWithProposals(rewrite, loopOverType.getName(), loopVariableName.getIdentifier(), false); VariableDeclarationFragment resolvedVariableDeclarationFragment= ast.newVariableDeclarationFragment(); resolvedVariableDeclarationFragment.setName(resolvedVariableName); VariableDeclarationExpression resolvedVariableDeclaration= ast.newVariableDeclarationExpression(resolvedVariableDeclarationFragment); resolvedVariableDeclaration.setType(getImportRewrite().addImport(loopOverType, ast, new ContextSensitiveImportRewriteContext(fCurrentNode, getImportRewrite()))); assignResolvedVariable.setLeftHandSide(resolvedVariableDeclaration); // right hand side MethodInvocation invokeGetExpression= ast.newMethodInvocation(); invokeGetExpression.setName(ast.newSimpleName("get")); //$NON-NLS-1$ SimpleName indexVariableName= ast.newSimpleName(loopVariableName.getIdentifier()); addLinkedPosition(rewrite.track(indexVariableName), LinkedPositionGroup.NO_STOP, indexVariableName.getIdentifier()); invokeGetExpression.arguments().add(indexVariableName); invokeGetExpression.setExpression((Expression) rewrite.createCopyTarget(fCurrentExpression)); assignResolvedVariable.setRightHandSide(invokeGetExpression); assignResolvedVariable.setOperator(Assignment.Operator.ASSIGN); return assignResolvedVariable; } /** * Resolves name proposals by the given basename and adds a {@link LinkedPosition} to the * returned {@link SimpleName} expression. * * @param rewrite the current instance of an {@link ASTRewrite}
Expression function(ASTRewrite rewrite, SimpleName loopVariableName) { AST ast= rewrite.getAST(); ITypeBinding loopOverType= extractElementType(ast); Assignment assignResolvedVariable= ast.newAssignment(); SimpleName resolvedVariableName= resolveLinkedVariableNameWithProposals(rewrite, loopOverType.getName(), loopVariableName.getIdentifier(), false); VariableDeclarationFragment resolvedVariableDeclarationFragment= ast.newVariableDeclarationFragment(); resolvedVariableDeclarationFragment.setName(resolvedVariableName); VariableDeclarationExpression resolvedVariableDeclaration= ast.newVariableDeclarationExpression(resolvedVariableDeclarationFragment); resolvedVariableDeclaration.setType(getImportRewrite().addImport(loopOverType, ast, new ContextSensitiveImportRewriteContext(fCurrentNode, getImportRewrite()))); assignResolvedVariable.setLeftHandSide(resolvedVariableDeclaration); MethodInvocation invokeGetExpression= ast.newMethodInvocation(); invokeGetExpression.setName(ast.newSimpleName("get")); SimpleName indexVariableName= ast.newSimpleName(loopVariableName.getIdentifier()); addLinkedPosition(rewrite.track(indexVariableName), LinkedPositionGroup.NO_STOP, indexVariableName.getIdentifier()); invokeGetExpression.arguments().add(indexVariableName); invokeGetExpression.setExpression((Expression) rewrite.createCopyTarget(fCurrentExpression)); assignResolvedVariable.setRightHandSide(invokeGetExpression); assignResolvedVariable.setOperator(Assignment.Operator.ASSIGN); return assignResolvedVariable; } /** * Resolves name proposals by the given basename and adds a {@link LinkedPosition} to the * returned {@link SimpleName} expression. * * @param rewrite the current instance of an {@link ASTRewrite}
/** * Creates an {@link Assignment} as first expression appearing in an index based * <code>for</code> loop's body. This Assignment declares a local variable and initializes it * using the {@link List}'s current element identified by the loop index. * * @param rewrite the current {@link ASTRewrite} instance * @param loopVariableName the name of the index variable in String representation * @return a completed {@link Assignment} containing the mentioned declaration and * initialization */
Creates an <code>Assignment</code> as first expression appearing in an index based <code>for</code> loop's body. This Assignment declares a local variable and initializes it using the <code>List</code>'s current element identified by the loop index
getIndexBasedForBodyAssignment
{ "repo_name": "trylimits/Eclipse-Postfix-Code-Completion", "path": "luna/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/proposals/GenerateForLoopAssistProposal.java", "license": "epl-1.0", "size": 26453 }
[ "org.eclipse.jdt.core.dom.Assignment", "org.eclipse.jdt.core.dom.Expression", "org.eclipse.jdt.core.dom.ITypeBinding", "org.eclipse.jdt.core.dom.MethodInvocation", "org.eclipse.jdt.core.dom.SimpleName", "org.eclipse.jdt.core.dom.VariableDeclarationExpression", "org.eclipse.jdt.core.dom.VariableDeclarationFragment", "org.eclipse.jdt.core.dom.rewrite.ASTRewrite", "org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext", "org.eclipse.jface.text.link.LinkedPosition", "org.eclipse.jface.text.link.LinkedPositionGroup" ]
import org.eclipse.jdt.core.dom.Assignment; import org.eclipse.jdt.core.dom.Expression; import org.eclipse.jdt.core.dom.ITypeBinding; import org.eclipse.jdt.core.dom.MethodInvocation; import org.eclipse.jdt.core.dom.SimpleName; import org.eclipse.jdt.core.dom.VariableDeclarationExpression; import org.eclipse.jdt.core.dom.VariableDeclarationFragment; import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; import org.eclipse.jdt.internal.corext.codemanipulation.ContextSensitiveImportRewriteContext; import org.eclipse.jface.text.link.LinkedPosition; import org.eclipse.jface.text.link.LinkedPositionGroup;
import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.core.dom.rewrite.*; import org.eclipse.jdt.internal.corext.codemanipulation.*; import org.eclipse.jface.text.link.*;
[ "org.eclipse.jdt", "org.eclipse.jface" ]
org.eclipse.jdt; org.eclipse.jface;
1,080,585
try (Git git = new Git(repository)) { git.gc().setProgressMonitor( new EclipseGitProgressTransformer(monitor)).call(); } catch (GitAPIException e) { throw new CoreException(new Status(IStatus.ERROR, Activator.getPluginId(), e.getMessage(), e)); } }
try (Git git = new Git(repository)) { git.gc().setProgressMonitor( new EclipseGitProgressTransformer(monitor)).call(); } catch (GitAPIException e) { throw new CoreException(new Status(IStatus.ERROR, Activator.getPluginId(), e.getMessage(), e)); } }
/** * Execute garbage collection */
Execute garbage collection
execute
{ "repo_name": "collaborative-modeling/egit", "path": "org.eclipse.egit.core/src/org/eclipse/egit/core/op/GarbageCollectOperation.java", "license": "epl-1.0", "size": 1847 }
[ "org.eclipse.core.runtime.CoreException", "org.eclipse.core.runtime.IStatus", "org.eclipse.core.runtime.Status", "org.eclipse.egit.core.Activator", "org.eclipse.egit.core.EclipseGitProgressTransformer", "org.eclipse.jgit.api.Git", "org.eclipse.jgit.api.errors.GitAPIException" ]
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.egit.core.Activator; import org.eclipse.egit.core.EclipseGitProgressTransformer; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.core.runtime.*; import org.eclipse.egit.core.*; import org.eclipse.jgit.api.*; import org.eclipse.jgit.api.errors.*;
[ "org.eclipse.core", "org.eclipse.egit", "org.eclipse.jgit" ]
org.eclipse.core; org.eclipse.egit; org.eclipse.jgit;
441,219
static double getHeadingFromCoordinates(Coord2D fromLoc, Coord2D toLoc) { double fLat = Math.toRadians(fromLoc.getY()); double fLng = Math.toRadians(fromLoc.getX()); double tLat = Math.toRadians(toLoc.getY()); double tLng = Math.toRadians(toLoc.getX()); double degree = Math.toDegrees(Math.atan2( Math.sin(tLng - fLng) * Math.cos(tLat), Math.cos(fLat) * Math.sin(tLat) - Math.sin(fLat) * Math.cos(tLat) * Math.cos(tLng - fLng))); if (degree >= 0) { return degree; } else { return 360 + degree; } }
static double getHeadingFromCoordinates(Coord2D fromLoc, Coord2D toLoc) { double fLat = Math.toRadians(fromLoc.getY()); double fLng = Math.toRadians(fromLoc.getX()); double tLat = Math.toRadians(toLoc.getY()); double tLng = Math.toRadians(toLoc.getX()); double degree = Math.toDegrees(Math.atan2( Math.sin(tLng - fLng) * Math.cos(tLat), Math.cos(fLat) * Math.sin(tLat) - Math.sin(fLat) * Math.cos(tLat) * Math.cos(tLng - fLng))); if (degree >= 0) { return degree; } else { return 360 + degree; } }
/** * Computes the heading between two coordinates * * @return heading in degrees */
Computes the heading between two coordinates
getHeadingFromCoordinates
{ "repo_name": "0359xiaodong/droidplanner", "path": "Core/src/org/droidplanner/core/helpers/geoTools/GeoTools.java", "license": "gpl-3.0", "size": 4413 }
[ "org.droidplanner.core.helpers.coordinates.Coord2D" ]
import org.droidplanner.core.helpers.coordinates.Coord2D;
import org.droidplanner.core.helpers.coordinates.*;
[ "org.droidplanner.core" ]
org.droidplanner.core;
2,088,122
public static FunctionResource fromName(String name) { String[] parts = StringUtils.split(name, '/'); if (!parts[0].equals(ROOT_NAME) || parts.length > 3) throw new IllegalArgumentException(String.format("%s is not a valid function resource name", name)); if (parts.length == 1) return root(); if (parts.length == 2) return keyspace(parts[1]); String[] nameAndArgs = StringUtils.split(parts[2], "[|]"); return function(parts[1], nameAndArgs[0], argsListFromString(nameAndArgs[1])); }
static FunctionResource function(String name) { String[] parts = StringUtils.split(name, '/'); if (!parts[0].equals(ROOT_NAME) parts.length > 3) throw new IllegalArgumentException(String.format(STR, name)); if (parts.length == 1) return root(); if (parts.length == 2) return keyspace(parts[1]); String[] nameAndArgs = StringUtils.split(parts[2], STR); return function(parts[1], nameAndArgs[0], argsListFromString(nameAndArgs[1])); }
/** * Parses a resource name into a FunctionResource instance. * * @param name Name of the function resource. * @return FunctionResource instance matching the name. */
Parses a resource name into a FunctionResource instance
fromName
{ "repo_name": "strapdata/cassandra", "path": "src/java/org/apache/cassandra/auth/FunctionResource.java", "license": "apache-2.0", "size": 12068 }
[ "org.apache.commons.lang3.StringUtils" ]
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.*;
[ "org.apache.commons" ]
org.apache.commons;
2,085,031
private int loadClass(OWLOntology ontology, OWLClass clazz, HashMap<String, String> annotation) { IRI iri = clazz.getIRI(); String acc = iri.toString(); // TODO check namespace as alternative // String key = shortForms.shortForm(iri); // String namespace = getNamespace(iri, shortForms.getFile(), shortForms.getNamespace()); if (acc.startsWith(INGORE_ERROR) || acc.contains(IGNORE_W3ORG)) { return Element.UNDEF; } if (filtered(acc) ) { return Element.UNDEF; } if (!acc.contains("/") && !acc.contains("\\") && shortNames.size()==1){ // not a valid accession return Element.UNDEF; } String name = getFullName(iri, ontology, clazz); String description = getComment(ontology, clazz, annotation); String synonyms = getSynoynms(ontology, clazz, annotation); int id = insertObject(source_id, acc, name, null, null, Element.KIND_ELEMTYPE, description, synonyms); Set<OWLClassExpression> eqClasses = clazz .getEquivalentClasses(ontology); if (eqClasses != null && eqClasses.size() > 0) { // TODO check!!! System.out.print("\teqClasses\t" + eqClasses.size()); // for (Iterator it = clazz.getEquivalentClasses(ontology).iterator(); it.hasNext();) // { // // OWLClassExpression c = (OWLClassExpression) it.next(); // //c is a class // if(c instanceof OWLClass ) // { // String synCandidat = getFullName( ((OWLNamedObject) c).getIRI(), ontology, (OWLNamedObject) c); // synonyms += synCandidat; // } // //c is a logical class construction // else // if(c instanceof OWLNaryBooleanClassExpression ) // { // Object[] classes = c.getClassesInSignature().toArray(); // for(int i = 0; i < classes.length; i++) // { // OWLClass subC = (OWLClass) classes[i]; // String synCandidat = getFullName(((OWLNamedObject) subC).getIRI(), ontology, subC); // synonyms += synCandidat; // if(i < classes.length - 1) // synonyms += ", "; // // } // } // // } } System.out.print(""); return id; }
int function(OWLOntology ontology, OWLClass clazz, HashMap<String, String> annotation) { IRI iri = clazz.getIRI(); String acc = iri.toString(); if (acc.startsWith(INGORE_ERROR) acc.contains(IGNORE_W3ORG)) { return Element.UNDEF; } if (filtered(acc) ) { return Element.UNDEF; } if (!acc.contains("/") && !acc.contains("\\") && shortNames.size()==1){ return Element.UNDEF; } String name = getFullName(iri, ontology, clazz); String description = getComment(ontology, clazz, annotation); String synonyms = getSynoynms(ontology, clazz, annotation); int id = insertObject(source_id, acc, name, null, null, Element.KIND_ELEMTYPE, description, synonyms); Set<OWLClassExpression> eqClasses = clazz .getEquivalentClasses(ontology); if (eqClasses != null && eqClasses.size() > 0) { System.out.print(STR + eqClasses.size()); } System.out.print(""); return id; }
/** * load OWL-Classes with their information into graph/repository * @param ontology * @param clazz * @param annotation * @return class id */
load OWL-Classes with their information into graph/repository
loadClass
{ "repo_name": "epu-ntua/FITMAN-SeMa", "path": "coma-engine/src/main/java/de/wdilab/coma/insert/metadata/OWLParser_V3.java", "license": "agpl-3.0", "size": 41514 }
[ "de.wdilab.coma.structure.Element", "java.util.HashMap", "java.util.Set", "org.semanticweb.owlapi.model.OWLClass", "org.semanticweb.owlapi.model.OWLClassExpression", "org.semanticweb.owlapi.model.OWLOntology" ]
import de.wdilab.coma.structure.Element; import java.util.HashMap; import java.util.Set; import org.semanticweb.owlapi.model.OWLClass; import org.semanticweb.owlapi.model.OWLClassExpression; import org.semanticweb.owlapi.model.OWLOntology;
import de.wdilab.coma.structure.*; import java.util.*; import org.semanticweb.owlapi.model.*;
[ "de.wdilab.coma", "java.util", "org.semanticweb.owlapi" ]
de.wdilab.coma; java.util; org.semanticweb.owlapi;
471,274
public void setA_Prior_Year_Accumulated_Depr (BigDecimal A_Prior_Year_Accumulated_Depr) { set_Value (COLUMNNAME_A_Prior_Year_Accumulated_Depr, A_Prior_Year_Accumulated_Depr); }
void function (BigDecimal A_Prior_Year_Accumulated_Depr) { set_Value (COLUMNNAME_A_Prior_Year_Accumulated_Depr, A_Prior_Year_Accumulated_Depr); }
/** Set Prior. Year Accumulated Depr.. @param A_Prior_Year_Accumulated_Depr Prior. Year Accumulated Depr. */
Set Prior. Year Accumulated Depr.
setA_Prior_Year_Accumulated_Depr
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiere_360/base/src/org/compiere/model/X_I_Asset.java", "license": "gpl-2.0", "size": 44316 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
2,839,305
@Test public void literal() { final ILiteral l_literal = CLiteral.parse( "foo(X, 123, 'test')" ); Assertions.assertEquals( "foo", l_literal.functor() ); final List<ITerm> l_values = l_literal.orderedvalues().collect( Collectors.toList() ); Assertions.assertEquals( 3, l_values.size() ); Assertions.assertTrue( l_values.get( 0 ) instanceof IVariable<?> ); Assertions.assertEquals( l_values.get( 0 ).<IVariable<?>>term().functor(), "X" ); Assertions.assertEquals( l_values.get( 1 ).<Number>raw(), 123.0 ); Assertions.assertEquals( l_values.get( 2 ).raw(), "test" ); }
void function() { final ILiteral l_literal = CLiteral.parse( STR ); Assertions.assertEquals( "foo", l_literal.functor() ); final List<ITerm> l_values = l_literal.orderedvalues().collect( Collectors.toList() ); Assertions.assertEquals( 3, l_values.size() ); Assertions.assertTrue( l_values.get( 0 ) instanceof IVariable<?> ); Assertions.assertEquals( l_values.get( 0 ).<IVariable<?>>term().functor(), "X" ); Assertions.assertEquals( l_values.get( 1 ).<Number>raw(), 123.0 ); Assertions.assertEquals( l_values.get( 2 ).raw(), "test" ); }
/** * test literal parsing */
test literal parsing
literal
{ "repo_name": "flashpixx/Light-Jason", "path": "src/test/java/org/lightjason/agentspeak/grammar/TestCManualParser.java", "license": "lgpl-3.0", "size": 2894 }
[ "java.util.List", "java.util.stream.Collectors", "org.junit.jupiter.api.Assertions", "org.lightjason.agentspeak.language.CLiteral", "org.lightjason.agentspeak.language.ILiteral", "org.lightjason.agentspeak.language.ITerm", "org.lightjason.agentspeak.language.variable.IVariable" ]
import java.util.List; import java.util.stream.Collectors; import org.junit.jupiter.api.Assertions; import org.lightjason.agentspeak.language.CLiteral; import org.lightjason.agentspeak.language.ILiteral; import org.lightjason.agentspeak.language.ITerm; import org.lightjason.agentspeak.language.variable.IVariable;
import java.util.*; import java.util.stream.*; import org.junit.jupiter.api.*; import org.lightjason.agentspeak.language.*; import org.lightjason.agentspeak.language.variable.*;
[ "java.util", "org.junit.jupiter", "org.lightjason.agentspeak" ]
java.util; org.junit.jupiter; org.lightjason.agentspeak;
2,591,981
private void writeVariableLengthInt(final int value) throws IOException { int valueToWrite = getValueToWrite(value); while (true) { writeByte(valueToWrite & 0xff); if ((valueToWrite & 0x80) != 0) { valueToWrite >>>= 8; } else { break; } } } }
void function(final int value) throws IOException { int valueToWrite = getValueToWrite(value); while (true) { writeByte(valueToWrite & 0xff); if ((valueToWrite & 0x80) != 0) { valueToWrite >>>= 8; } else { break; } } } }
/** * Write the specified value to the OutputStream * * @param value the value * @throws IOException */
Write the specified value to the OutputStream
writeVariableLengthInt
{ "repo_name": "KyoSherlock/SherlockMidi", "path": "sherlockmidi/src/main/java/jp/kshoji/javax/sound/midi/io/StandardMidiFileWriter.java", "license": "apache-2.0", "size": 6377 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,474,240
public ImgChannel create(String name) throws FileExistsException;
ImgChannel function(String name) throws FileExistsException;
/** * Create a new file it must not already exist. * @param name The file name. * @return A directory entry for the new file. * @throws FileExistsException If the file already exists. */
Create a new file it must not already exist
create
{ "repo_name": "openstreetmap/mkgmap", "path": "src/uk/me/parabola/imgfmt/fs/FileSystem.java", "license": "gpl-2.0", "size": 2577 }
[ "uk.me.parabola.imgfmt.FileExistsException" ]
import uk.me.parabola.imgfmt.FileExistsException;
import uk.me.parabola.imgfmt.*;
[ "uk.me.parabola" ]
uk.me.parabola;
13,886
@Test public void scrollToItem() { int itemIndex = 100; // Getting a cell by item index ListItemDock listItemDock = new ListItemDock(listView2.asList(), itemIndex, new Any()); // and show it listItemDock.shower().show(); }
void function() { int itemIndex = 100; ListItemDock listItemDock = new ListItemDock(listView2.asList(), itemIndex, new Any()); listItemDock.shower().show(); }
/** * Scrolling happens automatically in case an Item is selected. Should you * need to scroll anyway ... */
Scrolling happens automatically in case an Item is selected. Should you need to scroll anyway ..
scrollToItem
{ "repo_name": "teamfx/openjfx-8u-dev-tests", "path": "tools/Jemmy/JemmyFX/samples/org/jemmy/samples/listview/ListViewSample.java", "license": "gpl-2.0", "size": 6707 }
[ "org.jemmy.fx.control.ListItemDock", "org.jemmy.lookup.Any" ]
import org.jemmy.fx.control.ListItemDock; import org.jemmy.lookup.Any;
import org.jemmy.fx.control.*; import org.jemmy.lookup.*;
[ "org.jemmy.fx", "org.jemmy.lookup" ]
org.jemmy.fx; org.jemmy.lookup;
1,579,763
private void checkDropNoIndex(CacheMode mode, CacheAtomicityMode atomicityMode, boolean near) throws Exception { initialize(mode, atomicityMode, near);
void function(CacheMode mode, CacheAtomicityMode atomicityMode, boolean near) throws Exception { initialize(mode, atomicityMode, near);
/** * Check drop when there is no index. * * @param mode Mode. * @param atomicityMode Atomicity mode. * @param near Near flag. * @throws Exception If failed. */
Check drop when there is no index
checkDropNoIndex
{ "repo_name": "samaitra/ignite", "path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/DynamicIndexAbstractBasicSelfTest.java", "license": "apache-2.0", "size": 50590 }
[ "org.apache.ignite.cache.CacheAtomicityMode", "org.apache.ignite.cache.CacheMode" ]
import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.*;
[ "org.apache.ignite" ]
org.apache.ignite;
2,070,646
private static void handleException(IResource resource, CoreException e) { if (resource == null || resource.isAccessible()) exceptions.handleException(e); } } class LabelEventJob extends Job { private static final long DELAY = 100L; private static LabelEventJob instance = new LabelEventJob("LabelEventJob"); //$NON-NLS-1$
static void function(IResource resource, CoreException e) { if (resource == null resource.isAccessible()) exceptions.handleException(e); } } class LabelEventJob extends Job { private static final long DELAY = 100L; private static LabelEventJob instance = new LabelEventJob(STR);
/** * Handle exceptions that occur in the decorator. Exceptions are only logged * for resources that are accessible (i.e. exist in an open project). * * @param resource * The resource that triggered the exception * @param e * The exception that occurred */
Handle exceptions that occur in the decorator. Exceptions are only logged for resources that are accessible (i.e. exist in an open project)
handleException
{ "repo_name": "blizzy78/egit", "path": "org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java", "license": "epl-1.0", "size": 25118 }
[ "org.eclipse.core.resources.IResource", "org.eclipse.core.runtime.CoreException", "org.eclipse.core.runtime.jobs.Job" ]
import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.jobs.*;
[ "org.eclipse.core" ]
org.eclipse.core;
2,052,169
public static java.util.Set extractOrderInvApptSet(ims.domain.ILightweightDomainFactory domainFactory, ims.careuk.vo.OrderInvWithStatusApptVoCollection voCollection) { return extractOrderInvApptSet(domainFactory, voCollection, null, new HashMap()); }
static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.careuk.vo.OrderInvWithStatusApptVoCollection voCollection) { return extractOrderInvApptSet(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.careuk.domain.objects.OrderInvAppt set from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.careuk.domain.objects.OrderInvAppt set from the value object collection
extractOrderInvApptSet
{ "repo_name": "open-health-hub/openmaxims-linux", "path": "openmaxims_workspace/ValueObjects/src/ims/careuk/vo/domain/OrderInvWithStatusApptVoAssembler.java", "license": "agpl-3.0", "size": 18211 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
2,590,024
private void radioButtonClicked(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { notifyActionListeners(); } } // radioButtonClicked()
void function(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { notifyActionListeners(); } }
/** * Event that fires when any radio button is clicked. * * @param e the event */
Event that fires when any radio button is clicked
radioButtonClicked
{ "repo_name": "waynem77/BSCMail", "path": "src/main/java/io/github/waynem77/bscmail/gui/util/EnumRadioPanel.java", "license": "gpl-3.0", "size": 6580 }
[ "java.awt.event.ItemEvent" ]
import java.awt.event.ItemEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
2,133,945
public void read_oneFrame() throws IOException { int fortcheck1, fortcheck2; int siz = (dcd_first_read) ? NATOM : LNFREAT; long start = data.getFilePointer(); // first read the crystal PBCs if needed if (QCRYS == 1) { fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < 6; i++) { pbc[i] = convert.little2big(data.readDouble()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); } // then read coordinates : first vector X, then Y and Z if (dcd_first_read || (LNFREAT == NATOM)) { //The first frame of the dcd always contains all the atoms // X fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < NATOM; i++) { X[i] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); // Y fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < NATOM; i++) { Y[i] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); // Z fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < NATOM; i++) { Z[i] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); } else { // if not the first frame, only free atoms are stored for saving space if (LNFREAT != NATOM) // X fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < siz; i++) { X[FREEAT[i] - 1] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); // Y fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < siz; i++) { Y[FREEAT[i] - 1] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); // Z fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < siz; i++) { Z[FREEAT[i] - 1] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); } if (dcd_first_read) { dcd_first_read = false; firstFrameSize = data.getFilePointer() - start; } else { framesSize = data.getFilePointer() - start; } } // read_oneFrame()
void function() throws IOException { int fortcheck1, fortcheck2; int siz = (dcd_first_read) ? NATOM : LNFREAT; long start = data.getFilePointer(); if (QCRYS == 1) { fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < 6; i++) { pbc[i] = convert.little2big(data.readDouble()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); } if (dcd_first_read (LNFREAT == NATOM)) { fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < NATOM; i++) { X[i] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < NATOM; i++) { Y[i] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < NATOM; i++) { Z[i] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); } else { fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < siz; i++) { X[FREEAT[i] - 1] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < siz; i++) { Y[FREEAT[i] - 1] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); fortcheck1 = convert.little2big(data.readInt()); for (int i = 0; i < siz; i++) { Z[FREEAT[i] - 1] = convert.little2big(data.readFloat()); } fortcheck2 = convert.little2big(data.readInt()); checkFortranIOerror(fortcheck1, fortcheck2); } if (dcd_first_read) { dcd_first_read = false; firstFrameSize = data.getFilePointer() - start; } else { framesSize = data.getFilePointer() - start; } }
/** * Read one record (frame) of the trajectory dcd * @throws IOException Thrown if problem happens when reading file */
Read one record (frame) of the trajectory dcd
read_oneFrame
{ "repo_name": "MMunibas/FittingWizard", "path": "src/ch/unibas/charmmtools/files/trajectory/DCD.java", "license": "bsd-3-clause", "size": 15171 }
[ "ch.unibas.charmmtools.errors.IO_Errors", "java.io.IOException" ]
import ch.unibas.charmmtools.errors.IO_Errors; import java.io.IOException;
import ch.unibas.charmmtools.errors.*; import java.io.*;
[ "ch.unibas.charmmtools", "java.io" ]
ch.unibas.charmmtools; java.io;
2,896,602
private JSONObject emailQuery(Cursor cursor) { JSONObject email = new JSONObject(); try { email.put("id", cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email._ID))); email.put("pref", false); // Android does not store pref attribute email.put("value", cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA))); email.put("type", getContactType(cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.TYPE)))); } catch (JSONException e) { Log.e(LOG_TAG, e.getMessage(), e); } return email; }
JSONObject function(Cursor cursor) { JSONObject email = new JSONObject(); try { email.put("id", cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email._ID))); email.put("pref", false); email.put("value", cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA))); email.put("type", getContactType(cursor.getInt(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.TYPE)))); } catch (JSONException e) { Log.e(LOG_TAG, e.getMessage(), e); } return email; }
/** * Create a ContactField JSONObject * @param cursor the current database row * @return a JSONObject representing a ContactField */
Create a ContactField JSONObject
emailQuery
{ "repo_name": "justsml/cordova-android", "path": "framework/src/org/apache/cordova/ContactAccessorSdk5.java", "license": "apache-2.0", "size": 84647 }
[ "android.database.Cursor", "android.provider.ContactsContract", "android.util.Log", "org.json.JSONException", "org.json.JSONObject" ]
import android.database.Cursor; import android.provider.ContactsContract; import android.util.Log; import org.json.JSONException; import org.json.JSONObject;
import android.database.*; import android.provider.*; import android.util.*; import org.json.*;
[ "android.database", "android.provider", "android.util", "org.json" ]
android.database; android.provider; android.util; org.json;
2,481,041
public static void clean( Object func, ExecutionConfig.ClosureCleanerLevel level, boolean checkSerializable) { clean(func, level, checkSerializable, Collections.newSetFromMap(new IdentityHashMap<>())); }
static void function( Object func, ExecutionConfig.ClosureCleanerLevel level, boolean checkSerializable) { clean(func, level, checkSerializable, Collections.newSetFromMap(new IdentityHashMap<>())); }
/** * Tries to clean the closure of the given object, if the object is a non-static inner class. * * @param func The object whose closure should be cleaned. * @param level the clean up level. * @param checkSerializable Flag to indicate whether serializability should be checked after the * closure cleaning attempt. * @throws InvalidProgramException Thrown, if 'checkSerializable' is true, and the object was * not serializable after the closure cleaning. * @throws RuntimeException A RuntimeException may be thrown, if the code of the class could not * be loaded, in order to process during the closure cleaning. */
Tries to clean the closure of the given object, if the object is a non-static inner class
clean
{ "repo_name": "apache/flink", "path": "flink-core/src/main/java/org/apache/flink/api/java/ClosureCleaner.java", "license": "apache-2.0", "size": 10738 }
[ "java.util.Collections", "java.util.IdentityHashMap", "org.apache.flink.api.common.ExecutionConfig" ]
import java.util.Collections; import java.util.IdentityHashMap; import org.apache.flink.api.common.ExecutionConfig;
import java.util.*; import org.apache.flink.api.common.*;
[ "java.util", "org.apache.flink" ]
java.util; org.apache.flink;
980,381
@SuppressWarnings("unchecked") private <IN1, IN2, OUT> TypeInformation<OUT> createTypeInfoFromFactory( Type t, List<Type> typeHierarchy, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type) { final List<Type> factoryHierarchy = new ArrayList<>(typeHierarchy); final TypeInfoFactory<? super OUT> factory = getClosestFactory(factoryHierarchy, t); if (factory == null) { return null; } final Type factoryDefiningType = factoryHierarchy.get(factoryHierarchy.size() - 1); // infer possible type parameters from input final Map<String, TypeInformation<?>> genericParams; if (factoryDefiningType instanceof ParameterizedType) { genericParams = new HashMap<>(); final ParameterizedType paramDefiningType = (ParameterizedType) factoryDefiningType; final Type[] args = typeToClass(paramDefiningType).getTypeParameters(); final TypeInformation<?>[] subtypeInfo = createSubTypesInfo( t, paramDefiningType, factoryHierarchy, in1Type, in2Type, true); assert subtypeInfo != null; for (int i = 0; i < subtypeInfo.length; i++) { genericParams.put(args[i].toString(), subtypeInfo[i]); } } else { genericParams = Collections.emptyMap(); } final TypeInformation<OUT> createdTypeInfo = (TypeInformation<OUT>) factory.createTypeInfo(t, genericParams); if (createdTypeInfo == null) { throw new InvalidTypesException( "TypeInfoFactory returned invalid TypeInformation 'null'"); } return createdTypeInfo; } // -------------------------------------------------------------------------------------------- // Extract type parameters // --------------------------------------------------------------------------------------------
@SuppressWarnings(STR) <IN1, IN2, OUT> TypeInformation<OUT> function( Type t, List<Type> typeHierarchy, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type) { final List<Type> factoryHierarchy = new ArrayList<>(typeHierarchy); final TypeInfoFactory<? super OUT> factory = getClosestFactory(factoryHierarchy, t); if (factory == null) { return null; } final Type factoryDefiningType = factoryHierarchy.get(factoryHierarchy.size() - 1); final Map<String, TypeInformation<?>> genericParams; if (factoryDefiningType instanceof ParameterizedType) { genericParams = new HashMap<>(); final ParameterizedType paramDefiningType = (ParameterizedType) factoryDefiningType; final Type[] args = typeToClass(paramDefiningType).getTypeParameters(); final TypeInformation<?>[] subtypeInfo = createSubTypesInfo( t, paramDefiningType, factoryHierarchy, in1Type, in2Type, true); assert subtypeInfo != null; for (int i = 0; i < subtypeInfo.length; i++) { genericParams.put(args[i].toString(), subtypeInfo[i]); } } else { genericParams = Collections.emptyMap(); } final TypeInformation<OUT> createdTypeInfo = (TypeInformation<OUT>) factory.createTypeInfo(t, genericParams); if (createdTypeInfo == null) { throw new InvalidTypesException( STR); } return createdTypeInfo; }
/** * Creates type information using a factory if for this type or super types. Returns null * otherwise. */
Creates type information using a factory if for this type or super types. Returns null otherwise
createTypeInfoFromFactory
{ "repo_name": "tillrohrmann/flink", "path": "flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java", "license": "apache-2.0", "size": 101306 }
[ "java.lang.reflect.ParameterizedType", "java.lang.reflect.Type", "java.util.ArrayList", "java.util.Collections", "java.util.HashMap", "java.util.List", "java.util.Map", "org.apache.flink.api.common.functions.InvalidTypesException", "org.apache.flink.api.common.typeinfo.TypeInfoFactory", "org.apache.flink.api.common.typeinfo.TypeInformation", "org.apache.flink.api.java.typeutils.TypeExtractionUtils" ]
import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.flink.api.common.functions.InvalidTypesException; import org.apache.flink.api.common.typeinfo.TypeInfoFactory; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.api.java.typeutils.TypeExtractionUtils;
import java.lang.reflect.*; import java.util.*; import org.apache.flink.api.common.functions.*; import org.apache.flink.api.common.typeinfo.*; import org.apache.flink.api.java.typeutils.*;
[ "java.lang", "java.util", "org.apache.flink" ]
java.lang; java.util; org.apache.flink;
630,263
long getStateTimestamp(ExecutionState state);
long getStateTimestamp(ExecutionState state);
/** * Returns the timestamp for the given {@link ExecutionState}. * * @param state state for which the timestamp should be returned * @return timestamp for the given state */
Returns the timestamp for the given <code>ExecutionState</code>
getStateTimestamp
{ "repo_name": "aljoscha/flink", "path": "flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/AccessExecution.java", "license": "apache-2.0", "size": 2986 }
[ "org.apache.flink.runtime.execution.ExecutionState" ]
import org.apache.flink.runtime.execution.ExecutionState;
import org.apache.flink.runtime.execution.*;
[ "org.apache.flink" ]
org.apache.flink;
1,146,894
public void connect(Collection<IGeometry> geometries);
void function(Collection<IGeometry> geometries);
/** * Connecta um conjunto de geometrias * @param geometries geometrias a ser adicionadas */
Connecta um conjunto de geometrias
connect
{ "repo_name": "olhoscastanhosrj/Bluefinger4j", "path": "src/bluefinger4j/graphics/element/allinterfaces/IGraphicElement.java", "license": "bsd-3-clause", "size": 2977 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
204,962
EList<CD> getTargetSiteCodes();
EList<CD> getTargetSiteCodes();
/** * Returns the value of the '<em><b>Target Site Code</b></em>' containment reference list. * The list contents are of type {@link org.openhealthtools.mdht.uml.hl7.datatypes.CD}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Target Site Code</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Target Site Code</em>' containment reference list. * @see org.openhealthtools.mdht.uml.cda.CDAPackage#getProcedure_TargetSiteCode() * @model containment="true" ordered="false" * extendedMetaData="namespace='##targetNamespace'" * @generated */
Returns the value of the 'Target Site Code' containment reference list. The list contents are of type <code>org.openhealthtools.mdht.uml.hl7.datatypes.CD</code>. If the meaning of the 'Target Site Code' containment reference list isn't clear, there really should be more of a description here...
getTargetSiteCodes
{ "repo_name": "drbgfc/mdht", "path": "cda/plugins/org.openhealthtools.mdht.uml.cda/src/org/openhealthtools/mdht/uml/cda/Procedure.java", "license": "epl-1.0", "size": 30383 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,125,277