method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
@Deprecated
public static Header authenticate(
final Credentials credentials,
final String charset,
final boolean proxy) {
Args.notNull(credentials, "Credentials");
Args.notNull(charset, "charset");
final StringBuilder tmp = new StringBuilder();
tmp.append(credentials.getUserPrincipal().getName());
tmp.append(":");
tmp.append((credentials.getPassword() == null) ? "null" : credentials.getPassword());
final byte[] base64password = Base64.encode(
EncodingUtils.getBytes(tmp.toString(), charset),
Base64.NO_WRAP);
final CharArrayBuffer buffer = new CharArrayBuffer(32);
if (proxy) {
buffer.append(AUTH.PROXY_AUTH_RESP);
} else {
buffer.append(AUTH.WWW_AUTH_RESP);
}
buffer.append(": Basic ");
buffer.append(base64password, 0, base64password.length);
return new BufferedHeader(buffer);
} | static Header function( final Credentials credentials, final String charset, final boolean proxy) { Args.notNull(credentials, STR); Args.notNull(charset, STR); final StringBuilder tmp = new StringBuilder(); tmp.append(credentials.getUserPrincipal().getName()); tmp.append(":"); tmp.append((credentials.getPassword() == null) ? "null" : credentials.getPassword()); final byte[] base64password = Base64.encode( EncodingUtils.getBytes(tmp.toString(), charset), Base64.NO_WRAP); final CharArrayBuffer buffer = new CharArrayBuffer(32); if (proxy) { buffer.append(AUTH.PROXY_AUTH_RESP); } else { buffer.append(AUTH.WWW_AUTH_RESP); } buffer.append(STR); buffer.append(base64password, 0, base64password.length); return new BufferedHeader(buffer); } | /**
* Returns a basic <tt>Authorization</tt> header value for the given
* {@link Credentials} and charset.
*
* @param credentials The credentials to encode.
* @param charset The charset to use for encoding the credentials
*
* @return a basic authorization header
*
* @deprecated (4.3) use {@link #authenticate(Credentials, HttpRequest, HttpContext)}.
*/ | Returns a basic Authorization header value for the given <code>Credentials</code> and charset | authenticate | {
"repo_name": "Godine/android",
"path": "lib/httpclient-android/src/main/java/org/apache/http/impl/auth/BasicSchemeHC4.java",
"license": "gpl-2.0",
"size": 7270
} | [
"android.util.Base64",
"org.apache.http.Header",
"org.apache.http.auth.Credentials",
"org.apache.http.message.BufferedHeader",
"org.apache.http.util.Args",
"org.apache.http.util.CharArrayBuffer",
"org.apache.http.util.EncodingUtils"
] | import android.util.Base64; import org.apache.http.Header; import org.apache.http.auth.Credentials; import org.apache.http.message.BufferedHeader; import org.apache.http.util.Args; import org.apache.http.util.CharArrayBuffer; import org.apache.http.util.EncodingUtils; | import android.util.*; import org.apache.http.*; import org.apache.http.auth.*; import org.apache.http.message.*; import org.apache.http.util.*; | [
"android.util",
"org.apache.http"
] | android.util; org.apache.http; | 1,798,142 |
private @Nonnull Optional<String> toStringWithLengthInSpace(
ParserRuleContext messageCtx, ParserRuleContext ctx, IntegerSpace lengthSpace, String name) {
String text = ctx.getText();
if (!lengthSpace.contains(text.length())) {
_w.addWarning(
messageCtx,
getFullText(messageCtx),
_parser,
String.format(
"Expected %s with length in range %s, but got '%s'", name, lengthSpace, text));
return Optional.empty();
}
return Optional.of(text);
} | @Nonnull Optional<String> function( ParserRuleContext messageCtx, ParserRuleContext ctx, IntegerSpace lengthSpace, String name) { String text = ctx.getText(); if (!lengthSpace.contains(text.length())) { _w.addWarning( messageCtx, getFullText(messageCtx), _parser, String.format( STR, name, lengthSpace, text)); return Optional.empty(); } return Optional.of(text); } | /**
* Return the text of the provided {@code ctx} if its length is within the provided {@link
* IntegerSpace lengthSpace}, or else {@link Optional#empty}.
*/ | Return the text of the provided ctx if its length is within the provided <code>IntegerSpace lengthSpace</code>, or else <code>Optional#empty</code> | toStringWithLengthInSpace | {
"repo_name": "batfish/batfish",
"path": "projects/batfish/src/main/java/org/batfish/grammar/palo_alto/PaloAltoConfigurationBuilder.java",
"license": "apache-2.0",
"size": 140482
} | [
"java.util.Optional",
"javax.annotation.Nonnull",
"org.antlr.v4.runtime.ParserRuleContext",
"org.batfish.datamodel.IntegerSpace"
] | import java.util.Optional; import javax.annotation.Nonnull; import org.antlr.v4.runtime.ParserRuleContext; import org.batfish.datamodel.IntegerSpace; | import java.util.*; import javax.annotation.*; import org.antlr.v4.runtime.*; import org.batfish.datamodel.*; | [
"java.util",
"javax.annotation",
"org.antlr.v4",
"org.batfish.datamodel"
] | java.util; javax.annotation; org.antlr.v4; org.batfish.datamodel; | 1,847,037 |
@Test
public void testOptionsWithWhitespace() {
Set<String> result = OptionParser.parse(" +all -data_flow ");
assertContainedOptions(Arrays.asList("+all", "-data_flow"), result);
} | void function() { Set<String> result = OptionParser.parse(STR); assertContainedOptions(Arrays.asList("+all", STR), result); } | /**
* Test with options string that contains white space.
*
* Result contains the options only.
*/ | Test with options string that contains white space. Result contains the options only | testOptionsWithWhitespace | {
"repo_name": "mikanbako/Ant-Jlint-Task",
"path": "src/test/java/com/github/mikanbako/ant/jlinttask/OptionParserTest.java",
"license": "gpl-2.0",
"size": 3553
} | [
"java.util.Arrays",
"java.util.Set"
] | import java.util.Arrays; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,470,029 |
public static BodyContentType getEnumFromValue(String value)
throws NoEnumFoundException {
if (value != null) {
for (BodyContentType imValue : BodyContentType.values()) {
if (value.equalsIgnoreCase(imValue.getValue())) {
return imValue;
}
}
}
throw new NoEnumFoundException(
ImMessages.EXCEPTION_NO_REST_API_CONTENT_TYPE_ENUM_FOUND);
} | static BodyContentType function(String value) throws NoEnumFoundException { if (value != null) { for (BodyContentType imValue : BodyContentType.values()) { if (value.equalsIgnoreCase(imValue.getValue())) { return imValue; } } } throw new NoEnumFoundException( ImMessages.EXCEPTION_NO_REST_API_CONTENT_TYPE_ENUM_FOUND); } | /**
* Returns a RestApiBodyContentType if the String passed is the same as one of
* the states of the enum<br>
*
* @param value
* : string of the value to retrieve
* @return A RestApiBodyContentType, null if not found.
* @throws NoEnumFoundException
* : No enumerator found
*/ | Returns a RestApiBodyContentType if the String passed is the same as one of the states of the enum | getEnumFromValue | {
"repo_name": "indigo-dc/im-java-api",
"path": "src/main/java/es/upv/i3m/grycap/im/rest/client/BodyContentType.java",
"license": "apache-2.0",
"size": 1895
} | [
"es.upv.i3m.grycap.im.exceptions.NoEnumFoundException",
"es.upv.i3m.grycap.im.lang.ImMessages"
] | import es.upv.i3m.grycap.im.exceptions.NoEnumFoundException; import es.upv.i3m.grycap.im.lang.ImMessages; | import es.upv.i3m.grycap.im.exceptions.*; import es.upv.i3m.grycap.im.lang.*; | [
"es.upv.i3m"
] | es.upv.i3m; | 2,497,729 |
public List<AttributeStatement> createOrganizationIdAttributeStatement(String organizationId) {
List<AttributeStatement> statements = new ArrayList<AttributeStatement>();
Attribute attribute = createAttribute(null, SamlConstants.USER_ORG_ID_ATTR, null, Arrays.asList(organizationId));
statements.addAll(OpenSAML2ComponentBuilder.getInstance().createAttributeStatement(Arrays.asList(attribute)));
return statements;
} | List<AttributeStatement> function(String organizationId) { List<AttributeStatement> statements = new ArrayList<AttributeStatement>(); Attribute attribute = createAttribute(null, SamlConstants.USER_ORG_ID_ATTR, null, Arrays.asList(organizationId)); statements.addAll(OpenSAML2ComponentBuilder.getInstance().createAttributeStatement(Arrays.asList(attribute))); return statements; } | /**
* Creates the organization id attribute statement.
*
* @param organizationId the organization id
* @return the list
*/ | Creates the organization id attribute statement | createOrganizationIdAttributeStatement | {
"repo_name": "healthreveal/CONNECT",
"path": "Product/Production/Common/CONNECTCoreLib/src/main/java/gov/hhs/fha/nhinc/callback/openSAML/OpenSAML2ComponentBuilder.java",
"license": "bsd-3-clause",
"size": 32385
} | [
"gov.hhs.fha.nhinc.callback.SamlConstants",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List",
"org.opensaml.saml2.core.Attribute",
"org.opensaml.saml2.core.AttributeStatement"
] | import gov.hhs.fha.nhinc.callback.SamlConstants; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.opensaml.saml2.core.Attribute; import org.opensaml.saml2.core.AttributeStatement; | import gov.hhs.fha.nhinc.callback.*; import java.util.*; import org.opensaml.saml2.core.*; | [
"gov.hhs.fha",
"java.util",
"org.opensaml.saml2"
] | gov.hhs.fha; java.util; org.opensaml.saml2; | 2,488,194 |
int XUngrabKeyboard(Display display, NativeLong time); | int XUngrabKeyboard(Display display, NativeLong time); | /**
* Releases the keyboard and any queued events if this client has it actively grabbed from either XGrabKeyboard() or XGrabKey().
* @param display Specifies the connection to the X server.
* @param time Specifies the time. You can pass either a timestamp or CurrentTime.
* @return nothing
*/ | Releases the keyboard and any queued events if this client has it actively grabbed from either XGrabKeyboard() or XGrabKey() | XUngrabKeyboard | {
"repo_name": "trejkaz/jna",
"path": "contrib/platform/src/com/sun/jna/platform/unix/X11.java",
"license": "lgpl-2.1",
"size": 105805
} | [
"com.sun.jna.NativeLong"
] | import com.sun.jna.NativeLong; | import com.sun.jna.*; | [
"com.sun.jna"
] | com.sun.jna; | 1,247,471 |
@Override
protected SpreadSheet doRead(File file) {
SpreadSheet result;
Properties props;
List<String> keys;
Row row;
props = new Properties();
if (!props.load(file.getAbsolutePath()))
return null;
result = new DefaultSpreadSheet();
// header
row = result.getHeaderRow();
row.addCell("K").setContentAsString(HEADER_KEY);
row.addCell("V").setContentAsString(HEADER_VALUE);
// data
keys = new ArrayList<>(props.keySetAll());
Collections.sort(keys);
for (String key: keys) {
row = result.addRow();
row.addCell("K").setContentAsString(key);
if (m_ForceString)
row.addCell("V").setContentAsString(props.getProperty(key));
else
row.addCell("V").setContent(props.getProperty(key));
}
return result;
} | SpreadSheet function(File file) { SpreadSheet result; Properties props; List<String> keys; Row row; props = new Properties(); if (!props.load(file.getAbsolutePath())) return null; result = new DefaultSpreadSheet(); row = result.getHeaderRow(); row.addCell("K").setContentAsString(HEADER_KEY); row.addCell("V").setContentAsString(HEADER_VALUE); keys = new ArrayList<>(props.keySetAll()); Collections.sort(keys); for (String key: keys) { row = result.addRow(); row.addCell("K").setContentAsString(key); if (m_ForceString) row.addCell("V").setContentAsString(props.getProperty(key)); else row.addCell("V").setContent(props.getProperty(key)); } return result; } | /**
* Performs the actual reading. Must handle compression itself, if
* {@link #supportsCompressedInput()} returns true.
*
* @param file the file to read from
* @return the spreadsheet or null in case of an error
* @see #getInputType()
* @see #supportsCompressedInput()
*/ | Performs the actual reading. Must handle compression itself, if <code>#supportsCompressedInput()</code> returns true | doRead | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-spreadsheet/src/main/java/adams/data/io/input/PropertiesSpreadSheetReader.java",
"license": "gpl-3.0",
"size": 6624
} | [
"java.io.File",
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] | import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,151,795 |
public static Exception refreshCache(PrintStream... progress) {
Exception problem = null;
if (CACHE_URL == null) {
return null;
}
PACKAGE_MANAGER.setPackageRepositoryURL(REP_URL);
String cacheDir = WEKA_HOME.toString() + File.separator + "repCache";
try {
for (PrintStream p : progress) {
p.println("Refresh in progress. Please wait...");
}
byte[] zip =
PACKAGE_MANAGER.getRepositoryPackageMetaDataOnlyAsZip(progress);
ZipInputStream zis = new ZipInputStream(new ByteArrayInputStream(zip));
ZipEntry ze;
final byte[] buff = new byte[1024];
while ((ze = zis.getNextEntry()) != null) {
// System.out.println("Cache: inflating " + ze.getName());
if (ze.isDirectory()) {
new File(cacheDir, ze.getName()).mkdir();
continue;
}
BufferedOutputStream bo = new BufferedOutputStream(
new FileOutputStream(new File(cacheDir, ze.getName())));
while (true) {
int amountRead = zis.read(buff);
if (amountRead == -1) {
break;
}
// write the data here
bo.write(buff, 0, amountRead);
}
bo.close();
}
} catch (Exception e) {
e.printStackTrace();
// OK, we have a problem with the repository cache - use
// the repository itself instead and delete repCache
CACHE_URL = null;
try {
DefaultPackageManager.deleteDir(new File(cacheDir), System.out);
} catch (Exception e1) {
e1.printStackTrace();
}
return e;
}
return problem;
} | static Exception function(PrintStream... progress) { Exception problem = null; if (CACHE_URL == null) { return null; } PACKAGE_MANAGER.setPackageRepositoryURL(REP_URL); String cacheDir = WEKA_HOME.toString() + File.separator + STR; try { for (PrintStream p : progress) { p.println(STR); } byte[] zip = PACKAGE_MANAGER.getRepositoryPackageMetaDataOnlyAsZip(progress); ZipInputStream zis = new ZipInputStream(new ByteArrayInputStream(zip)); ZipEntry ze; final byte[] buff = new byte[1024]; while ((ze = zis.getNextEntry()) != null) { if (ze.isDirectory()) { new File(cacheDir, ze.getName()).mkdir(); continue; } BufferedOutputStream bo = new BufferedOutputStream( new FileOutputStream(new File(cacheDir, ze.getName()))); while (true) { int amountRead = zis.read(buff); if (amountRead == -1) { break; } bo.write(buff, 0, amountRead); } bo.close(); } } catch (Exception e) { e.printStackTrace(); CACHE_URL = null; try { DefaultPackageManager.deleteDir(new File(cacheDir), System.out); } catch (Exception e1) { e1.printStackTrace(); } return e; } return problem; } | /**
* Refresh the local copy of the package meta data
*
* @param progress to report progress to
* @return any Exception raised or null if all is successful
*/ | Refresh the local copy of the package meta data | refreshCache | {
"repo_name": "ModelWriter/Deliverables",
"path": "WP2/D2.5.2_Generation/Jeni/lib/weka-src/src/main/java/weka/core/WekaPackageManager.java",
"license": "epl-1.0",
"size": 87570
} | [
"java.io.BufferedOutputStream",
"java.io.ByteArrayInputStream",
"java.io.File",
"java.io.FileOutputStream",
"java.io.PrintStream",
"java.util.zip.ZipEntry",
"java.util.zip.ZipInputStream"
] | import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileOutputStream; import java.io.PrintStream; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; | import java.io.*; import java.util.zip.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,492,501 |
byte getLuminanceFromGround(Vector3i position); | byte getLuminanceFromGround(Vector3i position); | /**
* Get the light level for this object that is caused by everything
* other than the sky.
*
* <p>Higher levels indicate a higher luminance.</p>
*
* @param position The position of the block
* @return A light level, nominally between 0 and 15, inclusive
*/ | Get the light level for this object that is caused by everything other than the sky. Higher levels indicate a higher luminance | getLuminanceFromGround | {
"repo_name": "kenzierocks/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/world/extent/Extent.java",
"license": "mit",
"size": 33484
} | [
"com.flowpowered.math.vector.Vector3i"
] | import com.flowpowered.math.vector.Vector3i; | import com.flowpowered.math.vector.*; | [
"com.flowpowered.math"
] | com.flowpowered.math; | 723,941 |
@Test
public void removeScripts_3() throws Exception {
Submit submit = mock(Submit.class);
SubmitWrapper submitWrapper = new SubmitWrapper(submit);
List<ScriptText> scripts = new ArrayList<ScriptText>();
scripts.add(new ScriptText("name1", "text1"));
submitWrapper.scripts = scripts;
doThrow(new IOException()).when(submit).deleteScripts(scripts);
submitWrapper.removeScripts();
verify(submit).deleteScripts(scripts);
assertEquals(0, scripts.size());
} | void function() throws Exception { Submit submit = mock(Submit.class); SubmitWrapper submitWrapper = new SubmitWrapper(submit); List<ScriptText> scripts = new ArrayList<ScriptText>(); scripts.add(new ScriptText("name1", "text1")); submitWrapper.scripts = scripts; doThrow(new IOException()).when(submit).deleteScripts(scripts); submitWrapper.removeScripts(); verify(submit).deleteScripts(scripts); assertEquals(0, scripts.size()); } | /**
* Exception occur when delete scripts
*/ | Exception occur when delete scripts | removeScripts_3 | {
"repo_name": "cyron/byteman-framework",
"path": "src/test/java/jp/co/ntt/oss/jboss/byteman/framework/instrumentor/AbstractDistributedInstrumentorTest.java",
"license": "lgpl-2.1",
"size": 7460
} | [
"java.io.IOException",
"java.util.ArrayList",
"java.util.List",
"jp.co.ntt.oss.jboss.byteman.framework.instrumentor.AbstractDistributedInstrumentor",
"org.jboss.byteman.agent.submit.ScriptText",
"org.jboss.byteman.agent.submit.Submit",
"org.junit.Assert",
"org.mockito.Mockito"
] | import java.io.IOException; import java.util.ArrayList; import java.util.List; import jp.co.ntt.oss.jboss.byteman.framework.instrumentor.AbstractDistributedInstrumentor; import org.jboss.byteman.agent.submit.ScriptText; import org.jboss.byteman.agent.submit.Submit; import org.junit.Assert; import org.mockito.Mockito; | import java.io.*; import java.util.*; import jp.co.ntt.oss.jboss.byteman.framework.instrumentor.*; import org.jboss.byteman.agent.submit.*; import org.junit.*; import org.mockito.*; | [
"java.io",
"java.util",
"jp.co.ntt",
"org.jboss.byteman",
"org.junit",
"org.mockito"
] | java.io; java.util; jp.co.ntt; org.jboss.byteman; org.junit; org.mockito; | 2,610,180 |
public void openForWrite() throws IOException; | void function() throws IOException; | /**
* Open the file for writing, on the underlying file system. File name is
* passed in the link#connect() method.
*
* @throws IOException if file is directory, file does not exists,
* i if file is already open for write or other
* I/O error occurs
*/ | Open the file for writing, on the underlying file system. File name is passed in the link#connect() method | openForWrite | {
"repo_name": "wufucious/moped",
"path": "squawk/cldc/src/com/sun/squawk/platform/GCFFile.java",
"license": "gpl-2.0",
"size": 18824
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,351,099 |
@RobotKeyword
@ArgumentNames({ "locator", "text", "logLevel=INFO" })
public void frameShouldNotContain(String locator, String text, String logLevel) {
if (frameContains(locator, text)) {
logging.log(String.format("Frame Should Not Contain: %s => FAILED", text), logLevel);
throw new Selenium2LibraryNonFatalException(
String.format("Frame should not have contained text '%s', but did.", text));
} else {
logging.log(String.format("Frame Should Not Contain: %s => OK", text), logLevel);
}
} | @ArgumentNames({ STR, "text", STR }) void function(String locator, String text, String logLevel) { if (frameContains(locator, text)) { logging.log(String.format(STR, text), logLevel); throw new Selenium2LibraryNonFatalException( String.format(STR, text)); } else { logging.log(String.format(STR, text), logLevel); } } | /**
* Verify the frame identified by <b>locator</b> does not contain
* <b>text</b>.<br>
* <br>
* See `Introduction` for details about locators.
*
* @param locator
* The locator to locate the frame.
* @param text
* The text to verify.
* @param logLevel
* Default=INFO. Optional log level.
*/ | Verify the frame identified by locator does not contain text. See `Introduction` for details about locators | frameShouldNotContain | {
"repo_name": "MarkusBernhardt/robotframework-selenium2library-java",
"path": "src/main/java/com/github/markusbernhardt/selenium2library/keywords/Element.java",
"license": "apache-2.0",
"size": 56233
} | [
"com.github.markusbernhardt.selenium2library.Selenium2LibraryNonFatalException",
"org.robotframework.javalib.annotation.ArgumentNames"
] | import com.github.markusbernhardt.selenium2library.Selenium2LibraryNonFatalException; import org.robotframework.javalib.annotation.ArgumentNames; | import com.github.markusbernhardt.selenium2library.*; import org.robotframework.javalib.annotation.*; | [
"com.github.markusbernhardt",
"org.robotframework.javalib"
] | com.github.markusbernhardt; org.robotframework.javalib; | 546,052 |
EList getParentBindings(); | EList getParentBindings(); | /**
* Returns the value of the '<em><b>Parent Bindings</b></em>' reference list.
* The list contents are of type {@link ucm.map.ComponentBinding}.
* It is bidirectional and its opposite is '{@link ucm.map.ComponentBinding#getParentComponent <em>Parent Component</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Parent Bindings</em>' reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Parent Bindings</em>' reference list.
* @see ucm.map.MapPackage#getComponentRef_ParentBindings()
* @see ucm.map.ComponentBinding#getParentComponent
* @model type="ucm.map.ComponentBinding" opposite="parentComponent"
* @generated
*/ | Returns the value of the 'Parent Bindings' reference list. The list contents are of type <code>ucm.map.ComponentBinding</code>. It is bidirectional and its opposite is '<code>ucm.map.ComponentBinding#getParentComponent Parent Component</code>'. If the meaning of the 'Parent Bindings' reference list isn't clear, there really should be more of a description here... | getParentBindings | {
"repo_name": "McGill-DP-Group/seg.jUCMNav",
"path": "src/ucm/map/ComponentRef.java",
"license": "epl-1.0",
"size": 5233
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,961,481 |
Member validateMemberAsync(PerunSession sess, Member member) throws InternalErrorException; | Member validateMemberAsync(PerunSession sess, Member member) throws InternalErrorException; | /**
* Validate all attributes for member and then set member's status to VALID.
* This method runs asynchronously. It immediately return member with <b>ORIGINAL</b> status and after asynchronous validation sucessfuly finishes
* it switch member's status to VALID. If validation ends with error, member keeps his status.
*
* @param sess
* @param member
* @return member with original status
*
* @throws InternalErrorException
*/ | Validate all attributes for member and then set member's status to VALID. This method runs asynchronously. It immediately return member with ORIGINAL status and after asynchronous validation sucessfuly finishes it switch member's status to VALID. If validation ends with error, member keeps his status | validateMemberAsync | {
"repo_name": "ondrocks/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/bl/MembersManagerBl.java",
"license": "bsd-2-clause",
"size": 49250
} | [
"cz.metacentrum.perun.core.api.Member",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.exceptions.InternalErrorException"
] | import cz.metacentrum.perun.core.api.Member; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.exceptions.InternalErrorException; | import cz.metacentrum.perun.core.api.*; import cz.metacentrum.perun.core.api.exceptions.*; | [
"cz.metacentrum.perun"
] | cz.metacentrum.perun; | 1,304,794 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(
String resourceGroupName, String gatewayName, 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."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (gatewayName == null) {
return Mono.error(new IllegalArgumentException("Parameter gatewayName is required and cannot be null."));
}
final String apiVersion = "2021-05-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.delete(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
gatewayName,
apiVersion,
accept,
context);
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<Flux<ByteBuffer>>> function( String resourceGroupName, String gatewayName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (gatewayName == null) { return Mono.error(new IllegalArgumentException(STR)); } final String apiVersion = STR; final String accept = STR; context = this.client.mergeContext(context); return service .delete( this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, gatewayName, apiVersion, accept, context); } | /**
* Deletes a virtual wan p2s vpn gateway.
*
* @param resourceGroupName The resource group name of the P2SVpnGateway.
* @param gatewayName The name of the gateway.
* @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 {@link Response} on successful completion of {@link Mono}.
*/ | Deletes a virtual wan p2s vpn gateway | deleteWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/P2SVpnGatewaysClientImpl.java",
"license": "mit",
"size": 155308
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"java.nio.ByteBuffer"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import java.nio.ByteBuffer; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import java.nio.*; | [
"com.azure.core",
"java.nio"
] | com.azure.core; java.nio; | 2,353,501 |
public String getExtension(Metadata metadata) {
if (metadata != null) {
// Look for the first registered convenient mapping.
for (final MetadataExtension metadataExtension : this.mappings) {
if (metadata.equals(metadataExtension.getMetadata())) {
return metadataExtension.getName();
}
}
}
return null;
} | String function(Metadata metadata) { if (metadata != null) { for (final MetadataExtension metadataExtension : this.mappings) { if (metadata.equals(metadataExtension.getMetadata())) { return metadataExtension.getName(); } } } return null; } | /**
* Returns the first extension mapping to this metadata.
*
* @param metadata
* The metadata to find.
* @return The first extension mapping to this metadata.
*/ | Returns the first extension mapping to this metadata | getExtension | {
"repo_name": "pecko/debrief",
"path": "org.mwc.asset.comms/docs/restlet_src/org.restlet/org/restlet/service/MetadataService.java",
"license": "epl-1.0",
"size": 27797
} | [
"org.restlet.data.Metadata",
"org.restlet.engine.application.MetadataExtension"
] | import org.restlet.data.Metadata; import org.restlet.engine.application.MetadataExtension; | import org.restlet.data.*; import org.restlet.engine.application.*; | [
"org.restlet.data",
"org.restlet.engine"
] | org.restlet.data; org.restlet.engine; | 1,572,976 |
public static double calcScaleOfVector( Vector3d a, Vector3d b, double imageWidth ) {
Vector3d line = new Vector3d( a.x - b.x, a.y - b.y, a.z - b.z );
// how much meter is one pixel
// scale = the diagonal of one pixel
return ( line.length() / imageWidth ) * MapUtils.SQRT2;
}
| static double function( Vector3d a, Vector3d b, double imageWidth ) { Vector3d line = new Vector3d( a.x - b.x, a.y - b.y, a.z - b.z ); return ( line.length() / imageWidth ) * MapUtils.SQRT2; } | /**
* Calculates the Scale ( = Resolution* sqrt( 2 ) (== diagonal of pixel)) of a Vector between two points on the
* Screen given an imagewidth. That is, how much meter is the Scale of one Pixel in an Image given a certain vector.
*
* @param a
* "from" point
* @param b
* "to" point
* @param imageWidth
* the target imagewidth
* @return the scale on the screen.
*/ | Calculates the Scale ( = Resolution* sqrt( 2 ) (== diagonal of pixel)) of a Vector between two points on the Screen given an imagewidth. That is, how much meter is the Scale of one Pixel in an Image given a certain vector | calcScaleOfVector | {
"repo_name": "lat-lon/deegree2-base",
"path": "deegree2-core/src/main/java/org/deegree/ogcwebservices/wpvs/utils/StripeFactory.java",
"license": "lgpl-2.1",
"size": 47995
} | [
"javax.vecmath.Vector3d",
"org.deegree.framework.util.MapUtils"
] | import javax.vecmath.Vector3d; import org.deegree.framework.util.MapUtils; | import javax.vecmath.*; import org.deegree.framework.util.*; | [
"javax.vecmath",
"org.deegree.framework"
] | javax.vecmath; org.deegree.framework; | 87,831 |
public SceneGraphObject getSceneGraphObject(); | SceneGraphObject function(); | /**
* Get the OpenGL scene graph object representation of this node. This will
* need to be cast to the appropriate parent type when being used.
*
* @return The OpenGL representation.
*/ | Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used | getSceneGraphObject | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/web3d/vrml/renderer/ogl/nodes/OGLVRMLNode.java",
"license": "gpl-2.0",
"size": 1214
} | [
"org.j3d.aviatrix3d.SceneGraphObject"
] | import org.j3d.aviatrix3d.SceneGraphObject; | import org.j3d.aviatrix3d.*; | [
"org.j3d.aviatrix3d"
] | org.j3d.aviatrix3d; | 742,340 |
public Object findByKey(final String key, final Session session, final Class<?> objclass)
throws HibernateException {
final String queryText = objclass.getName() + ".findByKey";
final Query query = session.getNamedQuery(queryText);
query.setString("key", key);
Object uniqueResult = null;
try {
uniqueResult = query.uniqueResult();
}
catch (final NonUniqueResultException e) {
throw new RuntimeException(
"Got non-unique result for " + key + " on " + objclass.getName() + " " + e);
}
return uniqueResult;
} | Object function(final String key, final Session session, final Class<?> objclass) throws HibernateException { final String queryText = objclass.getName() + STR; final Query query = session.getNamedQuery(queryText); query.setString("key", key); Object uniqueResult = null; try { uniqueResult = query.uniqueResult(); } catch (final NonUniqueResultException e) { throw new RuntimeException( STR + key + STR + objclass.getName() + " " + e); } return uniqueResult; } | /**
* Find by key.
*
* @param key
* the key
* @param session
* the session
* @param objclass
* the objclass
* @return the object
* @throws HibernateException
* the hibernate exception @+ aram objclass
*/ | Find by key | findByKey | {
"repo_name": "leonarduk/unison",
"path": "src/main/java/uk/co/sleonard/unison/datahandling/HibernateHelper.java",
"license": "apache-2.0",
"size": 24694
} | [
"org.hibernate.HibernateException",
"org.hibernate.NonUniqueResultException",
"org.hibernate.Query",
"org.hibernate.Session"
] | import org.hibernate.HibernateException; import org.hibernate.NonUniqueResultException; import org.hibernate.Query; import org.hibernate.Session; | import org.hibernate.*; | [
"org.hibernate"
] | org.hibernate; | 187,240 |
public void setLoadingDrawable(Drawable drawable); | void function(Drawable drawable); | /**
* Set the drawable used in the loading layout. This is the same as calling
* <code>setLoadingDrawable(drawable, Mode.BOTH)</code>
*
* @param drawable - Drawable to display
*/ | Set the drawable used in the loading layout. This is the same as calling <code>setLoadingDrawable(drawable, Mode.BOTH)</code> | setLoadingDrawable | {
"repo_name": "Kingjimny/gdmc-mm",
"path": "extra_libs/Android-PullToRefreshLibrary/src/com/handmark/pulltorefresh/library/ILoadingLayout.java",
"license": "apache-2.0",
"size": 1594
} | [
"android.graphics.drawable.Drawable"
] | import android.graphics.drawable.Drawable; | import android.graphics.drawable.*; | [
"android.graphics"
] | android.graphics; | 967,319 |
@Test
public void checkRodAddRem() {
// Note: I only check assembly.getRodLocations() in a few spots
// below since it's a late addition. Further testing may be required.
int size = 10;
// An assembly to test.
ReflectorAssembly assembly = new ReflectorAssembly(10);
// Initialize some rods to add/remove from the assembly.
SFRRod rod1 = new SFRRod();
rod1.setName("Anjie");
SFRRod rod2 = new SFRRod();
rod2.setName("Colin");
SFRRod rod3 = new SFRRod();
rod3.setName("Dish of the Day");
// A List of boundary indexes to test.
List<Integer> boundaryIndexes = new ArrayList<Integer>();
boundaryIndexes.add(-1);
boundaryIndexes.add(0);
boundaryIndexes.add(size - 1);
boundaryIndexes.add(size);
// A set of indexes that will be empty. This makes it easier to check
// rod locations.
Set<Integer> emptyIndexes = new HashSet<Integer>();
for (int i = 0; i < size * size; i++) {
emptyIndexes.add(i);
}
String name;
// Methods to test:
// public boolean addRod(SFRRod rod)
// public boolean removeRod(String name)
// public boolean removeRodFromLocation(int row, int column)
// public ArrayList<String> getRodNames()
// public SFRRod getRodByName(String name)
// public SFRRod getRodByLocation(int row, int column)
// public boolean setRodLocation(String name, int row, int column)
// Check invalid locations.
for (int row : boundaryIndexes) {
for (int column : boundaryIndexes) {
if (row < 0 || row == size || column < 0 || column == size) {
assertNull(assembly.getRodByLocation(row, column));
}
}
}
// Check all valid locations.
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
name = rod1.getName();
// Verify that there is no rod set.
assertNull(assembly.getRodByName(name));
assertEquals(0, assembly.getNumberOfRods());
assertEquals(0, assembly.getRodNames().size());
assertFalse(assembly.getRodNames().contains(name));
// Check all the locations.
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
// addRod
assertFalse(assembly.addRod(null));
// addRod (successful)
assertTrue(assembly.addRod(rod1));
// setRodLocation
assertFalse(assembly.setRodLocation(null, -1, -1));
assertFalse(assembly.setRodLocation(null, 0, 0));
assertFalse(assembly.setRodLocation("Vogons", 0, 0));
assertFalse(assembly.setRodLocation(name, -1, 0));
assertFalse(assembly.setRodLocation(name, 0, size));
// Check setting invalid locations.
for (int row : boundaryIndexes) {
for (int column : boundaryIndexes) {
if (row < 0 || row >= size || column < 0 || column >= size) {
assertFalse(assembly.setRodLocation(name, row, column));
assertNull(assembly.getRodByLocation(row, column));
}
}
}
// setRodLocation (successful)
assertTrue(assembly.setRodLocation(name, 0, 0));
// getNumberOfRods (successful)
assertEquals(1, assembly.getNumberOfRods());
// getRodNames (successful)
assertEquals(1, assembly.getRodNames().size());
assertTrue(assembly.getRodNames().contains(name));
// getRodByName
assertNull(assembly.getRodByName(null));
assertNull(assembly.getRodByName("Vogons"));
// getRodByName (successful)
assertEquals(rod1, assembly.getRodByName(name));
// getRodByLocation
assertNull(assembly.getRodByLocation(-1, -1));
assertNull(assembly.getRodByLocation(-1, 0));
assertNull(assembly.getRodByLocation(0, size));
// getRodByLocation (successful)
assertEquals(rod1, assembly.getRodByLocation(0, 0));
// getRodLocations
assertTrue(assembly.getRodLocations(null).isEmpty());
assertTrue(assembly.getRodLocations("Vogons").isEmpty());
// getRodLocations (successful)
assertEquals(1, assembly.getRodLocations(name).size());
assertTrue(assembly.getRodLocations(name).contains(0));
// removeRodFromLocation
assertFalse(assembly.removeRodFromLocation(-1, -1));
assertFalse(assembly.removeRodFromLocation(-1, 0));
assertFalse(assembly.removeRodFromLocation(0, size));
// removeRodFromLocation (successful)
assertTrue(assembly.removeRodFromLocation(0, 0));
// removeRod
assertFalse(assembly.removeRod(null));
assertFalse(assembly.removeRod("Vogons"));
// removeRod (successful)
assertTrue(assembly.removeRod(name));
// Verify that the rod has been completely removed.
assertNull(assembly.getRodByName(name));
assertEquals(0, assembly.getNumberOfRods());
assertEquals(0, assembly.getRodNames().size());
assertFalse(assembly.getRodNames().contains(name));
// Check all the locations.
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
name = rod1.getName();
assertTrue(assembly.addRod(rod1));
assertFalse(assembly.addRod(rod1));
// Verify that the rod was added.
assertEquals(rod1, assembly.getRodByName(name));
assertEquals(1, assembly.getNumberOfRods());
assertEquals(1, assembly.getRodNames().size());
assertTrue(assembly.getRodNames().contains(name));
// All locations should be empty.
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
assertTrue(assembly.getRodLocations(name).isEmpty());
// The first attempt to set a location should succeed. Subsequent
// attempts to set the same rod in the same location should fail.
// Put it in the first spot.
assertTrue(assembly.setRodLocation(name, 0, 0));
assertFalse(assembly.setRodLocation(name, 0, 0));
emptyIndexes.remove(0);
// Put it in a middle spot.
assertTrue(assembly.setRodLocation(name, 0, 6));
assertFalse(assembly.setRodLocation(name, 0, 6));
emptyIndexes.remove(6);
// Put it in a middle spot.
assertTrue(assembly.setRodLocation(name, 3, 7));
assertFalse(assembly.setRodLocation(name, 3, 7));
emptyIndexes.remove(3 * size + 7);
// Put it in the last spot.
assertTrue(assembly.setRodLocation(name, size - 1, size - 1));
assertFalse(assembly.setRodLocation(name, size - 1, size - 1));
emptyIndexes.remove(size * size - 1);
// Verify the rod locations.
assertEquals(rod1, assembly.getRodByLocation(0, 0));
assertEquals(rod1, assembly.getRodByLocation(0, 6));
assertEquals(rod1, assembly.getRodByLocation(3, 7));
assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1));
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
// We should still be able to get the rod by location.
assertEquals(rod1, assembly.getRodByLocation(0, 0));
// Verify the rod locations (getRodLocations()).
assertEquals(4, assembly.getRodLocations(name).size());
assertTrue(assembly.getRodLocations(name).contains(0));
assertTrue(assembly.getRodLocations(name).contains(0 * size + 6));
assertTrue(assembly.getRodLocations(name).contains(3 * size + 7));
assertTrue(assembly.getRodLocations(name).contains(size * size - 1));
name = rod2.getName();
assertTrue(assembly.addRod(rod2));
assertFalse(assembly.addRod(rod2));
// Verify that the rod was added.
assertEquals(rod2, assembly.getRodByName(name));
assertEquals(2, assembly.getNumberOfRods());
assertEquals(2, assembly.getRodNames().size());
assertTrue(assembly.getRodNames().contains(rod1.getName()));
assertTrue(assembly.getRodNames().contains(name));
// Verify the rod locations.
assertEquals(rod1, assembly.getRodByLocation(0, 0));
assertEquals(rod1, assembly.getRodByLocation(0, 6));
assertEquals(rod1, assembly.getRodByLocation(3, 7));
assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1));
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
// Put it in a new spot.
assertTrue(assembly.setRodLocation(name, 1, 1));
assertFalse(assembly.setRodLocation(name, 1, 1));
emptyIndexes.remove(size + 1);
// Put it in a spot occupied by rod1.
assertTrue(assembly.setRodLocation(name, 3, 7));
assertFalse(assembly.setRodLocation(name, 3, 7));
// Verify the rod locations.
assertEquals(rod1, assembly.getRodByLocation(0, 0));
assertEquals(rod1, assembly.getRodByLocation(0, 6));
assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1));
assertEquals(rod2, assembly.getRodByLocation(1, 1));
assertEquals(rod2, assembly.getRodByLocation(3, 7));
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
name = rod3.getName();
assertTrue(assembly.addRod(rod3));
assertFalse(assembly.addRod(rod3));
// Verify that the rod was added.
assertEquals(rod3, assembly.getRodByName(name));
assertEquals(3, assembly.getNumberOfRods());
assertEquals(3, assembly.getRodNames().size());
assertTrue(assembly.getRodNames().contains(rod1.getName()));
assertTrue(assembly.getRodNames().contains(rod2.getName()));
assertTrue(assembly.getRodNames().contains(name));
// Verify the rod locations.
assertEquals(rod1, assembly.getRodByLocation(0, 0));
assertEquals(rod1, assembly.getRodByLocation(0, 6));
assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1));
assertEquals(rod2, assembly.getRodByLocation(1, 1));
assertEquals(rod2, assembly.getRodByLocation(3, 7));
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
// Put it in a new spot.
assertTrue(assembly.setRodLocation(name, 3, 3));
assertFalse(assembly.setRodLocation(name, 3, 3));
emptyIndexes.remove(3 * size + 3);
// Verify the rod locations.
assertEquals(rod1, assembly.getRodByLocation(0, 0));
assertEquals(rod1, assembly.getRodByLocation(0, 6));
assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1));
assertEquals(rod2, assembly.getRodByLocation(1, 1));
assertEquals(rod2, assembly.getRodByLocation(3, 7));
assertEquals(rod3, assembly.getRodByLocation(3, 3));
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
assertTrue(assembly.removeRodFromLocation(0, 6));
assertFalse(assembly.removeRodFromLocation(0, 6));
emptyIndexes.add(6);
// Verify the rod locations.
assertEquals(rod1, assembly.getRodByLocation(0, 0));
assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1));
assertEquals(rod2, assembly.getRodByLocation(1, 1));
assertEquals(rod2, assembly.getRodByLocation(3, 7));
assertEquals(rod3, assembly.getRodByLocation(3, 3));
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
// Remove rod2 entirely manually.
assertTrue(assembly.removeRodFromLocation(1, 1));
assertFalse(assembly.removeRodFromLocation(1, 1));
emptyIndexes.add(size + 1);
assertTrue(assembly.removeRodFromLocation(3, 7));
assertFalse(assembly.removeRodFromLocation(3, 7));
emptyIndexes.add(3 * size + 7);
// Verify the rod locations.
assertEquals(rod1, assembly.getRodByLocation(0, 0));
assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1));
assertEquals(rod3, assembly.getRodByLocation(3, 3));
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
// Verify the rod locations (getRodLocations()).
assertEquals(2, assembly.getRodLocations(rod1.getName()).size());
assertTrue(assembly.getRodLocations(rod1.getName()).contains(0));
assertTrue(assembly.getRodLocations(rod1.getName()).contains(
size * size - 1));
// rod2 should still be in the assembly, though.
// Verify the rods stored in the assembly.
assertEquals(rod1, assembly.getRodByName(rod1.getName()));
assertEquals(rod2, assembly.getRodByName(rod2.getName()));
assertEquals(rod3, assembly.getRodByName(rod3.getName()));
assertEquals(3, assembly.getNumberOfRods());
assertEquals(3, assembly.getRodNames().size());
assertTrue(assembly.getRodNames().contains(rod1.getName()));
assertTrue(assembly.getRodNames().contains(rod2.getName()));
assertTrue(assembly.getRodNames().contains(rod3.getName()));
assertTrue(assembly.removeRod(rod1.getName()));
assertFalse(assembly.removeRod(rod1.getName()));
emptyIndexes.add(0);
emptyIndexes.add(size * size - 1);
// Verify the rod locations.
assertEquals(rod3, assembly.getRodByLocation(3, 3));
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
// rod1 should not have any locations. In fact, since the rod is not in
// the assembly, this returns an empty List.
assertTrue(assembly.getRodLocations(rod1.getName()).isEmpty());
// Verify the rods stored in the assembly.
assertNull(assembly.getRodByName(rod1.getName()));
assertEquals(rod2, assembly.getRodByName(rod2.getName()));
assertEquals(rod3, assembly.getRodByName(rod3.getName()));
assertEquals(2, assembly.getNumberOfRods());
assertEquals(2, assembly.getRodNames().size());
assertFalse(assembly.getRodNames().contains(rod1.getName()));
assertTrue(assembly.getRodNames().contains(rod2.getName()));
assertTrue(assembly.getRodNames().contains(rod3.getName()));
assertFalse(assembly.removeRod(rod1.getName()));
assertTrue(assembly.removeRod(rod2.getName()));
assertFalse(assembly.removeRod(rod2.getName()));
assertTrue(assembly.removeRod(rod3.getName()));
assertFalse(assembly.removeRod(rod3.getName()));
// Add the last rod location back to the empty index set.
emptyIndexes.add(size * 3 + 3);
// Verify the rod locations.
for (int i : emptyIndexes) {
assertNull(assembly.getRodByLocation(i / size, i % size));
}
// Verify the rods stored in the assembly.
assertNull(assembly.getRodByName(rod1.getName()));
assertNull(assembly.getRodByName(rod2.getName()));
assertNull(assembly.getRodByName(rod3.getName()));
assertEquals(0, assembly.getNumberOfRods());
assertEquals(0, assembly.getRodNames().size());
return;
} | void function() { int size = 10; ReflectorAssembly assembly = new ReflectorAssembly(10); SFRRod rod1 = new SFRRod(); rod1.setName("Anjie"); SFRRod rod2 = new SFRRod(); rod2.setName("Colin"); SFRRod rod3 = new SFRRod(); rod3.setName(STR); List<Integer> boundaryIndexes = new ArrayList<Integer>(); boundaryIndexes.add(-1); boundaryIndexes.add(0); boundaryIndexes.add(size - 1); boundaryIndexes.add(size); Set<Integer> emptyIndexes = new HashSet<Integer>(); for (int i = 0; i < size * size; i++) { emptyIndexes.add(i); } String name; for (int row : boundaryIndexes) { for (int column : boundaryIndexes) { if (row < 0 row == size column < 0 column == size) { assertNull(assembly.getRodByLocation(row, column)); } } } for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } name = rod1.getName(); assertNull(assembly.getRodByName(name)); assertEquals(0, assembly.getNumberOfRods()); assertEquals(0, assembly.getRodNames().size()); assertFalse(assembly.getRodNames().contains(name)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertFalse(assembly.addRod(null)); assertTrue(assembly.addRod(rod1)); assertFalse(assembly.setRodLocation(null, -1, -1)); assertFalse(assembly.setRodLocation(null, 0, 0)); assertFalse(assembly.setRodLocation(STR, 0, 0)); assertFalse(assembly.setRodLocation(name, -1, 0)); assertFalse(assembly.setRodLocation(name, 0, size)); for (int row : boundaryIndexes) { for (int column : boundaryIndexes) { if (row < 0 row >= size column < 0 column >= size) { assertFalse(assembly.setRodLocation(name, row, column)); assertNull(assembly.getRodByLocation(row, column)); } } } assertTrue(assembly.setRodLocation(name, 0, 0)); assertEquals(1, assembly.getNumberOfRods()); assertEquals(1, assembly.getRodNames().size()); assertTrue(assembly.getRodNames().contains(name)); assertNull(assembly.getRodByName(null)); assertNull(assembly.getRodByName(STR)); assertEquals(rod1, assembly.getRodByName(name)); assertNull(assembly.getRodByLocation(-1, -1)); assertNull(assembly.getRodByLocation(-1, 0)); assertNull(assembly.getRodByLocation(0, size)); assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertTrue(assembly.getRodLocations(null).isEmpty()); assertTrue(assembly.getRodLocations(STR).isEmpty()); assertEquals(1, assembly.getRodLocations(name).size()); assertTrue(assembly.getRodLocations(name).contains(0)); assertFalse(assembly.removeRodFromLocation(-1, -1)); assertFalse(assembly.removeRodFromLocation(-1, 0)); assertFalse(assembly.removeRodFromLocation(0, size)); assertTrue(assembly.removeRodFromLocation(0, 0)); assertFalse(assembly.removeRod(null)); assertFalse(assembly.removeRod(STR)); assertTrue(assembly.removeRod(name)); assertNull(assembly.getRodByName(name)); assertEquals(0, assembly.getNumberOfRods()); assertEquals(0, assembly.getRodNames().size()); assertFalse(assembly.getRodNames().contains(name)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } name = rod1.getName(); assertTrue(assembly.addRod(rod1)); assertFalse(assembly.addRod(rod1)); assertEquals(rod1, assembly.getRodByName(name)); assertEquals(1, assembly.getNumberOfRods()); assertEquals(1, assembly.getRodNames().size()); assertTrue(assembly.getRodNames().contains(name)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertTrue(assembly.getRodLocations(name).isEmpty()); assertTrue(assembly.setRodLocation(name, 0, 0)); assertFalse(assembly.setRodLocation(name, 0, 0)); emptyIndexes.remove(0); assertTrue(assembly.setRodLocation(name, 0, 6)); assertFalse(assembly.setRodLocation(name, 0, 6)); emptyIndexes.remove(6); assertTrue(assembly.setRodLocation(name, 3, 7)); assertFalse(assembly.setRodLocation(name, 3, 7)); emptyIndexes.remove(3 * size + 7); assertTrue(assembly.setRodLocation(name, size - 1, size - 1)); assertFalse(assembly.setRodLocation(name, size - 1, size - 1)); emptyIndexes.remove(size * size - 1); assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertEquals(rod1, assembly.getRodByLocation(0, 6)); assertEquals(rod1, assembly.getRodByLocation(3, 7)); assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertEquals(4, assembly.getRodLocations(name).size()); assertTrue(assembly.getRodLocations(name).contains(0)); assertTrue(assembly.getRodLocations(name).contains(0 * size + 6)); assertTrue(assembly.getRodLocations(name).contains(3 * size + 7)); assertTrue(assembly.getRodLocations(name).contains(size * size - 1)); name = rod2.getName(); assertTrue(assembly.addRod(rod2)); assertFalse(assembly.addRod(rod2)); assertEquals(rod2, assembly.getRodByName(name)); assertEquals(2, assembly.getNumberOfRods()); assertEquals(2, assembly.getRodNames().size()); assertTrue(assembly.getRodNames().contains(rod1.getName())); assertTrue(assembly.getRodNames().contains(name)); assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertEquals(rod1, assembly.getRodByLocation(0, 6)); assertEquals(rod1, assembly.getRodByLocation(3, 7)); assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertTrue(assembly.setRodLocation(name, 1, 1)); assertFalse(assembly.setRodLocation(name, 1, 1)); emptyIndexes.remove(size + 1); assertTrue(assembly.setRodLocation(name, 3, 7)); assertFalse(assembly.setRodLocation(name, 3, 7)); assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertEquals(rod1, assembly.getRodByLocation(0, 6)); assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1)); assertEquals(rod2, assembly.getRodByLocation(1, 1)); assertEquals(rod2, assembly.getRodByLocation(3, 7)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } name = rod3.getName(); assertTrue(assembly.addRod(rod3)); assertFalse(assembly.addRod(rod3)); assertEquals(rod3, assembly.getRodByName(name)); assertEquals(3, assembly.getNumberOfRods()); assertEquals(3, assembly.getRodNames().size()); assertTrue(assembly.getRodNames().contains(rod1.getName())); assertTrue(assembly.getRodNames().contains(rod2.getName())); assertTrue(assembly.getRodNames().contains(name)); assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertEquals(rod1, assembly.getRodByLocation(0, 6)); assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1)); assertEquals(rod2, assembly.getRodByLocation(1, 1)); assertEquals(rod2, assembly.getRodByLocation(3, 7)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertTrue(assembly.setRodLocation(name, 3, 3)); assertFalse(assembly.setRodLocation(name, 3, 3)); emptyIndexes.remove(3 * size + 3); assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertEquals(rod1, assembly.getRodByLocation(0, 6)); assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1)); assertEquals(rod2, assembly.getRodByLocation(1, 1)); assertEquals(rod2, assembly.getRodByLocation(3, 7)); assertEquals(rod3, assembly.getRodByLocation(3, 3)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertTrue(assembly.removeRodFromLocation(0, 6)); assertFalse(assembly.removeRodFromLocation(0, 6)); emptyIndexes.add(6); assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1)); assertEquals(rod2, assembly.getRodByLocation(1, 1)); assertEquals(rod2, assembly.getRodByLocation(3, 7)); assertEquals(rod3, assembly.getRodByLocation(3, 3)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertTrue(assembly.removeRodFromLocation(1, 1)); assertFalse(assembly.removeRodFromLocation(1, 1)); emptyIndexes.add(size + 1); assertTrue(assembly.removeRodFromLocation(3, 7)); assertFalse(assembly.removeRodFromLocation(3, 7)); emptyIndexes.add(3 * size + 7); assertEquals(rod1, assembly.getRodByLocation(0, 0)); assertEquals(rod1, assembly.getRodByLocation(size - 1, size - 1)); assertEquals(rod3, assembly.getRodByLocation(3, 3)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertEquals(2, assembly.getRodLocations(rod1.getName()).size()); assertTrue(assembly.getRodLocations(rod1.getName()).contains(0)); assertTrue(assembly.getRodLocations(rod1.getName()).contains( size * size - 1)); assertEquals(rod1, assembly.getRodByName(rod1.getName())); assertEquals(rod2, assembly.getRodByName(rod2.getName())); assertEquals(rod3, assembly.getRodByName(rod3.getName())); assertEquals(3, assembly.getNumberOfRods()); assertEquals(3, assembly.getRodNames().size()); assertTrue(assembly.getRodNames().contains(rod1.getName())); assertTrue(assembly.getRodNames().contains(rod2.getName())); assertTrue(assembly.getRodNames().contains(rod3.getName())); assertTrue(assembly.removeRod(rod1.getName())); assertFalse(assembly.removeRod(rod1.getName())); emptyIndexes.add(0); emptyIndexes.add(size * size - 1); assertEquals(rod3, assembly.getRodByLocation(3, 3)); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertTrue(assembly.getRodLocations(rod1.getName()).isEmpty()); assertNull(assembly.getRodByName(rod1.getName())); assertEquals(rod2, assembly.getRodByName(rod2.getName())); assertEquals(rod3, assembly.getRodByName(rod3.getName())); assertEquals(2, assembly.getNumberOfRods()); assertEquals(2, assembly.getRodNames().size()); assertFalse(assembly.getRodNames().contains(rod1.getName())); assertTrue(assembly.getRodNames().contains(rod2.getName())); assertTrue(assembly.getRodNames().contains(rod3.getName())); assertFalse(assembly.removeRod(rod1.getName())); assertTrue(assembly.removeRod(rod2.getName())); assertFalse(assembly.removeRod(rod2.getName())); assertTrue(assembly.removeRod(rod3.getName())); assertFalse(assembly.removeRod(rod3.getName())); emptyIndexes.add(size * 3 + 3); for (int i : emptyIndexes) { assertNull(assembly.getRodByLocation(i / size, i % size)); } assertNull(assembly.getRodByName(rod1.getName())); assertNull(assembly.getRodByName(rod2.getName())); assertNull(assembly.getRodByName(rod3.getName())); assertEquals(0, assembly.getNumberOfRods()); assertEquals(0, assembly.getRodNames().size()); return; } | /**
* <p>
* Tests the addition and removal of SFRRods in the ReflectorAssembly.
* </p>
*
*/ | Tests the addition and removal of SFRRods in the ReflectorAssembly. | checkRodAddRem | {
"repo_name": "SmithRWORNL/ice",
"path": "tests/org.eclipse.ice.reactor.sfr.test/src/org/eclipse/ice/reactor/sfr/test/ReflectorAssemblyTester.java",
"license": "epl-1.0",
"size": 29897
} | [
"java.util.ArrayList",
"java.util.HashSet",
"java.util.List",
"java.util.Set",
"org.eclipse.ice.reactor.sfr.core.assembly.ReflectorAssembly",
"org.eclipse.ice.reactor.sfr.core.assembly.SFRRod",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.eclipse.ice.reactor.sfr.core.assembly.ReflectorAssembly; import org.eclipse.ice.reactor.sfr.core.assembly.SFRRod; import org.junit.Assert; | import java.util.*; import org.eclipse.ice.reactor.sfr.core.assembly.*; import org.junit.*; | [
"java.util",
"org.eclipse.ice",
"org.junit"
] | java.util; org.eclipse.ice; org.junit; | 1,831,168 |
public static DateTime newDateTime(int year, int month, int day) {
return newDateTime(newDate(year, month, day), 0, 0, 0);
} | static DateTime function(int year, int month, int day) { return newDateTime(newDate(year, month, day), 0, 0, 0); } | /**
* Creates new {@code DateTime} from given information. Time is set to 00:00:00.
*
* @param year the year to be stored
* @param month the month to be stored
* @param day the day to be stored
* @return the new {@code DateTime} instance
*/ | Creates new DateTime from given information. Time is set to 00:00:00 | newDateTime | {
"repo_name": "sebbrudzinski/motech",
"path": "platform/commons-date/src/main/java/org/motechproject/commons/date/util/DateUtil.java",
"license": "bsd-3-clause",
"size": 16668
} | [
"org.joda.time.DateTime"
] | import org.joda.time.DateTime; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 2,401,390 |
File dbFile = context.getDatabasePath(databaseName);
if (dbFile != null && !dbFile.exists()) {
try {
copyDatabase(dbFile);
} catch (IOException e) {
throw new RuntimeException("Error creating source database", e);
}
}
return SQLiteDatabase.openDatabase(dbFile.getPath(), null, SQLiteDatabase.OPEN_READWRITE);
} | File dbFile = context.getDatabasePath(databaseName); if (dbFile != null && !dbFile.exists()) { try { copyDatabase(dbFile); } catch (IOException e) { throw new RuntimeException(STR, e); } } return SQLiteDatabase.openDatabase(dbFile.getPath(), null, SQLiteDatabase.OPEN_READWRITE); } | /**
* Create and/or open a database that will be used for reading and writing.
*
* @return
* @throws RuntimeException if cannot copy database from assets
* @throws SQLiteException if the database cannot be opened
*/ | Create and/or open a database that will be used for reading and writing | getWritableDatabase | {
"repo_name": "yuhuayi/HexExamples",
"path": "newbee/src/main/java/app/newbee/lib/util/AssetDatabaseOpenHelper.java",
"license": "mit",
"size": 2772
} | [
"android.database.sqlite.SQLiteDatabase",
"java.io.File",
"java.io.IOException"
] | import android.database.sqlite.SQLiteDatabase; import java.io.File; import java.io.IOException; | import android.database.sqlite.*; import java.io.*; | [
"android.database",
"java.io"
] | android.database; java.io; | 1,255,539 |
@Override
public void setPartitionFilter(Expression arg0) throws IOException {
} | void function(Expression arg0) throws IOException { } | /**
* NOT IMPLEMENTED
*/ | NOT IMPLEMENTED | setPartitionFilter | {
"repo_name": "canojim/elephant-bird",
"path": "pig/src/main/java/com/twitter/elephantbird/pig/load/LzoW3CLogLoader.java",
"license": "apache-2.0",
"size": 3840
} | [
"java.io.IOException",
"org.apache.pig.Expression"
] | import java.io.IOException; import org.apache.pig.Expression; | import java.io.*; import org.apache.pig.*; | [
"java.io",
"org.apache.pig"
] | java.io; org.apache.pig; | 91,834 |
public static ClickInventoryEvent.Drag createClickInventoryEventDrag(Cause cause, Transaction<ItemStackSnapshot> cursorTransaction, Container targetInventory, List<SlotTransaction> transactions) {
HashMap<String, Object> values = new HashMap<>();
values.put("cause", cause);
values.put("cursorTransaction", cursorTransaction);
values.put("targetInventory", targetInventory);
values.put("transactions", transactions);
return SpongeEventFactoryUtils.createEventImpl(ClickInventoryEvent.Drag.class, values);
} | static ClickInventoryEvent.Drag function(Cause cause, Transaction<ItemStackSnapshot> cursorTransaction, Container targetInventory, List<SlotTransaction> transactions) { HashMap<String, Object> values = new HashMap<>(); values.put("cause", cause); values.put(STR, cursorTransaction); values.put(STR, targetInventory); values.put(STR, transactions); return SpongeEventFactoryUtils.createEventImpl(ClickInventoryEvent.Drag.class, values); } | /**
* AUTOMATICALLY GENERATED, DO NOT EDIT.
* Creates a new instance of
* {@link org.spongepowered.api.event.item.inventory.ClickInventoryEvent.Drag}.
*
* @param cause The cause
* @param cursorTransaction The cursor transaction
* @param targetInventory The target inventory
* @param transactions The transactions
* @return A new drag click inventory event
*/ | AUTOMATICALLY GENERATED, DO NOT EDIT. Creates a new instance of <code>org.spongepowered.api.event.item.inventory.ClickInventoryEvent.Drag</code> | createClickInventoryEventDrag | {
"repo_name": "kashike/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/event/SpongeEventFactory.java",
"license": "mit",
"size": 215110
} | [
"java.util.HashMap",
"java.util.List",
"org.spongepowered.api.data.Transaction",
"org.spongepowered.api.event.cause.Cause",
"org.spongepowered.api.event.item.inventory.ClickInventoryEvent",
"org.spongepowered.api.item.inventory.Container",
"org.spongepowered.api.item.inventory.ItemStackSnapshot",
"org.spongepowered.api.item.inventory.transaction.SlotTransaction"
] | import java.util.HashMap; import java.util.List; import org.spongepowered.api.data.Transaction; import org.spongepowered.api.event.cause.Cause; import org.spongepowered.api.event.item.inventory.ClickInventoryEvent; import org.spongepowered.api.item.inventory.Container; import org.spongepowered.api.item.inventory.ItemStackSnapshot; import org.spongepowered.api.item.inventory.transaction.SlotTransaction; | import java.util.*; import org.spongepowered.api.data.*; import org.spongepowered.api.event.cause.*; import org.spongepowered.api.event.item.inventory.*; import org.spongepowered.api.item.inventory.*; import org.spongepowered.api.item.inventory.transaction.*; | [
"java.util",
"org.spongepowered.api"
] | java.util; org.spongepowered.api; | 1,946,770 |
public void setBackgroundBaseColor(int backgroundBaseColor) {
this.backgroundBaseColor = backgroundBaseColor;
invalidate();
}
/**
* Set a text color for month names.
* Supported formats See {@link Color#parseColor(String)} | void function(int backgroundBaseColor) { this.backgroundBaseColor = backgroundBaseColor; invalidate(); } /** * Set a text color for month names. * Supported formats See {@link Color#parseColor(String)} | /**
* Sets the background color for this contributions view.
*
* @param backgroundBaseColor
* the color of the background
*/ | Sets the background color for this contributions view | setBackgroundBaseColor | {
"repo_name": "k0shk0sh/FastHub",
"path": "app/src/main/java/com/fastaccess/ui/widgets/contributions/GitHubContributionsView.java",
"license": "gpl-3.0",
"size": 13583
} | [
"android.graphics.Color"
] | import android.graphics.Color; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 1,764,050 |
public Collection getTemplateList()
{
try
{
AssessmentService delegate = new AssessmentService();
ArrayList list = delegate.getBasicInfoOfAllActiveAssessmentTemplates("title");
//ArrayList list = delegate.getAllAssessmentTemplates();
ArrayList templates = new ArrayList();
Iterator iter = list.iterator();
while (iter.hasNext())
{
AssessmentTemplateFacade facade =
(AssessmentTemplateFacade) iter.next();
TemplateBean bean = new TemplateBean();
bean.setTemplateName(facade.getTitle());
bean.setIdString(facade.getAssessmentBaseId().toString());
bean.setLastModified(facade.getLastModifiedDate().toString());
templates.add(bean);
}
this.templateList = templates;
} catch (Exception e) {
e.printStackTrace();
templateList = new ArrayList();
}
return this.templateList;
} | Collection function() { try { AssessmentService delegate = new AssessmentService(); ArrayList list = delegate.getBasicInfoOfAllActiveAssessmentTemplates("title"); ArrayList templates = new ArrayList(); Iterator iter = list.iterator(); while (iter.hasNext()) { AssessmentTemplateFacade facade = (AssessmentTemplateFacade) iter.next(); TemplateBean bean = new TemplateBean(); bean.setTemplateName(facade.getTitle()); bean.setIdString(facade.getAssessmentBaseId().toString()); bean.setLastModified(facade.getLastModifiedDate().toString()); templates.add(bean); } this.templateList = templates; } catch (Exception e) { e.printStackTrace(); templateList = new ArrayList(); } return this.templateList; } | /**
* DOCUMENTATION PENDING
*
* @return DOCUMENTATION PENDING
*/ | DOCUMENTATION PENDING | getTemplateList | {
"repo_name": "rodriguezdevera/sakai",
"path": "samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/IndexBean.java",
"license": "apache-2.0",
"size": 6561
} | [
"java.util.ArrayList",
"java.util.Collection",
"java.util.Iterator",
"org.sakaiproject.tool.assessment.facade.AssessmentTemplateFacade",
"org.sakaiproject.tool.assessment.services.assessment.AssessmentService"
] | import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import org.sakaiproject.tool.assessment.facade.AssessmentTemplateFacade; import org.sakaiproject.tool.assessment.services.assessment.AssessmentService; | import java.util.*; import org.sakaiproject.tool.assessment.facade.*; import org.sakaiproject.tool.assessment.services.assessment.*; | [
"java.util",
"org.sakaiproject.tool"
] | java.util; org.sakaiproject.tool; | 1,312,750 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
mySqlHostDatabaseSettingLabel = new javax.swing.JLabel();
mySqlHostDatabaseSettingTextField = new javax.swing.JTextField();
mySqlUserNameDatabaseSettingLabel = new javax.swing.JLabel();
mySqlUserNameDatabaseSettingTextField = new javax.swing.JTextField();
mySqlPasswordDatabaseSettingLabel = new javax.swing.JLabel();
mySqlPasswordDatabaseSettingTextField = new javax.swing.JPasswordField();
jSeparator1 = new javax.swing.JSeparator();
databaseSettingLabel = new javax.swing.JLabel();
saveSettingsButton = new javax.swing.JButton();
cancelSettingButton = new javax.swing.JButton();
mySqlDatabaseNameDatabaseSettingTextField = new javax.swing.JTextField();
mySqlDatabaseNameDatabaseSettingLabel = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jSeparator2 = new javax.swing.JSeparator();
displayLanguageSettingLabel = new javax.swing.JLabel();
displayLanguageSettingComboBox = new javax.swing.JComboBox<>();
setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
mySqlHostDatabaseSettingLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
mySqlHostDatabaseSettingLabel.setText("MySQL Hostname");
mySqlUserNameDatabaseSettingLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
mySqlUserNameDatabaseSettingLabel.setText("UserName"); | @SuppressWarnings(STR) void function() { mySqlHostDatabaseSettingLabel = new javax.swing.JLabel(); mySqlHostDatabaseSettingTextField = new javax.swing.JTextField(); mySqlUserNameDatabaseSettingLabel = new javax.swing.JLabel(); mySqlUserNameDatabaseSettingTextField = new javax.swing.JTextField(); mySqlPasswordDatabaseSettingLabel = new javax.swing.JLabel(); mySqlPasswordDatabaseSettingTextField = new javax.swing.JPasswordField(); jSeparator1 = new javax.swing.JSeparator(); databaseSettingLabel = new javax.swing.JLabel(); saveSettingsButton = new javax.swing.JButton(); cancelSettingButton = new javax.swing.JButton(); mySqlDatabaseNameDatabaseSettingTextField = new javax.swing.JTextField(); mySqlDatabaseNameDatabaseSettingLabel = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jSeparator2 = new javax.swing.JSeparator(); displayLanguageSettingLabel = new javax.swing.JLabel(); displayLanguageSettingComboBox = new javax.swing.JComboBox<>(); setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); mySqlHostDatabaseSettingLabel.setFont(new java.awt.Font(STR, 0, 12)); mySqlHostDatabaseSettingLabel.setText(STR); mySqlUserNameDatabaseSettingLabel.setFont(new java.awt.Font(STR, 0, 12)); mySqlUserNameDatabaseSettingLabel.setText(STR); | /**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/ | This method is called from within the constructor to initialize the form. regenerated by the Form Editor | initComponents | {
"repo_name": "benzyaa/javaapplication",
"path": "FreeBasicAccountManagement/src/main/java/com/freebasicacc/ui/SettingsInternalPanel.java",
"license": "bsd-3-clause",
"size": 18236
} | [
"javax.swing.JComboBox",
"javax.swing.JPasswordField",
"javax.swing.JTextField"
] | import javax.swing.JComboBox; import javax.swing.JPasswordField; import javax.swing.JTextField; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 362,918 |
public void testAbstractMethodPy3AddMeta() {
runWithLanguageLevel(LanguageLevel.PYTHON34, () -> checkAbstract(".my_method", ".my_class_method"));
} | void function() { runWithLanguageLevel(LanguageLevel.PYTHON34, () -> checkAbstract(STR, STR)); } | /**
* Ensures that pulling abstract method up to class that has NO ABCMeta works correctly for py3k (metaclass is added)
*/ | Ensures that pulling abstract method up to class that has NO ABCMeta works correctly for py3k (metaclass is added) | testAbstractMethodPy3AddMeta | {
"repo_name": "paplorinc/intellij-community",
"path": "python/testSrc/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpTest.java",
"license": "apache-2.0",
"size": 6079
} | [
"com.jetbrains.python.psi.LanguageLevel"
] | import com.jetbrains.python.psi.LanguageLevel; | import com.jetbrains.python.psi.*; | [
"com.jetbrains.python"
] | com.jetbrains.python; | 321,463 |
public static boolean checkAuthHeader(String authHeader) {
String url;
RESTResponse restResponse;
url= GeneralSettings.getXCodeBaseURL()+"bots";
try {
HashMap<String,String> headers=new HashMap<String,String>();
headers.put("Authorization",authHeader);
restResponse = RESTClient.sendHttpRequest(HTTPMethod.GET, url, headers, null);
return (1==restResponse.getStatusCode()/200);
}
catch (Exception e)
{
return false;
}
} | static boolean function(String authHeader) { String url; RESTResponse restResponse; url= GeneralSettings.getXCodeBaseURL()+"bots"; try { HashMap<String,String> headers=new HashMap<String,String>(); headers.put(STR,authHeader); restResponse = RESTClient.sendHttpRequest(HTTPMethod.GET, url, headers, null); return (1==restResponse.getStatusCode()/200); } catch (Exception e) { return false; } } | /**
* Check if an Authorization header are valid
* @param authHeader Authorization header
* @return true if header is valid, otherwise false.
*/ | Check if an Authorization header are valid | checkAuthHeader | {
"repo_name": "DLTAStudio/xwebic",
"path": "src/ServerWS/src/main/java/com/dltastudio/ws/TokenWS.java",
"license": "apache-2.0",
"size": 4815
} | [
"com.dltastudio.services.GeneralSettings",
"com.dltastudio.services.HTTPMethod",
"com.dltastudio.services.RESTClient",
"com.dltastudio.services.RESTResponse",
"java.util.HashMap"
] | import com.dltastudio.services.GeneralSettings; import com.dltastudio.services.HTTPMethod; import com.dltastudio.services.RESTClient; import com.dltastudio.services.RESTResponse; import java.util.HashMap; | import com.dltastudio.services.*; import java.util.*; | [
"com.dltastudio.services",
"java.util"
] | com.dltastudio.services; java.util; | 2,071,797 |
public void setFilters(final Collection<PotenzialflaecheSearch.FilterInfo> filters) {
jPanel1.removeAll();
if (filters != null) {
for (final PotenzialflaecheSearch.FilterInfo filter : filters) {
final PotenzialflaechenWindowSearchSubPanel sub = new PotenzialflaechenWindowSearchSubPanel(this);
sub.initWithConnectionContext(getConnectionContext());
sub.setFilter(filter);
jPanel1.add(sub);
}
}
} | void function(final Collection<PotenzialflaecheSearch.FilterInfo> filters) { jPanel1.removeAll(); if (filters != null) { for (final PotenzialflaecheSearch.FilterInfo filter : filters) { final PotenzialflaechenWindowSearchSubPanel sub = new PotenzialflaechenWindowSearchSubPanel(this); sub.initWithConnectionContext(getConnectionContext()); sub.setFilter(filter); jPanel1.add(sub); } } } | /**
* DOCUMENT ME!
*
* @param filters DOCUMENT ME!
*/ | DOCUMENT ME | setFilters | {
"repo_name": "cismet/cids-custom-wuppertal",
"path": "src/main/java/de/cismet/cids/custom/wunda_blau/search/PotenzialflaechenWindowSearchPanel.java",
"license": "lgpl-3.0",
"size": 14155
} | [
"de.cismet.cids.custom.wunda_blau.search.server.PotenzialflaecheSearch",
"java.util.Collection"
] | import de.cismet.cids.custom.wunda_blau.search.server.PotenzialflaecheSearch; import java.util.Collection; | import de.cismet.cids.custom.wunda_blau.search.server.*; import java.util.*; | [
"de.cismet.cids",
"java.util"
] | de.cismet.cids; java.util; | 2,050,438 |
public void invalidateAll(Predicate<? super P> predicate) {
final Set<AuthorizationContext<P>> keys = cache.asMap().keySet().stream()
.filter(cacheKey -> predicate.test(cacheKey.getPrincipal()))
.collect(Collectors.toSet());
cache.invalidateAll(keys);
} | void function(Predicate<? super P> predicate) { final Set<AuthorizationContext<P>> keys = cache.asMap().keySet().stream() .filter(cacheKey -> predicate.test(cacheKey.getPrincipal())) .collect(Collectors.toSet()); cache.invalidateAll(keys); } | /**
* Discards any cached role associations for principals satisfying
* the given predicate.
*
* @param predicate a predicate to filter credentials
*/ | Discards any cached role associations for principals satisfying the given predicate | invalidateAll | {
"repo_name": "mosoft521/dropwizard",
"path": "dropwizard-auth/src/main/java/io/dropwizard/auth/CachingAuthorizer.java",
"license": "apache-2.0",
"size": 6445
} | [
"java.util.Set",
"java.util.function.Predicate",
"java.util.stream.Collectors"
] | import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; | import java.util.*; import java.util.function.*; import java.util.stream.*; | [
"java.util"
] | java.util; | 1,432,235 |
@Override
public Graphics create() {
return new WPathGraphics((Graphics2D) getDelegate().create(),
getPrinterJob(),
getPrintable(),
getPageFormat(),
getPageIndex(),
canDoRedraws());
} | Graphics function() { return new WPathGraphics((Graphics2D) getDelegate().create(), getPrinterJob(), getPrintable(), getPageFormat(), getPageIndex(), canDoRedraws()); } | /**
* Creates a new <code>Graphics</code> object that is
* a copy of this <code>Graphics</code> object.
* @return a new graphics context that is a copy of
* this graphics context.
* @since 1.0
*/ | Creates a new <code>Graphics</code> object that is a copy of this <code>Graphics</code> object | create | {
"repo_name": "isaacl/openjdk-jdk",
"path": "src/windows/classes/sun/awt/windows/WPathGraphics.java",
"license": "gpl-2.0",
"size": 75305
} | [
"java.awt.Graphics",
"java.awt.Graphics2D"
] | import java.awt.Graphics; import java.awt.Graphics2D; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,836,792 |
protected boolean handleDirtyConflict() {
return
MessageDialog.openQuestion
(getSite().getShell(),
getString("_UI_FileConflict_label"),
getString("_WARN_FileConflict"));
}
public XsdRulesEditor() {
super();
initializeEditingDomain();
}
| boolean function() { return MessageDialog.openQuestion (getSite().getShell(), getString(STR), getString(STR)); } public XsdRulesEditor() { super(); initializeEditingDomain(); } | /**
* Shows a dialog that asks if conflicting changes should be discarded.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Shows a dialog that asks if conflicting changes should be discarded. | handleDirtyConflict | {
"repo_name": "TristanFAURE/oclCheckTool",
"path": "plugins/org.topcased.checktool.xsdrules.editor/src/org/topcased/checktool/xsdrules/xsdRules/presentation/XsdRulesEditor.java",
"license": "epl-1.0",
"size": 55302
} | [
"org.eclipse.jface.dialogs.MessageDialog"
] | import org.eclipse.jface.dialogs.MessageDialog; | import org.eclipse.jface.dialogs.*; | [
"org.eclipse.jface"
] | org.eclipse.jface; | 107,418 |
public void addInternalError(File file, String message) {
addInternalError(new FileLocation(file), message);
} | void function(File file, String message) { addInternalError(new FileLocation(file), message); } | /**
* Adds an internal error message to the log. Internal errors are
* only issued when possible bugs are encountered. They are
* counted as errors.
*
* @param file the file affected
* @param message the error message
*/ | Adds an internal error message to the log. Internal errors are only issued when possible bugs are encountered. They are counted as errors | addInternalError | {
"repo_name": "tmoskun/JSNMPWalker",
"path": "lib/mibble-2.9.3/src/java/net/percederberg/mibble/MibLoaderLog.java",
"license": "gpl-3.0",
"size": 13850
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,746,099 |
public void deleteKv(com.actiontech.dble.alarm.UcoreInterface.DeleteKvInput request,
io.grpc.stub.StreamObserver<com.actiontech.dble.alarm.UcoreInterface.Empty> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_DELETE_KV, getCallOptions()), request, responseObserver);
} | void function(com.actiontech.dble.alarm.UcoreInterface.DeleteKvInput request, io.grpc.stub.StreamObserver<com.actiontech.dble.alarm.UcoreInterface.Empty> responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_DELETE_KV, getCallOptions()), request, responseObserver); } | /**
* <pre>
* DeleteKv guarantee atomic.
* </pre>
*/ | <code> DeleteKv guarantee atomic. </code> | deleteKv | {
"repo_name": "actiontech/dble",
"path": "src/main/java/com/actiontech/dble/alarm/UcoreGrpc.java",
"license": "gpl-2.0",
"size": 134635
} | [
"io.grpc.stub.ClientCalls",
"io.grpc.stub.ServerCalls"
] | import io.grpc.stub.ClientCalls; import io.grpc.stub.ServerCalls; | import io.grpc.stub.*; | [
"io.grpc.stub"
] | io.grpc.stub; | 1,859,857 |
@Override
public Deferred<Boolean> call(ArrayList<Object> validated)
throws Exception {
return getFromStorage(tsdb, UniqueId.stringToUid(tsuid))
.addCallbackDeferring(new StoreCB());
}
}
// Begins the callback chain by validating that the UID mappings exist
return Deferred.group(uid_group).addCallbackDeferring(new ValidateCB(this));
} | Deferred<Boolean> function(ArrayList<Object> validated) throws Exception { return getFromStorage(tsdb, UniqueId.stringToUid(tsuid)) .addCallbackDeferring(new StoreCB()); } } return Deferred.group(uid_group).addCallbackDeferring(new ValidateCB(this)); } | /**
* Called on UID mapping verification and continues executing the CAS
* procedure.
* @return Results from the {@link #StoreCB} callback
*/ | Called on UID mapping verification and continues executing the CAS procedure | call | {
"repo_name": "manolama/opentsdb",
"path": "src/meta/TSMeta.java",
"license": "lgpl-2.1",
"size": 41474
} | [
"com.stumbleupon.async.Deferred",
"java.util.ArrayList",
"net.opentsdb.uid.UniqueId"
] | import com.stumbleupon.async.Deferred; import java.util.ArrayList; import net.opentsdb.uid.UniqueId; | import com.stumbleupon.async.*; import java.util.*; import net.opentsdb.uid.*; | [
"com.stumbleupon.async",
"java.util",
"net.opentsdb.uid"
] | com.stumbleupon.async; java.util; net.opentsdb.uid; | 2,524,593 |
public List<TDelete> getDeletes() {
return this.deletes;
} | List<TDelete> function() { return this.deletes; } | /**
* list of TDeletes to delete
*/ | list of TDeletes to delete | getDeletes | {
"repo_name": "Guavus/hbase",
"path": "hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift2/generated/THBaseService.java",
"license": "apache-2.0",
"size": 597913
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,801,957 |
public int getIteration() {
String iter = XMLUtils.getElementText(elementIteration);
if (iter != null) {
return Integer.parseInt(iter);
}
return DEFAULT_ITERATION;
}
/**
* Get the hashed indicator. If the indicator is <code>true> the password of the
* <code>UsernameToken</code> was encoded using {@link WSConstants#PASSWORD_DIGEST} | int function() { String iter = XMLUtils.getElementText(elementIteration); if (iter != null) { return Integer.parseInt(iter); } return DEFAULT_ITERATION; } /** * Get the hashed indicator. If the indicator is <code>true> the password of the * <code>UsernameToken</code> was encoded using {@link WSConstants#PASSWORD_DIGEST} | /**
* Get the Iteration value of this UsernameToken.
*
* @return Returns the Iteration value. If no Iteration was specified in the
* username token the default value according to the specification
* is returned.
*/ | Get the Iteration value of this UsernameToken | getIteration | {
"repo_name": "apache/wss4j",
"path": "ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java",
"license": "apache-2.0",
"size": 28595
} | [
"org.apache.wss4j.common.util.XMLUtils",
"org.apache.wss4j.dom.WSConstants"
] | import org.apache.wss4j.common.util.XMLUtils; import org.apache.wss4j.dom.WSConstants; | import org.apache.wss4j.common.util.*; import org.apache.wss4j.dom.*; | [
"org.apache.wss4j"
] | org.apache.wss4j; | 324,755 |
public static void zipDirectory(File sourceDirectory, OutputStream outputStream)
throws IOException {
checkNotNull(sourceDirectory);
checkNotNull(outputStream);
checkArgument(
sourceDirectory.isDirectory(),
"%s is not a valid directory",
sourceDirectory.getAbsolutePath());
ZipOutputStream zos = new ZipOutputStream(outputStream);
for (File file : sourceDirectory.listFiles()) {
zipDirectoryInternal(file, "", zos);
}
zos.finish();
} | static void function(File sourceDirectory, OutputStream outputStream) throws IOException { checkNotNull(sourceDirectory); checkNotNull(outputStream); checkArgument( sourceDirectory.isDirectory(), STR, sourceDirectory.getAbsolutePath()); ZipOutputStream zos = new ZipOutputStream(outputStream); for (File file : sourceDirectory.listFiles()) { zipDirectoryInternal(file, "", zos); } zos.finish(); } | /**
* Zips an entire directory specified by the path.
*
* @param sourceDirectory the directory to read from. This directory and all subdirectories will
* be added to the zip-file. The path within the zip file is relative to the directory given
* as parameter, not absolute.
* @param outputStream the stream to write the zip-file to. This method does not close
* outputStream.
* @throws IOException the zipping failed, e.g. because the input was not readable.
*/ | Zips an entire directory specified by the path | zipDirectory | {
"repo_name": "rangadi/incubator-beam",
"path": "sdks/java/core/src/main/java/org/apache/beam/sdk/util/ZipFiles.java",
"license": "apache-2.0",
"size": 10515
} | [
"com.google.common.base.Preconditions",
"java.io.File",
"java.io.IOException",
"java.io.OutputStream",
"java.util.zip.ZipOutputStream"
] | import com.google.common.base.Preconditions; import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.util.zip.ZipOutputStream; | import com.google.common.base.*; import java.io.*; import java.util.zip.*; | [
"com.google.common",
"java.io",
"java.util"
] | com.google.common; java.io; java.util; | 1,639,726 |
private static PersistenceUnitMetadata parsePU(XMLStreamReader reader, Version version, final PropertyReplacer propertyReplacer) throws XMLStreamException {
PersistenceUnitMetadata pu = new PersistenceUnitMetadataImpl();
List<String> classes = new ArrayList<String>(1);
List<String> jarFiles = new ArrayList<String>(1);
List<String> mappingFiles = new ArrayList<String>(1);
Properties properties = new Properties();
// set defaults
pu.setTransactionType(PersistenceUnitTransactionType.JTA);
pu.setValidationMode(ValidationMode.AUTO);
pu.setSharedCacheMode(SharedCacheMode.UNSPECIFIED);
pu.setPersistenceProviderClassName(Configuration.PROVIDER_CLASS_DEFAULT);
pu.setPersistenceXMLSchemaVersion(version.getVersion());
final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
if (traceEnabled) {
ROOT_LOGGER.tracef("parse persistence.xml: attribute value(%d) = %s", i, value);
}
final String attributeNamespace = reader.getAttributeNamespace(i);
if (attributeNamespace != null && !attributeNamespace.isEmpty()) {
continue;
}
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case NAME:
pu.setPersistenceUnitName(value);
break;
case TRANSACTIONTYPE:
if (value.equalsIgnoreCase("RESOURCE_LOCAL"))
pu.setTransactionType(PersistenceUnitTransactionType.RESOURCE_LOCAL);
break;
default:
throw unexpectedAttribute(reader, i);
}
}
// until the ending PERSISTENCEUNIT tag
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
final Element element = Element.forName(reader.getLocalName());
if (traceEnabled) {
ROOT_LOGGER.tracef("parse persistence.xml: element=%s", element.getLocalName());
}
switch (element) {
case CLASS:
classes.add(getElement(reader, propertyReplacer));
break;
case DESCRIPTION:
final String description = getElement(reader, propertyReplacer);
break;
case EXCLUDEUNLISTEDCLASSES:
String text = getElement(reader, propertyReplacer);
if (text == null || text.isEmpty()) {
//the spec has examples where an empty
//exclude-unlisted-classes element has the same
//effect as setting it to true
pu.setExcludeUnlistedClasses(true);
} else {
pu.setExcludeUnlistedClasses(Boolean.valueOf(text));
}
break;
case JARFILE:
String file = getElement(reader, propertyReplacer);
jarFiles.add(file);
break;
case JTADATASOURCE:
pu.setJtaDataSourceName(getElement(reader, propertyReplacer));
break;
case NONJTADATASOURCE:
pu.setNonJtaDataSourceName(getElement(reader, propertyReplacer));
break;
case MAPPINGFILE:
mappingFiles.add(getElement(reader, propertyReplacer));
break;
case PROPERTIES:
parseProperties(reader, properties, propertyReplacer);
break;
case PROVIDER:
pu.setPersistenceProviderClassName(getElement(reader, propertyReplacer));
break;
case SHAREDCACHEMODE:
String cm = getElement(reader, propertyReplacer);
pu.setSharedCacheMode(SharedCacheMode.valueOf(cm));
break;
case VALIDATIONMODE:
String validationMode = getElement(reader, propertyReplacer);
pu.setValidationMode(ValidationMode.valueOf(validationMode));
break;
default:
throw unexpectedElement(reader);
}
}
if (traceEnabled) {
ROOT_LOGGER.trace("parse persistence.xml: reached ending persistence-unit tag");
}
pu.setManagedClassNames(classes);
pu.setJarFiles(jarFiles);
pu.setMappingFiles(mappingFiles);
pu.setProperties(properties);
return pu;
} | static PersistenceUnitMetadata function(XMLStreamReader reader, Version version, final PropertyReplacer propertyReplacer) throws XMLStreamException { PersistenceUnitMetadata pu = new PersistenceUnitMetadataImpl(); List<String> classes = new ArrayList<String>(1); List<String> jarFiles = new ArrayList<String>(1); List<String> mappingFiles = new ArrayList<String>(1); Properties properties = new Properties(); pu.setTransactionType(PersistenceUnitTransactionType.JTA); pu.setValidationMode(ValidationMode.AUTO); pu.setSharedCacheMode(SharedCacheMode.UNSPECIFIED); pu.setPersistenceProviderClassName(Configuration.PROVIDER_CLASS_DEFAULT); pu.setPersistenceXMLSchemaVersion(version.getVersion()); final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { final String value = reader.getAttributeValue(i); if (traceEnabled) { ROOT_LOGGER.tracef(STR, i, value); } final String attributeNamespace = reader.getAttributeNamespace(i); if (attributeNamespace != null && !attributeNamespace.isEmpty()) { continue; } final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case NAME: pu.setPersistenceUnitName(value); break; case TRANSACTIONTYPE: if (value.equalsIgnoreCase(STR)) pu.setTransactionType(PersistenceUnitTransactionType.RESOURCE_LOCAL); break; default: throw unexpectedAttribute(reader, i); } } while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { final Element element = Element.forName(reader.getLocalName()); if (traceEnabled) { ROOT_LOGGER.tracef(STR, element.getLocalName()); } switch (element) { case CLASS: classes.add(getElement(reader, propertyReplacer)); break; case DESCRIPTION: final String description = getElement(reader, propertyReplacer); break; case EXCLUDEUNLISTEDCLASSES: String text = getElement(reader, propertyReplacer); if (text == null text.isEmpty()) { pu.setExcludeUnlistedClasses(true); } else { pu.setExcludeUnlistedClasses(Boolean.valueOf(text)); } break; case JARFILE: String file = getElement(reader, propertyReplacer); jarFiles.add(file); break; case JTADATASOURCE: pu.setJtaDataSourceName(getElement(reader, propertyReplacer)); break; case NONJTADATASOURCE: pu.setNonJtaDataSourceName(getElement(reader, propertyReplacer)); break; case MAPPINGFILE: mappingFiles.add(getElement(reader, propertyReplacer)); break; case PROPERTIES: parseProperties(reader, properties, propertyReplacer); break; case PROVIDER: pu.setPersistenceProviderClassName(getElement(reader, propertyReplacer)); break; case SHAREDCACHEMODE: String cm = getElement(reader, propertyReplacer); pu.setSharedCacheMode(SharedCacheMode.valueOf(cm)); break; case VALIDATIONMODE: String validationMode = getElement(reader, propertyReplacer); pu.setValidationMode(ValidationMode.valueOf(validationMode)); break; default: throw unexpectedElement(reader); } } if (traceEnabled) { ROOT_LOGGER.trace(STR); } pu.setManagedClassNames(classes); pu.setJarFiles(jarFiles); pu.setMappingFiles(mappingFiles); pu.setProperties(properties); return pu; } | /**
* Parse the persistence unit definitions based on persistence_2_0.xsd.
*
*
* @param reader
* @param propertyReplacer
* @return
* @throws XMLStreamException
*/ | Parse the persistence unit definitions based on persistence_2_0.xsd | parsePU | {
"repo_name": "jstourac/wildfly",
"path": "jpa/subsystem/src/main/java/org/jboss/as/jpa/puparser/PersistenceUnitXmlParser.java",
"license": "lgpl-2.1",
"size": 13542
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.Properties",
"javax.persistence.SharedCacheMode",
"javax.persistence.ValidationMode",
"javax.persistence.spi.PersistenceUnitTransactionType",
"javax.xml.stream.XMLStreamException",
"javax.xml.stream.XMLStreamReader",
"org.jboss.as.jpa.config.Configuration",
"org.jboss.as.jpa.config.PersistenceUnitMetadataImpl",
"org.jboss.metadata.property.PropertyReplacer",
"org.jipijapa.plugin.spi.PersistenceUnitMetadata"
] | import java.util.ArrayList; import java.util.List; import java.util.Properties; import javax.persistence.SharedCacheMode; import javax.persistence.ValidationMode; import javax.persistence.spi.PersistenceUnitTransactionType; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import org.jboss.as.jpa.config.Configuration; import org.jboss.as.jpa.config.PersistenceUnitMetadataImpl; import org.jboss.metadata.property.PropertyReplacer; import org.jipijapa.plugin.spi.PersistenceUnitMetadata; | import java.util.*; import javax.persistence.*; import javax.persistence.spi.*; import javax.xml.stream.*; import org.jboss.as.jpa.config.*; import org.jboss.metadata.property.*; import org.jipijapa.plugin.spi.*; | [
"java.util",
"javax.persistence",
"javax.xml",
"org.jboss.as",
"org.jboss.metadata",
"org.jipijapa.plugin"
] | java.util; javax.persistence; javax.xml; org.jboss.as; org.jboss.metadata; org.jipijapa.plugin; | 2,269,803 |
public PropertyGroup getPropertyGroup() {
return propertyGroup;
}
| PropertyGroup function() { return propertyGroup; } | /**
* Returns the property group.
* Values for properties in this group can be stored in the value containers that are this properties values.
*
* @return the property group
*/ | Returns the property group. Values for properties in this group can be stored in the value containers that are this properties values | getPropertyGroup | {
"repo_name": "ebourg/infonode",
"path": "src/net/infonode/properties/types/PropertyGroupProperty.java",
"license": "gpl-2.0",
"size": 2488
} | [
"net.infonode.properties.base.PropertyGroup"
] | import net.infonode.properties.base.PropertyGroup; | import net.infonode.properties.base.*; | [
"net.infonode.properties"
] | net.infonode.properties; | 21,117 |
public void recordDelegatedNotificationSmallIconFallback(
@DelegatedNotificationSmallIconFallback int fallback) {
RecordHistogram.recordEnumeratedHistogram(
"TrustedWebActivity.DelegatedNotificationSmallIconFallback", fallback,
DelegatedNotificationSmallIconFallback.NUM_ENTRIES);
} | void function( @DelegatedNotificationSmallIconFallback int fallback) { RecordHistogram.recordEnumeratedHistogram( STR, fallback, DelegatedNotificationSmallIconFallback.NUM_ENTRIES); } | /**
* Records which fallback (if any) was used for the small icon of a delegated notification.
*/ | Records which fallback (if any) was used for the small icon of a delegated notification | recordDelegatedNotificationSmallIconFallback | {
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/chrome/browser/android/browserservices/metrics/java/src/org/chromium/chrome/browser/browserservices/metrics/TrustedWebActivityUmaRecorder.java",
"license": "bsd-3-clause",
"size": 10003
} | [
"org.chromium.base.metrics.RecordHistogram"
] | import org.chromium.base.metrics.RecordHistogram; | import org.chromium.base.metrics.*; | [
"org.chromium.base"
] | org.chromium.base; | 788,540 |
public Observable<ServiceResponse<RouteFilterInner>> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (routeFilterName == null) {
throw new IllegalArgumentException("Parameter routeFilterName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (routeFilterParameters == null) {
throw new IllegalArgumentException("Parameter routeFilterParameters is required and cannot be null.");
} | Observable<ServiceResponse<RouteFilterInner>> function(String resourceGroupName, String routeFilterName, RouteFilterInner routeFilterParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (routeFilterName == null) { throw new IllegalArgumentException(STR); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (routeFilterParameters == null) { throw new IllegalArgumentException(STR); } | /**
* Creates or updates a route filter in a specified resource group.
*
* @param resourceGroupName The name of the resource group.
* @param routeFilterName The name of the route filter.
* @param routeFilterParameters Parameters supplied to the create or update route filter operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the RouteFilterInner object
*/ | Creates or updates a route filter in a specified resource group | beginCreateOrUpdateWithServiceResponseAsync | {
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteFiltersInner.java",
"license": "mit",
"size": 69813
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,289,178 |
private DefaultMutableTreeNode getRootNode() {
return (DefaultMutableTreeNode) categoryTree.getModel().getRoot();
}
| DefaultMutableTreeNode function() { return (DefaultMutableTreeNode) categoryTree.getModel().getRoot(); } | /**
* Returns the root node of the category tree.
*
* @return root node of categoryTree
*/ | Returns the root node of the category tree | getRootNode | {
"repo_name": "petebrew/fhaes",
"path": "fhaes/src/main/java/org/fhaes/gui/CategoryEntryPanel.java",
"license": "gpl-3.0",
"size": 16167
} | [
"javax.swing.tree.DefaultMutableTreeNode"
] | import javax.swing.tree.DefaultMutableTreeNode; | import javax.swing.tree.*; | [
"javax.swing"
] | javax.swing; | 2,463,996 |
public final <T> JaxBeanInfo<T> getBeanInfo(Class<T> clazz,boolean fatal) throws JAXBException {
JaxBeanInfo<T> bi = getBeanInfo(clazz);
if(bi!=null) return bi;
if(fatal)
throw new JAXBException(clazz.getName()+" is not known to this context");
return null;
} | final <T> JaxBeanInfo<T> function(Class<T> clazz,boolean fatal) throws JAXBException { JaxBeanInfo<T> bi = getBeanInfo(clazz); if(bi!=null) return bi; if(fatal) throw new JAXBException(clazz.getName()+STR); return null; } | /**
* Gets the {@link JaxBeanInfo} object that can handle
* the given JAXB-bound class.
*
* @param fatal
* if true, the failure to look up will throw an exception.
* Otherwise it will just return null.
*/ | Gets the <code>JaxBeanInfo</code> object that can handle the given JAXB-bound class | getBeanInfo | {
"repo_name": "openjdk/jdk7u",
"path": "jaxws/src/share/jaxws_classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java",
"license": "gpl-2.0",
"size": 40024
} | [
"javax.xml.bind.JAXBException"
] | import javax.xml.bind.JAXBException; | import javax.xml.bind.*; | [
"javax.xml"
] | javax.xml; | 625,381 |
protected byte[][] getComplexTypeKeyArray(int rowId) {
byte[][] complexTypeData = new byte[complexParentBlockIndexes.length][];
for (int i = 0; i < complexTypeData.length; i++) {
GenericQueryType genericQueryType =
complexParentIndexToQueryMap.get(complexParentBlockIndexes[i]);
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
DataOutputStream dataOutput = new DataOutputStream(byteStream);
try {
genericQueryType.parseBlocksAndReturnComplexColumnByteArray(dataChunks, rowId, dataOutput);
complexTypeData[i] = byteStream.toByteArray();
} catch (IOException e) {
LOGGER.error(e);
} finally {
CarbonUtil.closeStreams(dataOutput);
CarbonUtil.closeStreams(byteStream);
}
}
return complexTypeData;
} | byte[][] function(int rowId) { byte[][] complexTypeData = new byte[complexParentBlockIndexes.length][]; for (int i = 0; i < complexTypeData.length; i++) { GenericQueryType genericQueryType = complexParentIndexToQueryMap.get(complexParentBlockIndexes[i]); ByteArrayOutputStream byteStream = new ByteArrayOutputStream(); DataOutputStream dataOutput = new DataOutputStream(byteStream); try { genericQueryType.parseBlocksAndReturnComplexColumnByteArray(dataChunks, rowId, dataOutput); complexTypeData[i] = byteStream.toByteArray(); } catch (IOException e) { LOGGER.error(e); } finally { CarbonUtil.closeStreams(dataOutput); CarbonUtil.closeStreams(byteStream); } } return complexTypeData; } | /**
* Below method will be used to get the complex type keys array based
* on row id for all the complex type dimension selected in query
*
* @param rowId row number
* @return complex type key array for all the complex dimension selected in query
*/ | Below method will be used to get the complex type keys array based on row id for all the complex type dimension selected in query | getComplexTypeKeyArray | {
"repo_name": "foryou2030/incubator-carbondata",
"path": "core/src/main/java/org/apache/carbondata/scan/result/AbstractScannedResult.java",
"license": "apache-2.0",
"size": 13984
} | [
"java.io.ByteArrayOutputStream",
"java.io.DataOutputStream",
"java.io.IOException",
"org.apache.carbondata.core.util.CarbonUtil",
"org.apache.carbondata.scan.filter.GenericQueryType"
] | import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import org.apache.carbondata.core.util.CarbonUtil; import org.apache.carbondata.scan.filter.GenericQueryType; | import java.io.*; import org.apache.carbondata.core.util.*; import org.apache.carbondata.scan.filter.*; | [
"java.io",
"org.apache.carbondata"
] | java.io; org.apache.carbondata; | 2,851,040 |
protected StatusResponse parseResponse(String line)
throws ProtocolException
{
return parseResponse(line, false);
} | StatusResponse function(String line) throws ProtocolException { return parseResponse(line, false); } | /**
* Parse a response object from a response line sent by the server.
*/ | Parse a response object from a response line sent by the server | parseResponse | {
"repo_name": "SeekingFor/jfniki",
"path": "alien/src/gnu/inet/nntp/NNTPConnection.java",
"license": "gpl-2.0",
"size": 42972
} | [
"java.net.ProtocolException"
] | import java.net.ProtocolException; | import java.net.*; | [
"java.net"
] | java.net; | 1,708,299 |
public static void zip(File input, String pathWithinArchive, File output) throws IOException {
try (ZipOutputStream zipStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(output)))) {
zipStream.setMethod(ZipOutputStream.DEFLATED);
zipStream.setLevel(9);
zipStream.putNextEntry(new ZipEntry(pathWithinArchive));
try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(input))) {
copy(inputStream, zipStream);
}
}
} | static void function(File input, String pathWithinArchive, File output) throws IOException { try (ZipOutputStream zipStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(output)))) { zipStream.setMethod(ZipOutputStream.DEFLATED); zipStream.setLevel(9); zipStream.putNextEntry(new ZipEntry(pathWithinArchive)); try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(input))) { copy(inputStream, zipStream); } } } | /**
* Creates a single-entry zip file.
*
* @param input an uncompressed file
* @param pathWithinArchive the path within the archive
* @param output the new zip file it will be compressed into
*/ | Creates a single-entry zip file | zip | {
"repo_name": "diffplug/goomph",
"path": "src/main/java/com/diffplug/gradle/ZipMisc.java",
"license": "apache-2.0",
"size": 6903
} | [
"java.io.BufferedInputStream",
"java.io.BufferedOutputStream",
"java.io.File",
"java.io.FileInputStream",
"java.io.FileOutputStream",
"java.io.IOException",
"java.util.zip.ZipEntry",
"java.util.zip.ZipOutputStream"
] | import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; | import java.io.*; import java.util.zip.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 864,539 |
void calculateFilteredData(Entity entity); | void calculateFilteredData(Entity entity); | /**
* Calculate filtered data
* @param entity for which will calculate filtered data
*/ | Calculate filtered data | calculateFilteredData | {
"repo_name": "dimone-kun/cuba",
"path": "modules/core/src/com/haulmont/cuba/core/PersistenceSecurity.java",
"license": "apache-2.0",
"size": 3959
} | [
"com.haulmont.cuba.core.entity.Entity"
] | import com.haulmont.cuba.core.entity.Entity; | import com.haulmont.cuba.core.entity.*; | [
"com.haulmont.cuba"
] | com.haulmont.cuba; | 2,259,805 |
public NodeEnvironment getNodeEnvironment() {
return nodeEnvironment;
} | NodeEnvironment function() { return nodeEnvironment; } | /**
* Returns the {@link NodeEnvironment} instance of this node
*/ | Returns the <code>NodeEnvironment</code> instance of this node | getNodeEnvironment | {
"repo_name": "crate/crate",
"path": "server/src/main/java/org/elasticsearch/node/Node.java",
"license": "apache-2.0",
"size": 63492
} | [
"org.elasticsearch.env.NodeEnvironment"
] | import org.elasticsearch.env.NodeEnvironment; | import org.elasticsearch.env.*; | [
"org.elasticsearch.env"
] | org.elasticsearch.env; | 1,609,419 |
@ApiMethod(
name = "getConferencesCreated",
path = "getConferencesCreated",
httpMethod = HttpMethod.POST
)
public List<Conference> getConferencesCreated(final User user) throws UnauthorizedException {
// If not signed in, throw a 401 error.
if (user == null) {
throw new UnauthorizedException("Authorization required");
}
String userId = user.getUserId();
Key<Profile> userKey = Key.create(Profile.class, userId);
return ofy().load().type(Conference.class)
.ancestor(userKey)
.list();
} | @ApiMethod( name = STR, path = STR, httpMethod = HttpMethod.POST ) List<Conference> function(final User user) throws UnauthorizedException { if (user == null) { throw new UnauthorizedException(STR); } String userId = user.getUserId(); Key<Profile> userKey = Key.create(Profile.class, userId); return ofy().load().type(Conference.class) .ancestor(userKey) .list(); } | /**
* Returns a list of Conferences that the user created.
* In order to receive the websafeConferenceKey via the JSON params, uses a POST method.
*
* @param user A user who invokes this method, null when the user is not signed in.
* @return a list of Conferences that the user created.
* @throws UnauthorizedException when the user is not signed in.
*/ | Returns a list of Conferences that the user created. In order to receive the websafeConferenceKey via the JSON params, uses a POST method | getConferencesCreated | {
"repo_name": "GoogleCloudPlatformTraining/cpd200-conference-central-java",
"path": "solutions/REF_08_ConferenceApi.java",
"license": "apache-2.0",
"size": 11328
} | [
"com.google.api.server.spi.config.ApiMethod",
"com.google.api.server.spi.response.UnauthorizedException",
"com.google.appengine.api.users.User",
"com.google.training.cpd200.conference.domain.Conference",
"com.google.training.cpd200.conference.domain.Profile",
"com.google.training.cpd200.conference.service.OfyService",
"com.googlecode.objectify.Key",
"java.util.List"
] | import com.google.api.server.spi.config.ApiMethod; import com.google.api.server.spi.response.UnauthorizedException; import com.google.appengine.api.users.User; import com.google.training.cpd200.conference.domain.Conference; import com.google.training.cpd200.conference.domain.Profile; import com.google.training.cpd200.conference.service.OfyService; import com.googlecode.objectify.Key; import java.util.List; | import com.google.api.server.spi.config.*; import com.google.api.server.spi.response.*; import com.google.appengine.api.users.*; import com.google.training.cpd200.conference.domain.*; import com.google.training.cpd200.conference.service.*; import com.googlecode.objectify.*; import java.util.*; | [
"com.google.api",
"com.google.appengine",
"com.google.training",
"com.googlecode.objectify",
"java.util"
] | com.google.api; com.google.appengine; com.google.training; com.googlecode.objectify; java.util; | 211,224 |
@Test
public void test_validateException_emptyExpectations() {
try {
Exception exceptionToValidate = new Exception(exceptionMsg);
Expectations expectations = new Expectations();
utils.validateResult(exceptionToValidate, action, expectations);
assertStringNotInTrace(outputMgr, "Error");
assertRegexNotInTrace(outputMgr, "Expectations.+null");
} catch (Throwable t) {
outputMgr.failWithThrowable(testName.getMethodName(), t);
}
} | void function() { try { Exception exceptionToValidate = new Exception(exceptionMsg); Expectations expectations = new Expectations(); utils.validateResult(exceptionToValidate, action, expectations); assertStringNotInTrace(outputMgr, "Error"); assertRegexNotInTrace(outputMgr, STR); } catch (Throwable t) { outputMgr.failWithThrowable(testName.getMethodName(), t); } } | /**
* Tests:
* - Provided Expectation object is empty
* Expects:
* - Nothing should happen
*/ | Tests: - Provided Expectation object is empty Expects: - Nothing should happen | test_validateException_emptyExpectations | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.security.fat.common/test/com/ibm/ws/security/fat/common/validation/TestValidationUtilsTest.java",
"license": "epl-1.0",
"size": 91503
} | [
"com.ibm.ws.security.fat.common.expectations.Expectations"
] | import com.ibm.ws.security.fat.common.expectations.Expectations; | import com.ibm.ws.security.fat.common.expectations.*; | [
"com.ibm.ws"
] | com.ibm.ws; | 2,393,303 |
@Nonnull
public static <T extends EntityEvent> Predicate<T> entityHasMetadata(MetadataKey<?> key) {
return e -> Metadata.provideForEntity(e.getEntity()).has(key);
} | static <T extends EntityEvent> Predicate<T> function(MetadataKey<?> key) { return e -> Metadata.provideForEntity(e.getEntity()).has(key); } | /**
* Returns a predicate which only returns true if the entity has a given metadata key
*
* @param key the metadata key
* @param <T> the event type
* @return a predicate which only returns true if the entity has a given metadata key
*/ | Returns a predicate which only returns true if the entity has a given metadata key | entityHasMetadata | {
"repo_name": "lucko/helper",
"path": "helper/src/main/java/me/lucko/helper/event/filter/EventFilters.java",
"license": "mit",
"size": 7551
} | [
"java.util.function.Predicate",
"me.lucko.helper.metadata.Metadata",
"me.lucko.helper.metadata.MetadataKey",
"org.bukkit.event.entity.EntityEvent"
] | import java.util.function.Predicate; import me.lucko.helper.metadata.Metadata; import me.lucko.helper.metadata.MetadataKey; import org.bukkit.event.entity.EntityEvent; | import java.util.function.*; import me.lucko.helper.metadata.*; import org.bukkit.event.entity.*; | [
"java.util",
"me.lucko.helper",
"org.bukkit.event"
] | java.util; me.lucko.helper; org.bukkit.event; | 1,173,744 |
public Point getBottomRightCorner() {
final int x = getWidth() - 1;
final int y = getHeight() - 1;
return new Point(x, y);
}
| Point function() { final int x = getWidth() - 1; final int y = getHeight() - 1; return new Point(x, y); } | /**
* Returns the logical coordinates of the pixel on the inside
* of the panel's bottom right corner.
*
* @return a new Point object indicating the coordinates (never null)
*/ | Returns the logical coordinates of the pixel on the inside of the panel's bottom right corner | getBottomRightCorner | {
"repo_name": "stephengold/gold-tiles",
"path": "Java/GoldTile/src/goldtile/GamePanel.java",
"license": "gpl-3.0",
"size": 15967
} | [
"java.awt.Point"
] | import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 556,725 |
super.init();
//log into broker
driver.get(getLoginURL());
LoginPage loginPage = new LoginPage(driver);
homePage = loginPage.loginAs(getCurrentUserName(), getCurrentPassword());
} | super.init(); driver.get(getLoginURL()); LoginPage loginPage = new LoginPage(driver); homePage = loginPage.loginAs(getCurrentUserName(), getCurrentPassword()); } | /**
* Initialises the test case.
*
* @throws AutomationUtilException
* @throws XPathExpressionException
* @throws MalformedURLException
*/ | Initialises the test case | init | {
"repo_name": "wso2/product-ei",
"path": "integration/broker-tests/tests-ui-integration/src/test/java/org/wso2/carbon/mb/ui/test/subscriptions/SubscriptionDeleteTestCase.java",
"license": "apache-2.0",
"size": 17098
} | [
"org.wso2.mb.integration.common.utils.ui.pages.login.LoginPage"
] | import org.wso2.mb.integration.common.utils.ui.pages.login.LoginPage; | import org.wso2.mb.integration.common.utils.ui.pages.login.*; | [
"org.wso2.mb"
] | org.wso2.mb; | 2,669,621 |
@Nullable
public EducationRoot put(@Nonnull final EducationRoot newEducationRoot) throws ClientException {
return send(HttpMethod.PUT, newEducationRoot);
} | EducationRoot function(@Nonnull final EducationRoot newEducationRoot) throws ClientException { return send(HttpMethod.PUT, newEducationRoot); } | /**
* Creates a EducationRoot with a new object
*
* @param newEducationRoot the object to create/update
* @return the created EducationRoot
* @throws ClientException this exception occurs if the request was unable to complete for any reason
*/ | Creates a EducationRoot with a new object | put | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/EducationRootRequest.java",
"license": "mit",
"size": 6253
} | [
"com.microsoft.graph.core.ClientException",
"com.microsoft.graph.http.HttpMethod",
"com.microsoft.graph.models.EducationRoot",
"javax.annotation.Nonnull"
] | import com.microsoft.graph.core.ClientException; import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.EducationRoot; import javax.annotation.Nonnull; | import com.microsoft.graph.core.*; import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; import javax.annotation.*; | [
"com.microsoft.graph",
"javax.annotation"
] | com.microsoft.graph; javax.annotation; | 2,851,615 |
public int numDocs(Query a, Query b) throws IOException {
Query absA = QueryUtils.getAbs(a);
Query absB = QueryUtils.getAbs(b);
DocSet positiveA = getPositiveDocSet(absA);
DocSet positiveB = getPositiveDocSet(absB);
// Negative query if absolute value different from original
if (a==absA) {
if (b==absB) return positiveA.intersectionSize(positiveB);
return positiveA.andNotSize(positiveB);
}
if (b==absB) return positiveB.andNotSize(positiveA);
// if both negative, we need to create a temp DocSet since we
// don't have a counting method that takes three.
DocSet all = getPositiveDocSet(matchAllDocsQuery);
// -a -b == *:*.andNot(a).andNotSize(b) == *.*.andNotSize(a.union(b))
// we use the last form since the intermediate DocSet should normally be smaller.
return all.andNotSize(positiveA.union(positiveB));
} | int function(Query a, Query b) throws IOException { Query absA = QueryUtils.getAbs(a); Query absB = QueryUtils.getAbs(b); DocSet positiveA = getPositiveDocSet(absA); DocSet positiveB = getPositiveDocSet(absB); if (a==absA) { if (b==absB) return positiveA.intersectionSize(positiveB); return positiveA.andNotSize(positiveB); } if (b==absB) return positiveB.andNotSize(positiveA); DocSet all = getPositiveDocSet(matchAllDocsQuery); return all.andNotSize(positiveA.union(positiveB)); } | /**
* Returns the number of documents that match both <code>a</code> and <code>b</code>.
* <p>
* This method is cache-aware and may check as well as modify the cache.
*
* @return the number of documents in the intersection between <code>a</code> and <code>b</code>.
* @throws IOException If there is a low-level I/O error.
*/ | Returns the number of documents that match both <code>a</code> and <code>b</code>. This method is cache-aware and may check as well as modify the cache | numDocs | {
"repo_name": "visouza/solr-5.0.0",
"path": "solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java",
"license": "apache-2.0",
"size": 93382
} | [
"java.io.IOException",
"org.apache.lucene.search.Query"
] | import java.io.IOException; import org.apache.lucene.search.Query; | import java.io.*; import org.apache.lucene.search.*; | [
"java.io",
"org.apache.lucene"
] | java.io; org.apache.lucene; | 2,020,705 |
protected void fullyIdentifyCurrentUser() throws OsmTransferException {
getProgressMonitor().indeterminateSubTask(tr("Determine user id for current user..."));
synchronized(this) {
userInfoReader = new OsmServerUserInfoReader();
}
UserInfo info = userInfoReader.fetchUserInfo(getProgressMonitor().createSubTaskMonitor(1,false));
synchronized(this) {
userInfoReader = null;
}
JosmUserIdentityManager im = JosmUserIdentityManager.getInstance();
im.setFullyIdentified(im.getUserName(), info);
} | void function() throws OsmTransferException { getProgressMonitor().indeterminateSubTask(tr(STR)); synchronized(this) { userInfoReader = new OsmServerUserInfoReader(); } UserInfo info = userInfoReader.fetchUserInfo(getProgressMonitor().createSubTaskMonitor(1,false)); synchronized(this) { userInfoReader = null; } JosmUserIdentityManager im = JosmUserIdentityManager.getInstance(); im.setFullyIdentified(im.getUserName(), info); } | /**
* Tries to fully identify the current JOSM user
*
* @throws OsmTransferException thrown if something went wrong
*/ | Tries to fully identify the current JOSM user | fullyIdentifyCurrentUser | {
"repo_name": "CURocketry/Ground_Station_GUI",
"path": "src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryTask.java",
"license": "gpl-3.0",
"size": 8416
} | [
"org.openstreetmap.josm.data.osm.UserInfo",
"org.openstreetmap.josm.gui.JosmUserIdentityManager",
"org.openstreetmap.josm.io.OsmServerUserInfoReader",
"org.openstreetmap.josm.io.OsmTransferException"
] | import org.openstreetmap.josm.data.osm.UserInfo; import org.openstreetmap.josm.gui.JosmUserIdentityManager; import org.openstreetmap.josm.io.OsmServerUserInfoReader; import org.openstreetmap.josm.io.OsmTransferException; | import org.openstreetmap.josm.data.osm.*; import org.openstreetmap.josm.gui.*; import org.openstreetmap.josm.io.*; | [
"org.openstreetmap.josm"
] | org.openstreetmap.josm; | 1,617,610 |
InputStream in = null;
BufferedInputStream bis = null;
Document doc = null;
try {
in = documentF.getInputStream();
bis = new BufferedInputStream(in);
XMLParser xmlParser = new XMLParser(new IMSEntityResolver());
doc = xmlParser.parse(bis, false);
} catch (Exception e) { return null; }
finally {
try {
if (in != null) in.close();
if (bis != null) bis.close();
} catch (Exception e) {
// we did our best to close the inputStream
}
}
return doc;
}
| InputStream in = null; BufferedInputStream bis = null; Document doc = null; try { in = documentF.getInputStream(); bis = new BufferedInputStream(in); XMLParser xmlParser = new XMLParser(new IMSEntityResolver()); doc = xmlParser.parse(bis, false); } catch (Exception e) { return null; } finally { try { if (in != null) in.close(); if (bis != null) bis.close(); } catch (Exception e) { } } return doc; } | /**
* Reads an IMS XML Document if supported by /org/olat/ims/resources.
* @param documentF
* @return document
*/ | Reads an IMS XML Document if supported by /org/olat/ims/resources | loadIMSDocument | {
"repo_name": "stevenhva/InfoLearn_OpenOLAT",
"path": "src/main/java/org/olat/ims/resources/IMSLoader.java",
"license": "apache-2.0",
"size": 2868
} | [
"java.io.BufferedInputStream",
"java.io.InputStream",
"org.dom4j.Document",
"org.olat.core.util.xml.XMLParser"
] | import java.io.BufferedInputStream; import java.io.InputStream; import org.dom4j.Document; import org.olat.core.util.xml.XMLParser; | import java.io.*; import org.dom4j.*; import org.olat.core.util.xml.*; | [
"java.io",
"org.dom4j",
"org.olat.core"
] | java.io; org.dom4j; org.olat.core; | 1,126,549 |
private File resolveFileFromPath(String filename) {
File f = new File(filename);
if (f.isAbsolute() || f.exists()) {
return f;
} else {
return new File(base, filename);
}
} | File function(String filename) { File f = new File(filename); if (f.isAbsolute() f.exists()) { return f; } else { return new File(base, filename); } } | /**
* Resolves file name into {@link File} instance.
* When filename is not absolute and not found from current workind dir,
* it tries to find it under current base directory
* @param filename original file name
* @return {@link File} instance
*/ | Resolves file name into <code>File</code> instance. When filename is not absolute and not found from current workind dir, it tries to find it under current base directory | resolveFileFromPath | {
"repo_name": "DoctorQ/jmeter",
"path": "src/core/org/apache/jmeter/services/FileServer.java",
"license": "apache-2.0",
"size": 22886
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,718,782 |
public MiniHBaseCluster startMiniCluster(final int numMasters,
final int numSlaves, final int numDataNodes) throws Exception {
return startMiniCluster(numMasters, numSlaves, numDataNodes, null, null, null);
}
/**
* Start up a minicluster of hbase, optionally dfs, and zookeeper.
* Modifies Configuration. Homes the cluster data directory under a random
* subdirectory in a directory under System property test.build.data.
* Directory is cleaned up on exit.
* @param numMasters Number of masters to start up. We'll start this many
* hbase masters. If numMasters > 1, you can find the active/primary master
* with {@link MiniHBaseCluster#getMaster()}.
* @param numSlaves Number of slaves to start up. We'll start this many
* regionservers. If dataNodeHosts == null, this also indicates the number of
* datanodes to start. If dataNodeHosts != null, the number of datanodes is
* based on dataNodeHosts.length.
* If numSlaves is > 1, then make sure
* hbase.regionserver.info.port is -1 (i.e. no ui per regionserver) otherwise
* bind errors.
* @param dataNodeHosts hostnames DNs to run on.
* This is useful if you want to run datanode on distinct hosts for things
* like HDFS block location verification.
* If you start MiniDFSCluster without host names,
* all instances of the datanodes will have the same host name.
* @param masterClass The class to use as HMaster, or null for default
* @param regionserverClass The class to use as HRegionServer, or null for
* default
* @throws Exception
* @see {@link #shutdownMiniCluster()} | MiniHBaseCluster function(final int numMasters, final int numSlaves, final int numDataNodes) throws Exception { return startMiniCluster(numMasters, numSlaves, numDataNodes, null, null, null); } /** * Start up a minicluster of hbase, optionally dfs, and zookeeper. * Modifies Configuration. Homes the cluster data directory under a random * subdirectory in a directory under System property test.build.data. * Directory is cleaned up on exit. * @param numMasters Number of masters to start up. We'll start this many * hbase masters. If numMasters > 1, you can find the active/primary master * with {@link MiniHBaseCluster#getMaster()}. * @param numSlaves Number of slaves to start up. We'll start this many * regionservers. If dataNodeHosts == null, this also indicates the number of * datanodes to start. If dataNodeHosts != null, the number of datanodes is * based on dataNodeHosts.length. * If numSlaves is > 1, then make sure * hbase.regionserver.info.port is -1 (i.e. no ui per regionserver) otherwise * bind errors. * @param dataNodeHosts hostnames DNs to run on. * This is useful if you want to run datanode on distinct hosts for things * like HDFS block location verification. * If you start MiniDFSCluster without host names, * all instances of the datanodes will have the same host name. * @param masterClass The class to use as HMaster, or null for default * @param regionserverClass The class to use as HRegionServer, or null for * default * @throws Exception * @see {@link #shutdownMiniCluster()} | /**
* Same as {@link #startMiniCluster(int, int)}, but with custom number of datanodes.
* @param numDataNodes Number of data nodes.
*/ | Same as <code>#startMiniCluster(int, int)</code>, but with custom number of datanodes | startMiniCluster | {
"repo_name": "toshimasa-nasu/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java",
"license": "apache-2.0",
"size": 134883
} | [
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hbase.master.HMaster",
"org.apache.hadoop.hbase.regionserver.HRegionServer",
"org.apache.hadoop.hdfs.MiniDFSCluster"
] | import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hdfs.MiniDFSCluster; | import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.master.*; import org.apache.hadoop.hbase.regionserver.*; import org.apache.hadoop.hdfs.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,981,078 |
public void downloadUninterrupted() throws IOException {
try {
download();
} catch (InterruptedException ignored) { }
} | void function() throws IOException { try { download(); } catch (InterruptedException ignored) { } } | /**
* Helper function for synchronous downloads (i.e. those *not* using AsyncDownloadWrapper),
* which don't really want to bother dealing with an InterruptedException.
* The InterruptedException thrown from download() is there to enable cancelling asynchronous
* downloads, but regular synchronous downloads cannot be cancelled because download() will
* block until completed.
* @throws IOException
*/ | Helper function for synchronous downloads (i.e. those *not* using AsyncDownloadWrapper), which don't really want to bother dealing with an InterruptedException. The InterruptedException thrown from download() is there to enable cancelling asynchronous downloads, but regular synchronous downloads cannot be cancelled because download() will block until completed | downloadUninterrupted | {
"repo_name": "JTechMe/AppHub",
"path": "f-droid/src/com/jtechme/apphub/net/Downloader.java",
"license": "gpl-2.0",
"size": 8782
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,303,589 |
public static boolean checkNavigationCategory(Category categoryToCheck) {
Context mContext = OmniNotes.getAppContext();
String[] navigationListCodes = mContext.getResources().getStringArray(R.array.navigation_list_codes);
String navigation = mContext.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_MULTI_PROCESS).getString(Constants.PREF_NAVIGATION, navigationListCodes[0]);
return (categoryToCheck != null && navigation.equals(String.valueOf(categoryToCheck.getId())));
} | static boolean function(Category categoryToCheck) { Context mContext = OmniNotes.getAppContext(); String[] navigationListCodes = mContext.getResources().getStringArray(R.array.navigation_list_codes); String navigation = mContext.getSharedPreferences(Constants.PREFS_NAME, Context.MODE_MULTI_PROCESS).getString(Constants.PREF_NAVIGATION, navigationListCodes[0]); return (categoryToCheck != null && navigation.equals(String.valueOf(categoryToCheck.getId()))); } | /**
* Checks if passed parameters is the category user is actually navigating in
*/ | Checks if passed parameters is the category user is actually navigating in | checkNavigationCategory | {
"repo_name": "jfreax/Omni-Notes",
"path": "omniNotes/src/main/java/it/feio/android/omninotes/utils/Navigation.java",
"license": "gpl-3.0",
"size": 4250
} | [
"android.content.Context",
"it.feio.android.omninotes.OmniNotes",
"it.feio.android.omninotes.models.Category"
] | import android.content.Context; import it.feio.android.omninotes.OmniNotes; import it.feio.android.omninotes.models.Category; | import android.content.*; import it.feio.android.omninotes.*; import it.feio.android.omninotes.models.*; | [
"android.content",
"it.feio.android"
] | android.content; it.feio.android; | 1,041,495 |
public final void setReferenceSetAugmentor(ReferenceSetAugmentor rse) {
this.referenceSetAugmentor = rse;
} | final void function(ReferenceSetAugmentor rse) { this.referenceSetAugmentor = rse; } | /**
* Inject the ReferenceSetAugmentor used to translate or construct new
* ExternalReferenceSPI instances within a ReferenceSet
*/ | Inject the ReferenceSetAugmentor used to translate or construct new ExternalReferenceSPI instances within a ReferenceSet | setReferenceSetAugmentor | {
"repo_name": "apache/incubator-taverna-engine",
"path": "taverna-reference-impl/src/main/java/org/apache/taverna/reference/impl/AbstractReferenceSetServiceImpl.java",
"license": "apache-2.0",
"size": 5248
} | [
"org.apache.taverna.reference.ReferenceSetAugmentor"
] | import org.apache.taverna.reference.ReferenceSetAugmentor; | import org.apache.taverna.reference.*; | [
"org.apache.taverna"
] | org.apache.taverna; | 605,038 |
public KafkaRestProperties withConfigurationOverride(Map<String, String> configurationOverride) {
this.configurationOverride = configurationOverride;
return this;
} | KafkaRestProperties function(Map<String, String> configurationOverride) { this.configurationOverride = configurationOverride; return this; } | /**
* Set the configurationOverride property: The configurations that need to be overriden.
*
* @param configurationOverride the configurationOverride value to set.
* @return the KafkaRestProperties object itself.
*/ | Set the configurationOverride property: The configurations that need to be overriden | withConfigurationOverride | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/KafkaRestProperties.java",
"license": "mit",
"size": 2725
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,593,394 |
@ServiceMethod(returns = ReturnType.SINGLE)
private PollerFlux<PollResult<Void>, Void> beginDeleteAsync(
String resourceGroupName, String resourceName, Context context) {
context = this.client.mergeContext(context);
Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context);
return this
.client
.<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
} | @ServiceMethod(returns = ReturnType.SINGLE) PollerFlux<PollResult<Void>, Void> function( String resourceGroupName, String resourceName, Context context) { context = this.client.mergeContext(context); Mono<Response<Flux<ByteBuffer>>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); return this .client .<Void, Void>getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } | /**
* Deletes the OpenShift managed cluster with a specified resource group and name.
*
* @param resourceGroupName The name of the resource group.
* @param resourceName The name of the OpenShift managed cluster resource.
* @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 completion.
*/ | Deletes the OpenShift managed cluster with a specified resource group and name | beginDeleteAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-containerservice/src/main/java/com/azure/resourcemanager/containerservice/implementation/OpenShiftManagedClustersClientImpl.java",
"license": "mit",
"size": 77211
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.Context",
"com.azure.core.util.polling.PollerFlux",
"java.nio.ByteBuffer"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import java.nio.ByteBuffer; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*; import java.nio.*; | [
"com.azure.core",
"java.nio"
] | com.azure.core; java.nio; | 1,240,108 |
public void createOverlapOfFirstAndSecondInList() {
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.MONTH, SIX);
calendar.add(Calendar.YEAR, 1);
award.getAwardDirectFandADistributions().get(0).setEndDate(new Date(calendar.getTime().getTime()));
} | void function() { Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.MONTH, SIX); calendar.add(Calendar.YEAR, 1); award.getAwardDirectFandADistributions().get(0).setEndDate(new Date(calendar.getTime().getTime())); } | /**
* This method creates an overlap of dates for testing rule method will fail.
*/ | This method creates an overlap of dates for testing rule method will fail | createOverlapOfFirstAndSecondInList | {
"repo_name": "rashikpolus/MIT_KC",
"path": "coeus-impl/src/test/java/org/kuali/kra/award/timeandmoney/AwardDirectFandADistributionRuleTest.java",
"license": "agpl-3.0",
"size": 9371
} | [
"java.sql.Date",
"java.util.Calendar"
] | import java.sql.Date; import java.util.Calendar; | import java.sql.*; import java.util.*; | [
"java.sql",
"java.util"
] | java.sql; java.util; | 382,992 |
protected List<String> getExcludedVendorChoiceCodes() {
List<String> excludedVendorChoiceCodes = new ArrayList<String>();
for (int i = 0; i < PurapConstants.AUTO_CLOSE_EXCLUSION_VNDR_CHOICE_CODES.length; i++) {
String excludedCode = PurapConstants.AUTO_CLOSE_EXCLUSION_VNDR_CHOICE_CODES[i];
excludedVendorChoiceCodes.add(excludedCode);
}
return excludedVendorChoiceCodes;
} | List<String> function() { List<String> excludedVendorChoiceCodes = new ArrayList<String>(); for (int i = 0; i < PurapConstants.AUTO_CLOSE_EXCLUSION_VNDR_CHOICE_CODES.length; i++) { String excludedCode = PurapConstants.AUTO_CLOSE_EXCLUSION_VNDR_CHOICE_CODES[i]; excludedVendorChoiceCodes.add(excludedCode); } return excludedVendorChoiceCodes; } | /**
* Gets a List of excluded vendor choice codes from PurapConstants.
*
* @return a List of excluded vendor choice codes
*/ | Gets a List of excluded vendor choice codes from PurapConstants | getExcludedVendorChoiceCodes | {
"repo_name": "Ariah-Group/Finance",
"path": "af_webapp/src/main/java/org/kuali/kfs/module/purap/document/service/impl/PurchaseOrderServiceImpl.java",
"license": "apache-2.0",
"size": 122012
} | [
"java.util.ArrayList",
"java.util.List",
"org.kuali.kfs.module.purap.PurapConstants"
] | import java.util.ArrayList; import java.util.List; import org.kuali.kfs.module.purap.PurapConstants; | import java.util.*; import org.kuali.kfs.module.purap.*; | [
"java.util",
"org.kuali.kfs"
] | java.util; org.kuali.kfs; | 958,544 |
void registerDirectActions() {
registerCommonChromeActions(mContext, mActivityType, mMenuOrKeyboardActionController,
mGoBackAction, mTabModelSelector, mFindToolbarManager,
AutofillAssistantFacade.areDirectActionsAvailable(mActivityType)
? mBottomSheetController
: null,
mBrowserControls, mCompositorViewHolder, mActivityTabProvider);
if (mActivityType == ActivityType.TABBED) {
registerTabManipulationActions(mMenuOrKeyboardActionController, mTabModelSelector);
} else if (mActivityType == ActivityType.CUSTOM_TAB) {
allowMenuActions(mMenuOrKeyboardActionController, mTabModelSelector,
R.id.bookmark_this_page_id, R.id.preferences_id);
}
mDirectActionsRegistered = true;
} | void registerDirectActions() { registerCommonChromeActions(mContext, mActivityType, mMenuOrKeyboardActionController, mGoBackAction, mTabModelSelector, mFindToolbarManager, AutofillAssistantFacade.areDirectActionsAvailable(mActivityType) ? mBottomSheetController : null, mBrowserControls, mCompositorViewHolder, mActivityTabProvider); if (mActivityType == ActivityType.TABBED) { registerTabManipulationActions(mMenuOrKeyboardActionController, mTabModelSelector); } else if (mActivityType == ActivityType.CUSTOM_TAB) { allowMenuActions(mMenuOrKeyboardActionController, mTabModelSelector, R.id.bookmark_this_page_id, R.id.preferences_id); } mDirectActionsRegistered = true; } | /**
* Registers the set of direct actions available to assist apps.
*/ | Registers the set of direct actions available to assist apps | registerDirectActions | {
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/chrome/android/java/src/org/chromium/chrome/browser/directactions/DirectActionInitializer.java",
"license": "bsd-3-clause",
"size": 10662
} | [
"org.chromium.chrome.browser.autofill_assistant.AutofillAssistantFacade",
"org.chromium.chrome.browser.flags.ActivityType"
] | import org.chromium.chrome.browser.autofill_assistant.AutofillAssistantFacade; import org.chromium.chrome.browser.flags.ActivityType; | import org.chromium.chrome.browser.autofill_assistant.*; import org.chromium.chrome.browser.flags.*; | [
"org.chromium.chrome"
] | org.chromium.chrome; | 1,239,589 |
public Map<String, NodeList> getXmlAnnotations() {
return xmlAnnotations;
} | Map<String, NodeList> function() { return xmlAnnotations; } | /**
* Returns a {@link Map} of <annotation-xml/> elements, keyed on the "encoding" attribute with the
* {@link NodeList} content as values.
*/ | Returns a <code>Map</code> of elements, keyed on the "encoding" attribute with the <code>NodeList</code> content as values | getXmlAnnotations | {
"repo_name": "axkr/symja_android_library",
"path": "symja_android_library/matheclipse-external/src/main/java/uk/ac/ed/ph/snuggletex/utilities/UnwrappedParallelMathMLDOM.java",
"license": "gpl-3.0",
"size": 2115
} | [
"java.util.Map",
"org.w3c.dom.NodeList"
] | import java.util.Map; import org.w3c.dom.NodeList; | import java.util.*; import org.w3c.dom.*; | [
"java.util",
"org.w3c.dom"
] | java.util; org.w3c.dom; | 1,128,196 |
private void inlineFunction(
NodeTraversal t, Node callNode, FunctionState fs, InliningMode mode) {
Function fn = fs.getFn();
String fnName = fn.getName();
Node fnNode = fs.getSafeFnNode();
injector.inline(callNode, fnName, fnNode, mode);
t.getCompiler().reportCodeChange();
t.getCompiler().addToDebugLog("Inlined function: " + fn.getName());
}
} | void function( NodeTraversal t, Node callNode, FunctionState fs, InliningMode mode) { Function fn = fs.getFn(); String fnName = fn.getName(); Node fnNode = fs.getSafeFnNode(); injector.inline(callNode, fnName, fnNode, mode); t.getCompiler().reportCodeChange(); t.getCompiler().addToDebugLog(STR + fn.getName()); } } | /**
* Inline a function into the call site.
*/ | Inline a function into the call site | inlineFunction | {
"repo_name": "weitzj/closure-compiler",
"path": "src/com/google/javascript/jscomp/InlineFunctions.java",
"license": "apache-2.0",
"size": 34729
} | [
"com.google.javascript.jscomp.FunctionInjector",
"com.google.javascript.rhino.Node"
] | import com.google.javascript.jscomp.FunctionInjector; import com.google.javascript.rhino.Node; | import com.google.javascript.jscomp.*; import com.google.javascript.rhino.*; | [
"com.google.javascript"
] | com.google.javascript; | 187,441 |
public static SpannableStringBuilder getSpannablePriceNewText(Context context, String text) {
String[] result = text.split(":");
String first = result[0];
String second = result[1];
first = first.concat(":");
// Typeface font = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Medium.ttf");
SpannableStringBuilder builder = new SpannableStringBuilder();
SpannableString dkgraySpannable = new SpannableString(first + "");
builder.append(dkgraySpannable);
SpannableString blackSpannable = new SpannableString(second);
// blackSpannable.setSpan(new CustomTypefaceSpan("", font), 0, second.length(), 0);
builder.append(blackSpannable);
return builder;
} | static SpannableStringBuilder function(Context context, String text) { String[] result = text.split(":"); String first = result[0]; String second = result[1]; first = first.concat(":"); SpannableStringBuilder builder = new SpannableStringBuilder(); SpannableString dkgraySpannable = new SpannableString(first + ""); builder.append(dkgraySpannable); SpannableString blackSpannable = new SpannableString(second); builder.append(blackSpannable); return builder; } | /**
* Set string with spannable.
*
* @return: string with two different color
*/ | Set string with spannable | getSpannablePriceNewText | {
"repo_name": "QuixomTech/DeviceInfo",
"path": "app/src/main/java/com/quixom/apps/deviceinfo/utilities/Methods.java",
"license": "apache-2.0",
"size": 20686
} | [
"android.content.Context",
"android.text.SpannableString",
"android.text.SpannableStringBuilder"
] | import android.content.Context; import android.text.SpannableString; import android.text.SpannableStringBuilder; | import android.content.*; import android.text.*; | [
"android.content",
"android.text"
] | android.content; android.text; | 372,880 |
public Coord3D getCoord3D()
{
return coord;
}
| Coord3D function() { return coord; } | /**
* Get the coord of the plane the shapelist is associated with.
* @return see above.
*/ | Get the coord of the plane the shapelist is associated with | getCoord3D | {
"repo_name": "knabar/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/util/roi/model/ShapeList.java",
"license": "gpl-2.0",
"size": 3440
} | [
"org.openmicroscopy.shoola.util.roi.model.util.Coord3D"
] | import org.openmicroscopy.shoola.util.roi.model.util.Coord3D; | import org.openmicroscopy.shoola.util.roi.model.util.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 191,973 |
public Eviction constructEviction(InternalCacheBuildContext customizationContext,
HeapCacheForEviction hc, InternalEvictionListener l,
Cache2kConfig config, int availableProcessors) {
boolean strictEviction = config.isStrictEviction();
boolean boostConcurrency = config.isBoostConcurrency();
long maximumWeight = config.getMaximumWeight();
long entryCapacity = config.getEntryCapacity();
Weigher weigher = null;
if (config.getWeigher() != null) {
weigher = (Weigher) customizationContext.createCustomization(config.getWeigher());
if (maximumWeight <= 0) {
throw new IllegalArgumentException(
"maximumWeight > 0 expected. Weigher requires to set maximumWeight");
}
entryCapacity = -1;
} else {
if (entryCapacity < 0) {
entryCapacity = 2000;
}
if (entryCapacity == 0) {
throw new IllegalArgumentException("entryCapacity of 0 is not supported.");
}
}
int segmentCountOverride = HeapCache.TUNABLE.segmentCountOverride;
int segmentCount =
EvictionFactory.determineSegmentCount(
strictEviction, availableProcessors,
boostConcurrency, entryCapacity, maximumWeight, segmentCountOverride);
Eviction[] segments = new Eviction[segmentCount];
long maxSize = EvictionFactory.determineMaxSize(entryCapacity, segmentCount);
long maxWeight = EvictionFactory.determineMaxWeight(maximumWeight, segmentCount);
for (int i = 0; i < segments.length; i++) {
Eviction ev = new ClockProPlusEviction(hc, l, maxSize, weigher, maxWeight, strictEviction);
segments[i] = ev;
}
if (segmentCount == 1) {
return segments[0];
}
return new SegmentedEviction(segments);
} | Eviction function(InternalCacheBuildContext customizationContext, HeapCacheForEviction hc, InternalEvictionListener l, Cache2kConfig config, int availableProcessors) { boolean strictEviction = config.isStrictEviction(); boolean boostConcurrency = config.isBoostConcurrency(); long maximumWeight = config.getMaximumWeight(); long entryCapacity = config.getEntryCapacity(); Weigher weigher = null; if (config.getWeigher() != null) { weigher = (Weigher) customizationContext.createCustomization(config.getWeigher()); if (maximumWeight <= 0) { throw new IllegalArgumentException( STR); } entryCapacity = -1; } else { if (entryCapacity < 0) { entryCapacity = 2000; } if (entryCapacity == 0) { throw new IllegalArgumentException(STR); } } int segmentCountOverride = HeapCache.TUNABLE.segmentCountOverride; int segmentCount = EvictionFactory.determineSegmentCount( strictEviction, availableProcessors, boostConcurrency, entryCapacity, maximumWeight, segmentCountOverride); Eviction[] segments = new Eviction[segmentCount]; long maxSize = EvictionFactory.determineMaxSize(entryCapacity, segmentCount); long maxWeight = EvictionFactory.determineMaxWeight(maximumWeight, segmentCount); for (int i = 0; i < segments.length; i++) { Eviction ev = new ClockProPlusEviction(hc, l, maxSize, weigher, maxWeight, strictEviction); segments[i] = ev; } if (segmentCount == 1) { return segments[0]; } return new SegmentedEviction(segments); } | /**
* Construct segmented or queued eviction. For the moment hard coded.
* If capacity is at least 1000 we use 2 segments if 2 or more CPUs are available.
* Segmenting the eviction only improves for lots of concurrent inserts or evictions,
* there is no effect on read performance.
*/ | Construct segmented or queued eviction. For the moment hard coded. If capacity is at least 1000 we use 2 segments if 2 or more CPUs are available. Segmenting the eviction only improves for lots of concurrent inserts or evictions, there is no effect on read performance | constructEviction | {
"repo_name": "headissue/cache2k",
"path": "cache2k-core/src/main/java/org/cache2k/core/eviction/EvictionFactory.java",
"license": "gpl-3.0",
"size": 4757
} | [
"org.cache2k.config.Cache2kConfig",
"org.cache2k.core.HeapCache",
"org.cache2k.core.SegmentedEviction",
"org.cache2k.core.api.InternalCacheBuildContext",
"org.cache2k.operation.Weigher"
] | import org.cache2k.config.Cache2kConfig; import org.cache2k.core.HeapCache; import org.cache2k.core.SegmentedEviction; import org.cache2k.core.api.InternalCacheBuildContext; import org.cache2k.operation.Weigher; | import org.cache2k.config.*; import org.cache2k.core.*; import org.cache2k.core.api.*; import org.cache2k.operation.*; | [
"org.cache2k.config",
"org.cache2k.core",
"org.cache2k.operation"
] | org.cache2k.config; org.cache2k.core; org.cache2k.operation; | 1,230,938 |
public SearchSourceBuilder sort(String name, SortOrder order) {
return sort(SortBuilders.fieldSort(name).order(order));
} | SearchSourceBuilder function(String name, SortOrder order) { return sort(SortBuilders.fieldSort(name).order(order)); } | /**
* Adds a sort against the given field name and the sort ordering.
*
* @param name The name of the field
* @param order The sort ordering
*/ | Adds a sort against the given field name and the sort ordering | sort | {
"repo_name": "xinec/elasticsearch-innerhits-1.4.0",
"path": "src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java",
"license": "apache-2.0",
"size": 34237
} | [
"org.elasticsearch.search.sort.SortBuilders",
"org.elasticsearch.search.sort.SortOrder"
] | import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.search.sort.SortOrder; | import org.elasticsearch.search.sort.*; | [
"org.elasticsearch.search"
] | org.elasticsearch.search; | 2,625,839 |
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable<OpenidConnectProviderContractInner> listByService(
String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) {
return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context));
} | @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<OpenidConnectProviderContractInner> function( String resourceGroupName, String serviceName, String filter, Integer top, Integer skip, Context context) { return new PagedIterable<>(listByServiceAsync(resourceGroupName, serviceName, filter, top, skip, context)); } | /**
* Lists of all the OpenId Connect Providers.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param filter | Field | Usage | Supported operators | Supported functions
* |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq,
* ne, gt, lt | substringof, contains, startswith, endswith |</br>| displayName | filter | ge, le, eq, ne,
* gt, lt | substringof, contains, startswith, endswith |</br>.
* @param top Number of records to return.
* @param skip Number of records to skip.
* @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 paged OpenIdProviders list representation.
*/ | Lists of all the OpenId Connect Providers | listByService | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/apimanagement/azure-resourcemanager-apimanagement/src/main/java/com/azure/resourcemanager/apimanagement/implementation/OpenIdConnectProvidersClientImpl.java",
"license": "mit",
"size": 80530
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedIterable",
"com.azure.core.util.Context",
"com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.resourcemanager.apimanagement.fluent.models.OpenidConnectProviderContractInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.apimanagement.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 2,761,459 |
private final boolean isResolvable(Object base) {
return base instanceof Map<?, ?>;
}
| final boolean function(Object base) { return base instanceof Map<?, ?>; } | /**
* Test whether the given base should be resolved by this ELResolver.
*
* @param base
* The bean to analyze.
* @return base instanceof Map
*/ | Test whether the given base should be resolved by this ELResolver | isResolvable | {
"repo_name": "zwets/flowable-engine",
"path": "modules/flowable5-engine/src/main/java/org/activiti/engine/impl/javax/el/MapELResolver.java",
"license": "apache-2.0",
"size": 14160
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,324,516 |
default Versioned<V> putIfAbsent(K key, V value) {
return putIfAbsent(key, value, Duration.ZERO);
} | default Versioned<V> putIfAbsent(K key, V value) { return putIfAbsent(key, value, Duration.ZERO); } | /**
* If the specified key is not already associated with a value
* associates it with the given value and returns null, else returns the current value.
*
* @param key key with which the specified value is to be associated
* @param value value to be associated with the specified key
* @return the previous value associated with the specified key or null
* if key does not already mapped to a value.
*/ | If the specified key is not already associated with a value associates it with the given value and returns null, else returns the current value | putIfAbsent | {
"repo_name": "atomix/atomix",
"path": "core/src/main/java/io/atomix/core/map/AtomicMap.java",
"license": "apache-2.0",
"size": 16612
} | [
"io.atomix.utils.time.Versioned",
"java.time.Duration"
] | import io.atomix.utils.time.Versioned; import java.time.Duration; | import io.atomix.utils.time.*; import java.time.*; | [
"io.atomix.utils",
"java.time"
] | io.atomix.utils; java.time; | 219,478 |
public static void printHelp(PrintStream stream) throws IOException {
stream.println();
stream.println("NAME");
stream.println(" quota set - Set quota values for stores");
stream.println();
stream.println("SYNOPSIS");
stream.println(" quota set (<quota-type1>=<quota-value1>,...) -s <store-name-list> -u <url>");
stream.println(" [--confirm] [-n <node-id-list> | --all-nodes]");
stream.println();
stream.println("COMMENTS");
stream.println(" Valid quota types are:");
for(String quotaType: QuotaUtils.validQuotaTypes()) {
stream.println(" " + quotaType);
}
stream.println();
getParser().printHelpOn(stream);
stream.println();
} | static void function(PrintStream stream) throws IOException { stream.println(); stream.println("NAME"); stream.println(STR); stream.println(); stream.println(STR); stream.println(STR); stream.println(STR); stream.println(); stream.println(STR); stream.println(STR); for(String quotaType: QuotaUtils.validQuotaTypes()) { stream.println(" " + quotaType); } stream.println(); getParser().printHelpOn(stream); stream.println(); } | /**
* Prints help menu for command.
*
* @param stream PrintStream object for output
* @throws IOException
*/ | Prints help menu for command | printHelp | {
"repo_name": "cshaxu/voldemort",
"path": "src/java/voldemort/tools/admin/command/AdminCommandQuota.java",
"license": "apache-2.0",
"size": 29304
} | [
"java.io.IOException",
"java.io.PrintStream"
] | import java.io.IOException; import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 2,700,707 |
public String createKmaxPublication(PublicationDetail pubDetail); | String function(PublicationDetail pubDetail); | /**
* Create a new Publication (only the header - parameters)
*
* @param pubDetail a PublicationDetail
* @return the id of the new publication
* @see com.stratelia.webactiv.util.publication.model.PublicationDetail
* @since 1.0
*/ | Create a new Publication (only the header - parameters) | createKmaxPublication | {
"repo_name": "CecileBONIN/Silverpeas-Components",
"path": "kmelia/kmelia-ejb/src/main/java/com/stratelia/webactiv/kmelia/control/ejb/KmeliaBm.java",
"license": "agpl-3.0",
"size": 25457
} | [
"com.stratelia.webactiv.util.publication.model.PublicationDetail"
] | import com.stratelia.webactiv.util.publication.model.PublicationDetail; | import com.stratelia.webactiv.util.publication.model.*; | [
"com.stratelia.webactiv"
] | com.stratelia.webactiv; | 2,048,182 |
private void updateLocation(Location loc){
if (loc == null){
throw new NullPointerException();
}
if (actionSearchNearby){
setDataUri(Locatable.toDistanceSearchUri(mBaseContent, loc, searchRadius));
}
mLastLocation = loc;
} | void function(Location loc){ if (loc == null){ throw new NullPointerException(); } if (actionSearchNearby){ setDataUri(Locatable.toDistanceSearchUri(mBaseContent, loc, searchRadius)); } mLastLocation = loc; } | /**
* Called when the location updates.
*
* @param loc
*/ | Called when the location updates | updateLocation | {
"repo_name": "United-Nations/Locast-Rio-Android",
"path": "src/edu/mit/mobile/android/locast/ver2/casts/LocatableListWithMap.java",
"license": "gpl-2.0",
"size": 13416
} | [
"android.location.Location",
"edu.mit.mobile.android.locast.data.Locatable"
] | import android.location.Location; import edu.mit.mobile.android.locast.data.Locatable; | import android.location.*; import edu.mit.mobile.android.locast.data.*; | [
"android.location",
"edu.mit.mobile"
] | android.location; edu.mit.mobile; | 710,771 |
boolean endObjectEntry() throws ParseException, IOException;
| boolean endObjectEntry() throws ParseException, IOException; | /**
* Receive notification of the end of the value of previous object entry.
*
* @return false if the handler wants to stop parsing after return.
* @throws ParseException
*
* @see #startObjectEntry
*/ | Receive notification of the end of the value of previous object entry | endObjectEntry | {
"repo_name": "AntoineJanvier/Slyx",
"path": "Client/src/slyx/jsonsimple/parser/ContentHandler.java",
"license": "bsd-3-clause",
"size": 3067
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 490,563 |
public void refresh()
{ setMatch(match);
}
/////////////////////////////////////////////////////////////////
// SCORES /////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
private final static int LINE_POINTS = 0;
private final static int LINE_BOMBEDS = 1;
private final static int LINE_SELFBOMBINGS = 2;
private final static int LINE_BOMBINGS = 3;
private final static int LINE_TIME = 4;
private final static int LINE_ITEMS = 5;
private final static int LINE_BOMBS = 6;
private final static int LINE_PAINTINGS = 7;
private final static int LINE_CROWNS = 8;
private final static int COL_SCORES = 0;
private final static Map<Integer,String> SCORE_KEYS;
static
{ SCORE_KEYS = new HashMap<Integer, String>();
SCORE_KEYS.put(LINE_BOMBEDS, GuiKeys.COMMON_EVOLUTION_BUTTON_BOMBEDS);
SCORE_KEYS.put(LINE_SELFBOMBINGS, GuiKeys.COMMON_EVOLUTION_BUTTON_SELF_BOMBINGS);
SCORE_KEYS.put(LINE_BOMBINGS, GuiKeys.COMMON_EVOLUTION_BUTTON_BOMBINGS);
SCORE_KEYS.put(LINE_TIME, GuiKeys.COMMON_EVOLUTION_BUTTON_TIME);
SCORE_KEYS.put(LINE_ITEMS, GuiKeys.COMMON_EVOLUTION_BUTTON_ITEMS);
SCORE_KEYS.put(LINE_BOMBS, GuiKeys.COMMON_EVOLUTION_BUTTON_BOMBS);
SCORE_KEYS.put(LINE_PAINTINGS, GuiKeys.COMMON_EVOLUTION_BUTTON_PAINTINGS);
SCORE_KEYS.put(LINE_CROWNS, GuiKeys.COMMON_EVOLUTION_BUTTON_CROWNS);
SCORE_KEYS.put(LINE_POINTS, GuiKeys.COMMON_EVOLUTION_BUTTON_POINTS);
}
private int scoreWidth;
private int scoreFirstLineHeight;
private Score selectedScore = Score.BOMBEDS;
| void function() { setMatch(match); } private final static int LINE_POINTS = 0; private final static int LINE_BOMBEDS = 1; private final static int LINE_SELFBOMBINGS = 2; private final static int LINE_BOMBINGS = 3; private final static int LINE_TIME = 4; private final static int LINE_ITEMS = 5; private final static int LINE_BOMBS = 6; private final static int LINE_PAINTINGS = 7; private final static int LINE_CROWNS = 8; private final static int COL_SCORES = 0; private final static Map<Integer,String> SCORE_KEYS; static { SCORE_KEYS = new HashMap<Integer, String>(); SCORE_KEYS.put(LINE_BOMBEDS, GuiKeys.COMMON_EVOLUTION_BUTTON_BOMBEDS); SCORE_KEYS.put(LINE_SELFBOMBINGS, GuiKeys.COMMON_EVOLUTION_BUTTON_SELF_BOMBINGS); SCORE_KEYS.put(LINE_BOMBINGS, GuiKeys.COMMON_EVOLUTION_BUTTON_BOMBINGS); SCORE_KEYS.put(LINE_TIME, GuiKeys.COMMON_EVOLUTION_BUTTON_TIME); SCORE_KEYS.put(LINE_ITEMS, GuiKeys.COMMON_EVOLUTION_BUTTON_ITEMS); SCORE_KEYS.put(LINE_BOMBS, GuiKeys.COMMON_EVOLUTION_BUTTON_BOMBS); SCORE_KEYS.put(LINE_PAINTINGS, GuiKeys.COMMON_EVOLUTION_BUTTON_PAINTINGS); SCORE_KEYS.put(LINE_CROWNS, GuiKeys.COMMON_EVOLUTION_BUTTON_CROWNS); SCORE_KEYS.put(LINE_POINTS, GuiKeys.COMMON_EVOLUTION_BUTTON_POINTS); } private int scoreWidth; private int scoreFirstLineHeight; private Score selectedScore = Score.BOMBEDS; | /**
* Updates this panel
* (called after a change)
*/ | Updates this panel (called after a change) | refresh | {
"repo_name": "vlabatut/totalboumboum",
"path": "src/org/totalboumboum/gui/common/content/subpanel/events/MatchEvolutionSubPanel.java",
"license": "gpl-2.0",
"size": 24995
} | [
"java.util.HashMap",
"java.util.Map",
"org.totalboumboum.gui.tools.GuiKeys",
"org.totalboumboum.statistics.detailed.Score"
] | import java.util.HashMap; import java.util.Map; import org.totalboumboum.gui.tools.GuiKeys; import org.totalboumboum.statistics.detailed.Score; | import java.util.*; import org.totalboumboum.gui.tools.*; import org.totalboumboum.statistics.detailed.*; | [
"java.util",
"org.totalboumboum.gui",
"org.totalboumboum.statistics"
] | java.util; org.totalboumboum.gui; org.totalboumboum.statistics; | 7,742 |
@Test
public void testUnshift3() {
SBuilder instance = new SBuilder(4);
instance.shift();
instance.shift();
instance.unshift();
instance.unshift();
assertThat(instance.getIndent(), is(0));
} | void function() { SBuilder instance = new SBuilder(4); instance.shift(); instance.shift(); instance.unshift(); instance.unshift(); assertThat(instance.getIndent(), is(0)); } | /**
* Test of unshift method, of class SBuilder.
*/ | Test of unshift method, of class SBuilder | testUnshift3 | {
"repo_name": "tkob/yokohamaunit",
"path": "src/test/java/yokohama/unit/util/SBuilderTest.java",
"license": "mit",
"size": 3216
} | [
"org.hamcrest.CoreMatchers",
"org.junit.Assert"
] | import org.hamcrest.CoreMatchers; import org.junit.Assert; | import org.hamcrest.*; import org.junit.*; | [
"org.hamcrest",
"org.junit"
] | org.hamcrest; org.junit; | 1,903,405 |
private INodeSelectionUpdater getSelectionUpdater() {
return m_table == null ? new CNodeSelectionUpdater(getProjectTree(), findNode())
: new CEmptyNodeSelectionUpdater();
} | INodeSelectionUpdater function() { return m_table == null ? new CNodeSelectionUpdater(getProjectTree(), findNode()) : new CEmptyNodeSelectionUpdater(); } | /**
* Creates the project tree updater depending on the context in which the menu is built.
*
* @return Created tree updater object.
*/ | Creates the project tree updater depending on the context in which the menu is built | getSelectionUpdater | {
"repo_name": "guiquanz/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/Gui/MainWindow/ProjectTree/Nodes/Project/CProjectNodeMenuBuilder.java",
"license": "apache-2.0",
"size": 14963
} | [
"com.google.security.zynamics.binnavi.Gui"
] | import com.google.security.zynamics.binnavi.Gui; | import com.google.security.zynamics.binnavi.*; | [
"com.google.security"
] | com.google.security; | 409,355 |
public static EncodedCQCounter copy(EncodedCQCounter counterToCopy) {
EncodedCQCounter cqCounter = new EncodedCQCounter();
for (Entry<String, Integer> e : counterToCopy.values().entrySet()) {
cqCounter.setValue(e.getKey(), e.getValue());
}
return cqCounter;
}
public static final EncodedCQCounter NULL_COUNTER = new EncodedCQCounter() { | static EncodedCQCounter function(EncodedCQCounter counterToCopy) { EncodedCQCounter cqCounter = new EncodedCQCounter(); for (Entry<String, Integer> e : counterToCopy.values().entrySet()) { cqCounter.setValue(e.getKey(), e.getValue()); } return cqCounter; } public static final EncodedCQCounter NULL_COUNTER = new EncodedCQCounter() { | /**
* Copy constructor
* @param counterToCopy
* @return copy of the passed counter
*/ | Copy constructor | copy | {
"repo_name": "shehzaadn/phoenix",
"path": "phoenix-core/src/main/java/org/apache/phoenix/schema/PTable.java",
"license": "apache-2.0",
"size": 28386
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,995,599 |
public void setEndDate(Date endDate) {
this.endDate = endDate;
} | void function(Date endDate) { this.endDate = endDate; } | /**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column deploy_task_api.end_date
*
* @param endDate the value for deploy_task_api.end_date
* @mbggenerated
*/ | This method was generated by MyBatis Generator. This method sets the value of the database column deploy_task_api.end_date | setEndDate | {
"repo_name": "leonindy/camel",
"path": "camel-admin/src/main/java/com/dianping/phoenix/lb/deploy/model/api/DeployTaskApi.java",
"license": "gpl-3.0",
"size": 8241
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,750,542 |
@Before
public void setUp() throws Exception {
this.stdout = System.out;
this.outStream = new ByteArrayOutputStream();
System.setOut(new PrintStream(this.outStream));
Logger rootLogger = Logger.getRootLogger();
rootLogger.setLevel(Level.INFO);
rootLogger.addAppender(
new ConsoleAppender(
new PatternLayout("[%-5p] %m%n")
)
);
} | void function() throws Exception { this.stdout = System.out; this.outStream = new ByteArrayOutputStream(); System.setOut(new PrintStream(this.outStream)); Logger rootLogger = Logger.getRootLogger(); rootLogger.setLevel(Level.INFO); rootLogger.addAppender( new ConsoleAppender( new PatternLayout(STR) ) ); } | /**
* Set up the main logger. Redirect Out stream and create a test folder and the main
* test file in the java temp directory.
* @throws Exception
*/ | Set up the main logger. Redirect Out stream and create a test folder and the main test file in the java temp directory | setUp | {
"repo_name": "mpsonntag/crawler-to-rdf",
"path": "src/test/java/org/g_node/converter/ConverterJenaTest.java",
"license": "bsd-3-clause",
"size": 4407
} | [
"java.io.ByteArrayOutputStream",
"java.io.PrintStream",
"org.apache.log4j.ConsoleAppender",
"org.apache.log4j.Level",
"org.apache.log4j.Logger",
"org.apache.log4j.PatternLayout"
] | import java.io.ByteArrayOutputStream; import java.io.PrintStream; import org.apache.log4j.ConsoleAppender; import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; | import java.io.*; import org.apache.log4j.*; | [
"java.io",
"org.apache.log4j"
] | java.io; org.apache.log4j; | 1,948,186 |
private void addApplicationPermission(Connection connection, HashMap permissionMap, String applicationId)
throws SQLException {
final String query = "INSERT INTO AM_APPS_GROUP_PERMISSION (APPLICATION_ID, GROUP_ID, PERMISSION) " +
"VALUES (?, ?, ?)";
Map<String, Integer> map = permissionMap;
if (permissionMap != null) {
if (permissionMap.size() > 0) {
try (PreparedStatement statement = connection.prepareStatement(query)) {
for (Map.Entry<String, Integer> entry : map.entrySet()) {
statement.setString(1, applicationId);
statement.setString(2, entry.getKey());
//if permission value is UPDATE or DELETE we by default give them read permission also.
if (entry.getValue() < APIMgtConstants.Permission.READ_PERMISSION && entry.getValue() != 0) {
statement.setInt(3, entry.getValue() + APIMgtConstants.Permission.READ_PERMISSION);
} else {
statement.setInt(3, entry.getValue());
}
statement.addBatch();
}
statement.executeBatch();
}
}
} else {
try (PreparedStatement statement = connection.prepareStatement(query)) {
statement.setString(1, applicationId);
statement.setString(2, APIMgtConstants.Permission.EVERYONE_GROUP);
statement.setInt(3, 7);
statement.execute();
}
}
} | void function(Connection connection, HashMap permissionMap, String applicationId) throws SQLException { final String query = STR + STR; Map<String, Integer> map = permissionMap; if (permissionMap != null) { if (permissionMap.size() > 0) { try (PreparedStatement statement = connection.prepareStatement(query)) { for (Map.Entry<String, Integer> entry : map.entrySet()) { statement.setString(1, applicationId); statement.setString(2, entry.getKey()); if (entry.getValue() < APIMgtConstants.Permission.READ_PERMISSION && entry.getValue() != 0) { statement.setInt(3, entry.getValue() + APIMgtConstants.Permission.READ_PERMISSION); } else { statement.setInt(3, entry.getValue()); } statement.addBatch(); } statement.executeBatch(); } } } else { try (PreparedStatement statement = connection.prepareStatement(query)) { statement.setString(1, applicationId); statement.setString(2, APIMgtConstants.Permission.EVERYONE_GROUP); statement.setInt(3, 7); statement.execute(); } } } | /**
* This method will save permission in to AM_APPS_GROUP_PERMISSION table.
*
* @param connection Database connection
* @param permissionMap Permission Data
* @param applicationId Application Id
* @throws SQLException If failed to add application.
*/ | This method will save permission in to AM_APPS_GROUP_PERMISSION table | addApplicationPermission | {
"repo_name": "lakmali/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.core/src/main/java/org/wso2/carbon/apimgt/core/dao/impl/ApplicationDAOImpl.java",
"license": "apache-2.0",
"size": 23217
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException",
"java.util.HashMap",
"java.util.Map",
"org.wso2.carbon.apimgt.core.util.APIMgtConstants"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; import org.wso2.carbon.apimgt.core.util.APIMgtConstants; | import java.sql.*; import java.util.*; import org.wso2.carbon.apimgt.core.util.*; | [
"java.sql",
"java.util",
"org.wso2.carbon"
] | java.sql; java.util; org.wso2.carbon; | 2,174,883 |
public void setAssetValueAmt (BigDecimal AssetValueAmt); | void function (BigDecimal AssetValueAmt); | /** Set Asset value.
* Book Value of the asset
*/ | Set Asset value. Book Value of the asset | setAssetValueAmt | {
"repo_name": "arthurmelo88/palmetalADP",
"path": "adempiere_360/base/src/org/compiere/model/I_A_Asset_Retirement.java",
"license": "gpl-2.0",
"size": 5411
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 1,276,628 |
@OnAwt
public void openDialog() throws PropertyVetoException {
setStatus(Status.OPENED);
dialog.setVisible(true);
} | void function() throws PropertyVetoException { setStatus(Status.OPENED); dialog.setVisible(true); } | /**
* Opens the dialog.
* <p>
* <h2>AWT Thread</h2>
* Should be called in the AWT event dispatch thread.
* </p>
*
* @throws PropertyVetoException
* if the opening of the dialog was vetoed.
*
* @since 3.5
*/ | Opens the dialog. AWT Thread Should be called in the AWT event dispatch thread. | openDialog | {
"repo_name": "devent/prefdialog",
"path": "prefdialog-dialog/src/main/java/com/anrisoftware/prefdialog/simpledialog/SimpleDialog.java",
"license": "gpl-3.0",
"size": 24685
} | [
"java.beans.PropertyVetoException"
] | import java.beans.PropertyVetoException; | import java.beans.*; | [
"java.beans"
] | java.beans; | 466,687 |
final Type getType(final int index) {
return memberTypes[index];
}
/**
* Returns the type associated to the given attribute name, or {@code null} if none.
* This method is functionally equivalent to (omitting the check for null value):
*
* {@preformat java
* getMemberTypes().get(memberName).getTypeName();
* } | final Type getType(final int index) { return memberTypes[index]; } /** * Returns the type associated to the given attribute name, or {@code null} if none. * This method is functionally equivalent to (omitting the check for null value): * * {@preformat java * getMemberTypes().get(memberName).getTypeName(); * } | /**
* Returns the type at the given index.
*/ | Returns the type at the given index | getType | {
"repo_name": "Geomatys/sis",
"path": "core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultRecordType.java",
"license": "apache-2.0",
"size": 19474
} | [
"org.opengis.util.Type"
] | import org.opengis.util.Type; | import org.opengis.util.*; | [
"org.opengis.util"
] | org.opengis.util; | 2,824,951 |
public void startServer() throws Exception {
server = new LdapServer();
int serverPort = 10389;
server.setTransports(new TcpTransport(serverPort));
server.setDirectoryService(service);
server.start();
} | void function() throws Exception { server = new LdapServer(); int serverPort = 10389; server.setTransports(new TcpTransport(serverPort)); server.setDirectoryService(service); server.start(); } | /**
* starts the LdapServer
*
* @throws Exception
*/ | starts the LdapServer | startServer | {
"repo_name": "nevenr/vertx-auth",
"path": "vertx-auth-shiro/src/test/java/io/vertx/ext/auth/test/shiro/EmbeddedADS.java",
"license": "apache-2.0",
"size": 8630
} | [
"org.apache.directory.server.ldap.LdapServer",
"org.apache.directory.server.protocol.shared.transport.TcpTransport"
] | import org.apache.directory.server.ldap.LdapServer; import org.apache.directory.server.protocol.shared.transport.TcpTransport; | import org.apache.directory.server.ldap.*; import org.apache.directory.server.protocol.shared.transport.*; | [
"org.apache.directory"
] | org.apache.directory; | 1,700,032 |
public static ServerLocator createServerLocator(final boolean ha,
final DiscoveryGroupConfiguration groupConfiguration) {
return new ServerLocatorImpl(ha, groupConfiguration);
} | static ServerLocator function(final boolean ha, final DiscoveryGroupConfiguration groupConfiguration) { return new ServerLocatorImpl(ha, groupConfiguration); } | /**
* Create a ServerLocator which creates session factories from a set of live servers, no HA
* backup information is propagated to the client The UDP address and port are used to listen for
* live servers in the cluster
*
* @param ha The Locator will support topology updates and ha (this required the server to be
* clustered, otherwise the first connection will timeout)
* @param groupConfiguration
* @return the ServerLocator
*/ | Create a ServerLocator which creates session factories from a set of live servers, no HA backup information is propagated to the client The UDP address and port are used to listen for live servers in the cluster | createServerLocator | {
"repo_name": "paulgallagher75/activemq-artemis",
"path": "artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java",
"license": "apache-2.0",
"size": 17476
} | [
"org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration",
"org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl"
] | import org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration; import org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl; | import org.apache.activemq.artemis.api.core.*; import org.apache.activemq.artemis.core.client.impl.*; | [
"org.apache.activemq"
] | org.apache.activemq; | 1,574,469 |
public static GrantAchievementEvent createGrantAchievementEvent(Game game, Cause cause, Text originalMessage, Text message, MessageSink originalSink, MessageSink sink, Achievement achievement) {
Map<String, Object> values = Maps.newHashMap();
values.put("game", game);
values.put("cause", cause);
values.put("originalMessage", originalMessage);
values.put("message", message);
values.put("originalSink", originalSink);
values.put("sink", sink);
values.put("achievement", achievement);
return SpongeEventFactoryUtils.createEventImpl(GrantAchievementEvent.class, values);
} | static GrantAchievementEvent function(Game game, Cause cause, Text originalMessage, Text message, MessageSink originalSink, MessageSink sink, Achievement achievement) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("cause", cause); values.put(STR, originalMessage); values.put(STR, message); values.put(STR, originalSink); values.put("sink", sink); values.put(STR, achievement); return SpongeEventFactoryUtils.createEventImpl(GrantAchievementEvent.class, values); } | /**
* AUTOMATICALLY GENERATED, DO NOT EDIT.
* Creates a new instance of
* {@link org.spongepowered.api.event.achievement.GrantAchievementEvent}.
*
* @param game The game
* @param cause The cause
* @param originalMessage The original message
* @param message The message
* @param originalSink The original sink
* @param sink The sink
* @param achievement The achievement
* @return A new grant achievement event
*/ | AUTOMATICALLY GENERATED, DO NOT EDIT. Creates a new instance of <code>org.spongepowered.api.event.achievement.GrantAchievementEvent</code> | createGrantAchievementEvent | {
"repo_name": "jamierocks/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/event/SpongeEventFactory.java",
"license": "mit",
"size": 196993
} | [
"com.google.common.collect.Maps",
"java.util.Map",
"org.spongepowered.api.Game",
"org.spongepowered.api.event.achievement.GrantAchievementEvent",
"org.spongepowered.api.event.cause.Cause",
"org.spongepowered.api.statistic.achievement.Achievement",
"org.spongepowered.api.text.Text",
"org.spongepowered.api.text.sink.MessageSink"
] | import com.google.common.collect.Maps; import java.util.Map; import org.spongepowered.api.Game; import org.spongepowered.api.event.achievement.GrantAchievementEvent; import org.spongepowered.api.event.cause.Cause; import org.spongepowered.api.statistic.achievement.Achievement; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.sink.MessageSink; | import com.google.common.collect.*; import java.util.*; import org.spongepowered.api.*; import org.spongepowered.api.event.achievement.*; import org.spongepowered.api.event.cause.*; import org.spongepowered.api.statistic.achievement.*; import org.spongepowered.api.text.*; import org.spongepowered.api.text.sink.*; | [
"com.google.common",
"java.util",
"org.spongepowered.api"
] | com.google.common; java.util; org.spongepowered.api; | 2,173,132 |
public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
{
boolean loaded = (infoflags & ImageObserver.ALLBITS) > 0;
boolean error = (infoflags & ImageObserver.ERROR) > 0;
if (loaded || error) {
_consumer.tilesUpdated(loaded);
}
return !loaded;
} | boolean function(Image img, int infoflags, int x, int y, int width, int height) { boolean loaded = (infoflags & ImageObserver.ALLBITS) > 0; boolean error = (infoflags & ImageObserver.ERROR) > 0; if (loaded error) { _consumer.tilesUpdated(loaded); } return !loaded; } | /**
* Method called by image loader to inform of updates to the tiles
* @param img the image
* @param infoflags flags describing how much of the image is known
* @param x ignored
* @param y ignored
* @param width ignored
* @param height ignored
* @return false to carry on loading, true to stop
*/ | Method called by image loader to inform of updates to the tiles | imageUpdate | {
"repo_name": "sebastic/GpsPrune",
"path": "tim/prune/gui/map/MapTileManager.java",
"license": "gpl-2.0",
"size": 7451
} | [
"java.awt.Image",
"java.awt.image.ImageObserver"
] | import java.awt.Image; import java.awt.image.ImageObserver; | import java.awt.*; import java.awt.image.*; | [
"java.awt"
] | java.awt; | 912,573 |
protected NodeFigure createMainFigure() {
NodeFigure figure = createNodePlate();
figure.setLayoutManager(new StackLayout());
IFigure shape = createNodeShape();
figure.add(shape);
contentPane = setupContentPane(shape);
return figure;
} | NodeFigure function() { NodeFigure figure = createNodePlate(); figure.setLayoutManager(new StackLayout()); IFigure shape = createNodeShape(); figure.add(shape); contentPane = setupContentPane(shape); return figure; } | /**
* Creates figure for this edit part.
*
* Body of this method does not depend on settings in generation model
* so you may safely remove <i>generated</i> tag and modify it.
*
* @generated
*/ | Creates figure for this edit part. Body of this method does not depend on settings in generation model so you may safely remove generated tag and modify it | createMainFigure | {
"repo_name": "prabushi/devstudio-tooling-esb",
"path": "plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/edit/parts/WSDLEndPointEditPart.java",
"license": "apache-2.0",
"size": 28024
} | [
"org.eclipse.draw2d.IFigure",
"org.eclipse.draw2d.StackLayout",
"org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure"
] | import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.StackLayout; import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure; | import org.eclipse.draw2d.*; import org.eclipse.gmf.runtime.gef.ui.figures.*; | [
"org.eclipse.draw2d",
"org.eclipse.gmf"
] | org.eclipse.draw2d; org.eclipse.gmf; | 149,396 |
if (value == null) {
if (targetType.equals(Boolean.TYPE)) {
return false;
}
return value;
}
final Class<? extends Object> actualType = value.getClass();
if (targetType.isPrimitive()) {
targetType = PrimitiveTypes.valueOf(targetType.toString().toUpperCase()).getWraper();
}
if (targetType.isAssignableFrom(actualType)) {
return value;
}
if (Number.class.isAssignableFrom(actualType) && Number.class.isAssignableFrom(targetType)) {
return value;
}
if (!(value instanceof String)) {
final String message = String.format("Expected type '%s' for '%s'. Found '%s'", targetType.getName(), name, actualType.getName());
throw new IllegalArgumentException(message);
}
final String stringValue = (String) value;
if (Enum.class.isAssignableFrom(targetType)) {
final Class<? extends Enum> enumType = (Class<? extends Enum>) targetType;
try {
return Enum.valueOf(enumType, stringValue);
} catch (final IllegalArgumentException e) {
try {
return Enum.valueOf(enumType, stringValue.toUpperCase());
} catch (final IllegalArgumentException e1) {
return Enum.valueOf(enumType, stringValue.toLowerCase());
}
}
}
try {
// Force static initializers to run
Class.forName(targetType.getName(), true, targetType.getClassLoader());
} catch (final ClassNotFoundException e) {
e.printStackTrace();
}
final PropertyEditor editor = Editors.get(targetType);
if (editor == null) {
final Object result = create(targetType, stringValue);
if (result != null) {
return result;
}
}
if (editor == null) {
final String message = String.format("Cannot convert to '%s' for '%s'. No PropertyEditor", targetType.getName(), name);
throw new IllegalArgumentException(message);
}
editor.setAsText(stringValue);
return editor.getValue();
} | if (value == null) { if (targetType.equals(Boolean.TYPE)) { return false; } return value; } final Class<? extends Object> actualType = value.getClass(); if (targetType.isPrimitive()) { targetType = PrimitiveTypes.valueOf(targetType.toString().toUpperCase()).getWraper(); } if (targetType.isAssignableFrom(actualType)) { return value; } if (Number.class.isAssignableFrom(actualType) && Number.class.isAssignableFrom(targetType)) { return value; } if (!(value instanceof String)) { final String message = String.format(STR, targetType.getName(), name, actualType.getName()); throw new IllegalArgumentException(message); } final String stringValue = (String) value; if (Enum.class.isAssignableFrom(targetType)) { final Class<? extends Enum> enumType = (Class<? extends Enum>) targetType; try { return Enum.valueOf(enumType, stringValue); } catch (final IllegalArgumentException e) { try { return Enum.valueOf(enumType, stringValue.toUpperCase()); } catch (final IllegalArgumentException e1) { return Enum.valueOf(enumType, stringValue.toLowerCase()); } } } try { Class.forName(targetType.getName(), true, targetType.getClassLoader()); } catch (final ClassNotFoundException e) { e.printStackTrace(); } final PropertyEditor editor = Editors.get(targetType); if (editor == null) { final Object result = create(targetType, stringValue); if (result != null) { return result; } } if (editor == null) { final String message = String.format(STR, targetType.getName(), name); throw new IllegalArgumentException(message); } editor.setAsText(stringValue); return editor.getValue(); } | /**
* Todo : change this so the Cmd class being used in the conversion
* can itself have "editor" methods -- static methods like the ones below
*
* The 'public static Foo create(String)' method would take precedence over
* all other "editor" logic.
*
*/ | Todo : change this so the Cmd class being used in the conversion can itself have "editor" methods -- static methods like the ones below The 'public static Foo create(String)' method would take precedence over all other "editor" logic | convert | {
"repo_name": "danielsoro/crest",
"path": "tomitribe-crest/src/main/java/org/tomitribe/crest/converters/Converter.java",
"license": "apache-2.0",
"size": 5423
} | [
"java.beans.PropertyEditor",
"org.tomitribe.crest.cmds.processors.types.PrimitiveTypes",
"org.tomitribe.util.editor.Editors"
] | import java.beans.PropertyEditor; import org.tomitribe.crest.cmds.processors.types.PrimitiveTypes; import org.tomitribe.util.editor.Editors; | import java.beans.*; import org.tomitribe.crest.cmds.processors.types.*; import org.tomitribe.util.editor.*; | [
"java.beans",
"org.tomitribe.crest",
"org.tomitribe.util"
] | java.beans; org.tomitribe.crest; org.tomitribe.util; | 1,995,640 |
public static String readAssetAsString(final Context ctx, final String name)
throws IOException {
final Reader r = new BufferedReader(new InputStreamReader(
ctx.getAssets().open(name), UTF_8));
try {
return readString(r);
} finally {
r.close();
}
} | static String function(final Context ctx, final String name) throws IOException { final Reader r = new BufferedReader(new InputStreamReader( ctx.getAssets().open(name), UTF_8)); try { return readString(r); } finally { r.close(); } } | /**
* Attempts to read the asset with the given name as a utf-8 string.
* @throws IOException reading the asset failed (most likely the given name
* was wrong)
*/ | Attempts to read the asset with the given name as a utf-8 string | readAssetAsString | {
"repo_name": "TheAppGuys/winzigsql",
"path": "src/main/java/de/theappguys/winzigsql/ResourceUtils.java",
"license": "bsd-3-clause",
"size": 2588
} | [
"android.content.Context",
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStreamReader",
"java.io.Reader"
] | import android.content.Context; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; | import android.content.*; import java.io.*; | [
"android.content",
"java.io"
] | android.content; java.io; | 1,532,601 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.