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 boolean setmatrix(Env env, double a, double b, double c, double d, double e, double f) { env.stub("setmatrix"); return false; }
boolean function(Env env, double a, double b, double c, double d, double e, double f) { env.stub(STR); return false; }
/** * Sets the matrix style */
Sets the matrix style
setmatrix
{ "repo_name": "christianchristensen/resin", "path": "modules/resin/src/com/caucho/quercus/lib/pdf/PDF.java", "license": "gpl-2.0", "size": 20638 }
[ "com.caucho.quercus.env.Env" ]
import com.caucho.quercus.env.Env;
import com.caucho.quercus.env.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
1,708,329
public void createSignatures(File outputDirectory) { this.createSignatures(outputDirectory, null); }
void function(File outputDirectory) { this.createSignatures(outputDirectory, null); }
/** * Creates all signatures and puts them into the given output directory. * * @param outputDirectory */
Creates all signatures and puts them into the given output directory
createSignatures
{ "repo_name": "bkahlert/signature-generator", "path": "signaturegenerator/src/main/java/com/bkahlert/devel/signaturegenerator/SignatureGenerator.java", "license": "mit", "size": 4531 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,809,544
public static double computeSemiJoinSelectivity(RelMetadataQuery mq, SemiJoin rel) { return computeSemiJoinSelectivity(mq, rel.getLeft(), rel.getRight(), rel.getLeftKeys(), rel.getRightKeys()); }
static double function(RelMetadataQuery mq, SemiJoin rel) { return computeSemiJoinSelectivity(mq, rel.getLeft(), rel.getRight(), rel.getLeftKeys(), rel.getRightKeys()); }
/** * Computes the selectivity of a semijoin filter if it is applied on a fact * table. The computation is based on the selectivity of the dimension * table/columns and the number of distinct values in the fact table * columns. * * @param rel semijoin rel * @return calculated selectivity */
Computes the selectivity of a semijoin filter if it is applied on a fact table. The computation is based on the selectivity of the dimension table/columns and the number of distinct values in the fact table columns
computeSemiJoinSelectivity
{ "repo_name": "sreev/incubator-calcite", "path": "core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java", "license": "apache-2.0", "size": 28641 }
[ "org.apache.calcite.rel.core.SemiJoin" ]
import org.apache.calcite.rel.core.SemiJoin;
import org.apache.calcite.rel.core.*;
[ "org.apache.calcite" ]
org.apache.calcite;
354,069
void resolveTypeForIn(Session session) throws HsqlException { if (eArg2.exprType == QUERY) { if (eArg.isParam) { eArg.dataType = eArg2.dataType; } isQueryCorrelated = !eArg2.subQuery.isResolved; } else { Expression[] vl = eArg2.valueList; int len = vl.length; if (eArg.isParam) { if (vl[0].isParam) { throw Trace.error(Trace.UNRESOLVED_PARAMETER_TYPE, Trace.Expression_resolveTypeForIn2); } Expression e = vl[0]; int dt = e.dataType; // PARAM datatype same as first value list expression // should never be Types.NULL when all is said and done if (dt == Types.NULL) { // do nothing... } else { if (eArg.dataType == Types.NULL) { eArg.dataType = dt; } if (eArg2.dataType == Types.NULL) { eArg2.dataType = dt; } } for (int i = 1; i < len; i++) { e = vl[i]; if (e.isParam) { if (e.dataType == Types.NULL && dt != Types.NULL) { e.dataType = dt; } } else { e.resolveTypes(session); } } } else { int dt = eArg.dataType; if (eArg2.dataType == Types.NULL && dt != Types.NULL) { eArg2.dataType = dt; } for (int i = 0; i < len; i++) { Expression e = vl[i]; if (e.isParam) { if (e.dataType == Types.NULL && dt != Types.NULL) { e.dataType = dt; } } else { e.resolveTypes(session); } } } eArg2.isFixedConstantValueList = eArg2.dataType != Types.VARCHAR_IGNORECASE; for (int i = 0; i < len; i++) { if (!vl[i].isFixedConstant()) { eArg2.isFixedConstantValueList = false; isQueryCorrelated = true; break; } } if (eArg2.isFixedConstantValueList) { eArg2.hList = new HashSet(); for (int i = 0; i < len; i++) { try { Object value = eArg2.valueList[i].getValue(session); value = Column.convertObject(value, eArg2.dataType); if (eArg2.dataType == Types.CHAR && value != null) { value = Library.rtrim((String) value); } eArg2.hList.add(value); } catch (HsqlException e) {} } } } }
void resolveTypeForIn(Session session) throws HsqlException { if (eArg2.exprType == QUERY) { if (eArg.isParam) { eArg.dataType = eArg2.dataType; } isQueryCorrelated = !eArg2.subQuery.isResolved; } else { Expression[] vl = eArg2.valueList; int len = vl.length; if (eArg.isParam) { if (vl[0].isParam) { throw Trace.error(Trace.UNRESOLVED_PARAMETER_TYPE, Trace.Expression_resolveTypeForIn2); } Expression e = vl[0]; int dt = e.dataType; if (dt == Types.NULL) { } else { if (eArg.dataType == Types.NULL) { eArg.dataType = dt; } if (eArg2.dataType == Types.NULL) { eArg2.dataType = dt; } } for (int i = 1; i < len; i++) { e = vl[i]; if (e.isParam) { if (e.dataType == Types.NULL && dt != Types.NULL) { e.dataType = dt; } } else { e.resolveTypes(session); } } } else { int dt = eArg.dataType; if (eArg2.dataType == Types.NULL && dt != Types.NULL) { eArg2.dataType = dt; } for (int i = 0; i < len; i++) { Expression e = vl[i]; if (e.isParam) { if (e.dataType == Types.NULL && dt != Types.NULL) { e.dataType = dt; } } else { e.resolveTypes(session); } } } eArg2.isFixedConstantValueList = eArg2.dataType != Types.VARCHAR_IGNORECASE; for (int i = 0; i < len; i++) { if (!vl[i].isFixedConstant()) { eArg2.isFixedConstantValueList = false; isQueryCorrelated = true; break; } } if (eArg2.isFixedConstantValueList) { eArg2.hList = new HashSet(); for (int i = 0; i < len; i++) { try { Object value = eArg2.valueList[i].getValue(session); value = Column.convertObject(value, eArg2.dataType); if (eArg2.dataType == Types.CHAR && value != null) { value = Library.rtrim((String) value); } eArg2.hList.add(value); } catch (HsqlException e) {} } } } }
/** * Parametric or fixed value lists plus queries are handled. * * Empty lists are not allowed. * * Parametric predicand is resolved against the value list and vice versa. */
Parametric or fixed value lists plus queries are handled. Empty lists are not allowed. Parametric predicand is resolved against the value list and vice versa
resolveTypeForIn
{ "repo_name": "ckaestne/LEADT", "path": "workspace/hsqldb/src/org/hsqldb/Expression.java", "license": "gpl-3.0", "size": 123132 }
[ "org.hsqldb.lib.HashSet" ]
import org.hsqldb.lib.HashSet;
import org.hsqldb.lib.*;
[ "org.hsqldb.lib" ]
org.hsqldb.lib;
521,965
private void updateBackground() { Color bg = UIManager.getColor("Panel.background"); if (bg==null) { // UIManager properties aren't guaranteed to exist bg = new JPanel().getBackground(); } setBackground(bg); } /** * {@inheritDoc}
void function() { Color bg = UIManager.getColor(STR); if (bg==null) { bg = new JPanel().getBackground(); } setBackground(bg); } /** * {@inheritDoc}
/** * Sets our background color to that of standard "panels" in this * LookAndFeel. This is necessary because, otherwise, we'd inherit the * background color of our parent component (the Gutter). */
Sets our background color to that of standard "panels" in this LookAndFeel. This is necessary because, otherwise, we'd inherit the background color of our parent component (the Gutter)
updateBackground
{ "repo_name": "GreatArcStudios/TXE-Java-text-editor--MASTER-Code", "path": "TXE Code/RSyntaxTextArea-master/src/org/fife/ui/rtextarea/IconRowHeader.java", "license": "lgpl-3.0", "size": 23567 }
[ "java.awt.Color", "javax.swing.JPanel", "javax.swing.UIManager" ]
import java.awt.Color; import javax.swing.JPanel; import javax.swing.UIManager;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,292,270
private void sort() { if (!_hasBeenSorted) { Collections.sort(_infoList); _hasBeenSorted = true; } }
void function() { if (!_hasBeenSorted) { Collections.sort(_infoList); _hasBeenSorted = true; } }
/** * Sort the info list by ascending timestamps */
Sort the info list by ascending timestamps
sort
{ "repo_name": "sebastic/GpsPrune", "path": "tim/prune/function/deletebydate/DateInfoList.java", "license": "gpl-2.0", "size": 2602 }
[ "java.util.Collections" ]
import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
2,550,217
private static String getLog(String[] cmd) { Process logcatProc; try { logcatProc = Runtime.getRuntime().exec(cmd); } catch (IOException e1) { return ""; } BufferedReader reader = null; String response = ""; try { String separator = System.getProperty("line.separator"); StringBuilder sb = new StringBuilder(); reader = new BufferedReader(new InputStreamReader(logcatProc.getInputStream()), BUFFER_SIZE); String line; while ((line = reader.readLine()) != null) { sb.append(line); sb.append(separator); } response = sb.toString(); } catch (IOException e) { Log.e(LOG_TAG, "getLog fails with " + e.getLocalizedMessage()); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) { Log.e(LOG_TAG, "getLog fails with " + e.getLocalizedMessage()); } } } return response; }
static String function(String[] cmd) { Process logcatProc; try { logcatProc = Runtime.getRuntime().exec(cmd); } catch (IOException e1) { return STRSTRline.separatorSTRgetLog fails with STRgetLog fails with " + e.getLocalizedMessage()); } } } return response; }
/** * Retrieves the logs from a dedicated command. * @param cmd the command to execute. * @return the logs. */
Retrieves the logs from a dedicated command
getLog
{ "repo_name": "floviolleau/vector-android", "path": "vector/src/main/java/im/vector/util/LogUtilities.java", "license": "apache-2.0", "size": 9748 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,128,577
@Override public void mediaOpened(MediaPlayer mediaPlayer, MediaSource mediaSource) { currentPlayListItem = mediaSource; setVolumeValue(); if (mediaSource.getURL() == null && mediaPlayer.canSeek()) { setProgressEnabled(true); progressSongLength.setText(LibraryUtils.getSecondsInDDHHMMSS((int) mediaPlayer.getDurationInSecs())); } else { setProgressEnabled(false); progressSongLength.setText("--:--:--"); } updateTitle(mediaSource); updateSocialButton(mediaSource); updateMediaSourceButton(mediaSource); }
void function(MediaPlayer mediaPlayer, MediaSource mediaSource) { currentPlayListItem = mediaSource; setVolumeValue(); if (mediaSource.getURL() == null && mediaPlayer.canSeek()) { setProgressEnabled(true); progressSongLength.setText(LibraryUtils.getSecondsInDDHHMMSS((int) mediaPlayer.getDurationInSecs())); } else { setProgressEnabled(false); progressSongLength.setText(STR); } updateTitle(mediaSource); updateSocialButton(mediaSource); updateMediaSourceButton(mediaSource); }
/** * This event is thrown everytime a new media is opened and is ready to be * played. */
This event is thrown everytime a new media is opened and is ready to be played
mediaOpened
{ "repo_name": "alejandroarturom/frostwire-desktop", "path": "src/com/frostwire/gui/player/MediaPlayerComponent.java", "license": "gpl-3.0", "size": 41012 }
[ "com.frostwire.gui.library.LibraryUtils" ]
import com.frostwire.gui.library.LibraryUtils;
import com.frostwire.gui.library.*;
[ "com.frostwire.gui" ]
com.frostwire.gui;
674,296
public static void close(@Nullable Context rsrc, @Nullable IgniteLogger log) { if (rsrc != null) try { rsrc.close(); } catch (NamingException e) { warn(log, "Failed to close resource: " + e.getMessage()); } }
static void function(@Nullable Context rsrc, @Nullable IgniteLogger log) { if (rsrc != null) try { rsrc.close(); } catch (NamingException e) { warn(log, STR + e.getMessage()); } }
/** * Closes given resource logging possible checked exception. * * @param rsrc Resource to close. If it's {@code null} - it's no-op. * @param log Logger to log possible checked exception with (optional). */
Closes given resource logging possible checked exception
close
{ "repo_name": "SomeFire/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 374177 }
[ "javax.naming.Context", "javax.naming.NamingException", "org.apache.ignite.IgniteLogger", "org.jetbrains.annotations.Nullable" ]
import javax.naming.Context; import javax.naming.NamingException; import org.apache.ignite.IgniteLogger; import org.jetbrains.annotations.Nullable;
import javax.naming.*; import org.apache.ignite.*; import org.jetbrains.annotations.*;
[ "javax.naming", "org.apache.ignite", "org.jetbrains.annotations" ]
javax.naming; org.apache.ignite; org.jetbrains.annotations;
211,324
private void drawXline(double x, int color, @Nullable String label) { // Screen coordinate final int sx = (int) plot.getX(x); plot.paint.setColor(color); plot.canvas.drawLine(sx, 0, sx, plot.height, plot.paint); if (label != null) { plot.text.setColor(plot.options.grid_text_color); plot.text.setTextAlign(Paint.Align.LEFT); plot.canvas.drawText(label, sx + 2 * plot.options.density, plot.options.font_size - 2 * plot.options.density, plot.text); } }
void function(double x, int color, @Nullable String label) { final int sx = (int) plot.getX(x); plot.paint.setColor(color); plot.canvas.drawLine(sx, 0, sx, plot.height, plot.paint); if (label != null) { plot.text.setColor(plot.options.grid_text_color); plot.text.setTextAlign(Paint.Align.LEFT); plot.canvas.drawText(label, sx + 2 * plot.options.density, plot.options.font_size - 2 * plot.options.density, plot.text); } }
/** * Draws an X grid line (vertical) */
Draws an X grid line (vertical)
drawXline
{ "repo_name": "platypii/BASElineFlightComputer", "path": "common/src/main/java/com/platypii/baseline/views/charts/PlotAxes.java", "license": "mit", "size": 6951 }
[ "android.graphics.Paint", "androidx.annotation.Nullable" ]
import android.graphics.Paint; import androidx.annotation.Nullable;
import android.graphics.*; import androidx.annotation.*;
[ "android.graphics", "androidx.annotation" ]
android.graphics; androidx.annotation;
1,213,579
void close() throws IOException;
void close() throws IOException;
/** * Close the character stream. */
Close the character stream
close
{ "repo_name": "srnsw/xena", "path": "plugins/postscript/ext/src/toastscript-1.79/postscript/src/com/softhub/ps/util/CharStream.java", "license": "gpl-3.0", "size": 1478 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,983,264
@WebMethod @Path("/addNewRoleToAuthzGroup") @Produces("text/plain") @GET public String addNewRoleToAuthzGroup( @WebParam(name = "sessionid", partName = "sessionid") @QueryParam("sessionid") String sessionid, @WebParam(name = "authzgroupid", partName = "authzgroupid") @QueryParam("authzgroupid") String authzgroupid, @WebParam(name = "roleid", partName = "roleid") @QueryParam("roleid") String roleid, @WebParam(name = "description", partName = "description") @QueryParam("description") String description) { Session session = establishSession(sessionid); try { AuthzGroup authzgroup = authzGroupService.getAuthzGroup(authzgroupid); Role role = authzgroup.addRole(roleid); role.setDescription(description); authzGroupService.save(authzgroup); } catch (Exception e) { LOG.error("WS addNewRoleToAuthzGroup(): " + e.getClass().getName() + " : " + e.getMessage()); return e.getClass().getName() + " : " + e.getMessage(); } return "success"; }
@Path(STR) @Produces(STR) String function( @WebParam(name = STR, partName = STR) @QueryParam(STR) String sessionid, @WebParam(name = STR, partName = STR) @QueryParam(STR) String authzgroupid, @WebParam(name = STR, partName = STR) @QueryParam(STR) String roleid, @WebParam(name = STR, partName = STR) @QueryParam(STR) String description) { Session session = establishSession(sessionid); try { AuthzGroup authzgroup = authzGroupService.getAuthzGroup(authzgroupid); Role role = authzgroup.addRole(roleid); role.setDescription(description); authzGroupService.save(authzgroup); } catch (Exception e) { LOG.error(STR + e.getClass().getName() + STR + e.getMessage()); return e.getClass().getName() + STR + e.getMessage(); } return STR; }
/** * Add a role to an authzgroup (realm) * * @param sessionid the id of a valid session * @param authzgroupid the id of the authzgroup to add the role to * @param roleid the id of the role to add * @param description the description for the new role * @return success or exception message */
Add a role to an authzgroup (realm)
addNewRoleToAuthzGroup
{ "repo_name": "rodriguezdevera/sakai", "path": "webservices/cxf/src/java/org/sakaiproject/webservices/SakaiScript.java", "license": "apache-2.0", "size": 213282 }
[ "javax.jws.WebParam", "javax.ws.rs.Path", "javax.ws.rs.Produces", "javax.ws.rs.QueryParam", "org.sakaiproject.authz.api.AuthzGroup", "org.sakaiproject.authz.api.Role", "org.sakaiproject.tool.api.Session" ]
import javax.jws.WebParam; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import org.sakaiproject.authz.api.AuthzGroup; import org.sakaiproject.authz.api.Role; import org.sakaiproject.tool.api.Session;
import javax.jws.*; import javax.ws.rs.*; import org.sakaiproject.authz.api.*; import org.sakaiproject.tool.api.*;
[ "javax.jws", "javax.ws", "org.sakaiproject.authz", "org.sakaiproject.tool" ]
javax.jws; javax.ws; org.sakaiproject.authz; org.sakaiproject.tool;
2,016,018
protected InputStream getCompressorInputStream(InputStream inputStream, CompressionType compressionType) throws IOException { switch (compressionType) { case NONE: return inputStream; case GZIP: return new GZIPInputStream(inputStream); case BZ2: return new BZip2CompressorInputStream(new BufferedInputStream( inputStream)); default: throw new IllegalArgumentException("Unsupported compression type: " + compressionType); } }
InputStream function(InputStream inputStream, CompressionType compressionType) throws IOException { switch (compressionType) { case NONE: return inputStream; case GZIP: return new GZIPInputStream(inputStream); case BZ2: return new BZip2CompressorInputStream(new BufferedInputStream( inputStream)); default: throw new IllegalArgumentException(STR + compressionType); } }
/** * Returns an input stream that applies the required decompression to the * given input stream. * * @param inputStream * the input stream with the (possibly compressed) data * @param compressionType * the kind of compression * @return an input stream with decompressed data * @throws IOException * if there was a problem creating the decompression streams */
Returns an input stream that applies the required decompression to the given input stream
getCompressorInputStream
{ "repo_name": "Wikidata/Wikidata-Toolkit", "path": "wdtk-util/src/main/java/org/wikidata/wdtk/util/DirectoryManagerImpl.java", "license": "apache-2.0", "size": 7919 }
[ "java.io.BufferedInputStream", "java.io.IOException", "java.io.InputStream", "java.util.zip.GZIPInputStream", "org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream" ]
import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.util.zip.GZIPInputStream; import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
import java.io.*; import java.util.zip.*; import org.apache.commons.compress.compressors.bzip2.*;
[ "java.io", "java.util", "org.apache.commons" ]
java.io; java.util; org.apache.commons;
1,938,037
protected String prepareContent(String content, CmsObject cms, CmsResource xmlPage, String path) { // cut off eventually existing html skeleton content = CmsStringUtil.extractHtmlBody(content); // add tags for stylesheet String stylesheet = getUriStyleSheet(cms, xmlPage); // content-type String encoding = CmsLocaleManager.getResourceEncoding(cms, xmlPage); String contentType = CmsResourceManager.MIMETYPE_HTML + "; charset=" + encoding; content = CmsEncoder.adjustHtmlEncoding(content, encoding); // rewrite uri Object obj = cms.getRequestContext().getAttribute(CmsObjectWrapper.ATTRIBUTE_NAME); if (obj != null) { CmsObjectWrapper wrapper = (CmsObjectWrapper)obj; stylesheet = wrapper.rewriteLink(stylesheet); } String base = OpenCms.getSystemInfo().getOpenCmsContext(); StringBuffer result = new StringBuffer(content.length() + 1024); result.append("<html><head>"); // meta: content-type result.append("<meta http-equiv=\"content-type\" content=\""); result.append(contentType); result.append("\">"); // title as full path result.append("<title>"); result.append(cms.getRequestContext().removeSiteRoot(path)); result.append("</title>"); // stylesheet if (!"".equals(stylesheet)) { result.append("<link href=\""); result.append(base); result.append(stylesheet); result.append("\" rel=\"stylesheet\" type=\"text/css\">"); } result.append("</head><body>"); result.append(content); result.append("</body></html>"); content = result.toString(); return content.trim(); }
String function(String content, CmsObject cms, CmsResource xmlPage, String path) { content = CmsStringUtil.extractHtmlBody(content); String stylesheet = getUriStyleSheet(cms, xmlPage); String encoding = CmsLocaleManager.getResourceEncoding(cms, xmlPage); String contentType = CmsResourceManager.MIMETYPE_HTML + STR + encoding; content = CmsEncoder.adjustHtmlEncoding(content, encoding); Object obj = cms.getRequestContext().getAttribute(CmsObjectWrapper.ATTRIBUTE_NAME); if (obj != null) { CmsObjectWrapper wrapper = (CmsObjectWrapper)obj; stylesheet = wrapper.rewriteLink(stylesheet); } String base = OpenCms.getSystemInfo().getOpenCmsContext(); StringBuffer result = new StringBuffer(content.length() + 1024); result.append(STR); result.append(STRcontent-type\STRSTR\">"); result.append(STR); result.append(cms.getRequestContext().removeSiteRoot(path)); result.append(STR); if (!STR<link href=\STR\STRstylesheet\STRtext/css\">"); } result.append(STR); result.append(content); result.append(STR); content = result.toString(); return content.trim(); }
/** * Prepare the content of a xml page before returning.<p> * * Mainly adds the basic html structure and the css style sheet.<p> * * @param content the origin content of the xml page element * @param cms the initialized CmsObject * @param xmlPage the xml page resource * @param path the full path to set as the title in the html head * * @return the prepared content with the added html structure */
Prepare the content of a xml page before returning. Mainly adds the basic html structure and the css style sheet
prepareContent
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/file/wrapper/CmsResourceWrapperXmlPage.java", "license": "lgpl-2.1", "size": 42124 }
[ "org.opencms.file.CmsObject", "org.opencms.file.CmsResource", "org.opencms.i18n.CmsEncoder", "org.opencms.i18n.CmsLocaleManager", "org.opencms.loader.CmsResourceManager", "org.opencms.main.OpenCms", "org.opencms.util.CmsStringUtil" ]
import org.opencms.file.CmsObject; import org.opencms.file.CmsResource; import org.opencms.i18n.CmsEncoder; import org.opencms.i18n.CmsLocaleManager; import org.opencms.loader.CmsResourceManager; import org.opencms.main.OpenCms; import org.opencms.util.CmsStringUtil;
import org.opencms.file.*; import org.opencms.i18n.*; import org.opencms.loader.*; import org.opencms.main.*; import org.opencms.util.*;
[ "org.opencms.file", "org.opencms.i18n", "org.opencms.loader", "org.opencms.main", "org.opencms.util" ]
org.opencms.file; org.opencms.i18n; org.opencms.loader; org.opencms.main; org.opencms.util;
1,555,773
public final byte[] computeEncryptedKey(byte[] password, byte[] o, int permissions, byte[] id, int revision, int length) throws CryptographyException { byte[] result = new byte[length]; try { // PDFReference 1.4 pg 78 // step1 byte[] padded = truncateOrPad(password); // step 2 MessageDigest md = MessageDigest.getInstance("MD5"); md.update(padded); // step 3 md.update(o); // step 4 byte zero = (byte) (permissions >>> 0); byte one = (byte) (permissions >>> 8); byte two = (byte) (permissions >>> 16); byte three = (byte) (permissions >>> 24); md.update(zero); md.update(one); md.update(two); md.update(three); // step 5 md.update(id); byte[] digest = md.digest(); // step 6 if ((revision == 3) || (revision == 4)) { for (int i = 0; i < 50; i++) { md.reset(); md.update(digest, 0, length); digest = md.digest(); } } // step 7 if ((revision == 2) && (length != 5)) { throw new CryptographyException("Error: length should be 5 when revision is two actual=" + length); } System.arraycopy(digest, 0, result, 0, length); } catch (NoSuchAlgorithmException e) { throw new CryptographyException(e); } return result; }
final byte[] function(byte[] password, byte[] o, int permissions, byte[] id, int revision, int length) throws CryptographyException { byte[] result = new byte[length]; try { byte[] padded = truncateOrPad(password); MessageDigest md = MessageDigest.getInstance("MD5"); md.update(padded); md.update(o); byte zero = (byte) (permissions >>> 0); byte one = (byte) (permissions >>> 8); byte two = (byte) (permissions >>> 16); byte three = (byte) (permissions >>> 24); md.update(zero); md.update(one); md.update(two); md.update(three); md.update(id); byte[] digest = md.digest(); if ((revision == 3) (revision == 4)) { for (int i = 0; i < 50; i++) { md.reset(); md.update(digest, 0, length); digest = md.digest(); } } if ((revision == 2) && (length != 5)) { throw new CryptographyException(STR + length); } System.arraycopy(digest, 0, result, 0, length); } catch (NoSuchAlgorithmException e) { throw new CryptographyException(e); } return result; }
/** * This will compute the encrypted key. * * @param password The password used to compute the encrypted key. * @param o The owner password hash. * @param permissions The permissions for the document. * @param id The document id. * @param revision The security revision. * @param length The length of the encryption key. * * @return The encryption key. * * @throws CryptographyException If there is an error computing the key. */
This will compute the encrypted key
computeEncryptedKey
{ "repo_name": "sencko/NALB", "path": "nalb2013/src/org/apache/pdfbox/encryption/PDFEncryption.java", "license": "gpl-2.0", "size": 16703 }
[ "java.security.MessageDigest", "java.security.NoSuchAlgorithmException", "org.apache.pdfbox.exceptions.CryptographyException" ]
import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import org.apache.pdfbox.exceptions.CryptographyException;
import java.security.*; import org.apache.pdfbox.exceptions.*;
[ "java.security", "org.apache.pdfbox" ]
java.security; org.apache.pdfbox;
2,647,854
super.validate(obj, errors); EncounterRole encounterRole = (EncounterRole) obj; if (!errors.hasErrors()) { EncounterRole duplicate = Context.getEncounterService().getEncounterRoleByName(encounterRole.getName().trim()); if (duplicate != null) { if (duplicate.getUuid() != null && !OpenmrsUtil.nullSafeEquals(encounterRole.getUuid(), duplicate.getUuid())) { errors.rejectValue("name", "encounterRole.duplicate.name", "Specified Encounter Role name already exists, please specify another "); } } } }
super.validate(obj, errors); EncounterRole encounterRole = (EncounterRole) obj; if (!errors.hasErrors()) { EncounterRole duplicate = Context.getEncounterService().getEncounterRoleByName(encounterRole.getName().trim()); if (duplicate != null) { if (duplicate.getUuid() != null && !OpenmrsUtil.nullSafeEquals(encounterRole.getUuid(), duplicate.getUuid())) { errors.rejectValue("name", STR, STR); } } } }
/** * Checks the form object for any inconsistencies/errors * * @see org.springframework.validation.Validator#validate(java.lang.Object, * org.springframework.validation.Errors) * @should fail validation if name is null or empty or whitespace * @should fail validation if name is duplicate * @should pass validation if all required fields have proper values */
Checks the form object for any inconsistencies/errors
validate
{ "repo_name": "Winbobob/openmrs-core", "path": "api/src/main/java/org/openmrs/validator/EncounterRoleValidator.java", "license": "mpl-2.0", "size": 1922 }
[ "org.openmrs.EncounterRole", "org.openmrs.api.context.Context", "org.openmrs.util.OpenmrsUtil" ]
import org.openmrs.EncounterRole; import org.openmrs.api.context.Context; import org.openmrs.util.OpenmrsUtil;
import org.openmrs.*; import org.openmrs.api.context.*; import org.openmrs.util.*;
[ "org.openmrs", "org.openmrs.api", "org.openmrs.util" ]
org.openmrs; org.openmrs.api; org.openmrs.util;
1,557,084
public void rawDataStream( AudioFormat audioFormat, boolean priority, String sourcename, float x, float y, float z, int attModel, float distOrRoll ) { CommandQueue( new CommandObject( CommandObject.RAW_DATA_STREAM, audioFormat, priority, sourcename, x, y, z, attModel, distOrRoll ) ); commandThread.interrupt(); }
void function( AudioFormat audioFormat, boolean priority, String sourcename, float x, float y, float z, int attModel, float distOrRoll ) { CommandQueue( new CommandObject( CommandObject.RAW_DATA_STREAM, audioFormat, priority, sourcename, x, y, z, attModel, distOrRoll ) ); commandThread.interrupt(); }
/** * Opens a direct line for streaming audio data. This method creates a new * streaming source to play the data at. The resulting streaming source can be * manipulated the same as any other streaming source. Raw data can be sent to * the new streaming source using the feedRawAudioData() method. * @param audioFormat Format that the data will be in. * @param priority Setting this to true will prevent other sounds from overriding this one. * @param sourcename A unique identifier for this source. Two sources may not use the same sourcename. * @param x X position for this source. * @param y Y position for this source. * @param z Z position for this source. * @param attModel Attenuation model to use. * @param distOrRoll Either the fading distance or rolloff factor, depending on the value of "attmodel". */
Opens a direct line for streaming audio data. This method creates a new streaming source to play the data at. The resulting streaming source can be manipulated the same as any other streaming source. Raw data can be sent to the new streaming source using the feedRawAudioData() method
rawDataStream
{ "repo_name": "Guerra24/Infinity", "path": "src/main/java/net/guerra24/infinity/client/sound/soundsystem/SoundSystem.java", "license": "mit", "size": 125042 }
[ "javax.sound.sampled.AudioFormat" ]
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.*;
[ "javax.sound" ]
javax.sound;
858,796
private void injectAllOpenablesForJavaProject( IJavaProject project, ArrayList openables) { try { IPackageFragmentRoot[] devPathRoots = ((JavaProject) project).getPackageFragmentRoots(); if (devPathRoots == null) { return; } for (int j = 0; j < devPathRoots.length; j++) { IPackageFragmentRoot root = devPathRoots[j]; injectAllOpenablesForPackageFragmentRoot(root, openables); } } catch (JavaModelException e) { // ignore } }
void function( IJavaProject project, ArrayList openables) { try { IPackageFragmentRoot[] devPathRoots = ((JavaProject) project).getPackageFragmentRoots(); if (devPathRoots == null) { return; } for (int j = 0; j < devPathRoots.length; j++) { IPackageFragmentRoot root = devPathRoots[j]; injectAllOpenablesForPackageFragmentRoot(root, openables); } } catch (JavaModelException e) { } }
/** * Adds all of the openables defined within this java project to the * list. */
Adds all of the openables defined within this java project to the list
injectAllOpenablesForJavaProject
{ "repo_name": "elucash/eclipse-oxygen", "path": "org.eclipse.jdt.core/src/org/eclipse/jdt/internal/core/hierarchy/RegionBasedHierarchyBuilder.java", "license": "epl-1.0", "size": 7066 }
[ "java.util.ArrayList", "org.eclipse.jdt.core.IJavaProject", "org.eclipse.jdt.core.IPackageFragmentRoot", "org.eclipse.jdt.core.JavaModelException", "org.eclipse.jdt.internal.core.JavaProject" ]
import java.util.ArrayList; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.core.JavaProject;
import java.util.*; import org.eclipse.jdt.core.*; import org.eclipse.jdt.internal.core.*;
[ "java.util", "org.eclipse.jdt" ]
java.util; org.eclipse.jdt;
532,115
public void setStruct(StructMetadata struct) { m_struct = struct; }
void function(StructMetadata struct) { m_struct = struct; }
/** * INTERNAL: * Used for OX mapping. */
Used for OX mapping
setStruct
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/classes/ClassAccessor.java", "license": "epl-1.0", "size": 82197 }
[ "org.eclipse.persistence.internal.jpa.metadata.structures.StructMetadata" ]
import org.eclipse.persistence.internal.jpa.metadata.structures.StructMetadata;
import org.eclipse.persistence.internal.jpa.metadata.structures.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,185,897
private ResponseEntity<String> getMetadataForOaiIdentifer(String oaiIdentifier, MetadataExportFormat format) { return restTemplate.getForEntity( "https://www.da-ra.de/oaip/oai?verb=GetRecord&metadataPrefix={format}&identifier={oaiIdentifier}", String.class, format.urlFormat, oaiIdentifier); }
ResponseEntity<String> function(String oaiIdentifier, MetadataExportFormat format) { return restTemplate.getForEntity( "https: String.class, format.urlFormat, oaiIdentifier); }
/** * Get the metadata for the given OAI-PMH Identifier in the given format. * * @param oaiIdentifier A valid OAI-PMH Identifier. * @param format One of {@link MetadataExportFormat} powered by da|ra. * @return The json or xml depending on the desired format. */
Get the metadata for the given OAI-PMH Identifier in the given format
getMetadataForOaiIdentifer
{ "repo_name": "dzhw/metadatamanagement", "path": "src/main/java/eu/dzhw/fdz/metadatamanagement/datapackagemanagement/service/DaraOaiPmhClient.java", "license": "agpl-3.0", "size": 2974 }
[ "eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.MetadataExportFormat", "org.springframework.http.ResponseEntity" ]
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.MetadataExportFormat; import org.springframework.http.ResponseEntity;
import eu.dzhw.fdz.metadatamanagement.datapackagemanagement.domain.*; import org.springframework.http.*;
[ "eu.dzhw.fdz", "org.springframework.http" ]
eu.dzhw.fdz; org.springframework.http;
1,942,291
public double getAverageCPUUtilization() { return PoorManStatistics.mean(this.cpuData); }
double function() { return PoorManStatistics.mean(this.cpuData); }
/** * Gets The average CPU Utilization for the day * * @return Double representing average CPU Utilization for the day */
Gets The average CPU Utilization for the day
getAverageCPUUtilization
{ "repo_name": "rootio/rootio_handset", "path": "app/src/main/java/org/rootio/activities/DiagnosticStatistics.java", "license": "agpl-3.0", "size": 10139 }
[ "org.rootio.tools.utils.PoorManStatistics" ]
import org.rootio.tools.utils.PoorManStatistics;
import org.rootio.tools.utils.*;
[ "org.rootio.tools" ]
org.rootio.tools;
2,610,152
@SuppressWarnings("unchecked") private Script createScript(Object compiledScript, Map<String, Object> vars) throws InstantiationException, IllegalAccessException { Class<?> scriptClass = (Class<?>) compiledScript; Script scriptObject = (Script) scriptClass.newInstance(); Binding binding = new Binding(); binding.getVariables().putAll(vars); scriptObject.setBinding(binding); return scriptObject; }
@SuppressWarnings(STR) Script function(Object compiledScript, Map<String, Object> vars) throws InstantiationException, IllegalAccessException { Class<?> scriptClass = (Class<?>) compiledScript; Script scriptObject = (Script) scriptClass.newInstance(); Binding binding = new Binding(); binding.getVariables().putAll(vars); scriptObject.setBinding(binding); return scriptObject; }
/** * Return a script object with the given vars from the compiled script object */
Return a script object with the given vars from the compiled script object
createScript
{ "repo_name": "mapr/elasticsearch", "path": "modules/lang-groovy/src/main/java/org/elasticsearch/script/groovy/GroovyScriptEngineService.java", "license": "apache-2.0", "size": 14827 }
[ "groovy.lang.Binding", "groovy.lang.Script", "java.util.Map" ]
import groovy.lang.Binding; import groovy.lang.Script; import java.util.Map;
import groovy.lang.*; import java.util.*;
[ "groovy.lang", "java.util" ]
groovy.lang; java.util;
1,798,077
private void consume(Trie trie, int j, int l) { // System.err.println(String.format("CONSUME %s / %d %d %d", dotNode, // dotNode.begin(), dotNode.end(), l)); // Try to match terminals if (inputLattice.distance(j, l) == 1) { // Get the current sentence node, and explore all outgoing arcs, since we // might be decoding // a lattice. For sentence decoding, this is trivial: there is only one // outgoing arc. Node<Token> inputNode = sentence.getNode(j); for (Arc<Token> arc : inputNode.getOutgoingArcs()) { int word = arc.getLabel().getWord(); Trie nextTrie; if ((nextTrie = trie.match(word)) != null) { // add to chart item over (i, l) addToChart(nextTrie, arc.getHead().id(), i == j); } } } // Now try to match nonterminals Cell cell = cells.get(j, l); if (cell != null) { for (int id : cell.getKeySet()) { // for each supernode (lhs), see if you // can match a trie Trie nextTrie = trie.match(id); if (nextTrie != null) { SuperNode superNode = cell.getSuperNode(id); nodeStack.add(superNode); addToChart(nextTrie, superNode.end(), i == j); nodeStack.remove(nodeStack.size() - 1); } } } }
void function(Trie trie, int j, int l) { if (inputLattice.distance(j, l) == 1) { Node<Token> inputNode = sentence.getNode(j); for (Arc<Token> arc : inputNode.getOutgoingArcs()) { int word = arc.getLabel().getWord(); Trie nextTrie; if ((nextTrie = trie.match(word)) != null) { addToChart(nextTrie, arc.getHead().id(), i == j); } } } Cell cell = cells.get(j, l); if (cell != null) { for (int id : cell.getKeySet()) { Trie nextTrie = trie.match(id); if (nextTrie != null) { SuperNode superNode = cell.getSuperNode(id); nodeStack.add(superNode); addToChart(nextTrie, superNode.end(), i == j); nodeStack.remove(nodeStack.size() - 1); } } } }
/** * Recursively consumes the trie, following input nodes, finding applicable * rules and adding them to bins for each span for later cube pruning. * * @param dotNode data structure containing information about what's been * already matched * @param l extension point we're looking at * */
Recursively consumes the trie, following input nodes, finding applicable rules and adding them to bins for each span for later cube pruning
consume
{ "repo_name": "fhieber/incubator-joshua", "path": "src/main/java/org/apache/joshua/decoder/chart_parser/Chart.java", "license": "apache-2.0", "size": 27809 }
[ "org.apache.joshua.decoder.ff.tm.Trie", "org.apache.joshua.decoder.segment_file.Token", "org.apache.joshua.lattice.Arc", "org.apache.joshua.lattice.Node" ]
import org.apache.joshua.decoder.ff.tm.Trie; import org.apache.joshua.decoder.segment_file.Token; import org.apache.joshua.lattice.Arc; import org.apache.joshua.lattice.Node;
import org.apache.joshua.decoder.ff.tm.*; import org.apache.joshua.decoder.segment_file.*; import org.apache.joshua.lattice.*;
[ "org.apache.joshua" ]
org.apache.joshua;
1,833,049
public void run(Configuration configuration, List<CandidateSteps> candidateSteps, Story story) throws Throwable { run(configuration, candidateSteps, story, MetaFilter.EMPTY); }
void function(Configuration configuration, List<CandidateSteps> candidateSteps, Story story) throws Throwable { run(configuration, candidateSteps, story, MetaFilter.EMPTY); }
/** * Runs a Story with the given configuration and steps. * * @param configuration the Configuration used to run story * @param candidateSteps the List of CandidateSteps containing the candidate * steps methods * @param story the Story to run * @throws Throwable if failures occurred and FailureStrategy dictates it to * be re-thrown. */
Runs a Story with the given configuration and steps
run
{ "repo_name": "codehaus/jbehave-core", "path": "jbehave-core/src/main/java/org/jbehave/core/embedder/StoryRunner.java", "license": "bsd-3-clause", "size": 29844 }
[ "java.util.List", "org.jbehave.core.configuration.Configuration", "org.jbehave.core.model.Story", "org.jbehave.core.steps.CandidateSteps" ]
import java.util.List; import org.jbehave.core.configuration.Configuration; import org.jbehave.core.model.Story; import org.jbehave.core.steps.CandidateSteps;
import java.util.*; import org.jbehave.core.configuration.*; import org.jbehave.core.model.*; import org.jbehave.core.steps.*;
[ "java.util", "org.jbehave.core" ]
java.util; org.jbehave.core;
2,741,704
public void testTransformClassToClassGen_ArrayAndAnnotationTypes() throws ClassNotFoundException { final JavaClass jc = getTestClass(PACKAGE_BASE_NAME+".data.AnnotatedWithCombinedAnnotation"); final ClassGen cgen = new ClassGen(jc); // Check annotations are correctly preserved final AnnotationEntryGen[] annotations = cgen.getAnnotationEntries(); assertTrue("Expected one annotation but found " + annotations.length, annotations.length == 1); final AnnotationEntryGen a = annotations[0]; assertTrue("That annotation should only have one value but has " + a.getValues().size(), a.getValues().size() == 1); final ElementValuePairGen nvp = a.getValues().get(0); final ElementValueGen value = nvp.getValue(); assertTrue("Value should be ArrayElementValueGen but is " + value, value instanceof ArrayElementValueGen); final ArrayElementValueGen arrayValue = (ArrayElementValueGen) value; assertTrue("Array value should be size one but is " + arrayValue.getElementValuesSize(), arrayValue .getElementValuesSize() == 1); final ElementValueGen innerValue = arrayValue.getElementValues().get(0); assertTrue( "Value in the array should be AnnotationElementValueGen but is " + innerValue, innerValue instanceof AnnotationElementValueGen); final AnnotationElementValueGen innerAnnotationValue = (AnnotationElementValueGen) innerValue; assertTrue("Should be called L"+PACKAGE_BASE_SIG+"/data/SimpleAnnotation; but is called: " + innerAnnotationValue.getAnnotation().getTypeName(), innerAnnotationValue.getAnnotation().getTypeSignature().equals( "L"+PACKAGE_BASE_SIG+"/data/SimpleAnnotation;")); // check the three methods final Method[] methods = cgen.getMethods(); assertEquals(3, methods.length); for (final Method method : methods) { final String methodName= method.getName(); if(methodName.equals("<init>")) { assertMethodAnnotations(method, 0, 1); assertParameterAnnotations(method, 0, 1); } else if(methodName.equals("methodWithArrayOfZeroAnnotations")) { assertMethodAnnotations(method, 1, 0); } else if(methodName.equals("methodWithArrayOfTwoAnnotations")) { assertMethodAnnotations(method, 1, 2); } else { fail("unexpected method "+method.getName()); } } }
void function() throws ClassNotFoundException { final JavaClass jc = getTestClass(PACKAGE_BASE_NAME+STR); final ClassGen cgen = new ClassGen(jc); final AnnotationEntryGen[] annotations = cgen.getAnnotationEntries(); assertTrue(STR + annotations.length, annotations.length == 1); final AnnotationEntryGen a = annotations[0]; assertTrue(STR + a.getValues().size(), a.getValues().size() == 1); final ElementValuePairGen nvp = a.getValues().get(0); final ElementValueGen value = nvp.getValue(); assertTrue(STR + value, value instanceof ArrayElementValueGen); final ArrayElementValueGen arrayValue = (ArrayElementValueGen) value; assertTrue(STR + arrayValue.getElementValuesSize(), arrayValue .getElementValuesSize() == 1); final ElementValueGen innerValue = arrayValue.getElementValues().get(0); assertTrue( STR + innerValue, innerValue instanceof AnnotationElementValueGen); final AnnotationElementValueGen innerAnnotationValue = (AnnotationElementValueGen) innerValue; assertTrue(STR+PACKAGE_BASE_SIG+STR + innerAnnotationValue.getAnnotation().getTypeName(), innerAnnotationValue.getAnnotation().getTypeSignature().equals( "L"+PACKAGE_BASE_SIG+STR)); final Method[] methods = cgen.getMethods(); assertEquals(3, methods.length); for (final Method method : methods) { final String methodName= method.getName(); if(methodName.equals(STR)) { assertMethodAnnotations(method, 0, 1); assertParameterAnnotations(method, 0, 1); } else if(methodName.equals(STR)) { assertMethodAnnotations(method, 1, 0); } else if(methodName.equals(STR)) { assertMethodAnnotations(method, 1, 2); } else { fail(STR+method.getName()); } } }
/** * Transform simple class from an immutable to a mutable object. The class * is annotated with an annotation that uses an array of SimpleAnnotations. */
Transform simple class from an immutable to a mutable object. The class is annotated with an annotation that uses an array of SimpleAnnotations
testTransformClassToClassGen_ArrayAndAnnotationTypes
{ "repo_name": "typetools/commons-bcel", "path": "src/test/java/org/apache/bcel/generic/GeneratingAnnotatedClassesTestCase.java", "license": "apache-2.0", "size": 32266 }
[ "org.apache.bcel.classfile.JavaClass", "org.apache.bcel.classfile.Method" ]
import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method;
import org.apache.bcel.classfile.*;
[ "org.apache.bcel" ]
org.apache.bcel;
2,818,221
public static void validate(Map<String, String> props) { final boolean hasTopicsConfig = hasTopicsConfig(props); final boolean hasTopicsRegexConfig = hasTopicsRegexConfig(props); if (hasTopicsConfig && hasTopicsRegexConfig) { throw new ConfigException(SinkTask.TOPICS_CONFIG + " and " + SinkTask.TOPICS_REGEX_CONFIG + " are mutually exclusive options, but both are set."); } if (!hasTopicsConfig && !hasTopicsRegexConfig) { throw new ConfigException("Must configure one of " + SinkTask.TOPICS_CONFIG + " or " + SinkTask.TOPICS_REGEX_CONFIG); } }
static void function(Map<String, String> props) { final boolean hasTopicsConfig = hasTopicsConfig(props); final boolean hasTopicsRegexConfig = hasTopicsRegexConfig(props); if (hasTopicsConfig && hasTopicsRegexConfig) { throw new ConfigException(SinkTask.TOPICS_CONFIG + STR + SinkTask.TOPICS_REGEX_CONFIG + STR); } if (!hasTopicsConfig && !hasTopicsRegexConfig) { throw new ConfigException(STR + SinkTask.TOPICS_CONFIG + STR + SinkTask.TOPICS_REGEX_CONFIG); } }
/** * Throw an exception if the passed-in properties do not constitute a valid sink. * @param props sink configuration properties */
Throw an exception if the passed-in properties do not constitute a valid sink
validate
{ "repo_name": "richhaase/kafka", "path": "connect/runtime/src/main/java/org/apache/kafka/connect/runtime/SinkConnectorConfig.java", "license": "apache-2.0", "size": 6746 }
[ "java.util.Map", "org.apache.kafka.common.config.ConfigException", "org.apache.kafka.connect.sink.SinkTask" ]
import java.util.Map; import org.apache.kafka.common.config.ConfigException; import org.apache.kafka.connect.sink.SinkTask;
import java.util.*; import org.apache.kafka.common.config.*; import org.apache.kafka.connect.sink.*;
[ "java.util", "org.apache.kafka" ]
java.util; org.apache.kafka;
470,024
@Deprecated public void createAccountsForClient() throws CustomerException { if (offeringsAssociatedInCreate != null) { for (ClientInitialSavingsOfferingEntity clientOffering : offeringsAssociatedInCreate) { try { SavingsOfferingBO savingsOffering = getSavingsPrdPersistence().getSavingsProduct( clientOffering.getSavingsOffering().getPrdOfferingId()); if (savingsOffering.isActive()) { List<CustomFieldDefinitionEntity> customFieldDefs = getSavingsPersistence() .retrieveCustomFieldsDefinition(EntityType.SAVINGS.getValue()); addAccount(new SavingsBO(getUserContext(), savingsOffering, this, AccountState.SAVINGS_ACTIVE, savingsOffering.getRecommendedAmount(), createCustomFieldViewsForClientSavingsAccount(customFieldDefs))); } } catch (PersistenceException pe) { throw new CustomerException(pe); } catch (AccountException pe) { throw new CustomerException(pe); } } } }
void function() throws CustomerException { if (offeringsAssociatedInCreate != null) { for (ClientInitialSavingsOfferingEntity clientOffering : offeringsAssociatedInCreate) { try { SavingsOfferingBO savingsOffering = getSavingsPrdPersistence().getSavingsProduct( clientOffering.getSavingsOffering().getPrdOfferingId()); if (savingsOffering.isActive()) { List<CustomFieldDefinitionEntity> customFieldDefs = getSavingsPersistence() .retrieveCustomFieldsDefinition(EntityType.SAVINGS.getValue()); addAccount(new SavingsBO(getUserContext(), savingsOffering, this, AccountState.SAVINGS_ACTIVE, savingsOffering.getRecommendedAmount(), createCustomFieldViewsForClientSavingsAccount(customFieldDefs))); } } catch (PersistenceException pe) { throw new CustomerException(pe); } catch (AccountException pe) { throw new CustomerException(pe); } } } }
/** * remove when constructor is removed */
remove when constructor is removed
createAccountsForClient
{ "repo_name": "maduhu/mifos-head", "path": "application/src/main/java/org/mifos/customers/client/business/ClientBO.java", "license": "apache-2.0", "size": 54781 }
[ "java.util.List", "org.mifos.accounts.exceptions.AccountException", "org.mifos.accounts.productdefinition.business.SavingsOfferingBO", "org.mifos.accounts.savings.business.SavingsBO", "org.mifos.accounts.util.helpers.AccountState", "org.mifos.application.master.business.CustomFieldDefinitionEntity", "org.mifos.application.util.helpers.EntityType", "org.mifos.customers.exceptions.CustomerException", "org.mifos.framework.exceptions.PersistenceException" ]
import java.util.List; import org.mifos.accounts.exceptions.AccountException; import org.mifos.accounts.productdefinition.business.SavingsOfferingBO; import org.mifos.accounts.savings.business.SavingsBO; import org.mifos.accounts.util.helpers.AccountState; import org.mifos.application.master.business.CustomFieldDefinitionEntity; import org.mifos.application.util.helpers.EntityType; import org.mifos.customers.exceptions.CustomerException; import org.mifos.framework.exceptions.PersistenceException;
import java.util.*; import org.mifos.accounts.exceptions.*; import org.mifos.accounts.productdefinition.business.*; import org.mifos.accounts.savings.business.*; import org.mifos.accounts.util.helpers.*; import org.mifos.application.master.business.*; import org.mifos.application.util.helpers.*; import org.mifos.customers.exceptions.*; import org.mifos.framework.exceptions.*;
[ "java.util", "org.mifos.accounts", "org.mifos.application", "org.mifos.customers", "org.mifos.framework" ]
java.util; org.mifos.accounts; org.mifos.application; org.mifos.customers; org.mifos.framework;
209,728
@Deprecated public void save(OutputStream out, String comment) { try { store(out, comment); } catch (IOException e) { } }
void function(OutputStream out, String comment) { try { store(out, comment); } catch (IOException e) { } }
/** * Saves the mappings in this {@code Properties} to the specified {@code * OutputStream}, putting the specified comment at the beginning. The output * from this method is suitable for being read by the * {@link #load(InputStream)} method. * * @param out the {@code OutputStream} to write to. * @param comment the comment to add at the beginning. * @throws ClassCastException if the key or value of a mapping is not a * String. * @deprecated This method ignores any {@code IOException} thrown while * writing -- use {@link #store} instead for better exception * handling. */
Saves the mappings in this Properties to the specified OutputStream, putting the specified comment at the beginning. The output from this method is suitable for being read by the <code>#load(InputStream)</code> method
save
{ "repo_name": "skyHALud/codenameone", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/luni/src/main/java/java/util/Properties.java", "license": "gpl-2.0", "size": 34391 }
[ "java.io.IOException", "java.io.OutputStream" ]
import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
970,718
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<PagedResponse<StorageAccountInner>> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<StorageAccountInner>> function(Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); }
/** * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the * ListKeys operation for this. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List Storage Accounts operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */
Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this
listSinglePageAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/implementation/StorageAccountsClientImpl.java", "license": "mit", "size": 213141 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedResponse", "com.azure.core.http.rest.PagedResponseBase", "com.azure.core.util.Context", "com.azure.resourcemanager.storage.fluent.models.StorageAccountInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.storage.fluent.models.StorageAccountInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.storage.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,333,677
private static int skipAlias(String stmt, int offset) { offset = ParseUtil.move(stmt, offset, 0); if (offset >= stmt.length()) return offset; switch (stmt.charAt(offset)) { case '\'': return skipString(stmt, offset); case '"': return skipString2(stmt, offset); case '`': return skipIdentifierEscape(stmt, offset); default: if (CharTypes.isIdentifierChar(stmt.charAt(offset))) { for (; offset < stmt.length() && CharTypes.isIdentifierChar(stmt.charAt(offset)); ++offset) ; return offset; } } return -1; }
static int function(String stmt, int offset) { offset = ParseUtil.move(stmt, offset, 0); if (offset >= stmt.length()) return offset; switch (stmt.charAt(offset)) { case '\'': return skipString(stmt, offset); case '"': return skipString2(stmt, offset); case '`': return skipIdentifierEscape(stmt, offset); default: if (CharTypes.isIdentifierChar(stmt.charAt(offset))) { for (; offset < stmt.length() && CharTypes.isIdentifierChar(stmt.charAt(offset)); ++offset) ; return offset; } } return -1; }
/** * <code>SELECT LAST_INSERT_ID() AS id, </code> * * @param offset * index of 'i', offset == stmt.length() is possible * @return index of ','. return stmt.length() is possible. -1 if not alias */
<code>SELECT LAST_INSERT_ID() AS id, </code>
skipAlias
{ "repo_name": "fengyapeng/Mycat-Server", "path": "src/main/java/io/mycat/server/parser/ServerParseSelect.java", "license": "apache-2.0", "size": 12815 }
[ "io.mycat.util.CharTypes", "io.mycat.util.ParseUtil" ]
import io.mycat.util.CharTypes; import io.mycat.util.ParseUtil;
import io.mycat.util.*;
[ "io.mycat.util" ]
io.mycat.util;
229,237
public boolean isPassword(String password) { if (TextUtils.isEmpty(password)) { mPassword.error("Password cannot be null !"); return false; } String pattern = "(?!^(\\d+|[a-zA-Z]+|[!%&@#$^_.]+)$)^[\\w!%&@#$^_.]{6,18}+$"; if (password.matches(pattern)) { return true; } else { mPassword.error("Illegal Password Input !"); return false; } }
boolean function(String password) { if (TextUtils.isEmpty(password)) { mPassword.error(STR); return false; } String pattern = STR; if (password.matches(pattern)) { return true; } else { mPassword.error(STR); return false; } }
/** * Required 6-18 words, Contain upper and lower case letters, numbers or a combination of at least two special symbols * @param password * @return */
Required 6-18 words, Contain upper and lower case letters, numbers or a combination of at least two special symbols
isPassword
{ "repo_name": "Syehunter/MaterialEditText", "path": "app/src/main/java/z/sye/space/cleanedittext/MainActivity.java", "license": "apache-2.0", "size": 3640 }
[ "android.text.TextUtils" ]
import android.text.TextUtils;
import android.text.*;
[ "android.text" ]
android.text;
2,715,845
@ServiceMethod(returns = ReturnType.SINGLE) public Mono<Void> deleteShare(String shareName) { try { return deleteShareWithResponse(shareName, null).flatMap(FluxUtil::toMono); } catch (RuntimeException ex) { return monoError(logger, ex); } }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Void> function(String shareName) { try { return deleteShareWithResponse(shareName, null).flatMap(FluxUtil::toMono); } catch (RuntimeException ex) { return monoError(logger, ex); } }
/** * Deletes the share in the storage account with the given name. * * <p><strong>Code Samples</strong></p> * * <p>Delete the share "test"</p> * * <!-- src_embed com.azure.storage.file.share.ShareServiceAsyncClient.deleteShare#string --> * <pre> * fileServiceAsyncClient.deleteShare&#40;&quot;test&quot;&#41;.doOnSuccess&#40; * response -&gt; System.out.println&#40;&quot;Deleting the share completed.&quot;&#41; * &#41;; * </pre> * <!-- end com.azure.storage.file.share.ShareServiceAsyncClient.deleteShare#string --> * * <p>For more information, see the * <a href="https://docs.microsoft.com/rest/api/storageservices/delete-share">Azure Docs</a>.</p> * * @param shareName Name of the share * @return An empty response * @throws ShareStorageException If the share doesn't exist */
Deletes the share in the storage account with the given name. Code Samples Delete the share "test" <code> fileServiceAsyncClient.deleteShare&#40;&quot;test&quot;&#41;.doOnSuccess&#40; response -&gt; System.out.println&#40;&quot;Deleting the share completed.&quot;&#41; &#41;; </code> For more information, see the Azure Docs
deleteShare
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareServiceAsyncClient.java", "license": "mit", "size": 42555 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.util.FluxUtil" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.FluxUtil;
import com.azure.core.annotation.*; import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
2,175,439
private Path getLauncherlibPath() { String formattedDate = dateFormat.format(Calendar.getInstance(TimeZone.getTimeZone("GMT")).getTime()); Path tmpLauncherLibPath = new Path(services.get(WorkflowAppService.class).getSystemLibPath(), LAUNCHER_LIB_PREFIX + formattedDate); return tmpLauncherLibPath; }
Path function() { String formattedDate = dateFormat.format(Calendar.getInstance(TimeZone.getTimeZone("GMT")).getTime()); Path tmpLauncherLibPath = new Path(services.get(WorkflowAppService.class).getSystemLibPath(), LAUNCHER_LIB_PREFIX + formattedDate); return tmpLauncherLibPath; }
/** * Gets the launcherlib path. * * @return the launcherlib path */
Gets the launcherlib path
getLauncherlibPath
{ "repo_name": "cbaenziger/oozie", "path": "core/src/main/java/org/apache/oozie/service/ShareLibService.java", "license": "apache-2.0", "size": 37485 }
[ "java.util.Calendar", "java.util.TimeZone", "org.apache.hadoop.fs.Path" ]
import java.util.Calendar; import java.util.TimeZone; import org.apache.hadoop.fs.Path;
import java.util.*; import org.apache.hadoop.fs.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
2,610,666
public final void sendMessage(Message msg) { // mSmHandler can be null if the state machine has quit. SmHandler smh = mSmHandler; if (smh == null) return; smh.sendMessage(msg); }
final void function(Message msg) { SmHandler smh = mSmHandler; if (smh == null) return; smh.sendMessage(msg); }
/** * Enqueue a message to this state machine. * * Message is ignored if state machine has quit. */
Enqueue a message to this state machine. Message is ignored if state machine has quit
sendMessage
{ "repo_name": "hdodenhof/AndroidStateMachine", "path": "library/src/main/java/de/hdodenhof/androidstatemachine/StateMachine.java", "license": "apache-2.0", "size": 68024 }
[ "android.os.Message" ]
import android.os.Message;
import android.os.*;
[ "android.os" ]
android.os;
1,284,871
private void finishRecovery() throws IgniteCheckedException { assert !cctx.kernalContext().clientNode(); long time = System.currentTimeMillis(); CHECKPOINT_LOCK_HOLD_COUNT.set(CHECKPOINT_LOCK_HOLD_COUNT.get() + 1); try { for (DatabaseLifecycleListener lsnr : getDatabaseListeners(cctx.kernalContext())) lsnr.beforeResumeWalLogging(this); // Try to resume logging since last finished checkpoint if possible. if (walTail == null) { CheckpointStatus status = readCheckpointStatus(); walTail = CheckpointStatus.NULL_PTR.equals(status.endPtr) ? null : status.endPtr; } cctx.wal().resumeLogging(walTail); walTail = null; // Recreate metastorage to refresh page memory state after deactivation. if (metaStorage == null) metaStorage = createMetastorage(false); notifyMetastorageReadyForReadWrite(); U.log(log, "Finish recovery performed in " + (System.currentTimeMillis() - time) + " ms."); } catch (IgniteCheckedException e) { if (X.hasCause(e, StorageException.class, IOException.class)) cctx.kernalContext().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e)); throw e; } finally { CHECKPOINT_LOCK_HOLD_COUNT.set(CHECKPOINT_LOCK_HOLD_COUNT.get() - 1); } }
void function() throws IgniteCheckedException { assert !cctx.kernalContext().clientNode(); long time = System.currentTimeMillis(); CHECKPOINT_LOCK_HOLD_COUNT.set(CHECKPOINT_LOCK_HOLD_COUNT.get() + 1); try { for (DatabaseLifecycleListener lsnr : getDatabaseListeners(cctx.kernalContext())) lsnr.beforeResumeWalLogging(this); if (walTail == null) { CheckpointStatus status = readCheckpointStatus(); walTail = CheckpointStatus.NULL_PTR.equals(status.endPtr) ? null : status.endPtr; } cctx.wal().resumeLogging(walTail); walTail = null; if (metaStorage == null) metaStorage = createMetastorage(false); notifyMetastorageReadyForReadWrite(); U.log(log, STR + (System.currentTimeMillis() - time) + STR); } catch (IgniteCheckedException e) { if (X.hasCause(e, StorageException.class, IOException.class)) cctx.kernalContext().failure().process(new FailureContext(FailureType.CRITICAL_ERROR, e)); throw e; } finally { CHECKPOINT_LOCK_HOLD_COUNT.set(CHECKPOINT_LOCK_HOLD_COUNT.get() - 1); } }
/** * Restores last valid WAL pointer and resumes logging from that pointer. * Re-creates metastorage if needed. * * @throws IgniteCheckedException If failed. */
Restores last valid WAL pointer and resumes logging from that pointer. Re-creates metastorage if needed
finishRecovery
{ "repo_name": "samaitra/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/GridCacheDatabaseSharedManager.java", "license": "apache-2.0", "size": 127324 }
[ "java.io.IOException", "org.apache.ignite.IgniteCheckedException", "org.apache.ignite.failure.FailureContext", "org.apache.ignite.failure.FailureType", "org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointStatus", "org.apache.ignite.internal.util.typedef.X", "org.apache.ignite.internal.util.typedef.internal.U" ]
import java.io.IOException; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.failure.FailureContext; import org.apache.ignite.failure.FailureType; import org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointStatus; import org.apache.ignite.internal.util.typedef.X; import org.apache.ignite.internal.util.typedef.internal.U;
import java.io.*; import org.apache.ignite.*; import org.apache.ignite.failure.*; import org.apache.ignite.internal.processors.cache.persistence.checkpoint.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*;
[ "java.io", "org.apache.ignite" ]
java.io; org.apache.ignite;
827,726
public void moveRow(int from, int to) { if (from < 0 || to >= rows.size()) throw new IllegalArgumentException("Row from invalid"); if (to < 0 || to >= rows.size()) throw new IllegalArgumentException("Row to invalid"); // Move Data ArrayList<Object> temp = rows.get(from); rows.remove(from); rows.add(to, temp); // Move Description indicator >>> m_groupRows is not in sync after row move !! if (m_groupRowsIndicator != null) { Boolean tempB = m_groupRowsIndicator.get(from); m_groupRowsIndicator.remove(from); m_groupRowsIndicator.add(to, tempB); } } // moveRow
void function(int from, int to) { if (from < 0 to >= rows.size()) throw new IllegalArgumentException(STR); if (to < 0 to >= rows.size()) throw new IllegalArgumentException(STR); ArrayList<Object> temp = rows.get(from); rows.remove(from); rows.add(to, temp); if (m_groupRowsIndicator != null) { Boolean tempB = m_groupRowsIndicator.get(from); m_groupRowsIndicator.remove(from); m_groupRowsIndicator.add(to, tempB); } }
/** * Move Row * * @param from index * @param to index * @throws IllegalArgumentException if row index is invalid */
Move Row
moveRow
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.business/src/main/java-legacy/org/compiere/report/core/RModelData.java", "license": "gpl-2.0", "size": 16775 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,371,805
CompressionCodec createNewCodec(int bufferSize) { return createNewCodec(algorithm.getCodecClassNameProperty(), algorithm.getCodecClassName(), bufferSize, algorithm.getBufferSizeProperty()); }
CompressionCodec createNewCodec(int bufferSize) { return createNewCodec(algorithm.getCodecClassNameProperty(), algorithm.getCodecClassName(), bufferSize, algorithm.getBufferSizeProperty()); }
/** * Shared function to create new codec objects. It is expected that if buffersize is invalid, a * codec will be created with the default buffer size. */
Shared function to create new codec objects. It is expected that if buffersize is invalid, a codec will be created with the default buffer size
createNewCodec
{ "repo_name": "ctubbsii/accumulo", "path": "core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionAlgorithm.java", "license": "apache-2.0", "size": 14661 }
[ "org.apache.hadoop.io.compress.CompressionCodec" ]
import org.apache.hadoop.io.compress.CompressionCodec;
import org.apache.hadoop.io.compress.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,179,303
private void addTarget(TransitiveInfoCollection dep) { for (Artifact artifact : FileType.filterList( dep.getProvider(FileProvider.class).getFilesToBuild(), CppFileTypes.SHARED_LIBRARY)) { builder.add(new LinkerInputs.SimpleLinkerInput(artifact)); } }
void function(TransitiveInfoCollection dep) { for (Artifact artifact : FileType.filterList( dep.getProvider(FileProvider.class).getFilesToBuild(), CppFileTypes.SHARED_LIBRARY)) { builder.add(new LinkerInputs.SimpleLinkerInput(artifact)); } }
/** * Include files and genrule artifacts. */
Include files and genrule artifacts
addTarget
{ "repo_name": "mikelalcon/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/java/NativeLibraryNestedSetBuilder.java", "license": "apache-2.0", "size": 3925 }
[ "com.google.devtools.build.lib.actions.Artifact", "com.google.devtools.build.lib.analysis.FileProvider", "com.google.devtools.build.lib.analysis.TransitiveInfoCollection", "com.google.devtools.build.lib.rules.cpp.CppFileTypes", "com.google.devtools.build.lib.rules.cpp.LinkerInputs", "com.google.devtools.build.lib.util.FileType" ]
import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.FileProvider; import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.rules.cpp.CppFileTypes; import com.google.devtools.build.lib.rules.cpp.LinkerInputs; import com.google.devtools.build.lib.util.FileType;
import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.rules.cpp.*; import com.google.devtools.build.lib.util.*;
[ "com.google.devtools" ]
com.google.devtools;
1,189,948
public IndexShardState markAsRecovering(String reason, RecoveryState recoveryState) throws IndexShardStartedException, IndexShardRelocatedException, IndexShardRecoveringException, IndexShardClosedException { synchronized (mutex) { if (state == IndexShardState.CLOSED) { throw new IndexShardClosedException(shardId); } if (state == IndexShardState.STARTED) { throw new IndexShardStartedException(shardId); } if (state == IndexShardState.RELOCATED) { throw new IndexShardRelocatedException(shardId); } if (state == IndexShardState.RECOVERING) { throw new IndexShardRecoveringException(shardId); } if (state == IndexShardState.POST_RECOVERY) { throw new IndexShardRecoveringException(shardId); } this.recoveryState = recoveryState; return changeState(IndexShardState.RECOVERING, reason); } }
IndexShardState function(String reason, RecoveryState recoveryState) throws IndexShardStartedException, IndexShardRelocatedException, IndexShardRecoveringException, IndexShardClosedException { synchronized (mutex) { if (state == IndexShardState.CLOSED) { throw new IndexShardClosedException(shardId); } if (state == IndexShardState.STARTED) { throw new IndexShardStartedException(shardId); } if (state == IndexShardState.RELOCATED) { throw new IndexShardRelocatedException(shardId); } if (state == IndexShardState.RECOVERING) { throw new IndexShardRecoveringException(shardId); } if (state == IndexShardState.POST_RECOVERY) { throw new IndexShardRecoveringException(shardId); } this.recoveryState = recoveryState; return changeState(IndexShardState.RECOVERING, reason); } }
/** * Marks the shard as recovering based on a recovery state, fails with exception is recovering is not allowed to be set. */
Marks the shard as recovering based on a recovery state, fails with exception is recovering is not allowed to be set
markAsRecovering
{ "repo_name": "nezirus/elasticsearch", "path": "core/src/main/java/org/elasticsearch/index/shard/IndexShard.java", "license": "apache-2.0", "size": 102225 }
[ "org.elasticsearch.indices.recovery.RecoveryState" ]
import org.elasticsearch.indices.recovery.RecoveryState;
import org.elasticsearch.indices.recovery.*;
[ "org.elasticsearch.indices" ]
org.elasticsearch.indices;
2,181,185
void addArrayList(Node firstInList) { boolean lastWasEmpty = false; for (Node n = firstInList; n != null; n = n.getNext()) { if (n != firstInList) { cc.listSeparator(); } addExpr(n, 1, Context.OTHER); lastWasEmpty = n.isEmpty(); } if (lastWasEmpty) { cc.listSeparator(); } }
void addArrayList(Node firstInList) { boolean lastWasEmpty = false; for (Node n = firstInList; n != null; n = n.getNext()) { if (n != firstInList) { cc.listSeparator(); } addExpr(n, 1, Context.OTHER); lastWasEmpty = n.isEmpty(); } if (lastWasEmpty) { cc.listSeparator(); } }
/** * This function adds a comma-separated list as is specified by an ARRAYLIT * node with the associated skipIndexes array. This is a space optimization * since we avoid creating a whole Node object for each empty array literal * slot. * @param firstInList The first in the node list (chained through the next * property). */
This function adds a comma-separated list as is specified by an ARRAYLIT node with the associated skipIndexes array. This is a space optimization since we avoid creating a whole Node object for each empty array literal slot
addArrayList
{ "repo_name": "fredj/closure-compiler", "path": "src/com/google/javascript/jscomp/CodeGenerator.java", "license": "apache-2.0", "size": 44677 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
528,290
public void printHOA(PrintStream out) throws PrismException { out.println("HOA: v1"); out.println("States: "+size()); // AP out.print("AP: "+apList.size()); for (String ap : apList) { // TODO(JK): Proper quoting out.print(" \""+ap+"\""); } out.println(); out.println("Start: "+start); acceptance.outputHOAHeader(out); out.println("properties: trans-labels explicit-labels state-acc no-univ-branch deterministic"); out.println("--BODY--"); for (int i = 0; i < size(); i++) { out.print("State: "+i+" "); // id out.println(acceptance.getSignatureForStateHOA(i)); for (Edge edge : edges.get(i)) { Symbol label = edge.label; if (!(label instanceof BitSet)) throw new PrismNotSupportedException("Can not print automaton with "+label.getClass()+" labels"); String labelString = "["+APElement.toStringHOA((BitSet)label, apList.size())+"]"; out.print(labelString); out.print(" "); out.println(edge.dest); } } out.println("--END--"); }
void function(PrintStream out) throws PrismException { out.println(STR); out.println(STR+size()); out.print(STR+apList.size()); for (String ap : apList) { out.print(STR"+ap+"\STRStart: STRproperties: trans-labels explicit-labels state-acc no-univ-branch deterministicSTR--BODY--STRState: "+i+" STRCan not print automaton with STR labelsSTR[STR]STR STR--END--"); }
/** * Print the DA in HOA format to the output stream. * @param out the output stream */
Print the DA in HOA format to the output stream
printHOA
{ "repo_name": "nicodelpiano/prism", "path": "src/automata/DA.java", "license": "gpl-2.0", "size": 11022 }
[ "java.io.PrintStream" ]
import java.io.PrintStream;
import java.io.*;
[ "java.io" ]
java.io;
2,777,202
@SuppressWarnings("unchecked") public void testEqualsAndHashcode() throws IOException { SmoothingModel firstModel = createTestModel(); assertFalse("smoothing model is equal to null", firstModel.equals(null)); assertFalse("smoothing model is equal to incompatible type", firstModel.equals("")); assertTrue("smoothing model is not equal to self", firstModel.equals(firstModel)); assertThat("same smoothing model's hashcode returns different values if called multiple times", firstModel.hashCode(), equalTo(firstModel.hashCode())); assertThat("different smoothing models should not be equal", createMutation(firstModel), not(equalTo(firstModel))); SmoothingModel secondModel = copyModel(firstModel); assertTrue("smoothing model is not equal to self", secondModel.equals(secondModel)); assertTrue("smoothing model is not equal to its copy", firstModel.equals(secondModel)); assertTrue("equals is not symmetric", secondModel.equals(firstModel)); assertThat("smoothing model copy's hashcode is different from original hashcode", secondModel.hashCode(), equalTo(firstModel.hashCode())); SmoothingModel thirdModel = copyModel(secondModel); assertTrue("smoothing model is not equal to self", thirdModel.equals(thirdModel)); assertTrue("smoothing model is not equal to its copy", secondModel.equals(thirdModel)); assertThat("smoothing model copy's hashcode is different from original hashcode", secondModel.hashCode(), equalTo(thirdModel.hashCode())); assertTrue("equals is not transitive", firstModel.equals(thirdModel)); assertThat("smoothing model copy's hashcode is different from original hashcode", firstModel.hashCode(), equalTo(thirdModel.hashCode())); assertTrue("equals is not symmetric", thirdModel.equals(secondModel)); assertTrue("equals is not symmetric", thirdModel.equals(firstModel)); }
@SuppressWarnings(STR) void function() throws IOException { SmoothingModel firstModel = createTestModel(); assertFalse(STR, firstModel.equals(null)); assertFalse(STR, firstModel.equals(STRsmoothing model is not equal to selfSTRsame smoothing model's hashcode returns different values if called multiple timesSTRdifferent smoothing models should not be equalSTRsmoothing model is not equal to selfSTRsmoothing model is not equal to its copySTRequals is not symmetricSTRsmoothing model copy's hashcode is different from original hashcodeSTRsmoothing model is not equal to selfSTRsmoothing model is not equal to its copySTRsmoothing model copy's hashcode is different from original hashcodeSTRequals is not transitiveSTRsmoothing model copy's hashcode is different from original hashcodeSTRequals is not symmetricSTRequals is not symmetric", thirdModel.equals(firstModel)); }
/** * Test equality and hashCode properties */
Test equality and hashCode properties
testEqualsAndHashcode
{ "repo_name": "dpursehouse/elasticsearch", "path": "core/src/test/java/org/elasticsearch/search/suggest/phrase/SmoothingModelTestCase.java", "license": "apache-2.0", "size": 8758 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,777,146
public Optional<Integer> getMaxContentNumber() { return m_maxContentNumber; }
Optional<Integer> function() { return m_maxContentNumber; }
/** * Returns the maximum number of XML contents.<p> * * @return the maximum number of XML contents */
Returns the maximum number of XML contents
getMaxContentNumber
{ "repo_name": "victos/opencms-core", "path": "src/org/opencms/ugc/CmsUgcConfiguration.java", "license": "lgpl-2.1", "size": 9029 }
[ "com.google.common.base.Optional" ]
import com.google.common.base.Optional;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
2,322,107
public CompletableFuture<EnableLogMessagesResponse> enableLogMessages(String switchAddress, LogMessagesDto logMessagesDto) { GrpcSession sender = new GrpcSession(mapper, switchAddress); return sender.login(name, password) .thenCompose(e -> sender.setLogMessagesStatus(logMessagesDto)) .thenApply(optional -> optional .map(value -> new EnableLogMessagesResponse(logMessagesDto.getState())) .orElseThrow(() -> new GrpcException(format("Could not set log messages to status: %s", logMessagesDto.getState().toString())))) .whenComplete((e, ex) -> sender.shutdown()); }
CompletableFuture<EnableLogMessagesResponse> function(String switchAddress, LogMessagesDto logMessagesDto) { GrpcSession sender = new GrpcSession(mapper, switchAddress); return sender.login(name, password) .thenCompose(e -> sender.setLogMessagesStatus(logMessagesDto)) .thenApply(optional -> optional .map(value -> new EnableLogMessagesResponse(logMessagesDto.getState())) .orElseThrow(() -> new GrpcException(format(STR, logMessagesDto.getState().toString())))) .whenComplete((e, ex) -> sender.shutdown()); }
/** * Enable log messages. * * @param switchAddress a switch address. * @param logMessagesDto a log messages data. * @return {@link CompletableFuture} with the execution result. */
Enable log messages
enableLogMessages
{ "repo_name": "jonvestal/open-kilda", "path": "src-java/grpc-speaker/grpc-service/src/main/java/org/openkilda/grpc/speaker/service/GrpcSenderService.java", "license": "apache-2.0", "size": 13699 }
[ "java.util.concurrent.CompletableFuture", "org.openkilda.grpc.speaker.client.GrpcSession", "org.openkilda.grpc.speaker.exception.GrpcException", "org.openkilda.grpc.speaker.model.EnableLogMessagesResponse", "org.openkilda.grpc.speaker.model.LogMessagesDto" ]
import java.util.concurrent.CompletableFuture; import org.openkilda.grpc.speaker.client.GrpcSession; import org.openkilda.grpc.speaker.exception.GrpcException; import org.openkilda.grpc.speaker.model.EnableLogMessagesResponse; import org.openkilda.grpc.speaker.model.LogMessagesDto;
import java.util.concurrent.*; import org.openkilda.grpc.speaker.client.*; import org.openkilda.grpc.speaker.exception.*; import org.openkilda.grpc.speaker.model.*;
[ "java.util", "org.openkilda.grpc" ]
java.util; org.openkilda.grpc;
431,146
public Options dilations(Long... dilations) { this.dilations = Arrays.asList(dilations); return this; }
Options function(Long... dilations) { this.dilations = Arrays.asList(dilations); return this; }
/** * Sets the dilations option. * * @param dilations the dilations option * @return this Options instance. */
Sets the dilations option
dilations
{ "repo_name": "tensorflow/java", "path": "tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/nn/QuantizedConv2DAndRequantize.java", "license": "apache-2.0", "size": 10388 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,572,276
public Mjpeg addCookie(String cookie) { if (!TextUtils.isEmpty(cookie)) { msCookieManager.getCookieStore().add(null, HttpCookie.parse(cookie).get(0)); } return this; }
Mjpeg function(String cookie) { if (!TextUtils.isEmpty(cookie)) { msCookieManager.getCookieStore().add(null, HttpCookie.parse(cookie).get(0)); } return this; }
/** * Configure cookies. * * @param cookie cookie string * @return Mjpeg instance */
Configure cookies
addCookie
{ "repo_name": "niqdev/ipcam-view", "path": "mjpeg-view/src/main/java/com/github/niqdev/mjpeg/Mjpeg.java", "license": "mit", "size": 5275 }
[ "android.text.TextUtils", "java.net.HttpCookie" ]
import android.text.TextUtils; import java.net.HttpCookie;
import android.text.*; import java.net.*;
[ "android.text", "java.net" ]
android.text; java.net;
41,537
@Override public org.apache.lucene.search.SortField sortField(Schema schema) { if (field.equalsIgnoreCase("score")) { return FIELD_SCORE; } Mapper mapper = schema.mapper(field); if (mapper == null) { throw new IndexException("No mapper found for sortFields field '{}'", field); } else if (!mapper.docValues) { throw new IndexException("Field '{}' does not support sorting", field); } else { return mapper.sortField(field, reverse); } }
org.apache.lucene.search.SortField function(Schema schema) { if (field.equalsIgnoreCase("score")) { return FIELD_SCORE; } Mapper mapper = schema.mapper(field); if (mapper == null) { throw new IndexException(STR, field); } else if (!mapper.docValues) { throw new IndexException(STR, field); } else { return mapper.sortField(field, reverse); } }
/** * Returns the Lucene {@link org.apache.lucene.search.SortField} representing this {@link SortField}. * * @param schema the {@link Schema} to be used * @return the equivalent Lucene sort field */
Returns the Lucene <code>org.apache.lucene.search.SortField</code> representing this <code>SortField</code>
sortField
{ "repo_name": "Stratio/cassandra-lucene-index", "path": "plugin/src/main/java/com/stratio/cassandra/lucene/search/sort/SimpleSortField.java", "license": "apache-2.0", "size": 3545 }
[ "com.stratio.cassandra.lucene.IndexException", "com.stratio.cassandra.lucene.schema.Schema", "com.stratio.cassandra.lucene.schema.mapping.Mapper" ]
import com.stratio.cassandra.lucene.IndexException; import com.stratio.cassandra.lucene.schema.Schema; import com.stratio.cassandra.lucene.schema.mapping.Mapper;
import com.stratio.cassandra.lucene.*; import com.stratio.cassandra.lucene.schema.*; import com.stratio.cassandra.lucene.schema.mapping.*;
[ "com.stratio.cassandra" ]
com.stratio.cassandra;
180,418
EClass getDocumentRoot();
EClass getDocumentRoot();
/** * Returns the meta object for class '{@link com.example.example.with.substitutiongroup.DocumentRoot <em>Document Root</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Document Root</em>'. * @see com.example.example.with.substitutiongroup.DocumentRoot * @generated */
Returns the meta object for class '<code>com.example.example.with.substitutiongroup.DocumentRoot Document Root</code>'.
getDocumentRoot
{ "repo_name": "patrickneubauer/XMLIntellEdit", "path": "individual-experiments/SandboxProject/src/com/example/example/with/substitutiongroup/SubstitutiongroupPackage.java", "license": "mit", "size": 13231 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,895,440
@Test public void disjunct() { final QueryModifier expected = new QueryModifier(TermModifier.NONE, false, true, false, null); final QueryModifier actual = QueryModifier.start().disjunct().end(); Assert.assertEquals(expected, actual); }
void function() { final QueryModifier expected = new QueryModifier(TermModifier.NONE, false, true, false, null); final QueryModifier actual = QueryModifier.start().disjunct().end(); Assert.assertEquals(expected, actual); }
/** * Tests {@link ModifierBuilder#disjunct()}. */
Tests <code>ModifierBuilder#disjunct()</code>
disjunct
{ "repo_name": "cosmocode/cosmocode-lucene", "path": "src/test/java/de/cosmocode/lucene/QueryModifierTest.java", "license": "apache-2.0", "size": 11555 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,028,987
public void takeSnapshot(String tag, String... keyspaceNames) throws IOException;
void function(String tag, String... keyspaceNames) throws IOException;
/** * Takes the snapshot for the given keyspaces. A snapshot name must be specified. * * @param tag the tag given to the snapshot; may not be null or empty * @param keyspaceNames the name of the keyspaces to snapshot; empty means "all." */
Takes the snapshot for the given keyspaces. A snapshot name must be specified
takeSnapshot
{ "repo_name": "hobinyoon/apache-cassandra-3.0.5-src", "path": "src/java/org/apache/cassandra/service/StorageServiceMBean.java", "license": "apache-2.0", "size": 23501 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,417,458
public Component getValueComponent() { return textField; }
Component function() { return textField; }
/** * Returns the value component. * * @return Value component */
Returns the value component
getValueComponent
{ "repo_name": "csmith/DMDirc-Plugins", "path": "ui_swing/src/main/java/com/dmdirc/addons/ui_swing/components/modes/ParamModePanel.java", "license": "mit", "size": 5635 }
[ "java.awt.Component" ]
import java.awt.Component;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,316,707
public void testModifyChannelGreaterThanMaxFieldValueError() throws MalformedURLException, XmlRpcException { final String strGreaterThan255 = TextUtils.getString(256); assertNotNull(channelId); Map<String, Object> struct = new HashMap<String, Object>(); struct.put(CHANNEL_ID, channelId); struct.put(CHANNEL_NAME, strGreaterThan255); Object[] params = new Object[] { sessionId, struct }; executeModifyChannelWithError(params, ErrorMessage .getMessage(ErrorMessage.EXCEED_MAXIMUM_LENGTH_OF_FIELD, CHANNEL_NAME)); }
void function() throws MalformedURLException, XmlRpcException { final String strGreaterThan255 = TextUtils.getString(256); assertNotNull(channelId); Map<String, Object> struct = new HashMap<String, Object>(); struct.put(CHANNEL_ID, channelId); struct.put(CHANNEL_NAME, strGreaterThan255); Object[] params = new Object[] { sessionId, struct }; executeModifyChannelWithError(params, ErrorMessage .getMessage(ErrorMessage.EXCEED_MAXIMUM_LENGTH_OF_FIELD, CHANNEL_NAME)); }
/** * Test method with fields that has value greater than max. * * @throws MalformedURLException * @throws XmlRpcException */
Test method with fields that has value greater than max
testModifyChannelGreaterThanMaxFieldValueError
{ "repo_name": "adqio/revive-adserver", "path": "www/api/v2/xmlrpc/tests/unit/src/test/java/org/openx/channel/TestModifyChannel.java", "license": "gpl-2.0", "size": 4944 }
[ "java.net.MalformedURLException", "java.util.HashMap", "java.util.Map", "org.apache.xmlrpc.XmlRpcException", "org.openx.utils.ErrorMessage", "org.openx.utils.TextUtils" ]
import java.net.MalformedURLException; import java.util.HashMap; import java.util.Map; import org.apache.xmlrpc.XmlRpcException; import org.openx.utils.ErrorMessage; import org.openx.utils.TextUtils;
import java.net.*; import java.util.*; import org.apache.xmlrpc.*; import org.openx.utils.*;
[ "java.net", "java.util", "org.apache.xmlrpc", "org.openx.utils" ]
java.net; java.util; org.apache.xmlrpc; org.openx.utils;
1,215,901
public void resetUnsafe() { logger.debug("Closing and clearing existing commit log segments..."); while (!queue.isEmpty()) Thread.yield(); for (CommitLogSegment segment : Iterables.concat(activeSegments, availableSegments)) segment.close(); activeSegments.clear(); availableSegments.clear(); }
void function() { logger.debug(STR); while (!queue.isEmpty()) Thread.yield(); for (CommitLogSegment segment : Iterables.concat(activeSegments, availableSegments)) segment.close(); activeSegments.clear(); availableSegments.clear(); }
/** * Resets all the segments, for testing purposes. DO NOT USE THIS OUTSIDE OF TESTS. */
Resets all the segments, for testing purposes. DO NOT USE THIS OUTSIDE OF TESTS
resetUnsafe
{ "repo_name": "adelapena/cassandra_2i", "path": "src/java/org/apache/cassandra/db/commitlog/CommitLogAllocator.java", "license": "apache-2.0", "size": 12619 }
[ "com.google.common.collect.Iterables" ]
import com.google.common.collect.Iterables;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
1,363,349
public static long getFileSize(String path) { if (path == null || path.trim().length() == 0) { return -1; } File file = new File(path); return (file.exists() && file.isFile() ? file.length() : -1); }
static long function(String path) { if (path == null path.trim().length() == 0) { return -1; } File file = new File(path); return (file.exists() && file.isFile() ? file.length() : -1); }
/** * get file size * <ul> * <li>if path is null or empty, return -1</li> * <li>if path exist and it is a file, return file size, else return -1</li> * <ul> * * @param path * @return */
get file size if path is null or empty, return -1 if path exist and it is a file, return file size, else return -1
getFileSize
{ "repo_name": "Jayin/android-DataPool", "path": "android_datapool/src/com/utils/FileUtils.java", "license": "mit", "size": 12484 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,220,784
protected String getGroupName() { return (accountingLineForValidation.isSourceAccountingLine() ? KFSConstants.SOURCE_ACCOUNTING_LINES_GROUP_NAME : KFSConstants.TARGET_ACCOUNTING_LINES_GROUP_NAME); }
String function() { return (accountingLineForValidation.isSourceAccountingLine() ? KFSConstants.SOURCE_ACCOUNTING_LINES_GROUP_NAME : KFSConstants.TARGET_ACCOUNTING_LINES_GROUP_NAME); }
/** * Returns the name of the accounting line group which holds the proper authorizer to do the KIM check * @return the name of the accouting line group to get the authorizer from */
Returns the name of the accounting line group which holds the proper authorizer to do the KIM check
getGroupName
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/sys/document/validation/impl/AccountingLineAccessibleValidation.java", "license": "agpl-3.0", "size": 12783 }
[ "org.kuali.kfs.sys.KFSConstants" ]
import org.kuali.kfs.sys.KFSConstants;
import org.kuali.kfs.sys.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,021,930
public Set<WriteEntity> getOutputs() { return outputs; }
Set<WriteEntity> function() { return outputs; }
/** * Get the output set. */
Get the output set
getOutputs
{ "repo_name": "lirui-apache/hive", "path": "ql/src/java/org/apache/hadoop/hive/ql/optimizer/GenMRProcContext.java", "license": "apache-2.0", "size": 11997 }
[ "java.util.Set", "org.apache.hadoop.hive.ql.hooks.WriteEntity" ]
import java.util.Set; import org.apache.hadoop.hive.ql.hooks.WriteEntity;
import java.util.*; import org.apache.hadoop.hive.ql.hooks.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
2,204,756
public File getConstructorImplTempFileHandle() { return constructorImplTempFileHandle; }
File function() { return constructorImplTempFileHandle; }
/** * Returns constructor's temporary file handle. * * @return temporary file handle */
Returns constructor's temporary file handle
getConstructorImplTempFileHandle
{ "repo_name": "paradisecr/ONOS-OXP", "path": "utils/yangutils/plugin/src/main/java/org/onosproject/yangutils/translator/tojava/TempJavaBeanFragmentFiles.java", "license": "apache-2.0", "size": 4348 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
819,029
public void getProfileInfo ( String proFileName) throws ProtocolNotSupportedException,ProfileKeyValueLimitException;
void function ( String proFileName) throws ProtocolNotSupportedException,ProfileKeyValueLimitException;
/** * Gets profile info. * * @param proFileName the pro file name * @throws ProtocolNotSupportedException the protocol not supported exception * @throws ProfileKeyValueLimitException the profile key value limit exception */
Gets profile info
getProfileInfo
{ "repo_name": "NeoSmartpen/AndroidSDK2.0", "path": "NASDK2.0_Studio/app/src/main/java/kr/neolab/sdk/pen/IPenAdt.java", "license": "gpl-3.0", "size": 22799 }
[ "kr.neolab.sdk.pen.bluetooth.lib.ProfileKeyValueLimitException", "kr.neolab.sdk.pen.bluetooth.lib.ProtocolNotSupportedException" ]
import kr.neolab.sdk.pen.bluetooth.lib.ProfileKeyValueLimitException; import kr.neolab.sdk.pen.bluetooth.lib.ProtocolNotSupportedException;
import kr.neolab.sdk.pen.bluetooth.lib.*;
[ "kr.neolab.sdk" ]
kr.neolab.sdk;
2,681,635
public int getX() { return MSCConstants.TOP_MARGIN; }
int function() { return MSCConstants.TOP_MARGIN; }
/** * Returns the x coordinate of the frame * @return the x coordinate */
Returns the x coordinate of the frame
getX
{ "repo_name": "alovassy/titan.EclipsePlug-ins", "path": "org.eclipse.titan.log.viewer/src/org/eclipse/titan/log/viewer/views/msc/ui/core/BasicFrame.java", "license": "epl-1.0", "size": 6551 }
[ "org.eclipse.titan.log.viewer.views.msc.util.MSCConstants" ]
import org.eclipse.titan.log.viewer.views.msc.util.MSCConstants;
import org.eclipse.titan.log.viewer.views.msc.util.*;
[ "org.eclipse.titan" ]
org.eclipse.titan;
2,337,860
public T alterar(T object) throws FarmaciaException { try{ getEntityManager().merge(object); } catch (Exception e) { throw new FarmaciaException(e,"N�o foi poss�vel realizar a altera��o."); } return object; }
T function(T object) throws FarmaciaException { try{ getEntityManager().merge(object); } catch (Exception e) { throw new FarmaciaException(e,STR); } return object; }
/** * Altera um objeto T na base de dados * @param object * @return * @throws FarmaciaException */
Altera um objeto T na base de dados
alterar
{ "repo_name": "fabioads/ProjetoFarmacia", "path": "src/br/pucgoias/farmacia/persistencia/GenericoDAOImpl.java", "license": "gpl-2.0", "size": 3374 }
[ "br.pucgoias.util.FarmaciaException" ]
import br.pucgoias.util.FarmaciaException;
import br.pucgoias.util.*;
[ "br.pucgoias.util" ]
br.pucgoias.util;
1,228,215
public SmsSingleSearchResponse getSms(String id) throws VonageResponseParseException, VonageClientException { return singleSearch.execute(id); }
SmsSingleSearchResponse function(String id) throws VonageResponseParseException, VonageClientException { return singleSearch.execute(id); }
/** * Search for a single SMS by id. * * @param id The message id to search for. * * @return SmsSingleSearchResponse object containing the details of the SMS. * * @throws VonageClientException if there was a problem with the Vonage request or response objects. * @throws VonageResponseParseException if the response from the API could not be parsed. */
Search for a single SMS by id
getSms
{ "repo_name": "Nexmo/nexmo-java-sdk", "path": "src/main/java/com/vonage/client/sms/SmsClient.java", "license": "mit", "size": 7756 }
[ "com.vonage.client.VonageClientException", "com.vonage.client.VonageResponseParseException" ]
import com.vonage.client.VonageClientException; import com.vonage.client.VonageResponseParseException;
import com.vonage.client.*;
[ "com.vonage.client" ]
com.vonage.client;
1,053,306
@Override public Adapter createNumericComparisonExpressionAdapter() { if (numericComparisonExpressionItemProvider == null) { numericComparisonExpressionItemProvider = new NumericComparisonExpressionItemProvider(this); } return numericComparisonExpressionItemProvider; } protected NumericComputationExpressionItemProvider numericComputationExpressionItemProvider;
Adapter function() { if (numericComparisonExpressionItemProvider == null) { numericComparisonExpressionItemProvider = new NumericComparisonExpressionItemProvider(this); } return numericComparisonExpressionItemProvider; } protected NumericComputationExpressionItemProvider numericComputationExpressionItemProvider;
/** * This creates an adapter for a {@link com.thalesgroup.trt.mde.vp.expression.expression.NumericComparisonExpression}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This creates an adapter for a <code>com.thalesgroup.trt.mde.vp.expression.expression.NumericComparisonExpression</code>.
createNumericComparisonExpressionAdapter
{ "repo_name": "smadelenat/CapellaModeAutomata", "path": "Language/ExpressionLanguage/com.thalesgroup.trt.mde.vp.expression.model.edit/src/com/thalesgroup/trt/mde/vp/expression/expression/provider/ExpressionItemProviderAdapterFactory.java", "license": "epl-1.0", "size": 29651 }
[ "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;
383,651
private ArrayList<String> removeDuplicatedEntries(ArrayList<String> arrayList) { HashSet<String> hashSet = new HashSet<String>(arrayList); ArrayList<String> arrLi = new ArrayList<String>(); arrLi.addAll(hashSet); return arrLi; }
ArrayList<String> function(ArrayList<String> arrayList) { HashSet<String> hashSet = new HashSet<String>(arrayList); ArrayList<String> arrLi = new ArrayList<String>(); arrLi.addAll(hashSet); return arrLi; }
/** * This Method returns a ArrayList<String> without duplicate-entries. * * @param arrayList the array list * @return the array list */
This Method returns a ArrayList without duplicate-entries
removeDuplicatedEntries
{ "repo_name": "EnFlexIT/AgentWorkbench", "path": "eclipseProjects/org.agentgui/bundles/de.enflexit.common/src/de/enflexit/common/ontology/OntologyVisualizationHelper.java", "license": "lgpl-2.1", "size": 18106 }
[ "java.util.ArrayList", "java.util.HashSet" ]
import java.util.ArrayList; import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
512,009
FrbrDocument frbrDetection(final Document target) { return new FrbrDocument( target, AbstractEntityDetector.identifier(workDetector.detect(target)), AbstractEntityDetector.identifier(expressionDetector.detect(target)), manifestationDetector.detect(target), personDetector.detect(target), familyDetector.detect(target), corporateBodyDetector.detect(target), itemDetector.detect(target), conceptDetector.detect(target), eventDetector.detect(target), placeDetector.detect(target), recordetector.detect(target)); }
FrbrDocument frbrDetection(final Document target) { return new FrbrDocument( target, AbstractEntityDetector.identifier(workDetector.detect(target)), AbstractEntityDetector.identifier(expressionDetector.detect(target)), manifestationDetector.detect(target), personDetector.detect(target), familyDetector.detect(target), corporateBodyDetector.detect(target), itemDetector.detect(target), conceptDetector.detect(target), eventDetector.detect(target), placeDetector.detect(target), recordetector.detect(target)); }
/** * Detects the FRBR entities. * * @param target the current record (as {@link Document}). * @return the FRBR value object. */
Detects the FRBR entities
frbrDetection
{ "repo_name": "ALIADA/aliada-tool", "path": "aliada/aliada-rdfizer/src/main/java/eu/aliada/rdfizer/pipeline/format/marc/frbr/FrbrEntitiesDetector.java", "license": "gpl-3.0", "size": 3369 }
[ "eu.aliada.rdfizer.pipeline.format.marc.frbr.model.FrbrDocument", "org.w3c.dom.Document" ]
import eu.aliada.rdfizer.pipeline.format.marc.frbr.model.FrbrDocument; import org.w3c.dom.Document;
import eu.aliada.rdfizer.pipeline.format.marc.frbr.model.*; import org.w3c.dom.*;
[ "eu.aliada.rdfizer", "org.w3c.dom" ]
eu.aliada.rdfizer; org.w3c.dom;
1,615,894
public static AndroidManifestReader forString(String xmlString) throws IOException { return forReader(new StringReader(xmlString)); }
static AndroidManifestReader function(String xmlString) throws IOException { return forReader(new StringReader(xmlString)); }
/** * Parses an XML given as a string and returns an {@link AndroidManifestReader} for it. * @param xmlString a string representation of an XML document * @return an {@code AndroidManifestReader} for the XML document * @throws IOException */
Parses an XML given as a string and returns an <code>AndroidManifestReader</code> for it
forString
{ "repo_name": "neonichu/buck", "path": "src/com/facebook/buck/android/DefaultAndroidManifestReader.java", "license": "apache-2.0", "size": 6545 }
[ "java.io.IOException", "java.io.StringReader" ]
import java.io.IOException; import java.io.StringReader;
import java.io.*;
[ "java.io" ]
java.io;
1,608,259
public byte[] sign(final String login, final KeyPair keyPair, final byte[] data) { Objects.requireNonNull(login, "Login must be present"); Objects.requireNonNull(keyPair, "Keypair must be present"); Objects.requireNonNull(data, "Data must be present"); try { signature.initSign(keyPair.getPrivate()); signature.update(data); return signature.sign(); } catch (final InvalidKeyException e) { throw new CryptoException("invalid key", e); } catch (final SignatureException e) { throw new CryptoException("invalid signature", e); } }
byte[] function(final String login, final KeyPair keyPair, final byte[] data) { Objects.requireNonNull(login, STR); Objects.requireNonNull(keyPair, STR); Objects.requireNonNull(data, STR); try { signature.initSign(keyPair.getPrivate()); signature.update(data); return signature.sign(); } catch (final InvalidKeyException e) { throw new CryptoException(STR, e); } catch (final SignatureException e) { throw new CryptoException(STR, e); } }
/** * Cryptographically signs an any data input. * * @param login Account/login name * @param keyPair public/private keypair * @param data data to be signed * @return signed value of data */
Cryptographically signs an any data input
sign
{ "repo_name": "phillipross/java-http-signature", "path": "common/src/main/java/com/joyent/http/signature/Signer.java", "license": "mpl-2.0", "size": 32123 }
[ "java.security.InvalidKeyException", "java.security.KeyPair", "java.security.SignatureException", "java.util.Objects" ]
import java.security.InvalidKeyException; import java.security.KeyPair; import java.security.SignatureException; import java.util.Objects;
import java.security.*; import java.util.*;
[ "java.security", "java.util" ]
java.security; java.util;
2,400,005
public void onUpdate() { super.onUpdate(); this.field_70924_f = this.field_70926_e; if (this.func_70922_bv()) { this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F; } else { this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F; } if (this.func_70922_bv()) { this.numTicksToChaseTarget = 10; } if (this.isWet()) { this.isShaking = true; this.field_70928_h = false; this.timePenguinIsShaking = 0.0F; this.prevTimePenguinIsShaking = 0.0F; } else if ((this.isShaking || this.field_70928_h) && this.field_70928_h) { if (this.timePenguinIsShaking == 0.0F) { this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); } this.prevTimePenguinIsShaking = this.timePenguinIsShaking; this.timePenguinIsShaking += 0.05F; if (this.prevTimePenguinIsShaking >= 2.0F) { this.isShaking = false; this.field_70928_h = false; this.prevTimePenguinIsShaking = 0.0F; this.timePenguinIsShaking = 0.0F; } if (this.timePenguinIsShaking > 0.4F) { float f = (float)this.boundingBox.minY; int i = (int)(MathHelper.sin((this.timePenguinIsShaking - 0.4F) * (float)Math.PI) * 7.0F); for (int j = 0; j < i; ++j) { float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; this.worldObj.spawnParticle("splash", this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ); } } } }
void function() { super.onUpdate(); this.field_70924_f = this.field_70926_e; if (this.func_70922_bv()) { this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F; } else { this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F; } if (this.func_70922_bv()) { this.numTicksToChaseTarget = 10; } if (this.isWet()) { this.isShaking = true; this.field_70928_h = false; this.timePenguinIsShaking = 0.0F; this.prevTimePenguinIsShaking = 0.0F; } else if ((this.isShaking this.field_70928_h) && this.field_70928_h) { if (this.timePenguinIsShaking == 0.0F) { this.playSound(STR, this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); } this.prevTimePenguinIsShaking = this.timePenguinIsShaking; this.timePenguinIsShaking += 0.05F; if (this.prevTimePenguinIsShaking >= 2.0F) { this.isShaking = false; this.field_70928_h = false; this.prevTimePenguinIsShaking = 0.0F; this.timePenguinIsShaking = 0.0F; } if (this.timePenguinIsShaking > 0.4F) { float f = (float)this.boundingBox.minY; int i = (int)(MathHelper.sin((this.timePenguinIsShaking - 0.4F) * (float)Math.PI) * 7.0F); for (int j = 0; j < i; ++j) { float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; this.worldObj.spawnParticle(STR, this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ); } } } }
/** * Called to update the entity's position/logic. */
Called to update the entity's position/logic
onUpdate
{ "repo_name": "immediately/rancraftPeng172p", "path": "java/rancraftPenguins/EntityPenguin.java", "license": "gpl-3.0", "size": 21829 }
[ "net.minecraft.util.MathHelper" ]
import net.minecraft.util.MathHelper;
import net.minecraft.util.*;
[ "net.minecraft.util" ]
net.minecraft.util;
2,073,608
@Override public final void run() { Thread.currentThread().setName(threadName()); try { decode(); } finally { try { inputchannel.close(); outputchannel.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
final void function() { Thread.currentThread().setName(threadName()); try { decode(); } finally { try { inputchannel.close(); outputchannel.close(); } catch (IOException e) { e.printStackTrace(); } } }
/** * Template implementation for a decoding thread. Takes care of setting the * thread name and closing the input and output channels when decoding is * complete. */
Template implementation for a decoding thread. Takes care of setting the thread name and closing the input and output channels when decoding is complete
run
{ "repo_name": "Cr0s/JavaRA", "path": "src/redhorizon/filetypes/StreamingDataDecoder.java", "license": "gpl-3.0", "size": 2345 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
215,385
public void writeBinary(ByteBuffer bin) throws TException { int length = bin.limit() - bin.position(); writeBinary(bin.array(), bin.position() + bin.arrayOffset(), length); }
void function(ByteBuffer bin) throws TException { int length = bin.limit() - bin.position(); writeBinary(bin.array(), bin.position() + bin.arrayOffset(), length); }
/** * Write a byte array, using a varint for the size. */
Write a byte array, using a varint for the size
writeBinary
{ "repo_name": "YinYanfei/CadalWorkspace", "path": "thriftJava/src/org/apache/thrift/protocol/TCompactProtocol.java", "license": "gpl-3.0", "size": 24294 }
[ "java.nio.ByteBuffer", "org.apache.thrift.TException" ]
import java.nio.ByteBuffer; import org.apache.thrift.TException;
import java.nio.*; import org.apache.thrift.*;
[ "java.nio", "org.apache.thrift" ]
java.nio; org.apache.thrift;
815,105
env.put(name, value); env.put(name.toUpperCase(Locale.ENGLISH), value); // backward compatibility pre 1.345 }
env.put(name, value); env.put(name.toUpperCase(Locale.ENGLISH), value); }
/** * Exposes the name/value as an environment variable. */
Exposes the name/value as an environment variable
buildEnvVars
{ "repo_name": "sap-production/hudson-3.x", "path": "hudson-core/src/main/java/hudson/model/StringParameterValue.java", "license": "apache-2.0", "size": 2749 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
2,693,739
protected void createEdu_11Annotations() { String source = "edu.kit.ipd.sdq.mdsd.mj.classTrace.reftrace"; addAnnotation (getAsset_Location(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_Location_Location_Location") }); addAnnotation (locationEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_Location_Location_Location") }); addAnnotation (getLocation_Position(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_PositionPoint_PositionPoint_Position") }); addAnnotation (getLocation_PowerSystemResources(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_PowerSystemResource_PowerSystemResource_PowerSystemResources") }); addAnnotation (positionPointEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_PositionPoint_PositionPoint_Position") }); addAnnotation (powerSystemResourceEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_PowerSystemResource_PowerSystemResource_PowerSystemResources") }); addAnnotation (getConductingEquipment_Terminals(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_Terminal_Terminal_Terminals") }); addAnnotation (terminalEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_Terminal_Terminal_Terminals") }); addAnnotation (getTerminal_TieFlow(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_TieFlow_TieFlow_TieFlow") }); addAnnotation (tieFlowEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_TieFlow_TieFlow_TieFlow") }); addAnnotation (getTieFlow_ControlArea(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_ControlArea_ControlArea_ControlArea") }); addAnnotation (controlAreaEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_ControlArea_ControlArea_ControlArea") }); addAnnotation (controlAreaEClass, source, new String[] { }); addAnnotation (getEndDeviceAsset_ServiceDeliveryPoint(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_ServiceDeliveryPoint_ServiceDeliveryPoint_ServiceDeliveryPoint") }); addAnnotation (serviceDeliveryPointEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_ServiceDeliveryPoint_ServiceDeliveryPoint_ServiceDeliveryPoint") }); addAnnotation (getServiceDeliveryPoint_EnergyConsumer(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_EnergyConsumer_EnergyConsumer_EnergyConsumer") }); addAnnotation (energyConsumerEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_EnergyConsumer_EnergyConsumer_EnergyConsumer") }); addAnnotation (getConformLoad_LoadGroup(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_ConformLoadGroup_ConformLoadGroup_LoadGroup") }); addAnnotation (conformLoadGroupEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_ConformLoadGroup_ConformLoadGroup_LoadGroup") }); addAnnotation (getLoadGroup_SubLoadArea(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_SubLoadArea_SubLoadArea_SubLoadArea") }); addAnnotation (subLoadAreaEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_SubLoadArea_SubLoadArea_SubLoadArea") }); addAnnotation (getSubLoadArea_LoadArea(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_LoadArea_LoadArea_LoadArea") }); addAnnotation (loadAreaEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_LoadArea_LoadArea_LoadArea") }); addAnnotation (getLoadArea_ControlArea(), source, new String[] { }); addAnnotation (getNonConformLoad_LoadGroup(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_NonConformLoadGroup_NonConformLoadGroup_LoadGroup") }); addAnnotation (nonConformLoadGroupEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment("//ref_NonConformLoadGroup_NonConformLoadGroup_LoadGroup") }); }
void function() { String source = STR; addAnnotation (getAsset_Location(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getLocation_Position(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (positionPointEClass, source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getConductingEquipment_Terminals(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getTerminal_TieFlow(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getTieFlow_ControlArea(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (controlAreaEClass, source, new String[] { }); addAnnotation (getEndDeviceAsset_ServiceDeliveryPoint(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getServiceDeliveryPoint_EnergyConsumer(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getConformLoad_LoadGroup(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getLoadGroup_SubLoadArea(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getSubLoadArea_LoadArea(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); addAnnotation (getLoadArea_ControlArea(), source, new String[] { }); addAnnotation (getNonConformLoad_LoadGroup(), source, new String[] { }, new URI[] { URI.createURI(OutagePreventionMjtracePackage.eNS_URI).appendFragment(STR }); }
/** * Initializes the annotations for <b>edu.kit.ipd.sdq.mdsd.mj.classTrace.reftrace</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Initializes the annotations for edu.kit.ipd.sdq.mdsd.mj.classTrace.reftrace.
createEdu_11Annotations
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/outagePreventionJointarget/impl/OutagePreventionJointargetPackageImpl.java", "license": "mit", "size": 74780 }
[ "org.eclipse.emf.common.util.URI" ]
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,624,577
private void insertProcessesIntoDefinitions() { for (Process process : this.processes) { // if (process.isChoreographyProcess()) // continue; // // // for (Lane lane : process.getAllLanes()) { // this.definitions.getFirstPlane().getDiagramElement().add( // this.bpmnElements.get(lane.getId()).getShape()); // } // // // // for (FlowElement flowEle : process.getFlowElement()) { // if (!(flowEle instanceof Edge)) { // this.definitions.getFirstPlane().getDiagramElement().add( // this.bpmnElements.get(flowEle.getId()).getShape()); // } // // // if (flowEle instanceof SubProcess) { // insertSubprocessShapes((SubProcess) flowEle); // } // } // // // for (Artifact a : process.getArtifact()) { // this.definitions.getFirstPlane().getDiagramElement().add( // this.bpmnElements.get(a.getId()).getShape()); // } // // // if(process.getIoSpecification() != null) { // for(DataInput dataInput : process.getIoSpecification().getDataInput()) { // this.definitions.getFirstPlane().getDiagramElement().add( // this.bpmnElements.get(dataInput.getId()).getShape()); // } // // for(DataOutput dataOutput : process.getIoSpecification().getDataOutput()) { // this.definitions.getFirstPlane().getDiagramElement().add( // this.bpmnElements.get(dataOutput.getId()).getShape()); // } // } if(!this.insertProcessShapes(process)) { continue; } this.definitions.getRootElement().add(process); if(!(this.definitions.getFirstPlane().getBpmnElement() instanceof Collaboration) && !(this.definitions.getFirstPlane().getBpmnElement() instanceof Choreography)) { this.definitions.getFirstPlane().setBpmnElement(process); } for(Process p : this.tmpProcesses) { this.insertProcessShapes(p); } } }
void function() { for (Process process : this.processes) { if(!this.insertProcessShapes(process)) { continue; } this.definitions.getRootElement().add(process); if(!(this.definitions.getFirstPlane().getBpmnElement() instanceof Collaboration) && !(this.definitions.getFirstPlane().getBpmnElement() instanceof Choreography)) { this.definitions.getFirstPlane().setBpmnElement(process); } for(Process p : this.tmpProcesses) { this.insertProcessShapes(p); } } }
/** * Creates a process diagram for each identified process. */
Creates a process diagram for each identified process
insertProcessesIntoDefinitions
{ "repo_name": "guillermofuentesquijada/signavio-core-components", "path": "platform extensions/bpmn20xmlbasic/src/de/hpi/bpmn2_0/transformation/Diagram2BpmnConverter.java", "license": "gpl-3.0", "size": 71169 }
[ "de.hpi.bpmn2_0.model.Collaboration", "de.hpi.bpmn2_0.model.Process", "de.hpi.bpmn2_0.model.choreography.Choreography" ]
import de.hpi.bpmn2_0.model.Collaboration; import de.hpi.bpmn2_0.model.Process; import de.hpi.bpmn2_0.model.choreography.Choreography;
import de.hpi.bpmn2_0.model.*; import de.hpi.bpmn2_0.model.choreography.*;
[ "de.hpi.bpmn2_0" ]
de.hpi.bpmn2_0;
45,841
public @UInt64 long getExtent();
@UInt64 long function();
/** * <p>Returns the number of bytes currently allocated to the * storage.</p> * * @return Number of bytes allocated to the storage. */
Returns the number of bytes currently allocated to the storage
getExtent
{ "repo_name": "AMWA-TV/maj", "path": "src/main/java/tv/amwa/maj/model/RandomRawStorage.java", "license": "apache-2.0", "size": 5514 }
[ "tv.amwa.maj.integer.UInt64" ]
import tv.amwa.maj.integer.UInt64;
import tv.amwa.maj.integer.*;
[ "tv.amwa.maj" ]
tv.amwa.maj;
2,196,669
public void setUpperLimit(double upperLimit) { // make sure the distance is greater than zero if (upperLimit < 0.0) throw new IllegalArgumentException(Messages.getString("dynamics.joint.rope.lessThanZeroUpperLimit")); // make sure the minimum is less than or equal to the maximum if (upperLimit < this.lowerLimit) throw new IllegalArgumentException(Messages.getString("dynamics.joint.invalidUpperLimit")); // make sure its changed and enabled before waking the bodies if (this.upperLimitEnabled && upperLimit != this.upperLimit) { // wake up both bodies this.body1.setAsleep(false); this.body2.setAsleep(false); } // set the new target distance this.upperLimit = upperLimit; }
void function(double upperLimit) { if (upperLimit < 0.0) throw new IllegalArgumentException(Messages.getString(STR)); if (upperLimit < this.lowerLimit) throw new IllegalArgumentException(Messages.getString(STR)); if (this.upperLimitEnabled && upperLimit != this.upperLimit) { this.body1.setAsleep(false); this.body2.setAsleep(false); } this.upperLimit = upperLimit; }
/** * Sets the upper limit in meters. * @param upperLimit the upper limit in meters; must be greater than or equal to zero * @throws IllegalArgumentException if upperLimit is less than zero or less than the current lower limit */
Sets the upper limit in meters
setUpperLimit
{ "repo_name": "jipalgol/dyn4j", "path": "src/org/dyn4j/dynamics/joint/RopeJoint.java", "license": "bsd-3-clause", "size": 21417 }
[ "org.dyn4j.resources.Messages" ]
import org.dyn4j.resources.Messages;
import org.dyn4j.resources.*;
[ "org.dyn4j.resources" ]
org.dyn4j.resources;
1,964,727
protected ScriptingEnvironment initializeScriptingEnvironment (BridgeContext ctx) { SVGOMDocument d = (SVGOMDocument) ctx.getDocument(); ScriptingEnvironment se; if (d.isSVG12()) { se = new SVG12ScriptingEnvironment(ctx); ctx.xblManager = new DefaultXBLManager(d, ctx); d.setXBLManager(ctx.xblManager); } else { se = new ScriptingEnvironment(ctx); } return se; }
ScriptingEnvironment function (BridgeContext ctx) { SVGOMDocument d = (SVGOMDocument) ctx.getDocument(); ScriptingEnvironment se; if (d.isSVG12()) { se = new SVG12ScriptingEnvironment(ctx); ctx.xblManager = new DefaultXBLManager(d, ctx); d.setXBLManager(ctx.xblManager); } else { se = new ScriptingEnvironment(ctx); } return se; }
/** * Creates an appropriate ScriptingEnvironment and XBL manager for * the given document. */
Creates an appropriate ScriptingEnvironment and XBL manager for the given document
initializeScriptingEnvironment
{ "repo_name": "git-moss/Push2Display", "path": "lib/batik-1.8/sources/org/apache/batik/bridge/UpdateManager.java", "license": "lgpl-3.0", "size": 29915 }
[ "org.apache.batik.anim.dom.SVGOMDocument", "org.apache.batik.bridge.svg12.DefaultXBLManager", "org.apache.batik.bridge.svg12.SVG12ScriptingEnvironment" ]
import org.apache.batik.anim.dom.SVGOMDocument; import org.apache.batik.bridge.svg12.DefaultXBLManager; import org.apache.batik.bridge.svg12.SVG12ScriptingEnvironment;
import org.apache.batik.anim.dom.*; import org.apache.batik.bridge.svg12.*;
[ "org.apache.batik" ]
org.apache.batik;
920,460
protected void validateNew(final CmsAliasTableRow newEntry) { CmsRpcAction<CmsAliasEditValidationReply> action = new CmsRpcAction<CmsAliasEditValidationReply>() {
void function(final CmsAliasTableRow newEntry) { CmsRpcAction<CmsAliasEditValidationReply> action = new CmsRpcAction<CmsAliasEditValidationReply>() {
/** * Triggers server-side validation of the alias table and of a new entry which should be added to it.<p> * * @param newEntry the new entry */
Triggers server-side validation of the alias table and of a new entry which should be added to it
validateNew
{ "repo_name": "PatidarWeb/opencms-core", "path": "src-gwt/org/opencms/ade/sitemap/client/alias/CmsAliasTableController.java", "license": "lgpl-2.1", "size": 16161 }
[ "org.opencms.gwt.client.rpc.CmsRpcAction", "org.opencms.gwt.shared.alias.CmsAliasEditValidationReply", "org.opencms.gwt.shared.alias.CmsAliasTableRow" ]
import org.opencms.gwt.client.rpc.CmsRpcAction; import org.opencms.gwt.shared.alias.CmsAliasEditValidationReply; import org.opencms.gwt.shared.alias.CmsAliasTableRow;
import org.opencms.gwt.client.rpc.*; import org.opencms.gwt.shared.alias.*;
[ "org.opencms.gwt" ]
org.opencms.gwt;
2,150,973
public static List<Hook> getHooks(String csHooks) throws Exception { return getHooks(csHooks, Hook.class); }
static List<Hook> function(String csHooks) throws Exception { return getHooks(csHooks, Hook.class); }
/** * Returns a set of hooks specified in a configuration variable. * * See getHooks(HiveAuthzConf.AuthzConfVars hookConfVar, Class<T> clazz) * * @param hookConfVar * @return * @throws Exception */
Returns a set of hooks specified in a configuration variable. See getHooks(HiveAuthzConf.AuthzConfVars hookConfVar, Class clazz)
getHooks
{ "repo_name": "sundapeng/incubator-sentry", "path": "sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/util/SentryAuthorizerUtil.java", "license": "apache-2.0", "size": 13019 }
[ "java.util.List", "org.apache.hadoop.hive.ql.hooks.Hook" ]
import java.util.List; import org.apache.hadoop.hive.ql.hooks.Hook;
import java.util.*; import org.apache.hadoop.hive.ql.hooks.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
1,318,761
public static <T> PCollectionList<T> of(Iterable<PCollection<T>> pcs) { Iterator<PCollection<T>> pcsIter = pcs.iterator(); if (!pcsIter.hasNext()) { throw new IllegalArgumentException( "must either have a non-empty list of PCollections, " + "or must first call empty(Pipeline)"); } return new PCollectionList<T>(pcsIter.next().getPipeline()).and(pcs); }
static <T> PCollectionList<T> function(Iterable<PCollection<T>> pcs) { Iterator<PCollection<T>> pcsIter = pcs.iterator(); if (!pcsIter.hasNext()) { throw new IllegalArgumentException( STR + STR); } return new PCollectionList<T>(pcsIter.next().getPipeline()).and(pcs); }
/** * Returns a {@link PCollectionList} containing the given {@link PCollection PCollections}, * in order. * * <p>The argument list cannot be empty. * * <p>All the {@link PCollection PCollections} in the resulting {@link PCollectionList} must be * part of the same {@link Pipeline}. * * <p>Longer PCollectionLists can be created by calling * {@link #and} on the result. */
Returns a <code>PCollectionList</code> containing the given <code>PCollection PCollections</code>, in order. The argument list cannot be empty. All the <code>PCollection PCollections</code> in the resulting <code>PCollectionList</code> must be part of the same <code>Pipeline</code>. Longer PCollectionLists can be created by calling <code>#and</code> on the result
of
{ "repo_name": "tweise/beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/values/PCollectionList.java", "license": "apache-2.0", "size": 8010 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
1,539,429
public ACData[] selectVD(int dates_, Timestamp start_, Timestamp end_, String creators_[], String modifiers_[], String wstatus_[]);
ACData[] function(int dates_, Timestamp start_, Timestamp end_, String creators_[], String modifiers_[], String wstatus_[]);
/** * Pull all Value Domains changed in the date range specified. * * @param dates_ * The date comparison index. * @param start_ * The date to start. * @param end_ * The date to end. * @param creators_ * The list of desired creator user ids. * @param modifiers_ * The list of desired modifier user ids. * @param wstatus_ * The list of desired Workflow Statuses. * @return 0 if successful, otherwise the database error code. */
Pull all Value Domains changed in the date range specified
selectVD
{ "repo_name": "NCIP/cadsr-sentinel", "path": "software/src/java/gov/nih/nci/cadsr/sentinel/database/DBAlert.java", "license": "bsd-3-clause", "size": 73851 }
[ "gov.nih.nci.cadsr.sentinel.tool.ACData", "java.sql.Timestamp" ]
import gov.nih.nci.cadsr.sentinel.tool.ACData; import java.sql.Timestamp;
import gov.nih.nci.cadsr.sentinel.tool.*; import java.sql.*;
[ "gov.nih.nci", "java.sql" ]
gov.nih.nci; java.sql;
572,803
private Collection<SpanData> getSpanDataCollection() { return Collections.emptyList(); }
Collection<SpanData> function() { return Collections.emptyList(); }
/** * Method to make the sample compilable but is not visible in README code snippet. * @return An empty collection. */
Method to make the sample compilable but is not visible in README code snippet
getSpanDataCollection
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/monitor/opentelemetry-exporters-azuremonitor/src/samples/java/com/azure/opentelemetry/exporters/azuremonitor/ReadmeSamples.java", "license": "mit", "size": 1615 }
[ "io.opentelemetry.sdk.trace.data.SpanData", "java.util.Collection", "java.util.Collections" ]
import io.opentelemetry.sdk.trace.data.SpanData; import java.util.Collection; import java.util.Collections;
import io.opentelemetry.sdk.trace.data.*; import java.util.*;
[ "io.opentelemetry.sdk", "java.util" ]
io.opentelemetry.sdk; java.util;
2,579,364
protected ProtocolOnlineReviewService getProtocolOnlineReviewService() { return KcServiceLocator.getService(ProtocolOnlineReviewService.class); }
ProtocolOnlineReviewService function() { return KcServiceLocator.getService(ProtocolOnlineReviewService.class); }
/** * * This method is a wrapper method for getting ProtocolOnlineReviewerService service. * @return */
This method is a wrapper method for getting ProtocolOnlineReviewerService service
getProtocolOnlineReviewService
{ "repo_name": "sanjupolus/kc-coeus-1508.3", "path": "coeus-impl/src/main/java/org/kuali/kra/irb/ProtocolForm.java", "license": "agpl-3.0", "size": 17177 }
[ "org.kuali.coeus.sys.framework.service.KcServiceLocator", "org.kuali.kra.irb.onlinereview.ProtocolOnlineReviewService" ]
import org.kuali.coeus.sys.framework.service.KcServiceLocator; import org.kuali.kra.irb.onlinereview.ProtocolOnlineReviewService;
import org.kuali.coeus.sys.framework.service.*; import org.kuali.kra.irb.onlinereview.*;
[ "org.kuali.coeus", "org.kuali.kra" ]
org.kuali.coeus; org.kuali.kra;
282,820
@Override public void deleteEntity(String entitySetName, OEntityKey entityKey) { super.deleteEntity(entitySetName, entityKey); }
void function(String entitySetName, OEntityKey entityKey) { super.deleteEntity(entitySetName, entityKey); }
/** * Deletes an existing entity. * * @param entitySetName the entity-set name of the entity * @param entityKey the entity-key of the entity * @see <a href="http://www.odata.org/developers/protocols/operations#DeletingEntries">[odata.org] Deleting Entries</a> */
Deletes an existing entity
deleteEntity
{ "repo_name": "physion/ovation-odata", "path": "src/ovation/odata/service/OvationOData4JProducer.java", "license": "bsd-2-clause", "size": 15926 }
[ "org.odata4j.core.OEntityKey" ]
import org.odata4j.core.OEntityKey;
import org.odata4j.core.*;
[ "org.odata4j.core" ]
org.odata4j.core;
362,864
public static void sendXssed(HttpServletResponse response, String body) throws IOException { sendXssed(response, body, "text/html; charset=utf-8"); }
static void function(HttpServletResponse response, String body) throws IOException { sendXssed(response, body, STR); }
/** * Sends an XSS response. */
Sends an XSS response
sendXssed
{ "repo_name": "odin1314/firing-range", "path": "src/utils/Responses.java", "license": "apache-2.0", "size": 2911 }
[ "java.io.IOException", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
2,621,135
return driver.findElement(By.id(id)); }
return driver.findElement(By.id(id)); }
/** * Searches the DOM for the screen having the ID this wrapper cares about. Throws a timeout exception if the * widget is not found within the driver's current implicit wait period. */
Searches the DOM for the screen having the ID this wrapper cares about. Throws a timeout exception if the widget is not found within the driver's current implicit wait period
find
{ "repo_name": "ederign/uberfire", "path": "uberfire-workbench/uberfire-workbench-client-tests/src/test/java/org/uberfire/wbtest/selenium/MaximizeTestScreenWrapper.java", "license": "apache-2.0", "size": 2280 }
[ "org.openqa.selenium.By" ]
import org.openqa.selenium.By;
import org.openqa.selenium.*;
[ "org.openqa.selenium" ]
org.openqa.selenium;
1,936,676
protected final String getSortedQualifierNames() { // Create a list of the supported qualifiers and sort the list // alphabetically List<Class<? extends Annotation>> sortedSupportedQuals = new ArrayList<Class<? extends Annotation>>(); sortedSupportedQuals.addAll(getSupportedTypeQualifiers()); Collections.sort(sortedSupportedQuals, QUALIFIER_SORT_ORDERING); // display the number of qualifiers as well as the names of each // qualifier. StringBuilder sb = new StringBuilder(); sb.append(sortedSupportedQuals.size()); sb.append(" qualifiers examined"); if (sortedSupportedQuals.size() > 0) { sb.append(": "); // for each qualifier, add its canonical name, a comma and a space // to the string. for (Class<? extends Annotation> qual : sortedSupportedQuals) { sb.append(qual.getCanonicalName()); sb.append(", "); } // remove last comma and space return sb.substring(0, sb.length() - 2); } else { return sb.toString(); } } /** * Adds default qualifiers for type-checked code by * reading {@link DefaultFor} and {@link DefaultQualifierInHierarchy}
final String function() { List<Class<? extends Annotation>> sortedSupportedQuals = new ArrayList<Class<? extends Annotation>>(); sortedSupportedQuals.addAll(getSupportedTypeQualifiers()); Collections.sort(sortedSupportedQuals, QUALIFIER_SORT_ORDERING); StringBuilder sb = new StringBuilder(); sb.append(sortedSupportedQuals.size()); sb.append(STR); if (sortedSupportedQuals.size() > 0) { sb.append(STR); for (Class<? extends Annotation> qual : sortedSupportedQuals) { sb.append(qual.getCanonicalName()); sb.append(STR); } return sb.substring(0, sb.length() - 2); } else { return sb.toString(); } } /** * Adds default qualifiers for type-checked code by * reading {@link DefaultFor} and {@link DefaultQualifierInHierarchy}
/** * Creates and returns a string containing the number of qualifiers and the * canonical class names of each qualifier that has been added to this * checker's supported qualifier set. The names are alphabetically sorted. * * @return a string containing the number of qualifiers and canonical names * of each qualifier */
Creates and returns a string containing the number of qualifiers and the canonical class names of each qualifier that has been added to this checker's supported qualifier set. The names are alphabetically sorted
getSortedQualifierNames
{ "repo_name": "Jianchu/checker-framework", "path": "framework/src/org/checkerframework/framework/type/GenericAnnotatedTypeFactory.java", "license": "gpl-2.0", "size": 54494 }
[ "java.lang.annotation.Annotation", "java.util.ArrayList", "java.util.Collections", "java.util.List", "org.checkerframework.framework.qual.DefaultFor", "org.checkerframework.framework.qual.DefaultQualifierInHierarchy" ]
import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.checkerframework.framework.qual.DefaultFor; import org.checkerframework.framework.qual.DefaultQualifierInHierarchy;
import java.lang.annotation.*; import java.util.*; import org.checkerframework.framework.qual.*;
[ "java.lang", "java.util", "org.checkerframework.framework" ]
java.lang; java.util; org.checkerframework.framework;
546,886
private void displayFolderChoice(int requestCode, Account account, Folder folder, List<Message> messages) { if( account == null ) { return; } Intent intent = new Intent(getActivity(), ChooseFolder.class); intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, account.getUuid()); intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, account.getLastSelectedFolderName()); if (folder == null) { intent.putExtra(ChooseFolder.EXTRA_SHOW_CURRENT, "yes"); } else { intent.putExtra(ChooseFolder.EXTRA_CUR_FOLDER, folder.getName()); } // remember the selected messages for #onActivityResult mActiveMessages = messages; startActivityForResult(intent, requestCode); }
void function(int requestCode, Account account, Folder folder, List<Message> messages) { if( account == null ) { return; } Intent intent = new Intent(getActivity(), ChooseFolder.class); intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, account.getUuid()); intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, account.getLastSelectedFolderName()); if (folder == null) { intent.putExtra(ChooseFolder.EXTRA_SHOW_CURRENT, "yes"); } else { intent.putExtra(ChooseFolder.EXTRA_CUR_FOLDER, folder.getName()); } mActiveMessages = messages; startActivityForResult(intent, requestCode); }
/** * Helper method to manage the invocation of {@link #startActivityForResult(Intent, int)} for a * folder operation ({@link ChooseFolder} activity), while saving a list of associated messages. * * @param requestCode * If {@code >= 0}, this code will be returned in {@code onActivityResult()} when the * activity exits. * @param folder * The source folder. Never {@code null}. * @param messages * Messages to be affected by the folder operation. Never {@code null}. * * @see #startActivityForResult(Intent, int) */
Helper method to manage the invocation of <code>#startActivityForResult(Intent, int)</code> for a folder operation (<code>ChooseFolder</code> activity), while saving a list of associated messages
displayFolderChoice
{ "repo_name": "imaeses/k-9", "path": "src/com/fsck/k9/fragment/MessageListFragment.java", "license": "bsd-3-clause", "size": 128275 }
[ "android.content.Intent", "com.fsck.k9.Account", "com.fsck.k9.activity.ChooseFolder", "com.fsck.k9.mail.Folder", "com.fsck.k9.mail.Message", "java.util.List" ]
import android.content.Intent; import com.fsck.k9.Account; import com.fsck.k9.activity.ChooseFolder; import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.Message; import java.util.List;
import android.content.*; import com.fsck.k9.*; import com.fsck.k9.activity.*; import com.fsck.k9.mail.*; import java.util.*;
[ "android.content", "com.fsck.k9", "java.util" ]
android.content; com.fsck.k9; java.util;
1,818,730
static public String getUidFromGlobalObjId(String globalObjId) { StringBuilder sb = new StringBuilder(); // First get the decoded base64 try { byte[] idBytes = Base64.decode(globalObjId, Base64.DEFAULT); String idString = new String(idBytes); // If the base64 decoded string contains the magic substring: "vCal-Uid", then // the actual uid is hidden within; the magic substring is never at the start of the // decoded base64 int index = idString.indexOf("vCal-Uid"); if (index > 0) { // The uid starts after "vCal-Uidxxxx", where xxxx are padding // characters. And it ends before the last character, which is ascii 0 return idString.substring(index + 12, idString.length() - 1); } else { // This is an EAS uid. Go through the bytes and write out the hex // values as characters; this is what we'll need to pass back to EAS // when responding to the invitation for (byte b: idBytes) { Utility.byteToHex(sb, b); } return sb.toString(); } } catch (RuntimeException e) { // In the worst of cases (bad format, etc.), we can always return the input return globalObjId; } }
static String function(String globalObjId) { StringBuilder sb = new StringBuilder(); try { byte[] idBytes = Base64.decode(globalObjId, Base64.DEFAULT); String idString = new String(idBytes); int index = idString.indexOf(STR); if (index > 0) { return idString.substring(index + 12, idString.length() - 1); } else { for (byte b: idBytes) { Utility.byteToHex(sb, b); } return sb.toString(); } } catch (RuntimeException e) { return globalObjId; } }
/** * Return the uid for an event based on its globalObjId * @param globalObjId the base64 encoded String provided by EAS * @return the uid for the calendar event */
Return the uid for an event based on its globalObjId
getUidFromGlobalObjId
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Exchange/exchange2/src/com/android/exchange/utility/CalendarUtilities.java", "license": "gpl-2.0", "size": 91569 }
[ "android.util.Base64", "com.android.emailcommon.utility.Utility" ]
import android.util.Base64; import com.android.emailcommon.utility.Utility;
import android.util.*; import com.android.emailcommon.utility.*;
[ "android.util", "com.android.emailcommon" ]
android.util; com.android.emailcommon;
381,602
public Optional<Map.Entry<K, V>> maxByValue(Comparator<V> comparator) { return inner.max(byValueOnly(comparator)); }
Optional<Map.Entry<K, V>> function(Comparator<V> comparator) { return inner.max(byValueOnly(comparator)); }
/** * Returns the maximum element of this stream according to the provided * {@code Comparator} applied to the value-components of this stream. This * is a special case of a reduction. * <p> * This is a terminal operation. * * @param comparator a non-interfering, stateless {@code Comparator} to * compare values of this stream * @return an {@code Optional} describing the maximum element of * this stream, or an empty {@code Optional} if the * stream is empty * * @throws NullPointerException if the maximum element is null */
Returns the maximum element of this stream according to the provided Comparator applied to the value-components of this stream. This is a special case of a reduction. This is a terminal operation
maxByValue
{ "repo_name": "Pyknic/MapStream", "path": "src/main/java/com/speedment/stream/MapStream.java", "license": "apache-2.0", "size": 99760 }
[ "java.util.Comparator", "java.util.Map", "java.util.Optional" ]
import java.util.Comparator; import java.util.Map; import java.util.Optional;
import java.util.*;
[ "java.util" ]
java.util;
2,398,167
final ImmutableSet.Builder<AdminPrivilege> privileges = ImmutableSet.builder(); for (final IObject privilege : root.getSession().getTypesService().allEnumerations("AdminPrivilege")) { privileges.add((AdminPrivilege) privilege); } allPrivileges = privileges.build(); }
final ImmutableSet.Builder<AdminPrivilege> privileges = ImmutableSet.builder(); for (final IObject privilege : root.getSession().getTypesService().allEnumerations(STR)) { privileges.add((AdminPrivilege) privilege); } allPrivileges = privileges.build(); }
/** * Populate the set of available light administrator privileges. * @throws ServerError unexpected */
Populate the set of available light administrator privileges
populateAllPrivileges
{ "repo_name": "MontpellierRessourcesImagerie/openmicroscopy", "path": "components/tools/OmeroJava/test/integration/LightAdminPrivilegesTest.java", "license": "gpl-2.0", "size": 169987 }
[ "com.google.common.collect.ImmutableSet" ]
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
2,448,210
protected void writeRecreateTableStmt(Database model, Table table, Map parameters) throws IOException { print("ALTER "); super.createTable(model, table, parameters); }
void function(Database model, Table table, Map parameters) throws IOException { print(STR); super.createTable(model, table, parameters); }
/** * Writes the SQL to recreate a table. * * @param model The database model * @param table The table to recreate * @param parameters The table creation parameters */
Writes the SQL to recreate a table
writeRecreateTableStmt
{ "repo_name": "jpcb/ddlutils", "path": "src/main/java/org/apache/ddlutils/platform/mckoi/MckoiBuilder.java", "license": "apache-2.0", "size": 5646 }
[ "java.io.IOException", "java.util.Map", "org.apache.ddlutils.model.Database", "org.apache.ddlutils.model.Table" ]
import java.io.IOException; import java.util.Map; import org.apache.ddlutils.model.Database; import org.apache.ddlutils.model.Table;
import java.io.*; import java.util.*; import org.apache.ddlutils.model.*;
[ "java.io", "java.util", "org.apache.ddlutils" ]
java.io; java.util; org.apache.ddlutils;
346,502
Order order; log.info("Executing workflow for order failed..."); // Create a traverson for the root order Traverson traverson = new Traverson( URI.create(event.getLink("order").getHref()), MediaTypes.HAL_JSON ); order = traverson.follow("self").toObject(Order.class); context.getExtendedState().getVariables().put("order", order); return order; }
Order order; log.info(STR); Traverson traverson = new Traverson( URI.create(event.getLink("order").getHref()), MediaTypes.HAL_JSON ); order = traverson.follow("self").toObject(Order.class); context.getExtendedState().getVariables().put("order", order); return order; }
/** * Apply an {@link OrderEvent} to the lambda function that was provided through the * constructor of this {@link OrderFunction}. * * @param event is the {@link OrderEvent} to apply to the lambda function */
Apply an <code>OrderEvent</code> to the lambda function that was provided through the constructor of this <code>OrderFunction</code>
apply
{ "repo_name": "naheedmk/event-stream-processing-microservices", "path": "order/order-worker/src/main/java/demo/function/OrderFailed.java", "license": "apache-2.0", "size": 1547 }
[ "java.net.URI", "org.springframework.hateoas.MediaTypes", "org.springframework.hateoas.client.Traverson" ]
import java.net.URI; import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.client.Traverson;
import java.net.*; import org.springframework.hateoas.*; import org.springframework.hateoas.client.*;
[ "java.net", "org.springframework.hateoas" ]
java.net; org.springframework.hateoas;
278,536
public Fireball shootFireball(LivingEntity shooter, Location shootLocation, Double speed) { // Direction vector: Vector directionVector = new Vector(0.0, -1.0, 0.0); // Create the fireball: Fireball fireball = shootLocation.getWorld().spawn(shootLocation, Fireball.class); fireball.setDirection(directionVector.clone()); fireball.setVelocity(directionVector.multiply(speed)); // Set shooter: fireball.setShooter(shooter); // Remove fire: fireball.setIsIncendiary(false); return fireball; }
Fireball function(LivingEntity shooter, Location shootLocation, Double speed) { Vector directionVector = new Vector(0.0, -1.0, 0.0); Fireball fireball = shootLocation.getWorld().spawn(shootLocation, Fireball.class); fireball.setDirection(directionVector.clone()); fireball.setVelocity(directionVector.multiply(speed)); fireball.setShooter(shooter); fireball.setIsIncendiary(false); return fireball; }
/** * Shoots a fireball straight down. * * @param shooter * shooter * @param shootLocation * shoot location * @param speed * speed * @return shot fireball */
Shoots a fireball straight down
shootFireball
{ "repo_name": "Olyol95/Saga", "path": "src/org/saga/abilities/MeteorsTarget.java", "license": "gpl-3.0", "size": 5563 }
[ "org.bukkit.Location", "org.bukkit.entity.Fireball", "org.bukkit.entity.LivingEntity", "org.bukkit.util.Vector" ]
import org.bukkit.Location; import org.bukkit.entity.Fireball; import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector;
import org.bukkit.*; import org.bukkit.entity.*; import org.bukkit.util.*;
[ "org.bukkit", "org.bukkit.entity", "org.bukkit.util" ]
org.bukkit; org.bukkit.entity; org.bukkit.util;
1,387,905
public static RequiresRedisSentinel forConfig(RedisSentinelConfiguration config) { return new RequiresRedisSentinel(config != null ? config : DEFAULT_SENTINEL_CONFIG); }
static RequiresRedisSentinel function(RedisSentinelConfiguration config) { return new RequiresRedisSentinel(config != null ? config : DEFAULT_SENTINEL_CONFIG); }
/** * Create new {@link RequiresRedisSentinel} for given {@link RedisSentinelConfiguration}. * * @param config * @return */
Create new <code>RequiresRedisSentinel</code> for given <code>RedisSentinelConfiguration</code>
forConfig
{ "repo_name": "thomasdarimont/spring-data-examples", "path": "redis/util/src/main/java/example/springdata/redis/test/util/RequiresRedisSentinel.java", "license": "apache-2.0", "size": 5185 }
[ "org.springframework.data.redis.connection.RedisSentinelConfiguration" ]
import org.springframework.data.redis.connection.RedisSentinelConfiguration;
import org.springframework.data.redis.connection.*;
[ "org.springframework.data" ]
org.springframework.data;
365,191
public void testWhileLoop() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("loop") .endActivity() .createActivity("loop") .behavior(new While("count", 0, 500)) .transition("one", "more") .transition("end", "done") .endActivity() .createActivity("one") .behavior(new Automatic()) .transition("two") .endActivity() .createActivity("two") .behavior(new Automatic()) .transition("three") .endActivity() .createActivity("three") .behavior(new Automatic()) .transition("loop") .endActivity() .createActivity("end") .behavior(new End()) .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds()); assertTrue(processInstance.isEnded()); }
void function() { PvmProcessDefinition processDefinition = new ProcessDefinitionBuilder() .createActivity("start") .initial() .behavior(new Automatic()) .transition("loop") .endActivity() .createActivity("loop") .behavior(new While("count", 0, 500)) .transition("one", "more") .transition("end", "done") .endActivity() .createActivity("one") .behavior(new Automatic()) .transition("two") .endActivity() .createActivity("two") .behavior(new Automatic()) .transition("three") .endActivity() .createActivity("three") .behavior(new Automatic()) .transition("loop") .endActivity() .createActivity("end") .behavior(new End()) .endActivity() .buildProcessDefinition(); PvmProcessInstance processInstance = processDefinition.createProcessInstance(); processInstance.start(); assertEquals(new ArrayList<String>(), processInstance.findActiveActivityIds()); assertTrue(processInstance.isEnded()); }
/** * +----------------------------+ * v | * +-------+ +------+ +-----+ +-----+ +-------+ * | start |-->| loop |-->| one |-->| two |--> | three | * +-------+ +------+ +-----+ +-----+ +-------+ * | * | +-----+ * +-->| end | * +-----+ */
+----------------------------+ v | +-------+ +------+ +-----+ +-----+ +-------+ | start |-->| loop |-->| one |-->| two |--> | three | +-------+ +------+ +-----+ +-----+ +-------+ | | +-----+ +-->| end | +-----+
testWhileLoop
{ "repo_name": "tkaefer/camunda-bpm-platform", "path": "engine/src/test/java/org/camunda/bpm/engine/test/pvm/PvmBasicLinearExecutionTest.java", "license": "apache-2.0", "size": 6897 }
[ "java.util.ArrayList", "org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder", "org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition", "org.camunda.bpm.engine.impl.pvm.PvmProcessInstance", "org.camunda.bpm.engine.test.pvm.activities.Automatic", "org.camunda.bpm.engine.test.pvm.activities.End", "org.camunda.bpm.engine.test.pvm.activities.While" ]
import java.util.ArrayList; import org.camunda.bpm.engine.impl.pvm.ProcessDefinitionBuilder; import org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition; import org.camunda.bpm.engine.impl.pvm.PvmProcessInstance; import org.camunda.bpm.engine.test.pvm.activities.Automatic; import org.camunda.bpm.engine.test.pvm.activities.End; import org.camunda.bpm.engine.test.pvm.activities.While;
import java.util.*; import org.camunda.bpm.engine.impl.pvm.*; import org.camunda.bpm.engine.test.pvm.activities.*;
[ "java.util", "org.camunda.bpm" ]
java.util; org.camunda.bpm;
2,517,829
private Menu getContextMenuControl() { if ((contextMenuManager != null) && (toolBar != null)) { Menu menuWidget = contextMenuManager.getMenu(); if ((menuWidget == null) || (menuWidget.isDisposed())) { menuWidget = contextMenuManager.createContextMenu(toolBar); } return menuWidget; } return null; }
Menu function() { if ((contextMenuManager != null) && (toolBar != null)) { Menu menuWidget = contextMenuManager.getMenu(); if ((menuWidget == null) (menuWidget.isDisposed())) { menuWidget = contextMenuManager.createContextMenu(toolBar); } return menuWidget; } return null; }
/** * Returns the control of the Menu Manager. If the menu manager does not * have a control then one is created. * * @return menu widget associated with manager */
Returns the control of the Menu Manager. If the menu manager does not have a control then one is created
getContextMenuControl
{ "repo_name": "neelance/jface4ruby", "path": "jface4ruby/src/org/eclipse/jface/action/ToolBarManager.java", "license": "epl-1.0", "size": 13694 }
[ "org.eclipse.swt.widgets.Menu" ]
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
1,444,902
public void setupMap(Comment topComment) { mapData = new MapDataHelper((MapView) getActivity().findViewById( R.id.open_map_view)); mapData.setUpMap(); if (commentLocationIsValid(topComment)) { GeoLocation geoLocation = topComment.getLocation(); Drawable icon = getResources().getDrawable(R.drawable.red_map_pin); originalPostMarker = new CustomMarker(geoLocation, mapData.getMap(), icon); originalPostMarker.setUpInfoWindow("OP", getActivity()); setMarkerListeners(originalPostMarker); markers.add(originalPostMarker); startAndFinishClusterMarkers.add(originalPostMarker); handleChildComments(topComment); mapData.getOverlays().add(replyPostClusterMarkers); mapData.getOverlays().add(directionsClusterMarkers); mapData.getOverlays().add(originalPostMarker); } mapData.getMap().invalidate(); }
void function(Comment topComment) { mapData = new MapDataHelper((MapView) getActivity().findViewById( R.id.open_map_view)); mapData.setUpMap(); if (commentLocationIsValid(topComment)) { GeoLocation geoLocation = topComment.getLocation(); Drawable icon = getResources().getDrawable(R.drawable.red_map_pin); originalPostMarker = new CustomMarker(geoLocation, mapData.getMap(), icon); originalPostMarker.setUpInfoWindow("OP", getActivity()); setMarkerListeners(originalPostMarker); markers.add(originalPostMarker); startAndFinishClusterMarkers.add(originalPostMarker); handleChildComments(topComment); mapData.getOverlays().add(replyPostClusterMarkers); mapData.getOverlays().add(directionsClusterMarkers); mapData.getOverlays().add(originalPostMarker); } mapData.getMap().invalidate(); }
/** * This sets up the comment location the map. The map is centered at the * location of the comment GeoLocation, and places a pin at this point. It * then calls handleChildComments to place pins for each child comment in * the thread. * * @param topComment * The OP of the ThreadComment. */
This sets up the comment location the map. The map is centered at the location of the comment GeoLocation, and places a pin at this point. It then calls handleChildComments to place pins for each child comment in the thread
setupMap
{ "repo_name": "CMPUT301W14T08/GeoChan", "path": "GeoChan/src/ca/ualberta/cmput301w14t08/geochan/fragments/MapViewFragment.java", "license": "apache-2.0", "size": 18274 }
[ "android.graphics.drawable.Drawable", "ca.ualberta.cmput301w14t08.geochan.helpers.MapDataHelper", "ca.ualberta.cmput301w14t08.geochan.models.Comment", "ca.ualberta.cmput301w14t08.geochan.models.CustomMarker", "ca.ualberta.cmput301w14t08.geochan.models.GeoLocation", "org.osmdroid.views.MapView" ]
import android.graphics.drawable.Drawable; import ca.ualberta.cmput301w14t08.geochan.helpers.MapDataHelper; import ca.ualberta.cmput301w14t08.geochan.models.Comment; import ca.ualberta.cmput301w14t08.geochan.models.CustomMarker; import ca.ualberta.cmput301w14t08.geochan.models.GeoLocation; import org.osmdroid.views.MapView;
import android.graphics.drawable.*; import ca.ualberta.cmput301w14t08.geochan.helpers.*; import ca.ualberta.cmput301w14t08.geochan.models.*; import org.osmdroid.views.*;
[ "android.graphics", "ca.ualberta.cmput301w14t08", "org.osmdroid.views" ]
android.graphics; ca.ualberta.cmput301w14t08; org.osmdroid.views;
2,793,695
Log.printLine("Starting CloudSimExample1..."); try { // First step: Initialize the CloudSim package. It should be called // before creating any entities. int num_user = 1; // number of cloud users Calendar calendar = Calendar.getInstance(); boolean trace_flag = false; // mean trace events // Initialize the CloudSim library CloudSim.init(num_user, calendar, trace_flag); // Second step: Create Datacenters // Datacenters are the resource providers in CloudSim. We need at // list one of them to run a CloudSim simulation Datacenter datacenter0 = createDatacenter("Datacenter_0"); // Third step: Create Broker MyDatacenterBroker broker = createBroker(); int brokerId = broker.getId(); // Fourth step: Create one virtual machine vmlist = new ArrayList<Vm>(); // VM description int vmid = 0; int mips = 1000; long size = 10000; // image size (MB) int ram = 512; // vm memory (MB) long bw = 1000; int pesNumber = 2; // number of cpus String vmm = "Xen"; // VMM name // create VM Vm vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared()); // add the VM to the vmList vmlist.add(vm); // submit vm list to the broker broker.submitVmList(vmlist); // Fifth step: Create one Cloudlet cloudletList = new ArrayList<Cloudlet>(); // Cloudlet properties int id = 0; long length = 400000; long fileSize = 300; long outputSize = 300; UtilizationModel utilizationModel = new UtilizationModelFull(); // Cloudlet cloudlet = new Cloudlet(id, length, pesNumber, fileSize, outputSize, utilizationModel, utilizationModel, utilizationModel); Cloudlet cloudlet = new Cloudlet(id, length, 4, fileSize, outputSize, utilizationModel, utilizationModel, utilizationModel); cloudlet.setUserId(brokerId); cloudlet.setVmId(vmid); // add the cloudlet to the list cloudletList.add(cloudlet); // submit cloudlet list to the broker broker.submitCloudletList(cloudletList); // Sixth step: Starts the simulation CloudSim.startSimulation(); CloudSim.stopSimulation(); //Final step: Print results when simulation is over List<Cloudlet> newList = broker.getCloudletReceivedList(); printCloudletList(newList); Log.printLine("CloudSimExample1 finished!"); } catch (Exception e) { e.printStackTrace(); Log.printLine("Unwanted errors happen"); } }
Log.printLine(STR); try { int num_user = 1; Calendar calendar = Calendar.getInstance(); boolean trace_flag = false; CloudSim.init(num_user, calendar, trace_flag); Datacenter datacenter0 = createDatacenter(STR); MyDatacenterBroker broker = createBroker(); int brokerId = broker.getId(); vmlist = new ArrayList<Vm>(); int vmid = 0; int mips = 1000; long size = 10000; int ram = 512; long bw = 1000; int pesNumber = 2; String vmm = "Xen"; Vm vm = new Vm(vmid, brokerId, mips, pesNumber, ram, bw, size, vmm, new CloudletSchedulerTimeShared()); vmlist.add(vm); broker.submitVmList(vmlist); cloudletList = new ArrayList<Cloudlet>(); int id = 0; long length = 400000; long fileSize = 300; long outputSize = 300; UtilizationModel utilizationModel = new UtilizationModelFull(); Cloudlet cloudlet = new Cloudlet(id, length, 4, fileSize, outputSize, utilizationModel, utilizationModel, utilizationModel); cloudlet.setUserId(brokerId); cloudlet.setVmId(vmid); cloudletList.add(cloudlet); broker.submitCloudletList(cloudletList); CloudSim.startSimulation(); CloudSim.stopSimulation(); List<Cloudlet> newList = broker.getCloudletReceivedList(); printCloudletList(newList); Log.printLine(STR); } catch (Exception e) { e.printStackTrace(); Log.printLine(STR); } }
/** * Creates main() to run this example. * * @param args the args */
Creates main() to run this example
main
{ "repo_name": "Spirakos/CloudsimTest", "path": "examples/org/cloudbus/cloudsim/examples/MyCloudSimExample1.java", "license": "lgpl-3.0", "size": 8469 }
[ "java.util.ArrayList", "java.util.Calendar", "java.util.List", "org.cloudbus.cloudsim.Cloudlet", "org.cloudbus.cloudsim.CloudletSchedulerTimeShared", "org.cloudbus.cloudsim.Datacenter", "org.cloudbus.cloudsim.Log", "org.cloudbus.cloudsim.UtilizationModel", "org.cloudbus.cloudsim.UtilizationModelFull", "org.cloudbus.cloudsim.Vm", "org.cloudbus.cloudsim.core.CloudSim" ]
import java.util.ArrayList; import java.util.Calendar; import java.util.List; import org.cloudbus.cloudsim.Cloudlet; import org.cloudbus.cloudsim.CloudletSchedulerTimeShared; import org.cloudbus.cloudsim.Datacenter; import org.cloudbus.cloudsim.Log; import org.cloudbus.cloudsim.UtilizationModel; import org.cloudbus.cloudsim.UtilizationModelFull; import org.cloudbus.cloudsim.Vm; import org.cloudbus.cloudsim.core.CloudSim;
import java.util.*; import org.cloudbus.cloudsim.*; import org.cloudbus.cloudsim.core.*;
[ "java.util", "org.cloudbus.cloudsim" ]
java.util; org.cloudbus.cloudsim;
932,827
private Resource getAuthTokenResource(Registry registry) throws Exception { if (registry == null) { return null; } String resPath = this.generateAuthTokenResourcePath(); if (!registry.resourceExists(resPath)) { return null; } return registry.get(resPath); }
Resource function(Registry registry) throws Exception { if (registry == null) { return null; } String resPath = this.generateAuthTokenResourcePath(); if (!registry.resourceExists(resPath)) { return null; } return registry.get(resPath); }
/** * Returns the resource associated with the current gspread config user authentication token. * the resource path is :- * "/repository/components/org.wso2.carbon.dataservices.core/services/[service_id]/configs/[config_id]/ * user_auth_token" */
Returns the resource associated with the current gspread config user authentication token. the resource path is :- "/repository/components/org.wso2.carbon.dataservices.core/services/[service_id]/configs/[config_id] user_auth_token"
getAuthTokenResource
{ "repo_name": "wso2/carbon-data", "path": "components/data-services/org.wso2.carbon.dataservices.sql.driver/src/main/java/org/wso2/carbon/dataservices/sql/driver/util/GSpreadFeedProcessor.java", "license": "apache-2.0", "size": 15103 }
[ "org.wso2.carbon.registry.core.Registry", "org.wso2.carbon.registry.core.Resource" ]
import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.Resource;
import org.wso2.carbon.registry.core.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
1,078,190
public void removeMediator(Mediator mediator) throws ComponentException, UnsupportedOperationException;
void function(Mediator mediator) throws ComponentException, UnsupportedOperationException;
/** * This method takes a WSMO4J Mediator object already within the Resource * Manager and removes it from the Resource Manager. * * @param mediator The Mediator object to remove * @throws ComponentException * @throws UnsupportedOperationException */
This method takes a WSMO4J Mediator object already within the Resource Manager and removes it from the Resource Manager
removeMediator
{ "repo_name": "herculeshssj/unirio-ppgi-goalservice", "path": "GoalService/core/src/api/org/wsmo/execution/common/component/resourcemanager/MediatorResourceManager.java", "license": "lgpl-2.1", "size": 6196 }
[ "org.wsmo.execution.common.exception.ComponentException", "org.wsmo.mediator.Mediator" ]
import org.wsmo.execution.common.exception.ComponentException; import org.wsmo.mediator.Mediator;
import org.wsmo.execution.common.exception.*; import org.wsmo.mediator.*;
[ "org.wsmo.execution", "org.wsmo.mediator" ]
org.wsmo.execution; org.wsmo.mediator;
791,840
protected CacheConfiguration createCacheConfiguration(String cacheName) { CacheConfiguration cfg = new CacheConfiguration() .setName(cacheName) .setCacheMode(CacheMode.PARTITIONED) .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) .setAffinity(new BrokenAffinityFunction()); return cfg; }
CacheConfiguration function(String cacheName) { CacheConfiguration cfg = new CacheConfiguration() .setName(cacheName) .setCacheMode(CacheMode.PARTITIONED) .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL) .setAffinity(new BrokenAffinityFunction()); return cfg; }
/** * Creates new cache configuration with the given name. * * @param cacheName Cache name. * @return New cache configuration. */
Creates new cache configuration with the given name
createCacheConfiguration
{ "repo_name": "nizhikov/ignite", "path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/IgniteAbstractDynamicCacheStartFailTest.java", "license": "apache-2.0", "size": 41086 }
[ "org.apache.ignite.cache.CacheAtomicityMode", "org.apache.ignite.cache.CacheMode", "org.apache.ignite.configuration.CacheConfiguration" ]
import org.apache.ignite.cache.CacheAtomicityMode; import org.apache.ignite.cache.CacheMode; import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.cache.*; import org.apache.ignite.configuration.*;
[ "org.apache.ignite" ]
org.apache.ignite;
1,779,938