method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public void newPartitioningSchema( TransMeta transMeta ) {
delegates.partitions.newPartitioningSchema( transMeta );
} | void function( TransMeta transMeta ) { delegates.partitions.newPartitioningSchema( transMeta ); } | /**
* This creates a new partitioning schema, edits it and adds it to the transformation metadata if its name is not a
* duplicate of any of existing
*/ | This creates a new partitioning schema, edits it and adds it to the transformation metadata if its name is not a duplicate of any of existing | newPartitioningSchema | {
"repo_name": "cjsonger/pentaho-kettle",
"path": "ui/src/main/java/org/pentaho/di/ui/spoon/Spoon.java",
"license": "apache-2.0",
"size": 341299
} | [
"org.pentaho.di.trans.TransMeta"
] | import org.pentaho.di.trans.TransMeta; | import org.pentaho.di.trans.*; | [
"org.pentaho.di"
] | org.pentaho.di; | 1,902,098 |
public void executeRenderResult(String finalLocation, ActionInvocation invocation) throws Exception {
ValueStack stack = ActionContext.getContext().getValueStack();
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
ServletContext servletContext = ServletActionContext.getServletContext();
Servlet servlet = JspSupportServlet.jspSupportServlet;
velocityManager.init(servletContext);
boolean usedJspFactory = false;
PageContext pageContext = (PageContext) ActionContext.getContext().get(ServletActionContext.PAGE_CONTEXT);
if (pageContext == null && servlet != null) {
pageContext = jspFactory.getPageContext(servlet, request, response, null, true, 8192, true);
ActionContext.getContext().put(ServletActionContext.PAGE_CONTEXT, pageContext);
usedJspFactory = true;
}
try {
String encoding = getEncoding(finalLocation);
String contentType = getContentType(finalLocation);
if (encoding != null) {
contentType = contentType + ";charset=" + encoding;
}
response.setContentType(contentType);
Template t = getTemplate(stack, velocityManager.getVelocityEngine(), invocation, finalLocation, encoding);
Context context = createContext(velocityManager, stack, request, response, finalLocation);
Writer writer = new OutputStreamWriter(response.getOutputStream(), encoding);
t.merge(context, writer);
// always flush the writer (we used to only flush it if this was a
// jspWriter, but someone asked
// to do it all the time (WW-829). Since Velocity support is being
// deprecated, we'll oblige :)
writer.flush();
} catch (Exception e) {
LOG.error("Unable to render Velocity Template, '" + finalLocation + "'", e);
throw e;
} finally {
if (usedJspFactory) {
jspFactory.releasePageContext(pageContext);
}
}
}
| void function(String finalLocation, ActionInvocation invocation) throws Exception { ValueStack stack = ActionContext.getContext().getValueStack(); HttpServletRequest request = ServletActionContext.getRequest(); HttpServletResponse response = ServletActionContext.getResponse(); ServletContext servletContext = ServletActionContext.getServletContext(); Servlet servlet = JspSupportServlet.jspSupportServlet; velocityManager.init(servletContext); boolean usedJspFactory = false; PageContext pageContext = (PageContext) ActionContext.getContext().get(ServletActionContext.PAGE_CONTEXT); if (pageContext == null && servlet != null) { pageContext = jspFactory.getPageContext(servlet, request, response, null, true, 8192, true); ActionContext.getContext().put(ServletActionContext.PAGE_CONTEXT, pageContext); usedJspFactory = true; } try { String encoding = getEncoding(finalLocation); String contentType = getContentType(finalLocation); if (encoding != null) { contentType = contentType + STR + encoding; } response.setContentType(contentType); Template t = getTemplate(stack, velocityManager.getVelocityEngine(), invocation, finalLocation, encoding); Context context = createContext(velocityManager, stack, request, response, finalLocation); Writer writer = new OutputStreamWriter(response.getOutputStream(), encoding); t.merge(context, writer); writer.flush(); } catch (Exception e) { LOG.error(STR + finalLocation + "'", e); throw e; } finally { if (usedJspFactory) { jspFactory.releasePageContext(pageContext); } } } | /**
* Creates a Velocity context from the action, loads a Velocity template and
* executes the template. Output is written to the servlet output stream.
*
* @param finalLocation the location of the Velocity template
* @param invocation an encapsulation of the action execution state.
* @throws Exception if an error occurs when creating the Velocity context,
* loading or executing the template or writing output to the
* servlet response stream.
*/ | Creates a Velocity context from the action, loads a Velocity template and executes the template. Output is written to the servlet output stream | executeRenderResult | {
"repo_name": "Ile2/struts2-showcase-demo",
"path": "src/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletVelocityResult.java",
"license": "apache-2.0",
"size": 10930
} | [
"com.opensymphony.xwork2.ActionContext",
"com.opensymphony.xwork2.ActionInvocation",
"com.opensymphony.xwork2.util.ValueStack",
"java.io.OutputStreamWriter",
"java.io.Writer",
"javax.servlet.Servlet",
"javax.servlet.ServletContext",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpSe... | import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.util.ValueStack; import java.io.OutputStreamWriter; import java.io.Writer; import javax.servlet.Servlet; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.jsp.PageContext; import org.apache.struts2.ServletActionContext; import org.apache.struts2.views.JspSupportServlet; import org.apache.velocity.Template; import org.apache.velocity.context.Context; | import com.opensymphony.xwork2.*; import com.opensymphony.xwork2.util.*; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import org.apache.struts2.*; import org.apache.struts2.views.*; import org.apache.velocity.*; import org.apache.velocity.context.*; | [
"com.opensymphony.xwork2",
"java.io",
"javax.servlet",
"org.apache.struts2",
"org.apache.velocity"
] | com.opensymphony.xwork2; java.io; javax.servlet; org.apache.struts2; org.apache.velocity; | 1,567,682 |
public void shiftEpisode(String shifter)
{
if (UHConfig.EPISODES.ENABLED.get())
{
this.episode++;
final EpisodeChangedCause cause;
if (shifter == null || shifter.equals("")) cause = EpisodeChangedCause.FINISHED;
else cause = EpisodeChangedCause.SHIFTED;
// Restarts the timer.
// Useless for a normal start (restarted in the event), but needed if the episode was shifted.
if (cause == EpisodeChangedCause.SHIFTED)
{
p.getTimerManager().getMainTimer().start();
}
p.getServer().getPluginManager().callEvent(new UHEpisodeChangedEvent(episode, cause, shifter));
}
} | void function(String shifter) { if (UHConfig.EPISODES.ENABLED.get()) { this.episode++; final EpisodeChangedCause cause; if (shifter == null shifter.equals("")) cause = EpisodeChangedCause.FINISHED; else cause = EpisodeChangedCause.SHIFTED; if (cause == EpisodeChangedCause.SHIFTED) { p.getTimerManager().getMainTimer().start(); } p.getServer().getPluginManager().callEvent(new UHEpisodeChangedEvent(episode, cause, shifter)); } } | /**
* Shifts an episode.
*
* @param shifter The player who shifts the episode, an empty string if the episode is shifted
* because the timer is up.
*/ | Shifts an episode | shiftEpisode | {
"repo_name": "AmauryCarrade/UHPlugin",
"path": "src/main/java/eu/carrade/amaury/UHCReloaded/game/UHGameManager.java",
"license": "gpl-3.0",
"size": 42228
} | [
"eu.carrade.amaury.UHCReloaded"
] | import eu.carrade.amaury.UHCReloaded; | import eu.carrade.amaury.*; | [
"eu.carrade.amaury"
] | eu.carrade.amaury; | 2,582,283 |
public void closeTablePool(final String tableName) throws IOException {
Collection<HTableInterface> tables = this.tables.values(tableName);
if (tables != null) {
for (HTableInterface table : tables) {
this.tableFactory.releaseHTableInterface(table);
}
}
this.tables.remove(tableName);
} | void function(final String tableName) throws IOException { Collection<HTableInterface> tables = this.tables.values(tableName); if (tables != null) { for (HTableInterface table : tables) { this.tableFactory.releaseHTableInterface(table); } } this.tables.remove(tableName); } | /**
* Closes all the HTable instances , belonging to the given table, in the
* table pool.
* <p>
* Note: this is a 'shutdown' of the given table pool and different from
* {@link #putTable(HTableInterface)}, that is used to return the table
* instance to the pool for future re-use.
*
* @param tableName
*/ | Closes all the HTable instances , belonging to the given table, in the table pool. Note: this is a 'shutdown' of the given table pool and different from <code>#putTable(HTableInterface)</code>, that is used to return the table instance to the pool for future re-use | closeTablePool | {
"repo_name": "Jackygq1982/hbase_src",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTablePool.java",
"license": "apache-2.0",
"size": 19955
} | [
"java.io.IOException",
"java.util.Collection"
] | import java.io.IOException; import java.util.Collection; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,003,789 |
@Test(expected = BgpParseException.class)
public void bgpUpdateMessageTest16() throws BgpParseException {
byte[] updateMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff,
(byte) 0xff, (byte) 0xff, 0x00, 0x60, 0x02, 0x00, 0x00, //withdrawn len
0x00, 0x49, //path attribute len
(byte) 0xff, 0x01, 0x01, 0x00, //origin
0x40, 0x02, 0x04, 0x02, 0x01, (byte) 0xfd, (byte) 0xe9, //as_path
(byte) 0x80, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, //med
(byte) 0x80, 0x0e, 0x34, 0x40, 0x06, 0x47, //mpreach with safi = 71
0x04, 0x04, 0x00, 0x00, 0x01, //nexthop
0x00, //reserved
0x00, 0x01, 0x00,
0x27, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x1a, 0x02, 0x00,
0x00, 0x04, 0x00, 0x00, 0x08, (byte) 0xae, 0x02, 0x01, 0x00, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03,
0x00, 0x06, 0x19, 0x00, (byte) 0x95, 0x01, (byte) 0x90, 0x58}; //node nlri};
ChannelBuffer buffer = ChannelBuffers.dynamicBuffer();
buffer.writeBytes(updateMsg);
BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader();
BgpMessage message;
BgpHeader bgpHeader = new BgpHeader();
message = reader.readFrom(buffer, bgpHeader);
assertThat(message, instanceOf(BgpUpdateMsg.class));
} | @Test(expected = BgpParseException.class) void function() throws BgpParseException { byte[] updateMsg = new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff, 0x00, 0x60, 0x02, 0x00, 0x00, 0x00, 0x49, (byte) 0xff, 0x01, 0x01, 0x00, 0x40, 0x02, 0x04, 0x02, 0x01, (byte) 0xfd, (byte) 0xe9, (byte) 0x80, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, (byte) 0x80, 0x0e, 0x34, 0x40, 0x06, 0x47, 0x04, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x27, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x1a, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x08, (byte) 0xae, 0x02, 0x01, 0x00, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x00, 0x06, 0x19, 0x00, (byte) 0x95, 0x01, (byte) 0x90, 0x58}; ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); buffer.writeBytes(updateMsg); BgpMessageReader<BgpMessage> reader = BgpFactories.getGenericReader(); BgpMessage message; BgpHeader bgpHeader = new BgpHeader(); message = reader.readFrom(buffer, bgpHeader); assertThat(message, instanceOf(BgpUpdateMsg.class)); } | /**
* In this test case, Invalid AFI is given as input and expecting
* an exception.
*/ | In this test case, Invalid AFI is given as input and expecting an exception | bgpUpdateMessageTest16 | {
"repo_name": "sonu283304/onos",
"path": "protocols/bgp/bgpio/src/test/java/org/onosproject/bgpio/protocol/BgpUpdateMsgTest.java",
"license": "apache-2.0",
"size": 100189
} | [
"org.hamcrest.MatcherAssert",
"org.hamcrest.Matchers",
"org.jboss.netty.buffer.ChannelBuffer",
"org.jboss.netty.buffer.ChannelBuffers",
"org.junit.Test",
"org.onosproject.bgpio.exceptions.BgpParseException",
"org.onosproject.bgpio.types.BgpHeader"
] | import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.junit.Test; import org.onosproject.bgpio.exceptions.BgpParseException; import org.onosproject.bgpio.types.BgpHeader; | import org.hamcrest.*; import org.jboss.netty.buffer.*; import org.junit.*; import org.onosproject.bgpio.exceptions.*; import org.onosproject.bgpio.types.*; | [
"org.hamcrest",
"org.jboss.netty",
"org.junit",
"org.onosproject.bgpio"
] | org.hamcrest; org.jboss.netty; org.junit; org.onosproject.bgpio; | 2,701,995 |
@Message(id = 11400, value = "name == null")
IllegalArgumentException nameNull(); | @Message(id = 11400, value = STR) IllegalArgumentException nameNull(); | /**
* nameNull method definition.
* @return IllegalArgumentException
*/ | nameNull method definition | nameNull | {
"repo_name": "tadayosi/switchyard",
"path": "core/common/core/src/main/java/org/switchyard/common/CommonCoreMessages.java",
"license": "apache-2.0",
"size": 1613
} | [
"org.jboss.logging.annotations.Message"
] | import org.jboss.logging.annotations.Message; | import org.jboss.logging.annotations.*; | [
"org.jboss.logging"
] | org.jboss.logging; | 1,197,284 |
public OneResponse chmod(int octet)
{
return chmod(client, id, octet);
}
// =================================
// Helpers
// ================================= | OneResponse function(int octet) { return chmod(client, id, octet); } | /**
* Changes the permissions
*
* @param octet Permissions octed , e.g. 640
* @return If an error occurs the error message contains the reason.
*/ | Changes the permissions | chmod | {
"repo_name": "bcec/opennebula3.4.1",
"path": "src/oca/java/src/org/opennebula/client/datastore/Datastore.java",
"license": "apache-2.0",
"size": 11298
} | [
"org.opennebula.client.OneResponse"
] | import org.opennebula.client.OneResponse; | import org.opennebula.client.*; | [
"org.opennebula.client"
] | org.opennebula.client; | 2,512,049 |
@GwtIncompatible("used only in GwtIncompatible tests")
private static void runExtensiveMergerTest(Merger merger)
throws InterruptedException {
int inputCount = new TestFutureBatch().allFutures.size();
for (int i = 0; i < inputCount; i++) {
for (int j = 0; j < inputCount; j++) {
for (boolean iBeforeJ : new boolean[]{true, false}) {
TestFutureBatch inputs = new TestFutureBatch();
ListenableFuture<String> iFuture = inputs.allFutures.get(i).future;
ListenableFuture<String> jFuture = inputs.allFutures.get(j).future;
ListenableFuture<List<String>> future =
merger.merged(iFuture, jFuture);
// Test timed get before we've completed any delayed futures.
try {
List<String> result = future.get(0, MILLISECONDS);
assertTrue("Got " + result,
Arrays.asList("a", null).containsAll(result));
} catch (CancellationException e) {
assertTrue(merger == Merger.allMerger);
inputs.assertHasImmediateCancel(iFuture, jFuture, e);
} catch (ExecutionException e) {
assertTrue(merger == Merger.allMerger);
inputs.assertHasImmediateFailure(iFuture, jFuture, e);
} catch (TimeoutException e) {
inputs.assertHasDelayed(iFuture, jFuture, e);
}
// Same tests with pseudoTimedGet.
try {
List<String> result = conditionalPseudoTimedGetUninterruptibly(
inputs, iFuture, jFuture, future, 20, MILLISECONDS);
assertTrue("Got " + result,
Arrays.asList("a", null).containsAll(result));
} catch (CancellationException e) {
assertTrue(merger == Merger.allMerger);
inputs.assertHasImmediateCancel(iFuture, jFuture, e);
} catch (ExecutionException e) {
assertTrue(merger == Merger.allMerger);
inputs.assertHasImmediateFailure(iFuture, jFuture, e);
} catch (TimeoutException e) {
inputs.assertHasDelayed(iFuture, jFuture, e);
}
// Finish the two futures in the currently specified order:
inputs.allFutures.get(iBeforeJ ? i : j).finisher.run();
inputs.allFutures.get(iBeforeJ ? j : i).finisher.run();
// Test untimed get now that we've completed any delayed futures.
try {
List<String> result = future.get();
assertTrue("Got " + result,
Arrays.asList("a", "b", null).containsAll(result));
} catch (CancellationException e) {
assertTrue(merger == Merger.allMerger);
inputs.assertHasCancel(iFuture, jFuture, e);
} catch (ExecutionException e) {
assertTrue(merger == Merger.allMerger);
inputs.assertHasFailure(iFuture, jFuture, e);
}
}
}
}
} | @GwtIncompatible(STR) static void function(Merger merger) throws InterruptedException { int inputCount = new TestFutureBatch().allFutures.size(); for (int i = 0; i < inputCount; i++) { for (int j = 0; j < inputCount; j++) { for (boolean iBeforeJ : new boolean[]{true, false}) { TestFutureBatch inputs = new TestFutureBatch(); ListenableFuture<String> iFuture = inputs.allFutures.get(i).future; ListenableFuture<String> jFuture = inputs.allFutures.get(j).future; ListenableFuture<List<String>> future = merger.merged(iFuture, jFuture); try { List<String> result = future.get(0, MILLISECONDS); assertTrue(STR + result, Arrays.asList("a", null).containsAll(result)); } catch (CancellationException e) { assertTrue(merger == Merger.allMerger); inputs.assertHasImmediateCancel(iFuture, jFuture, e); } catch (ExecutionException e) { assertTrue(merger == Merger.allMerger); inputs.assertHasImmediateFailure(iFuture, jFuture, e); } catch (TimeoutException e) { inputs.assertHasDelayed(iFuture, jFuture, e); } try { List<String> result = conditionalPseudoTimedGetUninterruptibly( inputs, iFuture, jFuture, future, 20, MILLISECONDS); assertTrue(STR + result, Arrays.asList("a", null).containsAll(result)); } catch (CancellationException e) { assertTrue(merger == Merger.allMerger); inputs.assertHasImmediateCancel(iFuture, jFuture, e); } catch (ExecutionException e) { assertTrue(merger == Merger.allMerger); inputs.assertHasImmediateFailure(iFuture, jFuture, e); } catch (TimeoutException e) { inputs.assertHasDelayed(iFuture, jFuture, e); } inputs.allFutures.get(iBeforeJ ? i : j).finisher.run(); inputs.allFutures.get(iBeforeJ ? j : i).finisher.run(); try { List<String> result = future.get(); assertTrue(STR + result, Arrays.asList("a", "b", null).containsAll(result)); } catch (CancellationException e) { assertTrue(merger == Merger.allMerger); inputs.assertHasCancel(iFuture, jFuture, e); } catch (ExecutionException e) { assertTrue(merger == Merger.allMerger); inputs.assertHasFailure(iFuture, jFuture, e); } } } } } | /**
* For each possible pair of futures from {@link TestFutureBatch}, for each possible completion
* order of those futures, test that various get calls (timed before future completion, untimed
* before future completion, and untimed after future completion) return or throw the proper
* values.
*/ | For each possible pair of futures from <code>TestFutureBatch</code>, for each possible completion order of those futures, test that various get calls (timed before future completion, untimed before future completion, and untimed after future completion) return or throw the proper values | runExtensiveMergerTest | {
"repo_name": "sunbeansoft/guava",
"path": "guava-tests/test/com/google/common/util/concurrent/FuturesTest.java",
"license": "apache-2.0",
"size": 136171
} | [
"com.google.common.annotations.GwtIncompatible",
"java.util.Arrays",
"java.util.List",
"java.util.concurrent.CancellationException",
"java.util.concurrent.ExecutionException",
"java.util.concurrent.TimeoutException"
] | import com.google.common.annotations.GwtIncompatible; import java.util.Arrays; import java.util.List; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; | import com.google.common.annotations.*; import java.util.*; import java.util.concurrent.*; | [
"com.google.common",
"java.util"
] | com.google.common; java.util; | 2,101,917 |
//-------------------------------------------------------------------------
public SwaptionSensitivity presentValueSensitivityNormalVolatility(SwaptionTrade tradeSwaption, RatesProvider rates,
NormalVolatilitySwaptionProvider volatilities) {
Swaption product = tradeSwaption.getProduct();
return PRICER_PRODUCT.presentValueSensitivityNormalVolatility(product, rates, volatilities);
} | SwaptionSensitivity function(SwaptionTrade tradeSwaption, RatesProvider rates, NormalVolatilitySwaptionProvider volatilities) { Swaption product = tradeSwaption.getProduct(); return PRICER_PRODUCT.presentValueSensitivityNormalVolatility(product, rates, volatilities); } | /**
* Calculates the present value sensitivity to the implied volatility of the swaption trade.
* <p>
* The sensitivity to the implied normal volatility is also called normal vega.
*
* @param tradeSwaption the swaption trade
* @param rates the rates provider
* @param volatilities the normal volatility provider
* @return the point sensitivity to the normal volatility
*/ | Calculates the present value sensitivity to the implied volatility of the swaption trade. The sensitivity to the implied normal volatility is also called normal vega | presentValueSensitivityNormalVolatility | {
"repo_name": "nssales/Strata",
"path": "modules/pricer-beta/src/main/java/com/opengamma/strata/pricer/rate/swaption/NormalSwaptionPhysicalTradePricerBeta.java",
"license": "apache-2.0",
"size": 5848
} | [
"com.opengamma.strata.finance.rate.swaption.Swaption",
"com.opengamma.strata.finance.rate.swaption.SwaptionTrade",
"com.opengamma.strata.pricer.provider.NormalVolatilitySwaptionProvider",
"com.opengamma.strata.pricer.rate.RatesProvider",
"com.opengamma.strata.pricer.sensitivity.SwaptionSensitivity"
] | import com.opengamma.strata.finance.rate.swaption.Swaption; import com.opengamma.strata.finance.rate.swaption.SwaptionTrade; import com.opengamma.strata.pricer.provider.NormalVolatilitySwaptionProvider; import com.opengamma.strata.pricer.rate.RatesProvider; import com.opengamma.strata.pricer.sensitivity.SwaptionSensitivity; | import com.opengamma.strata.finance.rate.swaption.*; import com.opengamma.strata.pricer.provider.*; import com.opengamma.strata.pricer.rate.*; import com.opengamma.strata.pricer.sensitivity.*; | [
"com.opengamma.strata"
] | com.opengamma.strata; | 2,415,067 |
public ItemTextIfc loadPublishedItemText(String itemTextId)
{
try
{
PublishedAssessmentService service = new PublishedAssessmentService();
return service.loadPublishedItemText(itemTextId);
}
catch (Exception ex)
{
throw new AssessmentServiceException(ex);
}
} | ItemTextIfc function(String itemTextId) { try { PublishedAssessmentService service = new PublishedAssessmentService(); return service.loadPublishedItemText(itemTextId); } catch (Exception ex) { throw new AssessmentServiceException(ex); } } | /**
* Load published assessment item text.
* @param itemTextId the id string of the itemtext.
* @return the item.
*/ | Load published assessment item text | loadPublishedItemText | {
"repo_name": "bzhouduke123/sakai",
"path": "samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/shared/impl/assessment/PublishedAssessmentServiceImpl.java",
"license": "apache-2.0",
"size": 16234
} | [
"org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc",
"org.sakaiproject.tool.assessment.services.assessment.AssessmentServiceException",
"org.sakaiproject.tool.assessment.services.assessment.PublishedAssessmentService"
] | import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemTextIfc; import org.sakaiproject.tool.assessment.services.assessment.AssessmentServiceException; import org.sakaiproject.tool.assessment.services.assessment.PublishedAssessmentService; | import org.sakaiproject.tool.assessment.data.ifc.assessment.*; import org.sakaiproject.tool.assessment.services.assessment.*; | [
"org.sakaiproject.tool"
] | org.sakaiproject.tool; | 2,217,156 |
@Override
public void onMovieItemSelected(long movieDBId) {
MovieDetailFragment fragment = (MovieDetailFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_movie_details);
fragment.showDetailsByMovieDBId(movieDBId);
} | void function(long movieDBId) { MovieDetailFragment fragment = (MovieDetailFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_movie_details); fragment.showDetailsByMovieDBId(movieDBId); } | /**
* Ask the movie details fragment to use the movie identified by movieDBId
* @param movieDBId
*/ | Ask the movie details fragment to use the movie identified by movieDBId | onMovieItemSelected | {
"repo_name": "frank-tan/Popular-Movies",
"path": "app/src/main/java/com/franktan/popularmovies/ui/activities/MovieGridActivity.java",
"license": "apache-2.0",
"size": 3547
} | [
"com.franktan.popularmovies.ui.fragments.MovieDetailFragment"
] | import com.franktan.popularmovies.ui.fragments.MovieDetailFragment; | import com.franktan.popularmovies.ui.fragments.*; | [
"com.franktan.popularmovies"
] | com.franktan.popularmovies; | 2,803,737 |
protected void startActivityForResult(Intent intent, int code) {
if (fragment == null) {
activity.startActivityForResult(intent, code);
} else {
fragment.startActivityForResult(intent, code);
}
} | void function(Intent intent, int code) { if (fragment == null) { activity.startActivityForResult(intent, code); } else { fragment.startActivityForResult(intent, code); } } | /**
* Start an activity. This method is defined to allow different methods of
* activity starting for newer versions of Android and for compatibility
* library.
*
* @param intent
* Intent to start.
* @param code
* Request code for the activity
* @see android.app.Activity#startActivityForResult(Intent, int)
* @see android.app.Fragment#startActivityForResult(Intent, int)
*/ | Start an activity. This method is defined to allow different methods of activity starting for newer versions of Android and for compatibility library | startActivityForResult | {
"repo_name": "Kharatsa/tracking-app",
"path": "SampleTracking/src/com/google/zxing/integration/android/IntentIntegrator.java",
"license": "apache-2.0",
"size": 15245
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 2,847,565 |
public WsPk insert(Ws dto)
{
SqlUpdate su = new SqlUpdate( dataSource, "INSERT INTO " + getTableName() + " ( ws_code, ws_date, supplier_name, fish_species, fish_size, fish_weight, quantity, remarks, issued_by, checked_by, received_by, is_active, is_delete, created_by, created_date, updated_by, updated_date ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )");
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.CHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.CHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.TIMESTAMP) );
su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) );
su.declareParameter( new SqlParameter( java.sql.Types.TIMESTAMP) );
su.compile();
su.update( new Object[] { dto.getWsCode(),dto.getWsDate(),dto.getSupplierName(),dto.getFishSpecies(),dto.getFishSize(),dto.getFishWeight(),dto.getQuantity(),dto.getRemarks(),dto.getIssuedBy(),dto.getCheckedBy(),dto.getReceivedBy(),dto.getIsActive(),dto.getIsDelete(),dto.getCreatedBy(),dto.getCreatedDate(),dto.getUpdatedBy(),dto.getUpdatedDate()} );
WsPk pk = new WsPk();
pk.setId( jdbcTemplate.queryForInt("select @@IDENTITY") );
return pk;
} | WsPk function(Ws dto) { SqlUpdate su = new SqlUpdate( dataSource, STR + getTableName() + STR); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.INTEGER) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.CHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.CHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.TIMESTAMP) ); su.declareParameter( new SqlParameter( java.sql.Types.VARCHAR) ); su.declareParameter( new SqlParameter( java.sql.Types.TIMESTAMP) ); su.compile(); su.update( new Object[] { dto.getWsCode(),dto.getWsDate(),dto.getSupplierName(),dto.getFishSpecies(),dto.getFishSize(),dto.getFishWeight(),dto.getQuantity(),dto.getRemarks(),dto.getIssuedBy(),dto.getCheckedBy(),dto.getReceivedBy(),dto.getIsActive(),dto.getIsDelete(),dto.getCreatedBy(),dto.getCreatedDate(),dto.getUpdatedBy(),dto.getUpdatedDate()} ); WsPk pk = new WsPk(); pk.setId( jdbcTemplate.queryForInt(STR) ); return pk; } | /**
* Method 'insert'
*
* @param dto
* @return WsPk
*/ | Method 'insert' | insert | {
"repo_name": "rmage/gnvc-ims",
"path": "src/java/com/app/wms/engine/db/dao/spring/WsDaoImpl.java",
"license": "lgpl-3.0",
"size": 19191
} | [
"com.app.wms.engine.db.dto.Ws",
"com.app.wms.engine.db.dto.WsPk",
"org.springframework.jdbc.core.SqlParameter",
"org.springframework.jdbc.object.SqlUpdate"
] | import com.app.wms.engine.db.dto.Ws; import com.app.wms.engine.db.dto.WsPk; import org.springframework.jdbc.core.SqlParameter; import org.springframework.jdbc.object.SqlUpdate; | import com.app.wms.engine.db.dto.*; import org.springframework.jdbc.core.*; import org.springframework.jdbc.object.*; | [
"com.app.wms",
"org.springframework.jdbc"
] | com.app.wms; org.springframework.jdbc; | 1,456,775 |
@SuppressWarnings({"unchecked"})
@Nullable public CacheInterceptor<K, V> getInterceptor() {
return (CacheInterceptor<K, V>)interceptor;
} | @SuppressWarnings({STR}) @Nullable CacheInterceptor<K, V> function() { return (CacheInterceptor<K, V>)interceptor; } | /**
* Gets cache interceptor.
*
* @return Cache interceptor.
*/ | Gets cache interceptor | getInterceptor | {
"repo_name": "leveyj/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/configuration/CacheConfiguration.java",
"license": "apache-2.0",
"size": 96148
} | [
"org.apache.ignite.cache.CacheInterceptor",
"org.jetbrains.annotations.Nullable"
] | import org.apache.ignite.cache.CacheInterceptor; import org.jetbrains.annotations.Nullable; | import org.apache.ignite.cache.*; import org.jetbrains.annotations.*; | [
"org.apache.ignite",
"org.jetbrains.annotations"
] | org.apache.ignite; org.jetbrains.annotations; | 639,191 |
public Date getGmtModified() {
return gmtModified;
}
| Date function() { return gmtModified; } | /**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column metal_zinc_price.gmt_modified
*
* @return the value of metal_zinc_price.gmt_modified
*
* @mbggenerated Sun Jan 22 16:27:31 GMT+08:00 2017
*/ | This method was generated by MyBatis Generator. This method returns the value of the database column metal_zinc_price.gmt_modified | getGmtModified | {
"repo_name": "bbbbb1202/devzb",
"path": "self/src/main/java/com/devzb/metal/dao/model/MetalZincPrice.java",
"license": "apache-2.0",
"size": 5000
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,686,969 |
public Query setBigInteger(String name, BigInteger number); | Query function(String name, BigInteger number); | /**
* Bind a named BigInteger-valued parameter.
*
* @param name The parameter name
* @param number The bind value
*
* @return {@code this}, for method chaining
*/ | Bind a named BigInteger-valued parameter | setBigInteger | {
"repo_name": "kevin-chen-hw/LDAE",
"path": "com.huawei.soa.ldae/src/main/java/org/hibernate/Query.java",
"license": "lgpl-2.1",
"size": 25174
} | [
"java.math.BigInteger"
] | import java.math.BigInteger; | import java.math.*; | [
"java.math"
] | java.math; | 1,397,671 |
private void paintSetOfPositions(final CanvasType dest, final Color thisCol, final int lineStyle) {
if (_ptCtr > 0) {
dest.setColor(thisCol);
dest.setLineStyle(lineStyle);
final int[] poly = new int[_ptCtr];
System.arraycopy(_myPts, 0, poly, 0, _ptCtr);
dest.drawPolyline(poly);
dest.setLineStyle(CanvasType.SOLID);
// and reset the counter
_ptCtr = 0;
}
}
| void function(final CanvasType dest, final Color thisCol, final int lineStyle) { if (_ptCtr > 0) { dest.setColor(thisCol); dest.setLineStyle(lineStyle); final int[] poly = new int[_ptCtr]; System.arraycopy(_myPts, 0, poly, 0, _ptCtr); dest.drawPolyline(poly); dest.setLineStyle(CanvasType.SOLID); _ptCtr = 0; } } | /**
* paint any polyline that we've built up
*
* @param dest - where we're painting to
* @param thisCol
* @param lineStyle
*/ | paint any polyline that we've built up | paintSetOfPositions | {
"repo_name": "debrief/debrief",
"path": "org.mwc.debrief.legacy/src/Debrief/Wrappers/TrackWrapper.java",
"license": "epl-1.0",
"size": 120981
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,090,107 |
void moveFilestore(File destination) throws FileStoreException; | void moveFilestore(File destination) throws FileStoreException; | /**
* Moves the contents of this store to the given destination.
*/ | Moves the contents of this store to the given destination | moveFilestore | {
"repo_name": "gstevey/gradle",
"path": "subprojects/resources/src/main/java/org/gradle/internal/resource/local/FileStore.java",
"license": "apache-2.0",
"size": 1654
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,866,944 |
@Override
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
EmbeddedLinuxJVMConsoleView.getInstance(project).createToolWindowContent(toolWindow);
} | void function(@NotNull Project project, @NotNull ToolWindow toolWindow) { EmbeddedLinuxJVMConsoleView.getInstance(project).createToolWindowContent(toolWindow); } | /**
* Creates a custom tool window show pi logs (might be temporary)
*
* @param project
* @param toolWindow
*/ | Creates a custom tool window show pi logs (might be temporary) | createToolWindowContent | {
"repo_name": "asebak/embeddedlinux-jvmdebugger-intellij",
"path": "src/com/atsebak/embeddedlinuxjvm/console/EmbeddedLinuxJVMToolWindowFactory.java",
"license": "apache-2.0",
"size": 772
} | [
"com.intellij.openapi.project.Project",
"com.intellij.openapi.wm.ToolWindow",
"org.jetbrains.annotations.NotNull"
] | import com.intellij.openapi.project.Project; import com.intellij.openapi.wm.ToolWindow; import org.jetbrains.annotations.NotNull; | import com.intellij.openapi.project.*; import com.intellij.openapi.wm.*; import org.jetbrains.annotations.*; | [
"com.intellij.openapi",
"org.jetbrains.annotations"
] | com.intellij.openapi; org.jetbrains.annotations; | 221,214 |
@Test
public void testGetRelationalExprValuesForFilterSize() throws IOException {
final String path = "$.[?(\"@.Sizes\" size ['S', 'M', 'L'])]";
JsonPath jsonPath = JsonPath.compile(path);
List<SimpleEntry<String, String>> valuesMap = jsonPath.getRelationalExprValues();
Assert.assertNotNull(valuesMap);
Assert.assertEquals(valuesMap.get(0).getValue(), "['S', 'M', 'L']");
Assert.assertEquals(valuesMap.get(0).getKey(), "\"@.Sizes\"");
} | void function() throws IOException { final String path = STR@.Sizes\STR; JsonPath jsonPath = JsonPath.compile(path); List<SimpleEntry<String, String>> valuesMap = jsonPath.getRelationalExprValues(); Assert.assertNotNull(valuesMap); Assert.assertEquals(valuesMap.get(0).getValue(), STR); Assert.assertEquals(valuesMap.get(0).getKey(), "\"@.Sizes\""); } | /**
* Test extraction of relational expression values for "Size" filter
* @throws IOException
*/ | Test extraction of relational expression values for "Size" filter | testGetRelationalExprValuesForFilterSize | {
"repo_name": "lafaspot/JsonPath",
"path": "json-path/src/test/java/com/jayway/jsonpath/FilterTest.java",
"license": "apache-2.0",
"size": 30061
} | [
"java.io.IOException",
"java.util.AbstractMap",
"java.util.List",
"org.junit.Assert"
] | import java.io.IOException; import java.util.AbstractMap; import java.util.List; import org.junit.Assert; | import java.io.*; import java.util.*; import org.junit.*; | [
"java.io",
"java.util",
"org.junit"
] | java.io; java.util; org.junit; | 617,712 |
Collection<ObjectiveDisplayMode> getObjectiveDisplayModes(); | Collection<ObjectiveDisplayMode> getObjectiveDisplayModes(); | /**
* Gets a {@link Collection} of all possible {@link ObjectiveDisplayMode}s.
*
* @return The Collection of all available {@link ObjectiveDisplayMode}s
*/ | Gets a <code>Collection</code> of all possible <code>ObjectiveDisplayMode</code>s | getObjectiveDisplayModes | {
"repo_name": "SpongeHistory/SpongeAPI-History",
"path": "src/main/java/org/spongepowered/api/GameRegistry.java",
"license": "mit",
"size": 37085
} | [
"java.util.Collection",
"org.spongepowered.api.scoreboard.objective.displaymode.ObjectiveDisplayMode"
] | import java.util.Collection; import org.spongepowered.api.scoreboard.objective.displaymode.ObjectiveDisplayMode; | import java.util.*; import org.spongepowered.api.scoreboard.objective.displaymode.*; | [
"java.util",
"org.spongepowered.api"
] | java.util; org.spongepowered.api; | 1,218,154 |
public boolean stopSipStack() throws SameThreadException {
Log.d(THIS_FILE, "Stop sip stack");
boolean canStop = true;
if(pjService != null) {
canStop &= pjService.sipStop();
}
if(canStop) {
if(presenceMgr != null) {
presenceMgr.stopMonitoring();
}
// Due to http://code.google.com/p/android/issues/detail?id=21635
// exclude 14 and upper from auto disabling on stop.
if(!Compatibility.isCompatible(14)) {
applyComponentEnablingState(false);
}
unregisterBroadcasts();
releaseResources();
}
return canStop;
}
| boolean function() throws SameThreadException { Log.d(THIS_FILE, STR); boolean canStop = true; if(pjService != null) { canStop &= pjService.sipStop(); } if(canStop) { if(presenceMgr != null) { presenceMgr.stopMonitoring(); } if(!Compatibility.isCompatible(14)) { applyComponentEnablingState(false); } unregisterBroadcasts(); releaseResources(); } return canStop; } | /**
* Safe stop the sip stack
* @return true if can be stopped, false if there is a pending call and the sip service should not be stopped
*/ | Safe stop the sip stack | stopSipStack | {
"repo_name": "djkskqyr3/CSipSimple",
"path": "src/com/csipsimple/service/SipService.java",
"license": "lgpl-3.0",
"size": 62719
} | [
"com.csipsimple.utils.Compatibility",
"com.csipsimple.utils.Log"
] | import com.csipsimple.utils.Compatibility; import com.csipsimple.utils.Log; | import com.csipsimple.utils.*; | [
"com.csipsimple.utils"
] | com.csipsimple.utils; | 2,140,972 |
@ReactMethod
public void measure(int reactTag, Callback callback) {
mUIImplementation.measure(reactTag, callback);
} | void function(int reactTag, Callback callback) { mUIImplementation.measure(reactTag, callback); } | /**
* Determines the location on screen, width, and height of the given view and returns the values
* via an async callback.
*/ | Determines the location on screen, width, and height of the given view and returns the values via an async callback | measure | {
"repo_name": "Ten-Wang/hackfoldr-android",
"path": "node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java",
"license": "apache-2.0",
"size": 20678
} | [
"com.facebook.react.bridge.Callback"
] | import com.facebook.react.bridge.Callback; | import com.facebook.react.bridge.*; | [
"com.facebook.react"
] | com.facebook.react; | 1,969,753 |
public void loadConfig(final String fileName) throws IOException, InvalidConfigurationException {
final Path path = Paths.get(this.plugin.getDataFolder().toPath().toAbsolutePath() + File.separator + fileName);
if (!Files.exists(path)) {
path.toFile().getParentFile().mkdirs();
Files.createFile(path);
this.writeConfig(path);
} else {
final YamlConfiguration config = new YamlConfiguration();
try (BufferedReader reader = Files.newBufferedReader(path, CHARSET)) {
final StringBuilder s = new StringBuilder();
while (reader.ready()) {
s.append(reader.readLine()).append('\n');
}
config.loadFromString(s.toString());
}
try {
this.handleValues(config);
} catch (final Throwable t) {
// Make a backup copy of the just-read file in case something REALLY wrong happened
Files.copy(path, Paths.get(this.plugin.getDataFolder().toPath().toAbsolutePath().toString(), fileName + '.' + DateUtil.formatNow() + ".bak"));
throw t;
}
// Rewrite the config to "clean" it
this.writeConfig(path);
}
} | void function(final String fileName) throws IOException, InvalidConfigurationException { final Path path = Paths.get(this.plugin.getDataFolder().toPath().toAbsolutePath() + File.separator + fileName); if (!Files.exists(path)) { path.toFile().getParentFile().mkdirs(); Files.createFile(path); this.writeConfig(path); } else { final YamlConfiguration config = new YamlConfiguration(); try (BufferedReader reader = Files.newBufferedReader(path, CHARSET)) { final StringBuilder s = new StringBuilder(); while (reader.ready()) { s.append(reader.readLine()).append('\n'); } config.loadFromString(s.toString()); } try { this.handleValues(config); } catch (final Throwable t) { Files.copy(path, Paths.get(this.plugin.getDataFolder().toPath().toAbsolutePath().toString(), fileName + '.' + DateUtil.formatNow() + ".bak")); throw t; } this.writeConfig(path); } } | /**
* Load the config containing messages
* Creates a new config if it does not exists
* Fix the config after parsing
*
* @param fileName The name of the file to load
*
* @throws IOException If there is an error reading / writing file
* @throws InvalidConfigurationException If the configuration is malformed
*/ | Load the config containing messages Creates a new config if it does not exists Fix the config after parsing | loadConfig | {
"repo_name": "Ribesg/NPlugins",
"path": "NCore/src/main/java/fr/ribesg/bukkit/ncore/config/AbstractConfig.java",
"license": "gpl-3.0",
"size": 5951
} | [
"fr.ribesg.bukkit.ncore.util.DateUtil",
"java.io.BufferedReader",
"java.io.File",
"java.io.IOException",
"java.nio.file.Files",
"java.nio.file.Path",
"java.nio.file.Paths",
"org.bukkit.configuration.InvalidConfigurationException",
"org.bukkit.configuration.file.YamlConfiguration"
] | import fr.ribesg.bukkit.ncore.util.DateUtil; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.YamlConfiguration; | import fr.ribesg.bukkit.ncore.util.*; import java.io.*; import java.nio.file.*; import org.bukkit.configuration.*; import org.bukkit.configuration.file.*; | [
"fr.ribesg.bukkit",
"java.io",
"java.nio",
"org.bukkit.configuration"
] | fr.ribesg.bukkit; java.io; java.nio; org.bukkit.configuration; | 2,666,262 |
SecurityQuestionWithMaskedAnswerWidget getSecurityQuestionsWidget();
}
private final Display display;
public TempPwdLoginPresenter(Display displayArg) {
this.display = displayArg;
display.getReset().addClickHandler(new ClickHandler() { | SecurityQuestionWithMaskedAnswerWidget getSecurityQuestionsWidget(); } private final Display display; public TempPwdLoginPresenter(Display displayArg) { this.display = displayArg; display.getReset().addClickHandler(new ClickHandler() { | /**
* Gets the security questions widget.
*
* @return the security questions widget
*/ | Gets the security questions widget | getSecurityQuestionsWidget | {
"repo_name": "JaLandry/MeasureAuthoringTool_LatestSprint",
"path": "mat/src/mat/client/login/TempPwdLoginPresenter.java",
"license": "apache-2.0",
"size": 15370
} | [
"com.google.gwt.event.dom.client.ClickHandler"
] | import com.google.gwt.event.dom.client.ClickHandler; | import com.google.gwt.event.dom.client.*; | [
"com.google.gwt"
] | com.google.gwt; | 1,016,334 |
protected boolean processing() {
log.debug("Starting processing");
if (config.getProperty(AJPropertyConstants.QUIET.getKey()).equals(
"false")
&& config.getProperty(
AJPropertyConstants.SHOW_LICENSE_AT_START.getKey())
.equals("true")) {
showLicense();
}
if (config.getProperty(AJPropertyConstants.QUIET.getKey()).equals(
"false")
&& config.getProperty(
AJPropertyConstants.SHOW_PDFLATEX_VERSION_AT_START
.getKey()).equals("true")) {
if (!showPDFLatexVersion()) {
return false;
}
}
if (config.getProperty(AJPropertyConstants.QUIET.getKey()).equals(
"false")
&& config.getProperty(
AJPropertyConstants.SHOW_CONFIGURATION_AT_START
.getKey()).equals("true")) {
showConfiguration();
}
if (!generator.generateJournals()) {
log.error(config.getResourceBundle().getString(
"AJ.errJournalNotExported.text"));
return false;
}
log.debug("Processing was SUCCESSFUL");
return true;
} | boolean function() { log.debug(STR); if (config.getProperty(AJPropertyConstants.QUIET.getKey()).equals( "false") && config.getProperty( AJPropertyConstants.SHOW_LICENSE_AT_START.getKey()) .equals("true")) { showLicense(); } if (config.getProperty(AJPropertyConstants.QUIET.getKey()).equals( "false") && config.getProperty( AJPropertyConstants.SHOW_PDFLATEX_VERSION_AT_START .getKey()).equals("true")) { if (!showPDFLatexVersion()) { return false; } } if (config.getProperty(AJPropertyConstants.QUIET.getKey()).equals( "false") && config.getProperty( AJPropertyConstants.SHOW_CONFIGURATION_AT_START .getKey()).equals("true")) { showConfiguration(); } if (!generator.generateJournals()) { log.error(config.getResourceBundle().getString( STR)); return false; } log.debug(STR); return true; } | /**
* Generate the journals.
*
* @return true if the processing phase succeeded.
*/ | Generate the journals | processing | {
"repo_name": "pdp10/AstroJournal",
"path": "src/main/java/org/astrojournal/AJMainControls.java",
"license": "gpl-3.0",
"size": 5158
} | [
"org.astrojournal.configuration.ajconfiguration.AJPropertyConstants"
] | import org.astrojournal.configuration.ajconfiguration.AJPropertyConstants; | import org.astrojournal.configuration.ajconfiguration.*; | [
"org.astrojournal.configuration"
] | org.astrojournal.configuration; | 449,362 |
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos)
{
if (!this.canBlockStay(worldIn, pos))
{
worldIn.setBlockToAir(pos);
}
}
| void function(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos fromPos) { if (!this.canBlockStay(worldIn, pos)) { worldIn.setBlockToAir(pos); } } | /**
* Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor
* change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid
* block, etc.
*/ | Called when a neighboring block was changed and marks that this state should perform any checks during a neighbor change. Cases may include when redstone power is updated, cactus blocks popping off due to a neighboring solid block, etc | neighborChanged | {
"repo_name": "InverMN/MinecraftForgeReference",
"path": "MinecraftBlocks/BlockCake.java",
"license": "unlicense",
"size": 6140
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.util.math.BlockPos",
"net.minecraft.world.World"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; | import net.minecraft.block.state.*; import net.minecraft.util.math.*; import net.minecraft.world.*; | [
"net.minecraft.block",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.block; net.minecraft.util; net.minecraft.world; | 2,423,551 |
protected void deregister(String ssoId, Session session) {
synchronized (reverse) {
reverse.remove(session);
}
SingleSignOnEntry sso = lookup(ssoId);
if (sso == null)
return;
sso.removeSession(session);
// see if we are the last session, if so blow away ssoId
Session sessions[] = sso.findSessions();
if (sessions == null || sessions.length == 0) {
synchronized (cache) {
cache.remove(ssoId);
}
}
} | void function(String ssoId, Session session) { synchronized (reverse) { reverse.remove(session); } SingleSignOnEntry sso = lookup(ssoId); if (sso == null) return; sso.removeSession(session); Session sessions[] = sso.findSessions(); if (sessions == null sessions.length == 0) { synchronized (cache) { cache.remove(ssoId); } } } | /**
* Deregister the specified session. If it is the last session,
* then also get rid of the single sign on identifier
*
* @param ssoId Single sign on identifier
* @param session Session to be deregistered
*/ | Deregister the specified session. If it is the last session, then also get rid of the single sign on identifier | deregister | {
"repo_name": "sdw2330976/apache-tomcat-7.0.57",
"path": "target/classes/org/apache/catalina/authenticator/SingleSignOn.java",
"license": "apache-2.0",
"size": 22954
} | [
"org.apache.catalina.Session"
] | import org.apache.catalina.Session; | import org.apache.catalina.*; | [
"org.apache.catalina"
] | org.apache.catalina; | 2,811,925 |
@Override
public void run() {
amIActive = true;
String destHeader = null;
String outputHeader = null;
String backLinkHeader = null;
WhiteboxRaster destImage;
WhiteboxRaster output;
WhiteboxRaster backLink;
int cols, rows;
double z, flowDir;
float progress = 0;
int[] dX = new int[]{1, 1, 1, 0, -1, -1, -1, 0};
int[] dY = new int[]{-1, 0, 1, 1, 1, 0, -1, -1};
double lnOf2 = 0.693147180559945;
double gridRes;
int col, row, a;
int c;
int x, y, i;
boolean flag = false;
if (args.length <= 0) {
showFeedback("Plugin parameters have not been set.");
return;
}
for (i = 0; i < args.length; i++) {
if (i == 0) {
destHeader = args[i];
} else if (i == 1) {
backLinkHeader = args[i];
} else if (i == 2) {
outputHeader = args[i];
}
}
// check to see that the inputHeader and outputHeader are not null.
if ((destHeader == null) || (backLinkHeader == null) || (outputHeader == null)) {
showFeedback("One or more of the input parameters have not been set properly.");
return;
}
try {
destImage = new WhiteboxRaster(destHeader, "r");
rows = destImage.getNumberRows();
cols = destImage.getNumberColumns();
double noData = destImage.getNoDataValue();
gridRes = (destImage.getCellSizeX() + destImage.getCellSizeY()) / 2;
backLink = new WhiteboxRaster(backLinkHeader, "r");
if (backLink.getNumberColumns() != cols ||
backLink.getNumberRows() != rows) {
showFeedback("Input images must have the same dimensions");
return;
}
output = new WhiteboxRaster(outputHeader, "rw", backLinkHeader,
WhiteboxRaster.DataType.FLOAT, noData);
output.setPreferredPalette("spectrum.pal");
output.setDataScale(WhiteboxRaster.DataScale.CONTINUOUS);
double[] data;
for (row = 0; row < rows; row++) {
data = destImage.getRowValues(row);
for (col = 0; col < cols; col++) {
if (data[col] > 0) {
x = col;
y = row;
flag = true;
do {
z = output.getValue(y, x);
if (z == noData) {
output.setValue(y, x, 1);
} else {
output.setValue(y, x, z + 1);
}
flowDir = backLink.getValue(y, x);
if (flowDir > 0) {
//move x and y accordingly
c = (int)(Math.log(flowDir) / lnOf2);
x += dX[c];
y += dY[c];
} else {
flag = false; //stop the flowpath traverse
}
} while (flag);
}
}
if (cancelOp) {
cancelOperation();
return;
}
progress = (float)(100f * row / (rows - 1));
updateProgress((int) progress);
}
output.addMetadataEntry("Created by the "
+ getDescriptiveName() + " tool.");
output.addMetadataEntry("Created on " + new Date());
destImage.close();
backLink.close();
output.close();
// returning a header file string displays the image.
returnData(outputHeader);
} catch (OutOfMemoryError oe) {
myHost.showFeedback("An out-of-memory error has occurred during operation.");
} catch (Exception e) {
myHost.showFeedback("An error has occurred during operation. See log file for details.");
myHost.logException("Error in " + getDescriptiveName(), e);
} finally {
updateProgress("Progress: ", 0);
// tells the main application that this process is completed.
amIActive = false;
myHost.pluginComplete();
}
} | void function() { amIActive = true; String destHeader = null; String outputHeader = null; String backLinkHeader = null; WhiteboxRaster destImage; WhiteboxRaster output; WhiteboxRaster backLink; int cols, rows; double z, flowDir; float progress = 0; int[] dX = new int[]{1, 1, 1, 0, -1, -1, -1, 0}; int[] dY = new int[]{-1, 0, 1, 1, 1, 0, -1, -1}; double lnOf2 = 0.693147180559945; double gridRes; int col, row, a; int c; int x, y, i; boolean flag = false; if (args.length <= 0) { showFeedback(STR); return; } for (i = 0; i < args.length; i++) { if (i == 0) { destHeader = args[i]; } else if (i == 1) { backLinkHeader = args[i]; } else if (i == 2) { outputHeader = args[i]; } } if ((destHeader == null) (backLinkHeader == null) (outputHeader == null)) { showFeedback(STR); return; } try { destImage = new WhiteboxRaster(destHeader, "r"); rows = destImage.getNumberRows(); cols = destImage.getNumberColumns(); double noData = destImage.getNoDataValue(); gridRes = (destImage.getCellSizeX() + destImage.getCellSizeY()) / 2; backLink = new WhiteboxRaster(backLinkHeader, "r"); if (backLink.getNumberColumns() != cols backLink.getNumberRows() != rows) { showFeedback(STR); return; } output = new WhiteboxRaster(outputHeader, "rw", backLinkHeader, WhiteboxRaster.DataType.FLOAT, noData); output.setPreferredPalette(STR); output.setDataScale(WhiteboxRaster.DataScale.CONTINUOUS); double[] data; for (row = 0; row < rows; row++) { data = destImage.getRowValues(row); for (col = 0; col < cols; col++) { if (data[col] > 0) { x = col; y = row; flag = true; do { z = output.getValue(y, x); if (z == noData) { output.setValue(y, x, 1); } else { output.setValue(y, x, z + 1); } flowDir = backLink.getValue(y, x); if (flowDir > 0) { c = (int)(Math.log(flowDir) / lnOf2); x += dX[c]; y += dY[c]; } else { flag = false; } } while (flag); } } if (cancelOp) { cancelOperation(); return; } progress = (float)(100f * row / (rows - 1)); updateProgress((int) progress); } output.addMetadataEntry(STR + getDescriptiveName() + STR); output.addMetadataEntry(STR + new Date()); destImage.close(); backLink.close(); output.close(); returnData(outputHeader); } catch (OutOfMemoryError oe) { myHost.showFeedback(STR); } catch (Exception e) { myHost.showFeedback(STR); myHost.logException(STR + getDescriptiveName(), e); } finally { updateProgress(STR, 0); amIActive = false; myHost.pluginComplete(); } } | /**
* Used to execute this plugin tool.
*/ | Used to execute this plugin tool | run | {
"repo_name": "jblindsay/jblindsay.github.io",
"path": "ghrg/Whitebox/WhiteboxGAT-linux/resources/plugins/source_files/CostPathway.java",
"license": "mit",
"size": 10180
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 536,777 |
public static Path createRegularConvexPolygon(int left, int top, int right, int bottom,
int numSides, float rotationDegrees) {
return RegularConvexPolygonCreator.createRegularConvexPolygon(left, top, right, bottom,
numSides, rotationDegrees);
} | static Path function(int left, int top, int right, int bottom, int numSides, float rotationDegrees) { return RegularConvexPolygonCreator.createRegularConvexPolygon(left, top, right, bottom, numSides, rotationDegrees); } | /**
* Creates a regular convex polygon {@link android.graphics.Path}.
*
* @param left Left bound
* @param top Top bound
* @param right Right bound
* @param bottom Bottom bound
* @param numSides Number of sides
* @param rotationDegrees Degrees to rotate polygon
* @return A {@link android.graphics.Path} corresponding to a regular convex polygon.
*/ | Creates a regular convex polygon <code>android.graphics.Path</code> | createRegularConvexPolygon | {
"repo_name": "xiayouli0122/Wardroid",
"path": "src/com/example/ward/view/artise/Artiste.java",
"license": "apache-2.0",
"size": 6336
} | [
"android.graphics.Path"
] | import android.graphics.Path; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 1,744,941 |
public void unsubscribeAllDurable() throws MessagingException {
for (String name : durableSubscriptions.keySet()) {
unsubscribeDurable(name);
}
} | void function() throws MessagingException { for (String name : durableSubscriptions.keySet()) { unsubscribeDurable(name); } } | /**
* Removes all durable topic subscriptions created using
* this JMSManager instance
*
* @throws MessagingException
*/ | Removes all durable topic subscriptions created using this JMSManager instance | unsubscribeAllDurable | {
"repo_name": "andreasnef/fcrepo",
"path": "fcrepo-server/src/main/java/org/fcrepo/server/messaging/JMSManager.java",
"license": "apache-2.0",
"size": 35566
} | [
"org.fcrepo.server.errors.MessagingException"
] | import org.fcrepo.server.errors.MessagingException; | import org.fcrepo.server.errors.*; | [
"org.fcrepo.server"
] | org.fcrepo.server; | 1,667,432 |
Observable<List<Smiley>> getFavoriteSmileys(User user); | Observable<List<Smiley>> getFavoriteSmileys(User user); | /**
* Returns a list of the user's favorite smileys
*/ | Returns a list of the user's favorite smileys | getFavoriteSmileys | {
"repo_name": "Ayuget/Redface",
"path": "app/src/main/java/com/ayuget/redface/data/api/MDService.java",
"license": "apache-2.0",
"size": 5380
} | [
"com.ayuget.redface.data.api.model.Smiley",
"com.ayuget.redface.data.api.model.User",
"java.util.List"
] | import com.ayuget.redface.data.api.model.Smiley; import com.ayuget.redface.data.api.model.User; import java.util.List; | import com.ayuget.redface.data.api.model.*; import java.util.*; | [
"com.ayuget.redface",
"java.util"
] | com.ayuget.redface; java.util; | 1,432,526 |
@Test
public void testGetCause () {
assertNull(unknownSQLError.getCause());
assertNull(knownSQLError.getCause());
assertEquals(SQLException.class, knownCauseSQLError.getCause().getClass());
}
| void function () { assertNull(unknownSQLError.getCause()); assertNull(knownSQLError.getCause()); assertEquals(SQLException.class, knownCauseSQLError.getCause().getClass()); } | /**
* Test method for {@link java.lang.Throwable#getCause()}.
*/ | Test method for <code>java.lang.Throwable#getCause()</code> | testGetCause | {
"repo_name": "Club-Rock-ISEN/EntryManager",
"path": "src/test/java/org/clubrockisen/common/error/SQLConfigurationErrorTest.java",
"license": "bsd-3-clause",
"size": 1276
} | [
"java.sql.SQLException",
"org.junit.Assert"
] | import java.sql.SQLException; import org.junit.Assert; | import java.sql.*; import org.junit.*; | [
"java.sql",
"org.junit"
] | java.sql; org.junit; | 2,084,649 |
public void setField(Map<Field, String> fields) {
Objects.requireNonNull(fields, "fields must not be null");
fields.forEach(this::setField);
} | void function(Map<Field, String> fields) { Objects.requireNonNull(fields, STR); fields.forEach(this::setField); } | /**
* Sets a number of fields simultaneously. The given HashMap contains field
* names as keys, each mapped to the value to set.
*/ | Sets a number of fields simultaneously. The given HashMap contains field names as keys, each mapped to the value to set | setField | {
"repo_name": "JabRef/jabref",
"path": "src/main/java/org/jabref/model/entry/BibEntry.java",
"license": "mit",
"size": 38993
} | [
"java.util.Map",
"java.util.Objects",
"org.jabref.model.entry.field.Field"
] | import java.util.Map; import java.util.Objects; import org.jabref.model.entry.field.Field; | import java.util.*; import org.jabref.model.entry.field.*; | [
"java.util",
"org.jabref.model"
] | java.util; org.jabref.model; | 336,084 |
private boolean isActivated()
{
BlockPos blockpos = this.getSpawnerPosition();
return this.getSpawnerWorld().isAnyPlayerWithinRangeAt((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D, (double)this.activatingRangeFromPlayer);
} | boolean function() { BlockPos blockpos = this.getSpawnerPosition(); return this.getSpawnerWorld().isAnyPlayerWithinRangeAt((double)blockpos.getX() + 0.5D, (double)blockpos.getY() + 0.5D, (double)blockpos.getZ() + 0.5D, (double)this.activatingRangeFromPlayer); } | /**
* Returns true if there's a player close enough to this mob spawner to activate it.
*/ | Returns true if there's a player close enough to this mob spawner to activate it | isActivated | {
"repo_name": "tomtomtom09/CampCraft",
"path": "build/tmp/recompileMc/sources/net/minecraft/tileentity/MobSpawnerBaseLogic.java",
"license": "gpl-3.0",
"size": 15437
} | [
"net.minecraft.util.BlockPos"
] | import net.minecraft.util.BlockPos; | import net.minecraft.util.*; | [
"net.minecraft.util"
] | net.minecraft.util; | 472,192 |
MetricField getMetricField(); | MetricField getMetricField(); | /**
* The field in the query model representing the value of this metric.
*
* @return An aggregation or post aggregation appearing in the template druid query.
*/ | The field in the query model representing the value of this metric | getMetricField | {
"repo_name": "yahoo/fili",
"path": "fili-core/src/main/java/com/yahoo/bard/webservice/data/metric/LogicalMetric.java",
"license": "apache-2.0",
"size": 2289
} | [
"com.yahoo.bard.webservice.druid.model.MetricField"
] | import com.yahoo.bard.webservice.druid.model.MetricField; | import com.yahoo.bard.webservice.druid.model.*; | [
"com.yahoo.bard"
] | com.yahoo.bard; | 816,860 |
public static ChannelBuilder create(ChannelUID channelUID, String acceptedItemType) {
return new ChannelBuilder(channelUID, acceptedItemType, new HashSet<String>());
} | static ChannelBuilder function(ChannelUID channelUID, String acceptedItemType) { return new ChannelBuilder(channelUID, acceptedItemType, new HashSet<String>()); } | /**
* Creates a channel builder for the given channel UID and item type.
*
* @param channelUID
* channel UID
* @param acceptedItemType
* item type that is accepted by this channel
* @return channel builder
*/ | Creates a channel builder for the given channel UID and item type | create | {
"repo_name": "kaikreuzer/smarthome",
"path": "bundles/core/org.eclipse.smarthome.core.thing/src/main/java/org/eclipse/smarthome/core/thing/binding/builder/ChannelBuilder.java",
"license": "epl-1.0",
"size": 2481
} | [
"java.util.HashSet",
"org.eclipse.smarthome.core.thing.ChannelUID"
] | import java.util.HashSet; import org.eclipse.smarthome.core.thing.ChannelUID; | import java.util.*; import org.eclipse.smarthome.core.thing.*; | [
"java.util",
"org.eclipse.smarthome"
] | java.util; org.eclipse.smarthome; | 1,341,552 |
public void testSkipOnRollOver() {
appendEntries(log, 1020);
log.skip(10);
assertEquals(log.length(), 1030);
long index;
try (TestEntry entry = log.create(TestEntry.class)) {
entry.setTerm(1);
entry.setRemove(true);
index = log.append(entry);
}
assertEquals(log.length(), 1031);
try (TestEntry entry = log.get(1021)) {
assertNull(entry);
}
try (TestEntry entry = log.get(index)) {
assertEquals(entry.getTerm(), 1);
assertTrue(entry.isRemove());
}
} | void function() { appendEntries(log, 1020); log.skip(10); assertEquals(log.length(), 1030); long index; try (TestEntry entry = log.create(TestEntry.class)) { entry.setTerm(1); entry.setRemove(true); index = log.append(entry); } assertEquals(log.length(), 1031); try (TestEntry entry = log.get(1021)) { assertNull(entry); } try (TestEntry entry = log.get(index)) { assertEquals(entry.getTerm(), 1); assertTrue(entry.isRemove()); } } | /**
* Tests skipping entries on a segment rollover.
*/ | Tests skipping entries on a segment rollover | testSkipOnRollOver | {
"repo_name": "tempbottle/copycat",
"path": "storage/src/test/java/net/kuujo/copycat/io/storage/LogTest.java",
"license": "apache-2.0",
"size": 6576
} | [
"org.testng.Assert"
] | import org.testng.Assert; | import org.testng.*; | [
"org.testng"
] | org.testng; | 162,304 |
public void setInformationDate(final LocalDateTime informationDate) {
this.informationDate = informationDate;
}
public Domesticviolence() {
// Default constructor
}
public Domesticviolence(java.util.UUID id) {
this.id = id;
} | void function(final LocalDateTime informationDate) { this.informationDate = informationDate; } public Domesticviolence() { } public Domesticviolence(java.util.UUID id) { this.id = id; } | /**
* Set the value related to the column: informationDate.
* @param informationDate the informationDate value you wish to set
*/ | Set the value related to the column: informationDate | setInformationDate | {
"repo_name": "servinglynk/servinglynk-hmis",
"path": "hmis-model-v2017/src/main/java/com/servinglynk/hmis/warehouse/model/v2017/Domesticviolence.java",
"license": "mpl-2.0",
"size": 13696
} | [
"java.time.LocalDateTime"
] | import java.time.LocalDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 2,218,785 |
public Optional<Reader> getReaderIfFileExists(Path pathRelativeToProjectRoot) {
Path fileToRead = getPathForRelativePath(pathRelativeToProjectRoot);
if (Files.isRegularFile(fileToRead)) {
try {
return Optional.of(
(Reader) new BufferedReader(
new InputStreamReader(newFileInputStream(pathRelativeToProjectRoot))));
} catch (Exception e) {
throw new RuntimeException("Error reading " + pathRelativeToProjectRoot, e);
}
} else {
return Optional.absent();
}
}
/**
* Attempts to read the first line of the file specified by the relative path. If the file does
* not exist, is empty, or encounters an error while being read, {@link Optional#absent()} is
* returned. Otherwise, an {@link Optional} with the first line of the file will be returned.
*
* // @deprecated PRefero operation on {@code Path}s directly, replaced by
* {@link #readFirstLine(java.nio.file.Path)} | Optional<Reader> function(Path pathRelativeToProjectRoot) { Path fileToRead = getPathForRelativePath(pathRelativeToProjectRoot); if (Files.isRegularFile(fileToRead)) { try { return Optional.of( (Reader) new BufferedReader( new InputStreamReader(newFileInputStream(pathRelativeToProjectRoot)))); } catch (Exception e) { throw new RuntimeException(STR + pathRelativeToProjectRoot, e); } } else { return Optional.absent(); } } /** * Attempts to read the first line of the file specified by the relative path. If the file does * not exist, is empty, or encounters an error while being read, {@link Optional#absent()} is * returned. Otherwise, an {@link Optional} with the first line of the file will be returned. * * * {@link #readFirstLine(java.nio.file.Path)} | /**
* Attempts to open the file for future read access. Returns {@link Optional#absent()} if the file
* does not exist.
*/ | Attempts to open the file for future read access. Returns <code>Optional#absent()</code> if the file does not exist | getReaderIfFileExists | {
"repo_name": "MarkRunWu/buck",
"path": "src/com/facebook/buck/io/ProjectFilesystem.java",
"license": "apache-2.0",
"size": 31690
} | [
"com.google.common.base.Optional",
"java.io.BufferedReader",
"java.io.InputStreamReader",
"java.io.Reader",
"java.nio.file.Files",
"java.nio.file.Path"
] | import com.google.common.base.Optional; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.Reader; import java.nio.file.Files; import java.nio.file.Path; | import com.google.common.base.*; import java.io.*; import java.nio.file.*; | [
"com.google.common",
"java.io",
"java.nio"
] | com.google.common; java.io; java.nio; | 1,895,217 |
public void testInterop() throws Exception {
//
// This cert corresponds to the cert in wss86.keystore
// Extracted with:
// keytool -export -rfc -keystore wss86.keystore -alias wss86 -file wss86.cer
//
byte[] certBytes =
org.apache.ws.security.util.Base64.decode(
"MIIC3TCCAkagAwIBAgIJAOaXZIcXC/spMA0GCSqGSIb3DQEBCwUAMIGEMQswCQYD\n" +
"VQQGEwJERTEPMA0GA1UECAwGQmF5ZXJuMQ8wDQYDVQQHDAZNdW5pY2gxDzANBgNV\n" +
"BAoMBkFwYWNoZTEOMAwGA1UECwwFV1NTNEoxDzANBgNVBAMMBldlcm5lcjEhMB8G\n" +
"CSqGSIb3DQEJARYSV2VybmVyQGV4YW1wbGUuY29tMCAXDTE5MDQwNTEwMjA0MFoY\n" +
"DzIwNzUwNTAxMTAyMDQwWjCBhDELMAkGA1UEBhMCREUxDzANBgNVBAgMBkJheWVy\n" +
"bjEPMA0GA1UEBwwGTXVuaWNoMQ8wDQYDVQQKDAZBcGFjaGUxDjAMBgNVBAsMBVdT\n" +
"UzRKMQ8wDQYDVQQDDAZXZXJuZXIxITAfBgkqhkiG9w0BCQEWEldlcm5lckBleGFt\n" +
"cGxlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA3uRplw7q8y/sIR54\n" +
"1uCrlbIMzJHXCRU3nQreGNr6dM49/LxHYffQEx99chQh+wR6fwArFlziDRNnqslO\n" +
"y8zKMfGbaBaR41ZZrxvkSsIwzOhD6yAPgKVQL2vTmJAbdZ35GwcOW8oe7l+NV9qm\n" +
"v7yrr5OhqDhFh36WhgjVLiwmP/cCAwEAAaNTMFEwHQYDVR0OBBYEFHc37Gj+PGYN\n" +
"NB4km9/jVjZLh0CCMB8GA1UdIwQYMBaAFHc37Gj+PGYNNB4km9/jVjZLh0CCMA8G\n" +
"A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADgYEAKtsnYcLEFlAbKmnZDdHl\n" +
"uIHkVF2irwvUThpEt/AvS7wvpz4UbIdIbt7gnWv4KWdWLnmokTPQJmmPCv8Cjuh/\n" +
"DD/IRhV0K/g/77iK/4MXpQr6cxETSv+2/oSkbr0JtGRTwcUM3eoilff0DW7+ULuT\n" +
"WBmJmy0z6eeaXImNs6RH0fg="
);
CertificateFactory factory =
CertificateFactory.getInstance("X.509", "BC");
X509Certificate cert =
(X509Certificate)factory.generateCertificate(
new java.io.ByteArrayInputStream(certBytes)
);
SOAPEnvelope unsignedEnvelope = message.getSOAPEnvelope();
WSSecEncrypt encrypt = new WSSecEncrypt();
encrypt.setUseThisCert(cert);
Document doc = unsignedEnvelope.getAsDocument();
WSSecHeader secHeader = new WSSecHeader();
secHeader.insertSecurityHeader(doc);
Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
if (LOG.isDebugEnabled()) {
String outputString =
org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
LOG.debug(outputString);
}
verify(encryptedDoc);
} | void function() throws Exception { org.apache.ws.security.util.Base64.decode( STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR + STR ); CertificateFactory factory = CertificateFactory.getInstance("X.509", "BC"); X509Certificate cert = (X509Certificate)factory.generateCertificate( new java.io.ByteArrayInputStream(certBytes) ); SOAPEnvelope unsignedEnvelope = message.getSOAPEnvelope(); WSSecEncrypt encrypt = new WSSecEncrypt(); encrypt.setUseThisCert(cert); Document doc = unsignedEnvelope.getAsDocument(); WSSecHeader secHeader = new WSSecHeader(); secHeader.insertSecurityHeader(doc); Document encryptedDoc = encrypt.build(doc, crypto, secHeader); if (LOG.isDebugEnabled()) { String outputString = org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc); LOG.debug(outputString); } verify(encryptedDoc); } | /**
* Test loading a certificate using BouncyCastle, and using it to encrypt a message, but
* decrypt the message using the Java Keystore provider
*/ | Test loading a certificate using BouncyCastle, and using it to encrypt a message, but decrypt the message using the Java Keystore provider | testInterop | {
"repo_name": "wso2/wso2-wss4j",
"path": "modules/wss4j/test/wssec/TestWSSecurityWSS86.java",
"license": "apache-2.0",
"size": 11349
} | [
"java.io.ByteArrayInputStream",
"java.security.cert.CertificateFactory",
"java.security.cert.X509Certificate",
"org.apache.axis.message.SOAPEnvelope",
"org.apache.ws.security.message.WSSecEncrypt",
"org.apache.ws.security.message.WSSecHeader",
"org.w3c.dom.Document"
] | import java.io.ByteArrayInputStream; import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import org.apache.axis.message.SOAPEnvelope; import org.apache.ws.security.message.WSSecEncrypt; import org.apache.ws.security.message.WSSecHeader; import org.w3c.dom.Document; | import java.io.*; import java.security.cert.*; import org.apache.axis.message.*; import org.apache.ws.security.message.*; import org.w3c.dom.*; | [
"java.io",
"java.security",
"org.apache.axis",
"org.apache.ws",
"org.w3c.dom"
] | java.io; java.security; org.apache.axis; org.apache.ws; org.w3c.dom; | 492,505 |
@Test
public void testRenameMoreThanOnceAcrossSnapDirs() throws Exception {
final Path sdir1 = new Path("/dir1");
final Path sdir2 = new Path("/dir2");
final Path sdir3 = new Path("/dir3");
hdfs.mkdirs(sdir1);
hdfs.mkdirs(sdir2);
hdfs.mkdirs(sdir3);
final Path foo_dir1 = new Path(sdir1, "foo");
final Path bar1_dir1 = new Path(foo_dir1, "bar1");
final Path bar2_dir1 = new Path(sdir1, "bar");
DFSTestUtil.createFile(hdfs, bar1_dir1, BLOCKSIZE, REPL, SEED);
DFSTestUtil.createFile(hdfs, bar2_dir1, BLOCKSIZE, REPL, SEED);
SnapshotTestHelper.createSnapshot(hdfs, sdir1, "s1");
SnapshotTestHelper.createSnapshot(hdfs, sdir2, "s2");
SnapshotTestHelper.createSnapshot(hdfs, sdir3, "s3");
// 1. /dir1/foo -> /dir2/foo, /dir1/bar -> /dir2/bar
final Path foo_dir2 = new Path(sdir2, "foo");
hdfs.rename(foo_dir1, foo_dir2);
final Path bar2_dir2 = new Path(sdir2, "bar");
hdfs.rename(bar2_dir1, bar2_dir2);
// restart the cluster and check fsimage
restartClusterAndCheckImage(true);
// modification on /dir2/foo and /dir2/bar
final Path bar1_dir2 = new Path(foo_dir2, "bar1");
hdfs.setReplication(bar1_dir2, REPL_1);
hdfs.setReplication(bar2_dir2, REPL_1);
// check
final Path bar1_s1 = SnapshotTestHelper.getSnapshotPath(sdir1, "s1",
"foo/bar1");
final Path bar2_s1 = SnapshotTestHelper.getSnapshotPath(sdir1, "s1",
"bar");
final Path bar1_s2 = SnapshotTestHelper.getSnapshotPath(sdir2, "s2",
"foo/bar1");
final Path bar2_s2 = SnapshotTestHelper.getSnapshotPath(sdir2, "s2",
"bar");
assertTrue(hdfs.exists(bar1_s1));
assertTrue(hdfs.exists(bar2_s1));
assertFalse(hdfs.exists(bar1_s2));
assertFalse(hdfs.exists(bar2_s2));
FileStatus statusBar1 = hdfs.getFileStatus(bar1_s1);
assertEquals(REPL, statusBar1.getReplication());
statusBar1 = hdfs.getFileStatus(bar1_dir2);
assertEquals(REPL_1, statusBar1.getReplication());
FileStatus statusBar2 = hdfs.getFileStatus(bar2_s1);
assertEquals(REPL, statusBar2.getReplication());
statusBar2 = hdfs.getFileStatus(bar2_dir2);
assertEquals(REPL_1, statusBar2.getReplication());
// 2. /dir2/foo -> /dir3/foo, /dir2/bar -> /dir3/bar
final Path foo_dir3 = new Path(sdir3, "foo");
hdfs.rename(foo_dir2, foo_dir3);
final Path bar2_dir3 = new Path(sdir3, "bar");
hdfs.rename(bar2_dir2, bar2_dir3);
// restart the cluster and check fsimage
restartClusterAndCheckImage(true);
// modification on /dir3/foo and /dir3/bar
final Path bar1_dir3 = new Path(foo_dir3, "bar1");
hdfs.setReplication(bar1_dir3, REPL_2);
hdfs.setReplication(bar2_dir3, REPL_2);
// check
final Path bar1_s3 = SnapshotTestHelper.getSnapshotPath(sdir3, "s3",
"foo/bar1");
final Path bar2_s3 = SnapshotTestHelper.getSnapshotPath(sdir3, "s3",
"bar");
assertTrue(hdfs.exists(bar1_s1));
assertTrue(hdfs.exists(bar2_s1));
assertFalse(hdfs.exists(bar1_s2));
assertFalse(hdfs.exists(bar2_s2));
assertFalse(hdfs.exists(bar1_s3));
assertFalse(hdfs.exists(bar2_s3));
statusBar1 = hdfs.getFileStatus(bar1_s1);
assertEquals(REPL, statusBar1.getReplication());
statusBar1 = hdfs.getFileStatus(bar1_dir3);
assertEquals(REPL_2, statusBar1.getReplication());
statusBar2 = hdfs.getFileStatus(bar2_s1);
assertEquals(REPL, statusBar2.getReplication());
statusBar2 = hdfs.getFileStatus(bar2_dir3);
assertEquals(REPL_2, statusBar2.getReplication());
// 3. /dir3/foo -> /dir2/foo, /dir3/bar -> /dir2/bar
hdfs.rename(foo_dir3, foo_dir2);
hdfs.rename(bar2_dir3, bar2_dir2);
// restart the cluster and check fsimage
restartClusterAndCheckImage(true);
// modification on /dir2/foo
hdfs.setReplication(bar1_dir2, REPL);
hdfs.setReplication(bar2_dir2, REPL);
// check
assertTrue(hdfs.exists(bar1_s1));
assertTrue(hdfs.exists(bar2_s1));
assertFalse(hdfs.exists(bar1_s2));
assertFalse(hdfs.exists(bar2_s2));
assertFalse(hdfs.exists(bar1_s3));
assertFalse(hdfs.exists(bar2_s3));
statusBar1 = hdfs.getFileStatus(bar1_s1);
assertEquals(REPL, statusBar1.getReplication());
statusBar1 = hdfs.getFileStatus(bar1_dir2);
assertEquals(REPL, statusBar1.getReplication());
statusBar2 = hdfs.getFileStatus(bar2_s1);
assertEquals(REPL, statusBar2.getReplication());
statusBar2 = hdfs.getFileStatus(bar2_dir2);
assertEquals(REPL, statusBar2.getReplication());
// 4. /dir2/foo -> /dir1/foo, /dir2/bar -> /dir1/bar
hdfs.rename(foo_dir2, foo_dir1);
hdfs.rename(bar2_dir2, bar2_dir1);
// check the internal details
INodeReference fooRef = fsdir.getINode4Write(foo_dir1.toString())
.asReference();
INodeReference.WithCount fooWithCount = (WithCount) fooRef
.getReferredINode();
// only 2 references: one in deleted list of sdir1, one in created list of
// sdir1
assertEquals(2, fooWithCount.getReferenceCount());
INodeDirectory foo = fooWithCount.asDirectory();
assertEquals(1, foo.getDiffs().asList().size());
INodeDirectory sdir1Node = fsdir.getINode(sdir1.toString()).asDirectory();
Snapshot s1 = sdir1Node.getSnapshot(DFSUtil.string2Bytes("s1"));
assertEquals(s1.getId(), foo.getDirectoryWithSnapshotFeature()
.getLastSnapshotId());
INodeFile bar1 = fsdir.getINode4Write(bar1_dir1.toString()).asFile();
assertEquals(1, bar1.getDiffs().asList().size());
assertEquals(s1.getId(), bar1.getDiffs().getLastSnapshotId());
INodeReference barRef = fsdir.getINode4Write(bar2_dir1.toString())
.asReference();
INodeReference.WithCount barWithCount = (WithCount) barRef
.getReferredINode();
assertEquals(2, barWithCount.getReferenceCount());
INodeFile bar = barWithCount.asFile();
assertEquals(1, bar.getDiffs().asList().size());
assertEquals(s1.getId(), bar.getDiffs().getLastSnapshotId());
// restart the cluster and check fsimage
restartClusterAndCheckImage(true);
// delete foo
hdfs.delete(foo_dir1, true);
restartClusterAndCheckImage(true);
hdfs.delete(bar2_dir1, true);
// restart the cluster and check fsimage
restartClusterAndCheckImage(true);
// check
assertTrue(hdfs.exists(bar1_s1));
assertTrue(hdfs.exists(bar2_s1));
assertFalse(hdfs.exists(bar1_s2));
assertFalse(hdfs.exists(bar2_s2));
assertFalse(hdfs.exists(bar1_s3));
assertFalse(hdfs.exists(bar2_s3));
assertFalse(hdfs.exists(foo_dir1));
assertFalse(hdfs.exists(bar1_dir1));
assertFalse(hdfs.exists(bar2_dir1));
statusBar1 = hdfs.getFileStatus(bar1_s1);
assertEquals(REPL, statusBar1.getReplication());
statusBar2 = hdfs.getFileStatus(bar2_s1);
assertEquals(REPL, statusBar2.getReplication());
final Path foo_s1 = SnapshotTestHelper.getSnapshotPath(sdir1, "s1", "foo");
fooRef = fsdir.getINode(foo_s1.toString()).asReference();
fooWithCount = (WithCount) fooRef.getReferredINode();
assertEquals(1, fooWithCount.getReferenceCount());
barRef = fsdir.getINode(bar2_s1.toString()).asReference();
barWithCount = (WithCount) barRef.getReferredINode();
assertEquals(1, barWithCount.getReferenceCount());
} | void function() throws Exception { final Path sdir1 = new Path("/dir1"); final Path sdir2 = new Path("/dir2"); final Path sdir3 = new Path("/dir3"); hdfs.mkdirs(sdir1); hdfs.mkdirs(sdir2); hdfs.mkdirs(sdir3); final Path foo_dir1 = new Path(sdir1, "foo"); final Path bar1_dir1 = new Path(foo_dir1, "bar1"); final Path bar2_dir1 = new Path(sdir1, "bar"); DFSTestUtil.createFile(hdfs, bar1_dir1, BLOCKSIZE, REPL, SEED); DFSTestUtil.createFile(hdfs, bar2_dir1, BLOCKSIZE, REPL, SEED); SnapshotTestHelper.createSnapshot(hdfs, sdir1, "s1"); SnapshotTestHelper.createSnapshot(hdfs, sdir2, "s2"); SnapshotTestHelper.createSnapshot(hdfs, sdir3, "s3"); final Path foo_dir2 = new Path(sdir2, "foo"); hdfs.rename(foo_dir1, foo_dir2); final Path bar2_dir2 = new Path(sdir2, "bar"); hdfs.rename(bar2_dir1, bar2_dir2); restartClusterAndCheckImage(true); final Path bar1_dir2 = new Path(foo_dir2, "bar1"); hdfs.setReplication(bar1_dir2, REPL_1); hdfs.setReplication(bar2_dir2, REPL_1); final Path bar1_s1 = SnapshotTestHelper.getSnapshotPath(sdir1, "s1", STR); final Path bar2_s1 = SnapshotTestHelper.getSnapshotPath(sdir1, "s1", "bar"); final Path bar1_s2 = SnapshotTestHelper.getSnapshotPath(sdir2, "s2", STR); final Path bar2_s2 = SnapshotTestHelper.getSnapshotPath(sdir2, "s2", "bar"); assertTrue(hdfs.exists(bar1_s1)); assertTrue(hdfs.exists(bar2_s1)); assertFalse(hdfs.exists(bar1_s2)); assertFalse(hdfs.exists(bar2_s2)); FileStatus statusBar1 = hdfs.getFileStatus(bar1_s1); assertEquals(REPL, statusBar1.getReplication()); statusBar1 = hdfs.getFileStatus(bar1_dir2); assertEquals(REPL_1, statusBar1.getReplication()); FileStatus statusBar2 = hdfs.getFileStatus(bar2_s1); assertEquals(REPL, statusBar2.getReplication()); statusBar2 = hdfs.getFileStatus(bar2_dir2); assertEquals(REPL_1, statusBar2.getReplication()); final Path foo_dir3 = new Path(sdir3, "foo"); hdfs.rename(foo_dir2, foo_dir3); final Path bar2_dir3 = new Path(sdir3, "bar"); hdfs.rename(bar2_dir2, bar2_dir3); restartClusterAndCheckImage(true); final Path bar1_dir3 = new Path(foo_dir3, "bar1"); hdfs.setReplication(bar1_dir3, REPL_2); hdfs.setReplication(bar2_dir3, REPL_2); final Path bar1_s3 = SnapshotTestHelper.getSnapshotPath(sdir3, "s3", STR); final Path bar2_s3 = SnapshotTestHelper.getSnapshotPath(sdir3, "s3", "bar"); assertTrue(hdfs.exists(bar1_s1)); assertTrue(hdfs.exists(bar2_s1)); assertFalse(hdfs.exists(bar1_s2)); assertFalse(hdfs.exists(bar2_s2)); assertFalse(hdfs.exists(bar1_s3)); assertFalse(hdfs.exists(bar2_s3)); statusBar1 = hdfs.getFileStatus(bar1_s1); assertEquals(REPL, statusBar1.getReplication()); statusBar1 = hdfs.getFileStatus(bar1_dir3); assertEquals(REPL_2, statusBar1.getReplication()); statusBar2 = hdfs.getFileStatus(bar2_s1); assertEquals(REPL, statusBar2.getReplication()); statusBar2 = hdfs.getFileStatus(bar2_dir3); assertEquals(REPL_2, statusBar2.getReplication()); hdfs.rename(foo_dir3, foo_dir2); hdfs.rename(bar2_dir3, bar2_dir2); restartClusterAndCheckImage(true); hdfs.setReplication(bar1_dir2, REPL); hdfs.setReplication(bar2_dir2, REPL); assertTrue(hdfs.exists(bar1_s1)); assertTrue(hdfs.exists(bar2_s1)); assertFalse(hdfs.exists(bar1_s2)); assertFalse(hdfs.exists(bar2_s2)); assertFalse(hdfs.exists(bar1_s3)); assertFalse(hdfs.exists(bar2_s3)); statusBar1 = hdfs.getFileStatus(bar1_s1); assertEquals(REPL, statusBar1.getReplication()); statusBar1 = hdfs.getFileStatus(bar1_dir2); assertEquals(REPL, statusBar1.getReplication()); statusBar2 = hdfs.getFileStatus(bar2_s1); assertEquals(REPL, statusBar2.getReplication()); statusBar2 = hdfs.getFileStatus(bar2_dir2); assertEquals(REPL, statusBar2.getReplication()); hdfs.rename(foo_dir2, foo_dir1); hdfs.rename(bar2_dir2, bar2_dir1); INodeReference fooRef = fsdir.getINode4Write(foo_dir1.toString()) .asReference(); INodeReference.WithCount fooWithCount = (WithCount) fooRef .getReferredINode(); assertEquals(2, fooWithCount.getReferenceCount()); INodeDirectory foo = fooWithCount.asDirectory(); assertEquals(1, foo.getDiffs().asList().size()); INodeDirectory sdir1Node = fsdir.getINode(sdir1.toString()).asDirectory(); Snapshot s1 = sdir1Node.getSnapshot(DFSUtil.string2Bytes("s1")); assertEquals(s1.getId(), foo.getDirectoryWithSnapshotFeature() .getLastSnapshotId()); INodeFile bar1 = fsdir.getINode4Write(bar1_dir1.toString()).asFile(); assertEquals(1, bar1.getDiffs().asList().size()); assertEquals(s1.getId(), bar1.getDiffs().getLastSnapshotId()); INodeReference barRef = fsdir.getINode4Write(bar2_dir1.toString()) .asReference(); INodeReference.WithCount barWithCount = (WithCount) barRef .getReferredINode(); assertEquals(2, barWithCount.getReferenceCount()); INodeFile bar = barWithCount.asFile(); assertEquals(1, bar.getDiffs().asList().size()); assertEquals(s1.getId(), bar.getDiffs().getLastSnapshotId()); restartClusterAndCheckImage(true); hdfs.delete(foo_dir1, true); restartClusterAndCheckImage(true); hdfs.delete(bar2_dir1, true); restartClusterAndCheckImage(true); assertTrue(hdfs.exists(bar1_s1)); assertTrue(hdfs.exists(bar2_s1)); assertFalse(hdfs.exists(bar1_s2)); assertFalse(hdfs.exists(bar2_s2)); assertFalse(hdfs.exists(bar1_s3)); assertFalse(hdfs.exists(bar2_s3)); assertFalse(hdfs.exists(foo_dir1)); assertFalse(hdfs.exists(bar1_dir1)); assertFalse(hdfs.exists(bar2_dir1)); statusBar1 = hdfs.getFileStatus(bar1_s1); assertEquals(REPL, statusBar1.getReplication()); statusBar2 = hdfs.getFileStatus(bar2_s1); assertEquals(REPL, statusBar2.getReplication()); final Path foo_s1 = SnapshotTestHelper.getSnapshotPath(sdir1, "s1", "foo"); fooRef = fsdir.getINode(foo_s1.toString()).asReference(); fooWithCount = (WithCount) fooRef.getReferredINode(); assertEquals(1, fooWithCount.getReferenceCount()); barRef = fsdir.getINode(bar2_s1.toString()).asReference(); barWithCount = (WithCount) barRef.getReferredINode(); assertEquals(1, barWithCount.getReferenceCount()); } | /**
* Test rename a dir and a file multiple times across snapshottable
* directories: /dir1/foo -> /dir2/foo -> /dir3/foo -> /dir2/foo -> /dir1/foo
*
* Only create snapshots in the beginning (before the rename).
*/ | Test rename a dir and a file multiple times across snapshottable directories: /dir1/foo -> /dir2/foo -> /dir3/foo -> /dir2/foo -> /dir1/foo Only create snapshots in the beginning (before the rename) | testRenameMoreThanOnceAcrossSnapDirs | {
"repo_name": "jaypatil/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/snapshot/TestRenameWithSnapshots.java",
"license": "gpl-3.0",
"size": 105217
} | [
"org.apache.hadoop.fs.FileStatus",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hdfs.DFSTestUtil",
"org.apache.hadoop.hdfs.DFSUtil",
"org.apache.hadoop.hdfs.server.namenode.INodeDirectory",
"org.apache.hadoop.hdfs.server.namenode.INodeFile",
"org.apache.hadoop.hdfs.server.namenode.INodeReference",
... | import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hdfs.DFSTestUtil; import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.hdfs.server.namenode.INodeDirectory; import org.apache.hadoop.hdfs.server.namenode.INodeFile; import org.apache.hadoop.hdfs.server.namenode.INodeReference; import org.junit.Assert; | import org.apache.hadoop.fs.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.hdfs.server.namenode.*; import org.junit.*; | [
"org.apache.hadoop",
"org.junit"
] | org.apache.hadoop; org.junit; | 2,438,172 |
@Test(groups =
{ "DataPrepCloudSync1", "DataPrepCloudSync" })
public void dataPrep_ALF_1846() throws Exception
{
testName = getTestName();
String user1OP = getUserNameForDomain(testName + "-1", hybridDomainPremium);
String user1CL = getUserNameForDomain(testName + "-1", hybridDomainPremium);
String user2CL = getUserNameForDomain(testName + "-2", hybridDomainFree);
cloudUserSiteName = getSiteName(testName) + "CS";
siteName = getSiteName(testName) + "OP-1";
fileName = getFileName(testName) + ".txt";
// Create User1 (On-premise)
CreateUserAPI.CreateActivateUser(drone, adminUserPrem, new String[]
{ user1OP });
// Create User1 and User2 (Cloud)
CreateUserAPI.CreateActivateUser(hybridDrone, adminUserPrem, new String[]
{ user1CL });
CreateUserAPI.CreateActivateUser(hybridDrone, adminUserFree, new String[]
{ user2CL });
// // Login to Cloud as User1, create a site
ShareUser.login(hybridDrone, user1CL, DEFAULT_PASSWORD);
ShareUser.createSite(hybridDrone, cloudUserSiteName, SITE_VISIBILITY_PUBLIC);
ShareUser.logout(hybridDrone);
// Login as User1 (On-Premise) and configure Cloud Sync
ShareUser.login(drone, user1OP, DEFAULT_PASSWORD);
// Create Site
ShareUser.createSite(drone, siteName, SITE_VISIBILITY_PUBLIC);
// Upload a file
String[] fileInfo = { fileName, DOCLIB };
ShareUser.uploadFileInFolder(drone, fileInfo);
signInToAlfrescoInTheCloud(drone, user2CL, DEFAULT_PASSWORD);
ShareUser.logout(drone);
} | @Test(groups = { STR, STR }) void function() throws Exception { testName = getTestName(); String user1OP = getUserNameForDomain(testName + "-1", hybridDomainPremium); String user1CL = getUserNameForDomain(testName + "-1", hybridDomainPremium); String user2CL = getUserNameForDomain(testName + "-2", hybridDomainFree); cloudUserSiteName = getSiteName(testName) + "CS"; siteName = getSiteName(testName) + "OP-1"; fileName = getFileName(testName) + ".txt"; CreateUserAPI.CreateActivateUser(drone, adminUserPrem, new String[] { user1OP }); CreateUserAPI.CreateActivateUser(hybridDrone, adminUserPrem, new String[] { user1CL }); CreateUserAPI.CreateActivateUser(hybridDrone, adminUserFree, new String[] { user2CL }); ShareUser.login(hybridDrone, user1CL, DEFAULT_PASSWORD); ShareUser.createSite(hybridDrone, cloudUserSiteName, SITE_VISIBILITY_PUBLIC); ShareUser.logout(hybridDrone); ShareUser.login(drone, user1OP, DEFAULT_PASSWORD); ShareUser.createSite(drone, siteName, SITE_VISIBILITY_PUBLIC); String[] fileInfo = { fileName, DOCLIB }; ShareUser.uploadFileInFolder(drone, fileInfo); signInToAlfrescoInTheCloud(drone, user2CL, DEFAULT_PASSWORD); ShareUser.logout(drone); } | /**
* 1. Create User1 (On-premise) 2. Create Cloud User1 with PremierNet domain
* and Cloud User2 wih FreeNet domain 3. Login to Cloud as User1, create a
* site 4. Login as User1 (On-Premise), configure Cloud Sync (with Cloud
* User2), Create a site and upload a document
*
* @throws Exception
*/ | 1. Create User1 (On-premise) 2. Create Cloud User1 with PremierNet domain and Cloud User2 wih FreeNet domain 3. Login to Cloud as User1, create a site 4. Login as User1 (On-Premise), configure Cloud Sync (with Cloud User2), Create a site and upload a document | dataPrep_ALF_1846 | {
"repo_name": "loftuxab/community-edition-old",
"path": "projects/qa-share/src/test/java/org/alfresco/share/cloudsync/CloudSyncAccessTest.java",
"license": "lgpl-3.0",
"size": 105081
} | [
"org.alfresco.share.util.ShareUser",
"org.alfresco.share.util.api.CreateUserAPI",
"org.testng.annotations.Test"
] | import org.alfresco.share.util.ShareUser; import org.alfresco.share.util.api.CreateUserAPI; import org.testng.annotations.Test; | import org.alfresco.share.util.*; import org.alfresco.share.util.api.*; import org.testng.annotations.*; | [
"org.alfresco.share",
"org.testng.annotations"
] | org.alfresco.share; org.testng.annotations; | 1,507,232 |
public SVGAnimatedBoolean getExternalResourcesRequired() {
return externalResourcesRequired;
}
// SVGTests support /////////////////////////////////////////////////// | SVGAnimatedBoolean function() { return externalResourcesRequired; } | /**
* <b>DOM</b>: Implements {@link
* org.w3c.dom.svg.SVGExternalResourcesRequired#getExternalResourcesRequired()}.
*/ | DOM: Implements <code>org.w3c.dom.svg.SVGExternalResourcesRequired#getExternalResourcesRequired()</code> | getExternalResourcesRequired | {
"repo_name": "shyamalschandra/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/dom/svg/SVGOMSVGElement.java",
"license": "apache-2.0",
"size": 29079
} | [
"org.w3c.dom.svg.SVGAnimatedBoolean"
] | import org.w3c.dom.svg.SVGAnimatedBoolean; | import org.w3c.dom.svg.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,308,070 |
@Override
protected void createObject() {
Rectangle location = getLocation();
if (location == null) {
if (jrElement != null)
location = new Rectangle(jrElement.getX(), jrElement.getY(), jrElement.getWidth(), jrElement.getHeight());
else
location = new Rectangle(0, 0, 100, 50);
}
if (location.width < 0)
location.width = srcNode.getDefaultWidth() * 2;
if (location.height < 0)
location.height = srcNode.getDefaultHeight();
int index = getIndex();
JRElementGroup jrGroup = getJrGroup();
if (index < 0)
index = jrGroup.getChildren().size();
// CREATE 2 TEXTFIELDS
MPageNumber mPageNumber = new MPageNumber();
tfPageNumber = mPageNumber.createJRElement(jrDesign);
tfPageNumber.setX(location.x);
tfPageNumber.setY(location.y);
tfPageNumber.setWidth(location.width / 2);
tfPageNumber.setHeight(location.height);
tfPageNumber.setHorizontalAlignment(HorizontalAlignEnum.RIGHT);
tfPageNumber.setEvaluationTime(EvaluationTimeEnum.NOW);
JRDesignExpression expression = new JRDesignExpression();
expression.setText(Messages.CreatePageXofYCommand_0);
tfPageNumber.setExpression(expression);
if (jrGroup instanceof JRDesignElementGroup)
((JRDesignElementGroup) jrGroup).addElement(index, tfPageNumber);
else if (jrGroup instanceof JRDesignFrame)
((JRDesignFrame) jrGroup).addElement(index, tfPageNumber);
// CREATE SECOND TEXT FIELD
MTotalPages mTotalPages = new MTotalPages();
tfPageTotal = mTotalPages.createJRElement(jrDesign);
tfPageTotal.setX(location.x + tfPageNumber.getWidth());
tfPageTotal.setY(location.y);
tfPageTotal.setWidth(location.width / 2);
tfPageTotal.setHeight(location.height);
tfPageTotal.setHorizontalAlignment(HorizontalAlignEnum.LEFT);
tfPageTotal.setEvaluationTime(EvaluationTimeEnum.REPORT);
expression = new JRDesignExpression();
expression.setText(Messages.CreatePageXofYCommand_1);
tfPageTotal.setExpression(expression);
if (jrGroup instanceof JRDesignElementGroup)
((JRDesignElementGroup) jrGroup).addElement(index + 1, tfPageTotal);
else if (jrGroup instanceof JRDesignFrame)
((JRDesignFrame) jrGroup).addElement(index + 1, tfPageTotal);
} | void function() { Rectangle location = getLocation(); if (location == null) { if (jrElement != null) location = new Rectangle(jrElement.getX(), jrElement.getY(), jrElement.getWidth(), jrElement.getHeight()); else location = new Rectangle(0, 0, 100, 50); } if (location.width < 0) location.width = srcNode.getDefaultWidth() * 2; if (location.height < 0) location.height = srcNode.getDefaultHeight(); int index = getIndex(); JRElementGroup jrGroup = getJrGroup(); if (index < 0) index = jrGroup.getChildren().size(); MPageNumber mPageNumber = new MPageNumber(); tfPageNumber = mPageNumber.createJRElement(jrDesign); tfPageNumber.setX(location.x); tfPageNumber.setY(location.y); tfPageNumber.setWidth(location.width / 2); tfPageNumber.setHeight(location.height); tfPageNumber.setHorizontalAlignment(HorizontalAlignEnum.RIGHT); tfPageNumber.setEvaluationTime(EvaluationTimeEnum.NOW); JRDesignExpression expression = new JRDesignExpression(); expression.setText(Messages.CreatePageXofYCommand_0); tfPageNumber.setExpression(expression); if (jrGroup instanceof JRDesignElementGroup) ((JRDesignElementGroup) jrGroup).addElement(index, tfPageNumber); else if (jrGroup instanceof JRDesignFrame) ((JRDesignFrame) jrGroup).addElement(index, tfPageNumber); MTotalPages mTotalPages = new MTotalPages(); tfPageTotal = mTotalPages.createJRElement(jrDesign); tfPageTotal.setX(location.x + tfPageNumber.getWidth()); tfPageTotal.setY(location.y); tfPageTotal.setWidth(location.width / 2); tfPageTotal.setHeight(location.height); tfPageTotal.setHorizontalAlignment(HorizontalAlignEnum.LEFT); tfPageTotal.setEvaluationTime(EvaluationTimeEnum.REPORT); expression = new JRDesignExpression(); expression.setText(Messages.CreatePageXofYCommand_1); tfPageTotal.setExpression(expression); if (jrGroup instanceof JRDesignElementGroup) ((JRDesignElementGroup) jrGroup).addElement(index + 1, tfPageTotal); else if (jrGroup instanceof JRDesignFrame) ((JRDesignFrame) jrGroup).addElement(index + 1, tfPageTotal); } | /**
* Creates the object.
*/ | Creates the object | createObject | {
"repo_name": "OpenSoftwareSolutions/PDFReporter-Studio",
"path": "com.jaspersoft.studio/src/com/jaspersoft/studio/model/textfield/command/CreatePageXofYCommand.java",
"license": "lgpl-3.0",
"size": 6747
} | [
"com.jaspersoft.studio.messages.Messages",
"com.jaspersoft.studio.model.textfield.MPageNumber",
"com.jaspersoft.studio.model.textfield.MTotalPages",
"net.sf.jasperreports.engine.JRElementGroup",
"net.sf.jasperreports.engine.design.JRDesignElementGroup",
"net.sf.jasperreports.engine.design.JRDesignExpressi... | import com.jaspersoft.studio.messages.Messages; import com.jaspersoft.studio.model.textfield.MPageNumber; import com.jaspersoft.studio.model.textfield.MTotalPages; import net.sf.jasperreports.engine.JRElementGroup; import net.sf.jasperreports.engine.design.JRDesignElementGroup; import net.sf.jasperreports.engine.design.JRDesignExpression; import net.sf.jasperreports.engine.design.JRDesignFrame; import net.sf.jasperreports.engine.type.EvaluationTimeEnum; import net.sf.jasperreports.engine.type.HorizontalAlignEnum; import org.eclipse.draw2d.geometry.Rectangle; | import com.jaspersoft.studio.messages.*; import com.jaspersoft.studio.model.textfield.*; import net.sf.jasperreports.engine.*; import net.sf.jasperreports.engine.design.*; import net.sf.jasperreports.engine.type.*; import org.eclipse.draw2d.geometry.*; | [
"com.jaspersoft.studio",
"net.sf.jasperreports",
"org.eclipse.draw2d"
] | com.jaspersoft.studio; net.sf.jasperreports; org.eclipse.draw2d; | 319,892 |
public void setFramesDiamonds(ArrayList<BufferedImage> framesDiamonds) {
this.framesDiamonds = framesDiamonds;
} | void function(ArrayList<BufferedImage> framesDiamonds) { this.framesDiamonds = framesDiamonds; } | /**
* Un setter qui permet de changer les sprites de Diamond si besoin
**/ | Un setter qui permet de changer les sprites de Diamond si besoin | setFramesDiamonds | {
"repo_name": "NunusPower/BoulderDash",
"path": "src/Controleur/Jeu.java",
"license": "mit",
"size": 4602
} | [
"java.awt.image.BufferedImage",
"java.util.ArrayList"
] | import java.awt.image.BufferedImage; import java.util.ArrayList; | import java.awt.image.*; import java.util.*; | [
"java.awt",
"java.util"
] | java.awt; java.util; | 2,098,758 |
public void executeScenarioDdl(List<Ddl> ddls, String tenantId, DataLoadTimeSummary dataLoadTimeSummary) throws Exception {
if (null != ddls) {
Connection conn = null;
try {
for (Ddl ddl : ddls) {
LOGGER.info("\nExecuting DDL:" + ddl + " on tenantId:" +tenantId);
long startTime = EnvironmentEdgeManager.currentTimeMillis();
executeStatement(ddl.toString(), conn = getConnection(tenantId));
if (ddl.getStatement().toUpperCase().contains(ASYNC_KEYWORD)) {
waitForAsyncIndexToFinish(ddl.getTableName());
}
dataLoadTimeSummary.add(ddl.getTableName(), 0,
(int)(EnvironmentEdgeManager.currentTimeMillis() - startTime));
}
} finally {
if (null != conn) {
conn.close();
}
}
}
} | void function(List<Ddl> ddls, String tenantId, DataLoadTimeSummary dataLoadTimeSummary) throws Exception { if (null != ddls) { Connection conn = null; try { for (Ddl ddl : ddls) { LOGGER.info(STR + ddl + STR +tenantId); long startTime = EnvironmentEdgeManager.currentTimeMillis(); executeStatement(ddl.toString(), conn = getConnection(tenantId)); if (ddl.getStatement().toUpperCase().contains(ASYNC_KEYWORD)) { waitForAsyncIndexToFinish(ddl.getTableName()); } dataLoadTimeSummary.add(ddl.getTableName(), 0, (int)(EnvironmentEdgeManager.currentTimeMillis() - startTime)); } } finally { if (null != conn) { conn.close(); } } } } | /**
* Executes any ddl defined at the scenario level. This is executed before we commence
* the data load.
*
* @throws Exception
*/ | Executes any ddl defined at the scenario level. This is executed before we commence the data load | executeScenarioDdl | {
"repo_name": "ankitsinghal/phoenix",
"path": "phoenix-pherf/src/main/java/org/apache/phoenix/pherf/util/PhoenixUtil.java",
"license": "apache-2.0",
"size": 23580
} | [
"java.sql.Connection",
"java.util.List",
"org.apache.phoenix.pherf.configuration.Ddl",
"org.apache.phoenix.pherf.result.DataLoadTimeSummary",
"org.apache.phoenix.util.EnvironmentEdgeManager"
] | import java.sql.Connection; import java.util.List; import org.apache.phoenix.pherf.configuration.Ddl; import org.apache.phoenix.pherf.result.DataLoadTimeSummary; import org.apache.phoenix.util.EnvironmentEdgeManager; | import java.sql.*; import java.util.*; import org.apache.phoenix.pherf.configuration.*; import org.apache.phoenix.pherf.result.*; import org.apache.phoenix.util.*; | [
"java.sql",
"java.util",
"org.apache.phoenix"
] | java.sql; java.util; org.apache.phoenix; | 859,640 |
private void processXmpTag(@NotNull XMPMeta meta, @NotNull XmpDirectory directory, int tagType, int formatCode) throws XMPException
{
String schemaNS = XmpDirectory._tagSchemaMap.get(tagType);
String propName = XmpDirectory._tagPropNameMap.get(tagType);
String property = meta.getPropertyString(schemaNS, propName);
if (property == null)
return;
switch (formatCode)
{
case FMT_RATIONAL:
String[] rationalParts = property.split("/", 2);
if (rationalParts.length == 2)
{
try
{
Rational rational = new Rational((long) Float.parseFloat(rationalParts[0]), (long) Float.parseFloat(rationalParts[1]));
directory.setRational(tagType, rational);
}
catch (NumberFormatException ex)
{
directory.addError(String.format("Unable to parse XMP property %s as a Rational.", propName));
}
}
else
{
directory.addError("Error in rational format for tag " + tagType);
}
break;
case FMT_INT:
try
{
directory.setInt(tagType, Integer.valueOf(property));
}
catch (NumberFormatException ex)
{
directory.addError(String.format("Unable to parse XMP property %s as an int.", propName));
}
break;
case FMT_DOUBLE:
try
{
directory.setDouble(tagType, Double.valueOf(property));
}
catch (NumberFormatException ex)
{
directory.addError(String.format("Unable to parse XMP property %s as an double.", propName));
}
break;
case FMT_STRING:
directory.setString(tagType, property);
break;
case FMT_STRING_ARRAY:
//XMP iterators are 1-based
int count = meta.countArrayItems(schemaNS, propName);
String[] array = new String[count];
for ( int i = 1; i <= count; ++i)
{
array[i-1] = meta.getArrayItem(schemaNS, propName, i).getValue();
}
directory.setStringArray(tagType, array);
break;
default:
directory.addError(String.format("Unknown format code %d for tag %d", formatCode, tagType));
}
}
| void function(@NotNull XMPMeta meta, @NotNull XmpDirectory directory, int tagType, int formatCode) throws XMPException { String schemaNS = XmpDirectory._tagSchemaMap.get(tagType); String propName = XmpDirectory._tagPropNameMap.get(tagType); String property = meta.getPropertyString(schemaNS, propName); if (property == null) return; switch (formatCode) { case FMT_RATIONAL: String[] rationalParts = property.split("/", 2); if (rationalParts.length == 2) { try { Rational rational = new Rational((long) Float.parseFloat(rationalParts[0]), (long) Float.parseFloat(rationalParts[1])); directory.setRational(tagType, rational); } catch (NumberFormatException ex) { directory.addError(String.format(STR, propName)); } } else { directory.addError(STR + tagType); } break; case FMT_INT: try { directory.setInt(tagType, Integer.valueOf(property)); } catch (NumberFormatException ex) { directory.addError(String.format(STR, propName)); } break; case FMT_DOUBLE: try { directory.setDouble(tagType, Double.valueOf(property)); } catch (NumberFormatException ex) { directory.addError(String.format(STR, propName)); } break; case FMT_STRING: directory.setString(tagType, property); break; case FMT_STRING_ARRAY: int count = meta.countArrayItems(schemaNS, propName); String[] array = new String[count]; for ( int i = 1; i <= count; ++i) { array[i-1] = meta.getArrayItem(schemaNS, propName, i).getValue(); } directory.setStringArray(tagType, array); break; default: directory.addError(String.format(STR, formatCode, tagType)); } } | /**
* Reads an property value with given namespace URI and property name. Add property value to directory if exists
*/ | Reads an property value with given namespace URI and property name. Add property value to directory if exists | processXmpTag | {
"repo_name": "Odrahcyr/amanda-xmp",
"path": "Source/com/drew/metadata/xmp/XmpReader.java",
"license": "apache-2.0",
"size": 12530
} | [
"com.adobe.xmp.XMPException",
"com.adobe.xmp.XMPMeta",
"com.drew.lang.Rational",
"com.drew.lang.annotations.NotNull"
] | import com.adobe.xmp.XMPException; import com.adobe.xmp.XMPMeta; import com.drew.lang.Rational; import com.drew.lang.annotations.NotNull; | import com.adobe.xmp.*; import com.drew.lang.*; import com.drew.lang.annotations.*; | [
"com.adobe.xmp",
"com.drew.lang"
] | com.adobe.xmp; com.drew.lang; | 1,702,114 |
public static String[] split(String s, Pattern delim, boolean keep) {
if (s == null) {
s = "";
}
int lastMatch = 0;
ArrayList<String> parts = new ArrayList<>();
Matcher m = delim.matcher(s);
while (m.find()) {
String x = s.substring(lastMatch, m.start());
if (!x.isEmpty()) {
parts.add(x);
}
if (keep) {
parts.add(m.group(0));
}
lastMatch = m.end();
}
String x = s.substring(lastMatch);
if (!x.isEmpty()) {
parts.add(x);
}
return parts.toArray(new String[parts.size()]);
} | static String[] function(String s, Pattern delim, boolean keep) { if (s == null) { s = ""; } int lastMatch = 0; ArrayList<String> parts = new ArrayList<>(); Matcher m = delim.matcher(s); while (m.find()) { String x = s.substring(lastMatch, m.start()); if (!x.isEmpty()) { parts.add(x); } if (keep) { parts.add(m.group(0)); } lastMatch = m.end(); } String x = s.substring(lastMatch); if (!x.isEmpty()) { parts.add(x); } return parts.toArray(new String[parts.size()]); } | /**
* Splits a string by a pattern.
*
* @param s The string to split.
* @param delim The delimeter.
* @param keep Indicates if the delimeters should be kept.
* @return The splitted string.
*/ | Splits a string by a pattern | split | {
"repo_name": "Intevation/downloadclient",
"path": "src/main/java/de/bayern/gdi/utils/StringUtils.java",
"license": "apache-2.0",
"size": 8957
} | [
"java.util.ArrayList",
"java.util.regex.Matcher",
"java.util.regex.Pattern"
] | import java.util.ArrayList; import java.util.regex.Matcher; import java.util.regex.Pattern; | import java.util.*; import java.util.regex.*; | [
"java.util"
] | java.util; | 1,381,921 |
@Override
public boolean containsEntry(RegionEntry entry) {
return false;
} | boolean function(RegionEntry entry) { return false; } | /**
* This implementation is for PrimaryKeyIndex. RangeIndex has its own implementation. For
* PrimaryKeyIndex , this method should not be used
* <p>
* TODO: check if an Exception should be thrown if the function implementation of this class gets
* invoked
*/ | This implementation is for PrimaryKeyIndex. RangeIndex has its own implementation. For PrimaryKeyIndex , this method should not be used invoked | containsEntry | {
"repo_name": "pdxrunner/geode",
"path": "geode-core/src/main/java/org/apache/geode/cache/query/internal/index/AbstractIndex.java",
"license": "apache-2.0",
"size": 77062
} | [
"org.apache.geode.internal.cache.RegionEntry"
] | import org.apache.geode.internal.cache.RegionEntry; | import org.apache.geode.internal.cache.*; | [
"org.apache.geode"
] | org.apache.geode; | 2,701,956 |
public boolean isBefore(@NonNull CalendarDay other) {
if (other == null) {
throw new IllegalArgumentException("other cannot be null");
}
if (year == other.year) {
return ((month == other.month) ? (day < other.day) : (month < other.month));
} else {
return year < other.year;
}
} | boolean function(@NonNull CalendarDay other) { if (other == null) { throw new IllegalArgumentException(STR); } if (year == other.year) { return ((month == other.month) ? (day < other.day) : (month < other.month)); } else { return year < other.year; } } | /**
* Determine if this day is before the given instance
*
* @param other the other day to test
* @return true if this is before other, false if equal or after
*/ | Determine if this day is before the given instance | isBefore | {
"repo_name": "Zhangsongsong/GraduationPro",
"path": "毕业设计/code/android/YYFramework/src/com/prolificinteractive/materialcalendarview/CalendarDay.java",
"license": "apache-2.0",
"size": 8115
} | [
"android.support.annotation.NonNull"
] | import android.support.annotation.NonNull; | import android.support.annotation.*; | [
"android.support"
] | android.support; | 1,671,658 |
T get(ResultRetriever<T> retriever); | T get(ResultRetriever<T> retriever); | /**
* Gets {@link java.sql.ResultSet} and retrieves single result
* <p>
* Note: Only for direct JDBC streams
* <p/>
*
* @param retriever
*
* @return T single query result
* @see java.sql.ResultSet
* @see org.lightmare.criteria.config.Configuration.ResultRetriever
*/ | Gets <code>java.sql.ResultSet</code> and retrieves single result Note: Only for direct JDBC streams | get | {
"repo_name": "levants/lightmare",
"path": "lightmare-criteria/src/main/java/org/lightmare/criteria/query/providers/jdbc/JdbcResultStream.java",
"license": "lgpl-2.1",
"size": 3311
} | [
"org.lightmare.criteria.config.Configuration"
] | import org.lightmare.criteria.config.Configuration; | import org.lightmare.criteria.config.*; | [
"org.lightmare.criteria"
] | org.lightmare.criteria; | 800,479 |
public void setSelectedCell(CellDisplay cell)
{
if (cell == null) return;
if (!(model instanceof WellsModel)) return;
//quietly save the description of the well and the color.
((WellsModel) model).setSelectedCell(cell);
view.repaint();
}
| void function(CellDisplay cell) { if (cell == null) return; if (!(model instanceof WellsModel)) return; ((WellsModel) model).setSelectedCell(cell); view.repaint(); } | /**
* Implemented as specified by the {@link DataBrowser} interface.
* @see DataBrowser#setSelectedCell(CellDisplay)
*/ | Implemented as specified by the <code>DataBrowser</code> interface | setSelectedCell | {
"repo_name": "hflynn/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/dataBrowser/view/DataBrowserComponent.java",
"license": "gpl-2.0",
"size": 52375
} | [
"org.openmicroscopy.shoola.agents.dataBrowser.browser.CellDisplay"
] | import org.openmicroscopy.shoola.agents.dataBrowser.browser.CellDisplay; | import org.openmicroscopy.shoola.agents.*; | [
"org.openmicroscopy.shoola"
] | org.openmicroscopy.shoola; | 294,235 |
EAttribute getFeatureTypeType_OtherCRS(); | EAttribute getFeatureTypeType_OtherCRS(); | /**
* Returns the meta object for the attribute list '{@link net.opengis.wfs20.FeatureTypeType#getOtherCRS <em>Other CRS</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute list '<em>Other CRS</em>'.
* @see net.opengis.wfs20.FeatureTypeType#getOtherCRS()
* @see #getFeatureTypeType()
* @generated
*/ | Returns the meta object for the attribute list '<code>net.opengis.wfs20.FeatureTypeType#getOtherCRS Other CRS</code>'. | getFeatureTypeType_OtherCRS | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wfs/src/net/opengis/wfs20/Wfs20Package.java",
"license": "lgpl-2.1",
"size": 404067
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,181,484 |
@Override
public String toString() {
return StringUtils.join(" ", this.parts);
} | String function() { return StringUtils.join(" ", this.parts); } | /**
* Convert the parts to a string.
*
* @return The part as a string.
*/ | Convert the parts to a string | toString | {
"repo_name": "sgdc3/AuthMeReloaded",
"path": "src/main/java/fr/xephi/authme/command/CommandParts.java",
"license": "gpl-3.0",
"size": 1445
} | [
"fr.xephi.authme.util.StringUtils"
] | import fr.xephi.authme.util.StringUtils; | import fr.xephi.authme.util.*; | [
"fr.xephi.authme"
] | fr.xephi.authme; | 2,278,016 |
try {
readData(
new DataInputStream(
new ByteArrayInputStream(msg)
)
);
} catch (IOException ex) {
}
}//setMessage | try { readData( new DataInputStream( new ByteArrayInputStream(msg) ) ); } catch (IOException ex) { } } | /**
* Utility method to set the raw data of the message.
* Should not be used except under rare circumstances.
* <p>
* @param msg the <tt>byte[]</tt> resembling the raw modbus
* response message.
*/ | Utility method to set the raw data of the message. Should not be used except under rare circumstances. | setMessage | {
"repo_name": "geog-opensource/jamod",
"path": "src/net/wimpi/modbus/msg/ModbusResponse.java",
"license": "bsd-3-clause",
"size": 2910
} | [
"java.io.ByteArrayInputStream",
"java.io.DataInputStream",
"java.io.IOException"
] | import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 116,384 |
@SneakyThrows
protected String generateToken(final Service service, final Map<String, String> parameters) {
final String ticketId = parameters.get(CasProtocolConstants.PARAMETER_TICKET);
return this.tokenTicketBuilder.build(ticketId, service);
} | String function(final Service service, final Map<String, String> parameters) { final String ticketId = parameters.get(CasProtocolConstants.PARAMETER_TICKET); return this.tokenTicketBuilder.build(ticketId, service); } | /**
* Generate token string.
*
* @param service the service
* @param parameters the parameters
* @return the jwt
*/ | Generate token string | generateToken | {
"repo_name": "prigaux/cas",
"path": "support/cas-server-support-token-tickets/src/main/java/org/apereo/cas/token/authentication/principal/TokenWebApplicationServiceResponseBuilder.java",
"license": "apache-2.0",
"size": 2826
} | [
"java.util.Map",
"org.apereo.cas.CasProtocolConstants",
"org.apereo.cas.authentication.principal.Service"
] | import java.util.Map; import org.apereo.cas.CasProtocolConstants; import org.apereo.cas.authentication.principal.Service; | import java.util.*; import org.apereo.cas.*; import org.apereo.cas.authentication.principal.*; | [
"java.util",
"org.apereo.cas"
] | java.util; org.apereo.cas; | 2,072,763 |
public void testDirWithFiles() throws Exception {
final List<Event> evtList = new ArrayList<>();
final int evtsCnt = 4 + 3 + 1;
final CountDownLatch latch = new CountDownLatch(evtsCnt); | void function() throws Exception { final List<Event> evtList = new ArrayList<>(); final int evtsCnt = 4 + 3 + 1; final CountDownLatch latch = new CountDownLatch(evtsCnt); | /**
* Checks events on CRUD operations on a single directory
* with some files.
*
* @throws Exception If failed.
*/ | Checks events on CRUD operations on a single directory with some files | testDirWithFiles | {
"repo_name": "psadusumilli/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/igfs/IgfsEventsAbstractSelfTest.java",
"license": "apache-2.0",
"size": 29327
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.concurrent.CountDownLatch",
"org.apache.ignite.events.Event"
] | import java.util.ArrayList; import java.util.List; import java.util.concurrent.CountDownLatch; import org.apache.ignite.events.Event; | import java.util.*; import java.util.concurrent.*; import org.apache.ignite.events.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 989,750 |
public Comment remove(long commentId)
throws NoSuchCommentException, SystemException {
return remove(Long.valueOf(commentId));
} | Comment function(long commentId) throws NoSuchCommentException, SystemException { return remove(Long.valueOf(commentId)); } | /**
* Removes the Comment with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param commentId the primary key of the Comment
* @return the Comment that was removed
* @throws it.gebhard.qa.NoSuchCommentException if a Comment with the primary key could not be found
* @throws SystemException if a system exception occurred
*/ | Removes the Comment with the primary key from the database. Also notifies the appropriate model listeners | remove | {
"repo_name": "p-gebhard/QuickAnswer",
"path": "docroot/WEB-INF/src/it/gebhard/qa/service/persistence/CommentPersistenceImpl.java",
"license": "gpl-3.0",
"size": 49083
} | [
"com.liferay.portal.kernel.exception.SystemException",
"it.gebhard.qa.NoSuchCommentException",
"it.gebhard.qa.model.Comment"
] | import com.liferay.portal.kernel.exception.SystemException; import it.gebhard.qa.NoSuchCommentException; import it.gebhard.qa.model.Comment; | import com.liferay.portal.kernel.exception.*; import it.gebhard.qa.*; import it.gebhard.qa.model.*; | [
"com.liferay.portal",
"it.gebhard.qa"
] | com.liferay.portal; it.gebhard.qa; | 2,477,909 |
public void testPersistenceGenerateSchemaDropOnlyScript() {
Map properties = new HashMap();
properties.put(PersistenceUnitProperties.SESSION_NAME, "generate-schema-no-conn-session-drop-only");
properties.put(PersistenceUnitProperties.ORM_SCHEMA_VALIDATION, true);
properties.put(PersistenceUnitProperties.SCHEMA_DATABASE_PRODUCT_NAME, "MySQL");
properties.put(PersistenceUnitProperties.SCHEMA_DATABASE_MAJOR_VERSION, "5");
properties.put(PersistenceUnitProperties.SCHEMA_DATABASE_MINOR_VERSION, "5");
properties.put(PersistenceUnitProperties.SCHEMA_GENERATION_SCRIPTS_ACTION, PersistenceUnitProperties.SCHEMA_GENERATION_DROP_ACTION);
properties.put(PersistenceUnitProperties.SCHEMA_GENERATION_SCRIPTS_DROP_TARGET, "jpa21-generate-schema-no-connection-drop-only.jdbc");
Persistence.generateSchema(getPersistenceUnitName(), properties);
} | void function() { Map properties = new HashMap(); properties.put(PersistenceUnitProperties.SESSION_NAME, STR); properties.put(PersistenceUnitProperties.ORM_SCHEMA_VALIDATION, true); properties.put(PersistenceUnitProperties.SCHEMA_DATABASE_PRODUCT_NAME, "MySQL"); properties.put(PersistenceUnitProperties.SCHEMA_DATABASE_MAJOR_VERSION, "5"); properties.put(PersistenceUnitProperties.SCHEMA_DATABASE_MINOR_VERSION, "5"); properties.put(PersistenceUnitProperties.SCHEMA_GENERATION_SCRIPTS_ACTION, PersistenceUnitProperties.SCHEMA_GENERATION_DROP_ACTION); properties.put(PersistenceUnitProperties.SCHEMA_GENERATION_SCRIPTS_DROP_TARGET, STR); Persistence.generateSchema(getPersistenceUnitName(), properties); } | /**
* Test the generate schema feature from the Persistence API.
*/ | Test the generate schema feature from the Persistence API | testPersistenceGenerateSchemaDropOnlyScript | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa21/advanced/DDLTestSuite.java",
"license": "epl-1.0",
"size": 28321
} | [
"java.util.HashMap",
"java.util.Map",
"javax.persistence.Persistence",
"org.eclipse.persistence.config.PersistenceUnitProperties"
] | import java.util.HashMap; import java.util.Map; import javax.persistence.Persistence; import org.eclipse.persistence.config.PersistenceUnitProperties; | import java.util.*; import javax.persistence.*; import org.eclipse.persistence.config.*; | [
"java.util",
"javax.persistence",
"org.eclipse.persistence"
] | java.util; javax.persistence; org.eclipse.persistence; | 1,882,004 |
List<Bill> getBillsByPatientId(int patientId, PagingInfo paging); | List<Bill> getBillsByPatientId(int patientId, PagingInfo paging); | /**
* Returns all {@link Bill}s for the specified patient with the specified paging.
* @param patientId The patient id.
* @param paging The paging information.
* @return All of the bills for the specified patient.
* @should throw IllegalArgumentException if the patientId is less than zero
* @should throw NullPointerException if patient is null
* @should return all bills for the specified patient
* @should return an empty list if the specified patient has no bills
*/ | Returns all <code>Bill</code>s for the specified patient with the specified paging | getBillsByPatientId | {
"repo_name": "andrewmoko/openmrs-module-openhmis.cashier",
"path": "api/src/main/java/org/openmrs/module/openhmis/cashier/api/IBillService.java",
"license": "mpl-2.0",
"size": 4392
} | [
"java.util.List",
"org.openmrs.module.openhmis.cashier.api.model.Bill",
"org.openmrs.module.openhmis.commons.api.PagingInfo"
] | import java.util.List; import org.openmrs.module.openhmis.cashier.api.model.Bill; import org.openmrs.module.openhmis.commons.api.PagingInfo; | import java.util.*; import org.openmrs.module.openhmis.cashier.api.model.*; import org.openmrs.module.openhmis.commons.api.*; | [
"java.util",
"org.openmrs.module"
] | java.util; org.openmrs.module; | 602,577 |
public String getLocalName(int index)
{
return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index)));
}
| String function(int index) { return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index))); } | /**
* Look up an attribute's local name by index.
*
* @param index The attribute index (zero-based).
* @return The local name, or the empty string if Namespace
* processing is not being performed, or null
* if the index is out of range.
*/ | Look up an attribute's local name by index | getLocalName | {
"repo_name": "srnsw/xena",
"path": "xena/ext/src/xalan-j_2_7_1/src/org/apache/xml/serializer/utils/AttList.java",
"license": "gpl-3.0",
"size": 6927
} | [
"org.w3c.dom.Attr"
] | import org.w3c.dom.Attr; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 363,376 |
public AggregatorRegistry getAggregatorRegistry()
{
return aggregatorRegistry;
} | AggregatorRegistry function() { return aggregatorRegistry; } | /**
* Gets the {@link AggregatorRegistry} associated with this schema.
*
* @return The {@link AggregatorRegistry} associated with this schema.
*/ | Gets the <code>AggregatorRegistry</code> associated with this schema | getAggregatorRegistry | {
"repo_name": "ananthc/apex-malhar",
"path": "library/src/main/java/org/apache/apex/malhar/lib/appdata/schemas/DimensionalConfigurationSchema.java",
"license": "apache-2.0",
"size": 108286
} | [
"org.apache.apex.malhar.lib.dimensions.aggregator.AggregatorRegistry"
] | import org.apache.apex.malhar.lib.dimensions.aggregator.AggregatorRegistry; | import org.apache.apex.malhar.lib.dimensions.aggregator.*; | [
"org.apache.apex"
] | org.apache.apex; | 522,210 |
public Reliability getExceptionDiscardReliability(); | Reliability function(); | /**
* Get the reliability level at which exceptioned messages on a link will
* automatically be discarded. The default level is BEST_EFFORT_NONPERSISTENT.
*
* @return Reliability
*/ | Get the reliability level at which exceptioned messages on a link will automatically be discarded. The default level is BEST_EFFORT_NONPERSISTENT | getExceptionDiscardReliability | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/admin/VirtualLinkDefinition.java",
"license": "epl-1.0",
"size": 2742
} | [
"com.ibm.websphere.sib.Reliability"
] | import com.ibm.websphere.sib.Reliability; | import com.ibm.websphere.sib.*; | [
"com.ibm.websphere"
] | com.ibm.websphere; | 2,188,418 |
@Test
public void testGetDescription() {
final Item mo = new Item("name1", "class", "subclass",
new HashMap<String, String>());
assertEquals("", mo.getDescription());
} | void function() { final Item mo = new Item("name1", "class", STR, new HashMap<String, String>()); assertEquals("", mo.getDescription()); } | /**
* Tests for getDescription.
*/ | Tests for getDescription | testGetDescription | {
"repo_name": "AntumDeluge/arianne-stendhal",
"path": "tests/games/stendhal/server/entity/item/ItemTest.java",
"license": "gpl-2.0",
"size": 14749
} | [
"java.util.HashMap",
"org.junit.Assert"
] | import java.util.HashMap; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 719,204 |
byte[] recoverData(byte[] envelop, PrivateKeyEntry addresseePke) throws InvalidKeyException, AOException, IOException, InvalidKeySpecException; | byte[] recoverData(byte[] envelop, PrivateKeyEntry addresseePke) throws InvalidKeyException, AOException, IOException, InvalidKeySpecException; | /** Recupera los datos contenidos en un envoltorio.
* @param envelop
* Envoltorio de datos.
* @param addresseePke
* Clave privada del receptor del envoltorio (si es necesario)
* @return Datos contenidos en el envoltorio.
* @throws InvalidKeyException
* Si la clave indicada no es válida o no pertenece a un destinatario del envoltorio.
* @throws AOException
* Cuando ocurre algun problema en la apetura del envoltorio.
* @throws IOException Si hay problema de lectura / escritura de datos
* @throws InvalidKeySpecException Cuando la clave es inválida
*/ | Recupera los datos contenidos en un envoltorio | recoverData | {
"repo_name": "venanciolm/afirma-ui-miniapplet_x_x",
"path": "afirma_ui_miniapplet/src/main/java/es/gob/afirma/core/envelopers/AOEnveloper.java",
"license": "mit",
"size": 3628
} | [
"es.gob.afirma.core.AOException",
"java.io.IOException",
"java.security.InvalidKeyException",
"java.security.KeyStore",
"java.security.spec.InvalidKeySpecException"
] | import es.gob.afirma.core.AOException; import java.io.IOException; import java.security.InvalidKeyException; import java.security.KeyStore; import java.security.spec.InvalidKeySpecException; | import es.gob.afirma.core.*; import java.io.*; import java.security.*; import java.security.spec.*; | [
"es.gob.afirma",
"java.io",
"java.security"
] | es.gob.afirma; java.io; java.security; | 196,971 |
protected static void reportError(String message, Throwable throwable) {
IStatus status = null;
if (throwable instanceof CoreException) {
status = ((CoreException) throwable).getStatus();
} else {
status = new Status(IStatus.ERROR, AngularUIPlugin.PLUGIN_ID, 0, message, throwable);
}
ErrorDialog.openError(AngularUIPlugin.getActiveWorkbenchWindow().getShell(),
AngularUIMessages.ProtractorLaunchShortcut_Error,
AngularUIMessages.ProtractorLaunchShortcut_Protractor_Failed, status);
}
| static void function(String message, Throwable throwable) { IStatus status = null; if (throwable instanceof CoreException) { status = ((CoreException) throwable).getStatus(); } else { status = new Status(IStatus.ERROR, AngularUIPlugin.PLUGIN_ID, 0, message, throwable); } ErrorDialog.openError(AngularUIPlugin.getActiveWorkbenchWindow().getShell(), AngularUIMessages.ProtractorLaunchShortcut_Error, AngularUIMessages.ProtractorLaunchShortcut_Protractor_Failed, status); } | /**
* Opens an error dialog presenting the user with the specified message and
* throwable
*
* @param message
* @param throwable
*/ | Opens an error dialog presenting the user with the specified message and throwable | reportError | {
"repo_name": "angelozerr/angularjs-eclipse",
"path": "org.eclipse.angularjs.ui/src/org/eclipse/angularjs/internal/ui/launchConfigurations/ProtractorLaunchShortcut.java",
"license": "epl-1.0",
"size": 8963
} | [
"org.eclipse.angularjs.internal.ui.AngularUIMessages",
"org.eclipse.angularjs.internal.ui.AngularUIPlugin",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IStatus",
"org.eclipse.core.runtime.Status",
"org.eclipse.jface.dialogs.ErrorDialog"
] | import org.eclipse.angularjs.internal.ui.AngularUIMessages; import org.eclipse.angularjs.internal.ui.AngularUIPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ErrorDialog; | import org.eclipse.angularjs.internal.ui.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.dialogs.*; | [
"org.eclipse.angularjs",
"org.eclipse.core",
"org.eclipse.jface"
] | org.eclipse.angularjs; org.eclipse.core; org.eclipse.jface; | 2,071,280 |
protected static Node buildTree(Node root, List nested, MessageCollection warnings, MessageCollection errors, ArrayConsumer consumer) {
String cmdline;
Actor actor;
Node node;
int i;
if (nested.size() == 0)
return null;
i = 0;
while (i < nested.size()) {
try {
cmdline = ((Line) nested.get(i)).getContent();
actor = (Actor) consumer.fromString(cmdline);
if (consumer.hasErrors()) {
errors.addAll(consumer.getErrors());
return null;
}
if (consumer.hasWarnings())
warnings.addAll(consumer.getWarnings());
}
catch (Exception e) {
errors.add("Failed to parse actor: " + nested.get(0), e);
return null;
}
node = new Node(null, actor, cmdline);
if (root != null)
root.add(node);
else
root = node;
i++;
if ((i < nested.size()) && (nested.get(i) instanceof List)) {
buildTree(node, (List) nested.get(i), warnings, errors, consumer);
i++;
}
}
return root;
} | static Node function(Node root, List nested, MessageCollection warnings, MessageCollection errors, ArrayConsumer consumer) { String cmdline; Actor actor; Node node; int i; if (nested.size() == 0) return null; i = 0; while (i < nested.size()) { try { cmdline = ((Line) nested.get(i)).getContent(); actor = (Actor) consumer.fromString(cmdline); if (consumer.hasErrors()) { errors.addAll(consumer.getErrors()); return null; } if (consumer.hasWarnings()) warnings.addAll(consumer.getWarnings()); } catch (Exception e) { errors.add(STR + nested.get(0), e); return null; } node = new Node(null, actor, cmdline); if (root != null) root.add(node); else root = node; i++; if ((i < nested.size()) && (nested.get(i) instanceof List)) { buildTree(node, (List) nested.get(i), warnings, errors, consumer); i++; } } return root; } | /**
* Builds the tree from the nested commandlines.
*
* @param root the root node to add to
* @param nested the nested commandlines
* @param warnings for storing any warnings
* @param errors for storing any errors
* @return the root node, null if failed to build
*/ | Builds the tree from the nested commandlines | buildTree | {
"repo_name": "waikato-datamining/adams-base",
"path": "adams-core/src/main/java/adams/gui/flow/tree/TreeHelper.java",
"license": "gpl-3.0",
"size": 11651
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,762,550 |
public Map<String,Integer> getCommandPendingTasks()
{
return messagingServiceMBean.getCommandPendingTasks();
} | Map<String,Integer> function() { return messagingServiceMBean.getCommandPendingTasks(); } | /**
* Get command pending tasks
* @return map Map<String,Integer>
*/ | Get command pending tasks | getCommandPendingTasks | {
"repo_name": "lankavitharana/carbon-storage-management",
"path": "components/cassandra/org.wso2.carbon.cassandra.cluster.mgt/src/main/java/org/wso2/carbon/cassandra/cluster/mgt/mbean/ClusterMessagingServiceMBeanService.java",
"license": "apache-2.0",
"size": 3038
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 918,187 |
public Set<Sensor> getAllValuesOfsensor() {
return rawAccumulateAllValuesOfsensor(emptyArray());
} | Set<Sensor> function() { return rawAccumulateAllValuesOfsensor(emptyArray()); } | /**
* Retrieve the set of values that occur in matches for sensor.
* @return the Set of all values, null if no parameter with the given name exists, empty set if there are no matches
*
*/ | Retrieve the set of values that occur in matches for sensor | getAllValuesOfsensor | {
"repo_name": "FTSRG/viatra-cep-examples",
"path": "com.rh12.tbcep/src-gen/com/rh12/tbcep/queries/SensorZPlusMatcher.java",
"license": "epl-1.0",
"size": 9711
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,755,887 |
@FIXVersion(introduced="4.0", retired="4.1")
@TagNumRef(tagNum=TagNum.SettlCurrency)
public Currency getSettlCurrency() {
throw new UnsupportedOperationException(getUnsupportedTagMessage());
} | @FIXVersion(introduced="4.0", retired="4.1") @TagNumRef(tagNum=TagNum.SettlCurrency) Currency function() { throw new UnsupportedOperationException(getUnsupportedTagMessage()); } | /**
* Message field getter.
* @return field value
*/ | Message field getter | getSettlCurrency | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/AllocationInstructionMsg.java",
"license": "gpl-3.0",
"size": 122626
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.Currency",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.Currency; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 1,939,883 |
private DataBrowser handleDiscardedBrowser(TreeImageDisplay display)
{
if (!DataBrowserFactory.hasBeenDiscarded(display)) return null;
DataBrowser db = null;
Browser browser = model.getSelectedBrowser();
List list;
List<ApplicationData> app = null;
if (display.isChildrenLoaded()
&& display.containsImages()) {
List l = display.getChildrenDisplay();
if (l != null) {
Set s = new HashSet();
Iterator i = l.iterator();
TreeImageDisplay child;
//copy the node.
while (i.hasNext()) {
child = (TreeImageDisplay) i.next();
s.add(child.getUserObject());
}
setLeaves((TreeImageSet) display, s);
db = DataBrowserFactory.getDataBrowser(display);
list = browser.getSelectedDataObjects();
if (list != null && list.size() == 1) {
app = TreeViewerFactory.getApplications(
model.getObjectMimeType(list.get(0)));
}
db.setSelectedNodes(list, app);
}
}
return db;
} | DataBrowser function(TreeImageDisplay display) { if (!DataBrowserFactory.hasBeenDiscarded(display)) return null; DataBrowser db = null; Browser browser = model.getSelectedBrowser(); List list; List<ApplicationData> app = null; if (display.isChildrenLoaded() && display.containsImages()) { List l = display.getChildrenDisplay(); if (l != null) { Set s = new HashSet(); Iterator i = l.iterator(); TreeImageDisplay child; while (i.hasNext()) { child = (TreeImageDisplay) i.next(); s.add(child.getUserObject()); } setLeaves((TreeImageSet) display, s); db = DataBrowserFactory.getDataBrowser(display); list = browser.getSelectedDataObjects(); if (list != null && list.size() == 1) { app = TreeViewerFactory.getApplications( model.getObjectMimeType(list.get(0))); } db.setSelectedNodes(list, app); } } return db; } | /**
* Checks if a browser associated to the passed node has been
* discarded.
*
* @param display The node to handle.
*/ | Checks if a browser associated to the passed node has been discarded | handleDiscardedBrowser | {
"repo_name": "stelfrich/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/view/TreeViewerComponent.java",
"license": "gpl-2.0",
"size": 160473
} | [
"java.util.HashSet",
"java.util.Iterator",
"java.util.List",
"java.util.Set",
"org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowser",
"org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowserFactory",
"org.openmicroscopy.shoola.agents.treeviewer.browser.Browser",
"org.openmicroscopy.shoo... | import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowser; import org.openmicroscopy.shoola.agents.dataBrowser.view.DataBrowserFactory; import org.openmicroscopy.shoola.agents.treeviewer.browser.Browser; import org.openmicroscopy.shoola.agents.util.browser.TreeImageDisplay; import org.openmicroscopy.shoola.agents.util.browser.TreeImageSet; import org.openmicroscopy.shoola.env.data.model.ApplicationData; | import java.util.*; import org.openmicroscopy.shoola.agents.*; import org.openmicroscopy.shoola.agents.treeviewer.browser.*; import org.openmicroscopy.shoola.agents.util.browser.*; import org.openmicroscopy.shoola.env.data.model.*; | [
"java.util",
"org.openmicroscopy.shoola"
] | java.util; org.openmicroscopy.shoola; | 2,584,206 |
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux<SqlRoleAssignmentGetResultsInner> listSqlRoleAssignmentsAsync(
String resourceGroupName, String accountName) {
return new PagedFlux<>(() -> listSqlRoleAssignmentsSinglePageAsync(resourceGroupName, accountName));
} | @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<SqlRoleAssignmentGetResultsInner> function( String resourceGroupName, String accountName) { return new PagedFlux<>(() -> listSqlRoleAssignmentsSinglePageAsync(resourceGroupName, accountName)); } | /**
* Retrieves the list of all Azure Cosmos DB SQL Role Assignments.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @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 relevant Role Assignments.
*/ | Retrieves the list of all Azure Cosmos DB SQL Role Assignments | listSqlRoleAssignmentsAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java",
"license": "mit",
"size": 547809
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedFlux",
"com.azure.resourcemanager.cosmos.fluent.models.SqlRoleAssignmentGetResultsInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.resourcemanager.cosmos.fluent.models.SqlRoleAssignmentGetResultsInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.cosmos.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,839,669 |
@Test public void testSortExpThenLimit() {
final RelBuilder builder = RelBuilder.create(config().build());
final RelNode root =
builder.scan("DEPT")
.sort(
builder.desc(
builder.call(SqlStdOperatorTable.PLUS,
builder.field("DEPTNO"), builder.literal(1))))
.limit(3, 10)
.build();
final String expected = ""
+ "LogicalProject(DEPTNO=[$0], DNAME=[$1], LOC=[$2])\n"
+ " LogicalSort(sort0=[$3], dir0=[DESC], offset=[3], fetch=[10])\n"
+ " LogicalProject(DEPTNO=[$0], DNAME=[$1], LOC=[$2], $f3=[+($0, 1)])\n"
+ " LogicalTableScan(table=[[scott, DEPT]])\n";
assertThat(root, hasTree(expected));
final RelNode root2 =
builder.scan("DEPT")
.sortLimit(3, 10,
builder.desc(
builder.call(SqlStdOperatorTable.PLUS,
builder.field("DEPTNO"), builder.literal(1))))
.build();
assertThat(root2, hasTree(expected));
} | @Test void function() { final RelBuilder builder = RelBuilder.create(config().build()); final RelNode root = builder.scan("DEPT") .sort( builder.desc( builder.call(SqlStdOperatorTable.PLUS, builder.field(STR), builder.literal(1)))) .limit(3, 10) .build(); final String expected = STRLogicalProject(DEPTNO=[$0], DNAME=[$1], LOC=[$2])\nSTR LogicalSort(sort0=[$3], dir0=[DESC], offset=[3], fetch=[10])\nSTR LogicalProject(DEPTNO=[$0], DNAME=[$1], LOC=[$2], $f3=[+($0, 1)])\nSTR LogicalTableScan(table=[[scott, DEPT]])\nSTRDEPT") .sortLimit(3, 10, builder.desc( builder.call(SqlStdOperatorTable.PLUS, builder.field(STR), builder.literal(1)))) .build(); assertThat(root2, hasTree(expected)); } | /** Tests that a sort on an expression followed by a limit gives the same
* effect as calling sortLimit. */ | Tests that a sort on an expression followed by a limit gives the same | testSortExpThenLimit | {
"repo_name": "xhoong/incubator-calcite",
"path": "core/src/test/java/org/apache/calcite/test/RelBuilderTest.java",
"license": "apache-2.0",
"size": 116680
} | [
"org.apache.calcite.rel.RelNode",
"org.apache.calcite.sql.fun.SqlStdOperatorTable",
"org.apache.calcite.test.Matchers",
"org.apache.calcite.tools.RelBuilder",
"org.junit.Assert",
"org.junit.Test"
] | import org.apache.calcite.rel.RelNode; import org.apache.calcite.sql.fun.SqlStdOperatorTable; import org.apache.calcite.test.Matchers; import org.apache.calcite.tools.RelBuilder; import org.junit.Assert; import org.junit.Test; | import org.apache.calcite.rel.*; import org.apache.calcite.sql.fun.*; import org.apache.calcite.test.*; import org.apache.calcite.tools.*; import org.junit.*; | [
"org.apache.calcite",
"org.junit"
] | org.apache.calcite; org.junit; | 1,156,130 |
@Test
public void outputInstructionTest() {
final Instructions.OutputInstruction instruction =
Instructions.createOutput(PortNumber.portNumber(22));
final ObjectNode instructionJson =
instructionCodec.encode(instruction, context);
assertThat(instructionJson, matchesInstruction(instruction));
} | void function() { final Instructions.OutputInstruction instruction = Instructions.createOutput(PortNumber.portNumber(22)); final ObjectNode instructionJson = instructionCodec.encode(instruction, context); assertThat(instructionJson, matchesInstruction(instruction)); } | /**
* Tests the encoding of output instructions.
*/ | Tests the encoding of output instructions | outputInstructionTest | {
"repo_name": "shlee89/athena",
"path": "core/common/src/test/java/org/onosproject/codec/impl/InstructionCodecTest.java",
"license": "apache-2.0",
"size": 9279
} | [
"com.fasterxml.jackson.databind.node.ObjectNode",
"org.hamcrest.MatcherAssert",
"org.onosproject.codec.impl.InstructionJsonMatcher",
"org.onosproject.net.PortNumber",
"org.onosproject.net.flow.instructions.Instructions"
] | import com.fasterxml.jackson.databind.node.ObjectNode; import org.hamcrest.MatcherAssert; import org.onosproject.codec.impl.InstructionJsonMatcher; import org.onosproject.net.PortNumber; import org.onosproject.net.flow.instructions.Instructions; | import com.fasterxml.jackson.databind.node.*; import org.hamcrest.*; import org.onosproject.codec.impl.*; import org.onosproject.net.*; import org.onosproject.net.flow.instructions.*; | [
"com.fasterxml.jackson",
"org.hamcrest",
"org.onosproject.codec",
"org.onosproject.net"
] | com.fasterxml.jackson; org.hamcrest; org.onosproject.codec; org.onosproject.net; | 2,513,225 |
public void debug(
@Nullable final String event,
@Nullable final String message,
@Nullable final String dataKey1,
@Nullable final Object dataValue1,
@Nullable final Throwable throwable) {
if (getSlf4jLogger().isDebugEnabled()) {
LogLevel.DEBUG.log(
getSlf4jLogger(),
event,
createKeysFromArgs(MESSAGE_DATA_KEY, dataKey1),
createValuesFromArgs(message, dataValue1),
throwable);
}
} | void function( @Nullable final String event, @Nullable final String message, @Nullable final String dataKey1, @Nullable final Object dataValue1, @Nullable final Throwable throwable) { if (getSlf4jLogger().isDebugEnabled()) { LogLevel.DEBUG.log( getSlf4jLogger(), event, createKeysFromArgs(MESSAGE_DATA_KEY, dataKey1), createValuesFromArgs(message, dataValue1), throwable); } } | /**
* Log a message for a canonical event with supporting key-value pairs and
* a {@link Throwable} at the debug level. This method is provided
* only for efficiency over the var-args method above as it avoids an array
* creation during invocation.
*
* @since 1.3.0
*
* @param event The canonical event that occurred.
* @param message The message to be logged.
* @param dataKey1 First data name.
* @param dataValue1 First data value.
* @param throwable The exception ({@link Throwable}) to be logged.
*/ | Log a message for a canonical event with supporting key-value pairs and a <code>Throwable</code> at the debug level. This method is provided only for efficiency over the var-args method above as it avoids an array creation during invocation | debug | {
"repo_name": "ArpNetworking/logback-steno",
"path": "src/main/java/com/arpnetworking/steno/Logger.java",
"license": "apache-2.0",
"size": 68020
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,208,211 |
default void load(final PreferenceScopeResolutionStrategyInfo customScopeResolutionStrategy) {
throw new UnsupportedOperationException("You should call this method only for default qualified injected instances.");
} | default void load(final PreferenceScopeResolutionStrategyInfo customScopeResolutionStrategy) { throw new UnsupportedOperationException(STR); } | /**
* Loads the preference content recursively through its properties.
* @param customScopeResolutionStrategy Custom preference scope resolution strategy to be used.
*/ | Loads the preference content recursively through its properties | load | {
"repo_name": "ederign/uberfire",
"path": "uberfire-preferences/uberfire-preferences-api/src/main/java/org/uberfire/preferences/shared/bean/BasePreference.java",
"license": "apache-2.0",
"size": 7544
} | [
"org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo"
] | import org.uberfire.preferences.shared.impl.PreferenceScopeResolutionStrategyInfo; | import org.uberfire.preferences.shared.impl.*; | [
"org.uberfire.preferences"
] | org.uberfire.preferences; | 1,920,122 |
@Override
public void selectionChanged(SelectionChangedEvent event) {
// Remove any menu items for old selection.
//
if (createChildMenuManager != null) {
depopulateManager(createChildMenuManager, createChildActions);
}
if (createSiblingMenuManager != null) {
depopulateManager(createSiblingMenuManager, createSiblingActions);
}
// Query the new selection for appropriate new child/sibling descriptors
//
Collection<?> newChildDescriptors = null;
Collection<?> newSiblingDescriptors = null;
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
Object object = ((IStructuredSelection)selection).getFirstElement();
EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain();
newChildDescriptors = domain.getNewChildDescriptors(object, null);
newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
}
// Generate actions for selection; populate and redraw the menus.
//
createChildActions = generateCreateChildActions(newChildDescriptors, selection);
createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
if (createChildMenuManager != null) {
populateManager(createChildMenuManager, createChildActions, null);
createChildMenuManager.update(true);
}
if (createSiblingMenuManager != null) {
populateManager(createSiblingMenuManager, createSiblingActions, null);
createSiblingMenuManager.update(true);
}
} | void function(SelectionChangedEvent event) { depopulateManager(createChildMenuManager, createChildActions); } if (createSiblingMenuManager != null) { depopulateManager(createSiblingMenuManager, createSiblingActions); } Collection<?> newSiblingDescriptors = null; ISelection selection = event.getSelection(); if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) { Object object = ((IStructuredSelection)selection).getFirstElement(); EditingDomain domain = ((IEditingDomainProvider)activeEditorPart).getEditingDomain(); newChildDescriptors = domain.getNewChildDescriptors(object, null); newSiblingDescriptors = domain.getNewChildDescriptors(null, object); } createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); if (createChildMenuManager != null) { populateManager(createChildMenuManager, createChildActions, null); createChildMenuManager.update(true); } if (createSiblingMenuManager != null) { populateManager(createSiblingMenuManager, createSiblingActions, null); createSiblingMenuManager.update(true); } } | /**
* This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
* handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
* that can be added to the selected object and updating the menus accordingly.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This implements <code>org.eclipse.jface.viewers.ISelectionChangedListener</code>, handling <code>org.eclipse.jface.viewers.SelectionChangedEvent</code>s by querying for the children and siblings that can be added to the selected object and updating the menus accordingly. | selectionChanged | {
"repo_name": "RobertHilbrich/assist",
"path": "ch.hilbri.assist.model.editor/src/ch/hilbri/assist/model/presentation/ModelActionBarContributor.java",
"license": "gpl-2.0",
"size": 15709
} | [
"java.util.Collection",
"org.eclipse.emf.edit.domain.EditingDomain",
"org.eclipse.emf.edit.domain.IEditingDomainProvider",
"org.eclipse.jface.viewers.ISelection",
"org.eclipse.jface.viewers.IStructuredSelection",
"org.eclipse.jface.viewers.SelectionChangedEvent"
] | import java.util.Collection; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.edit.domain.IEditingDomainProvider; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; | import java.util.*; import org.eclipse.emf.edit.domain.*; import org.eclipse.jface.viewers.*; | [
"java.util",
"org.eclipse.emf",
"org.eclipse.jface"
] | java.util; org.eclipse.emf; org.eclipse.jface; | 467,609 |
private String generateOctetJsonWebKeyOfSize(final int size) {
final OctetSequenceJsonWebKey octetKey = OctJwkGenerator.generateJwk(size);
final Map<String, Object> params = octetKey.toParams(JsonWebKey.OutputControlLevel.INCLUDE_SYMMETRIC);
return params.get("k").toString();
} | String function(final int size) { final OctetSequenceJsonWebKey octetKey = OctJwkGenerator.generateJwk(size); final Map<String, Object> params = octetKey.toParams(JsonWebKey.OutputControlLevel.INCLUDE_SYMMETRIC); return params.get("k").toString(); } | /**
* Generate octet json web key of size string.
*
* @param size the size
* @return the string
*/ | Generate octet json web key of size string | generateOctetJsonWebKeyOfSize | {
"repo_name": "y1011/cas-server",
"path": "cas-server-core-util/src/main/java/org/jasig/cas/util/BinaryCipherExecutor.java",
"license": "apache-2.0",
"size": 4646
} | [
"java.util.Map",
"org.jose4j.jwk.JsonWebKey",
"org.jose4j.jwk.OctJwkGenerator",
"org.jose4j.jwk.OctetSequenceJsonWebKey"
] | import java.util.Map; import org.jose4j.jwk.JsonWebKey; import org.jose4j.jwk.OctJwkGenerator; import org.jose4j.jwk.OctetSequenceJsonWebKey; | import java.util.*; import org.jose4j.jwk.*; | [
"java.util",
"org.jose4j.jwk"
] | java.util; org.jose4j.jwk; | 1,331,048 |
private void readGroups(Element groupsNode) throws Exception
{
NodeList groupElements = groupsNode.getElementsByTagName(GROUP_ELEMENT);
for (int i = 0; i < groupElements.getLength(); ++i)
{
if (groupElements.item(i).getNodeType() == Node.ELEMENT_NODE)
{
Element g = (Element) groupElements.item(i);
String name = g.getAttribute(NAME_ATTR);
if (_availableGroups.containsKey(name))
{
GroupConfiguration gc = _availableGroups.get(name);
if (_groups.contains(gc))
{
throw new Exception("Duplicated transformation group creation: " + name);
}
_groups.add(_availableGroups.get(name));
} else
{
throw new Exception("No transformation found for " + name + " in available transformation sets!");
}
}
}
} | void function(Element groupsNode) throws Exception { NodeList groupElements = groupsNode.getElementsByTagName(GROUP_ELEMENT); for (int i = 0; i < groupElements.getLength(); ++i) { if (groupElements.item(i).getNodeType() == Node.ELEMENT_NODE) { Element g = (Element) groupElements.item(i); String name = g.getAttribute(NAME_ATTR); if (_availableGroups.containsKey(name)) { GroupConfiguration gc = _availableGroups.get(name); if (_groups.contains(gc)) { throw new Exception(STR + name); } _groups.add(_availableGroups.get(name)); } else { throw new Exception(STR + name + STR); } } } } | /**
* Read defined transformation groups in configuration. Order determines
* application order of transformation.
*
* @param groupsNode The "groups" element of the configuration.
* @throws Exception If the group name is not an available in any transformation
* set.
*/ | Read defined transformation groups in configuration. Order determines application order of transformation | readGroups | {
"repo_name": "clementval/claw-compiler",
"path": "cx2t/src/claw/wani/x2t/configuration/Configuration.java",
"license": "bsd-2-clause",
"size": 32882
} | [
"org.w3c.dom.Element",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] | import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 690,115 |
List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS);
// only process if there is a schoolYear query parameter
if (schoolYears != null && schoolYears.size() > 0) {
String schoolYearRange = schoolYears.get(0);
//Extract date range using session
SessionDateInfo sessionDateInfo = sessionRangeCalculator.findDateRange(schoolYearRange);
// Find appropriate entity to apply filter
EntityFilterInfo entityFilterInfo = entityIdentifier.findEntity(request.getPath());
GranularAccessFilter filter = new DateFilterCriteriaBuilder().forEntity(entityFilterInfo.getEntityName())
.connectedBy(entityFilterInfo.getConnectingEntityList())
.withDateAttributes(entityFilterInfo.getBeginDateAttribute(), entityFilterInfo.getEndDateAttribute())
.withSessionAttribute(entityFilterInfo.getSessionAttribute())
.startingFrom(sessionDateInfo.getStartDate())
.endingTo(sessionDateInfo.getEndDate())
.withSessionIds(sessionDateInfo.getSessionIds())
.build();
granularAccessFilterProvider.storeGranularAccessFilter(filter);
}
}
private static final class DateFilterCriteriaBuilder {
private String entityName;
private String beginDate;
private String endDate;
private String beginDateAttribute;
private String endDateAttribute;
private String sessionAttribute;
private Set<String> sessionIds;
private List<String> connectingEntityList; | List<String> schoolYears = request.getQueryParameters().get(ParameterConstants.SCHOOL_YEARS); if (schoolYears != null && schoolYears.size() > 0) { String schoolYearRange = schoolYears.get(0); SessionDateInfo sessionDateInfo = sessionRangeCalculator.findDateRange(schoolYearRange); EntityFilterInfo entityFilterInfo = entityIdentifier.findEntity(request.getPath()); GranularAccessFilter filter = new DateFilterCriteriaBuilder().forEntity(entityFilterInfo.getEntityName()) .connectedBy(entityFilterInfo.getConnectingEntityList()) .withDateAttributes(entityFilterInfo.getBeginDateAttribute(), entityFilterInfo.getEndDateAttribute()) .withSessionAttribute(entityFilterInfo.getSessionAttribute()) .startingFrom(sessionDateInfo.getStartDate()) .endingTo(sessionDateInfo.getEndDate()) .withSessionIds(sessionDateInfo.getSessionIds()) .build(); granularAccessFilterProvider.storeGranularAccessFilter(filter); } } private static final class DateFilterCriteriaBuilder { private String entityName; private String beginDate; private String endDate; private String beginDateAttribute; private String endDateAttribute; private String sessionAttribute; private Set<String> sessionIds; private List<String> connectingEntityList; | /**
* Generates the date filter based on the request
* @param request
*/ | Generates the date filter based on the request | generate | {
"repo_name": "inbloom/secure-data-service",
"path": "sli/api/src/main/java/org/slc/sli/api/criteriaGenerator/DateFilterCriteriaGenerator.java",
"license": "apache-2.0",
"size": 6878
} | [
"java.util.List",
"java.util.Set",
"org.slc.sli.common.constants.ParameterConstants"
] | import java.util.List; import java.util.Set; import org.slc.sli.common.constants.ParameterConstants; | import java.util.*; import org.slc.sli.common.constants.*; | [
"java.util",
"org.slc.sli"
] | java.util; org.slc.sli; | 2,055,063 |
return ObjectifyService.ofy();
} | return ObjectifyService.ofy(); } | /**
* Use this static method for getting the Objectify service object in order to make sure the
* above static block is executed before using Objectify.
* @return Objectify service object.
*/ | Use this static method for getting the Objectify service object in order to make sure the above static block is executed before using Objectify | ofy | {
"repo_name": "yannliao/conference",
"path": "src/main/java/com/google/devrel/training/conference/service/OfyService.java",
"license": "apache-2.0",
"size": 1011
} | [
"com.googlecode.objectify.ObjectifyService"
] | import com.googlecode.objectify.ObjectifyService; | import com.googlecode.objectify.*; | [
"com.googlecode.objectify"
] | com.googlecode.objectify; | 2,159,497 |
public double div(double firstOperand, double secondOperand) {
checkArgument(secondOperand != 0, "secondOperand must be != 0, you cannot divide by zero");
return firstOperand / secondOperand;
} | double function(double firstOperand, double secondOperand) { checkArgument(secondOperand != 0, STR); return firstOperand / secondOperand; } | /**
* Divide operation
*/ | Divide operation | div | {
"repo_name": "bootstraponline/zip_align_test_apk",
"path": "testrunner/AndroidJunitRunnerSample/app/src/main/java/com/example/android/testing/androidjunitrunnersample/Calculator.java",
"license": "apache-2.0",
"size": 1629
} | [
"com.google.common.base.Preconditions"
] | import com.google.common.base.Preconditions; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 1,644,359 |
public static InputParameter fileParameter(String id) {
return new InputParameter(id).withDatatypeJavaClass(FileDescriptor.class);
} | static InputParameter function(String id) { return new InputParameter(id).withDatatypeJavaClass(FileDescriptor.class); } | /**
* Creates parameter with FileDescriptor type.
*
* @param id field id
* @return input parameter
*/ | Creates parameter with FileDescriptor type | fileParameter | {
"repo_name": "cuba-platform/cuba",
"path": "modules/gui/src/com/haulmont/cuba/gui/app/core/inputdialog/InputParameter.java",
"license": "apache-2.0",
"size": 12698
} | [
"com.haulmont.cuba.core.entity.FileDescriptor"
] | import com.haulmont.cuba.core.entity.FileDescriptor; | import com.haulmont.cuba.core.entity.*; | [
"com.haulmont.cuba"
] | com.haulmont.cuba; | 2,867,842 |
public ValueNode checkIsBoolean()
throws StandardException
{
ValueNode whereClause = this;
TypeId whereTypeId = whereClause.getTypeId();
if (whereTypeId.userType())
{
whereClause = whereClause.genSQLJavaSQLTree();
whereTypeId = whereClause.getTypeId();
}
if (! whereTypeId.equals(TypeId.BOOLEAN_ID))
{
throw StandardException.newException(SQLState.LANG_NON_BOOLEAN_WHERE_CLAUSE,
whereTypeId.getSQLTypeName()
);
}
return whereClause;
} | ValueNode function() throws StandardException { ValueNode whereClause = this; TypeId whereTypeId = whereClause.getTypeId(); if (whereTypeId.userType()) { whereClause = whereClause.genSQLJavaSQLTree(); whereTypeId = whereClause.getTypeId(); } if (! whereTypeId.equals(TypeId.BOOLEAN_ID)) { throw StandardException.newException(SQLState.LANG_NON_BOOLEAN_WHERE_CLAUSE, whereTypeId.getSQLTypeName() ); } return whereClause; } | /**
* Bind time logic. Raises an error if this ValueNode does not resolve to
* a boolean value. This method is called by WHERE clauses.
*
* @return bound coercion of this node to a builtin type as necessary
*
* @exception StandardException Thrown on error
*/ | Bind time logic. Raises an error if this ValueNode does not resolve to a boolean value. This method is called by WHERE clauses | checkIsBoolean | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/impl/sql/compile/ValueNode.java",
"license": "apache-2.0",
"size": 44750
} | [
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.reference.SQLState",
"org.apache.derby.iapi.types.TypeId"
] | import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.reference.SQLState; import org.apache.derby.iapi.types.TypeId; | import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.reference.*; import org.apache.derby.iapi.types.*; | [
"org.apache.derby"
] | org.apache.derby; | 318,590 |
public void setSeriesItemLabelsVisible(int series, Boolean visible,
boolean notify) {
this.itemLabelsVisibleList.setBoolean(series, visible);
if (notify) {
notifyListeners(new RendererChangeEvent(this));
}
} | void function(int series, Boolean visible, boolean notify) { this.itemLabelsVisibleList.setBoolean(series, visible); if (notify) { notifyListeners(new RendererChangeEvent(this)); } } | /**
* Sets the visibility of item labels for a series and, if requested, sends
* a {@link RendererChangeEvent} to all registered listeners.
*
* @param series the series index (zero-based).
* @param visible the visible flag.
* @param notify a flag that controls whether or not listeners are
* notified.
*/ | Sets the visibility of item labels for a series and, if requested, sends a <code>RendererChangeEvent</code> to all registered listeners | setSeriesItemLabelsVisible | {
"repo_name": "opensim-org/opensim-gui",
"path": "Gui/opensim/jfreechart/src/org/jfree/chart/renderer/AbstractRenderer.java",
"license": "apache-2.0",
"size": 98153
} | [
"org.jfree.chart.event.RendererChangeEvent"
] | import org.jfree.chart.event.RendererChangeEvent; | import org.jfree.chart.event.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 1,950,237 |
public CoinfloorExchangeEvent watchTicker(String tradableIdentifier, String tradingCurrency) {
return doNewRequest(new RequestFactory.WatchTickerRequest(tradableIdentifier, tradingCurrency), ExchangeEventType.SUBSCRIBE_TICKER);
} | CoinfloorExchangeEvent function(String tradableIdentifier, String tradingCurrency) { return doNewRequest(new RequestFactory.WatchTickerRequest(tradableIdentifier, tradingCurrency), ExchangeEventType.SUBSCRIBE_TICKER); } | /**
* Watch the ticker feed
* Upon receipt of response, a CoinfloorExchangeEvent with payload Map<String, Object>, consisting of:
* > A raw object of type CoinfloorTicker (key "raw")
* > A generic object of type Ticker (key "generic")
*/ | Watch the ticker feed Upon receipt of response, a CoinfloorExchangeEvent with payload Map, consisting of: > A raw object of type CoinfloorTicker (key "raw") > A generic object of type Ticker (key "generic") | watchTicker | {
"repo_name": "Achterhoeker/XChange",
"path": "xchange-coinfloor/src/main/java/com/xeiam/xchange/coinfloor/streaming/CoinfloorStreamingExchangeService.java",
"license": "mit",
"size": 12702
} | [
"com.xeiam.xchange.coinfloor.dto.streaming.CoinfloorExchangeEvent",
"com.xeiam.xchange.service.streaming.ExchangeEventType"
] | import com.xeiam.xchange.coinfloor.dto.streaming.CoinfloorExchangeEvent; import com.xeiam.xchange.service.streaming.ExchangeEventType; | import com.xeiam.xchange.coinfloor.dto.streaming.*; import com.xeiam.xchange.service.streaming.*; | [
"com.xeiam.xchange"
] | com.xeiam.xchange; | 1,726,231 |
private void createPR(VM vm) {
SerializableRunnable createDS = new SerializableRunnable("Creating PR Datastore") { | void function(VM vm) { SerializableRunnable createDS = new SerializableRunnable(STR) { | /**
* CReates a PR on a VM with NUM_BKTS buckets.
*
*/ | CReates a PR on a VM with NUM_BKTS buckets | createPR | {
"repo_name": "deepakddixit/incubator-geode",
"path": "geode-core/src/distributedTest/java/org/apache/geode/cache/query/internal/index/IndexTrackingQueryObserverDUnitTest.java",
"license": "apache-2.0",
"size": 8916
} | [
"org.apache.geode.test.dunit.SerializableRunnable"
] | import org.apache.geode.test.dunit.SerializableRunnable; | import org.apache.geode.test.dunit.*; | [
"org.apache.geode"
] | org.apache.geode; | 1,365,978 |
public Tag scan (Tag tag, Lexer lexer, NodeList stack)
throws ParserException
{
Node content;
int position;
Node node;
Attribute attribute;
Vector vector;
content = lexer.parseCDATA ();
position = lexer.getPosition ();
node = lexer.nextNode (false);
if (null != node)
if (!(node instanceof Tag) || !( ((Tag)node).isEndTag ()
&& ((Tag)node).getTagName ().equals (tag.getIds ()[0])))
{
lexer.setPosition (position);
node = null;
}
// build new end tag if required
if (null == node)
{
attribute = new Attribute ("/style", null);
vector = new Vector ();
vector.addElement (attribute);
node = lexer.getNodeFactory ().createTagNode (
lexer.getPage (), position, position, vector);
}
tag.setEndTag ((Tag)node);
if (null != content)
{
tag.setChildren (new NodeList (content));
content.setParent (tag);
}
node.setParent (tag);
tag.doSemanticAction ();
return (tag);
} | Tag function (Tag tag, Lexer lexer, NodeList stack) throws ParserException { Node content; int position; Node node; Attribute attribute; Vector vector; content = lexer.parseCDATA (); position = lexer.getPosition (); node = lexer.nextNode (false); if (null != node) if (!(node instanceof Tag) !( ((Tag)node).isEndTag () && ((Tag)node).getTagName ().equals (tag.getIds ()[0]))) { lexer.setPosition (position); node = null; } if (null == node) { attribute = new Attribute (STR, null); vector = new Vector (); vector.addElement (attribute); node = lexer.getNodeFactory ().createTagNode ( lexer.getPage (), position, position, vector); } tag.setEndTag ((Tag)node); if (null != content) { tag.setChildren (new NodeList (content)); content.setParent (tag); } node.setParent (tag); tag.doSemanticAction (); return (tag); } | /**
* Scan for style definitions.
* Accumulates text from the page, until </[a-zA-Z] is encountered.
* @param tag The tag this scanner is responsible for.
* @param lexer The source of CDATA.
* @param stack The parse stack, <em>not used</em>.
*/ | Scan for style definitions. Accumulates text from the page, until </[a-zA-Z] is encountered | scan | {
"repo_name": "patrickfav/tuwien",
"path": "master/swt workspace/HTMLParser/src/org/htmlparser/scanners/StyleScanner.java",
"license": "apache-2.0",
"size": 3228
} | [
"java.util.Vector",
"org.htmlparser.Attribute",
"org.htmlparser.Node",
"org.htmlparser.Tag",
"org.htmlparser.lexer.Lexer",
"org.htmlparser.util.NodeList",
"org.htmlparser.util.ParserException"
] | import java.util.Vector; import org.htmlparser.Attribute; import org.htmlparser.Node; import org.htmlparser.Tag; import org.htmlparser.lexer.Lexer; import org.htmlparser.util.NodeList; import org.htmlparser.util.ParserException; | import java.util.*; import org.htmlparser.*; import org.htmlparser.lexer.*; import org.htmlparser.util.*; | [
"java.util",
"org.htmlparser",
"org.htmlparser.lexer",
"org.htmlparser.util"
] | java.util; org.htmlparser; org.htmlparser.lexer; org.htmlparser.util; | 1,146,919 |
public void replaceCACertificatesAndCRLs(String[] caCert) throws HostConfigFault, RuntimeFault, RemoteException {
replaceCACertificatesAndCRLs(caCert, null);
} | void function(String[] caCert) throws HostConfigFault, RuntimeFault, RemoteException { replaceCACertificatesAndCRLs(caCert, null); } | /**
* Replaces the trusted Certificate Authority (CA) certificates and Certification Revocation List (CRL) used by the
* server with the provided values. These determine whether the server can verify the identity of an external entity.
*
* @param caCert List of SSL certificates, in PEM format, of all CAs that should be trusted
* @throws HostConfigFault
* @throws RuntimeFault
* @throws RemoteException
*/ | Replaces the trusted Certificate Authority (CA) certificates and Certification Revocation List (CRL) used by the server with the provided values. These determine whether the server can verify the identity of an external entity | replaceCACertificatesAndCRLs | {
"repo_name": "hubertverstraete/yavijava",
"path": "src/main/java/com/vmware/vim25/mo/HostCertificateManager.java",
"license": "bsd-3-clause",
"size": 5370
} | [
"com.vmware.vim25.HostConfigFault",
"com.vmware.vim25.RuntimeFault",
"java.rmi.RemoteException"
] | import com.vmware.vim25.HostConfigFault; import com.vmware.vim25.RuntimeFault; import java.rmi.RemoteException; | import com.vmware.vim25.*; import java.rmi.*; | [
"com.vmware.vim25",
"java.rmi"
] | com.vmware.vim25; java.rmi; | 2,396,833 |
private void setPopupMenu(JPopupMenu pop) {
this.pop = pop;
pop.addPopupMenuListener(new PopupMenuListener() {
public void popupMenuCanceled(PopupMenuEvent e) {} | void function(JPopupMenu pop) { this.pop = pop; pop.addPopupMenuListener(new PopupMenuListener() { public void popupMenuCanceled(PopupMenuEvent e) {} | /**
* Seteaza popup-ul lansat de catre buton
* @param pop
*/ | Seteaza popup-ul lansat de catre buton | setPopupMenu | {
"repo_name": "genomeartist/genomeartist",
"path": "sources_java/Components/src/ro/genomeartist/components/dropdownbutton/JDropDownButton.java",
"license": "gpl-3.0",
"size": 3565
} | [
"javax.swing.JPopupMenu",
"javax.swing.event.PopupMenuEvent",
"javax.swing.event.PopupMenuListener"
] | import javax.swing.JPopupMenu; import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; | import javax.swing.*; import javax.swing.event.*; | [
"javax.swing"
] | javax.swing; | 2,010,089 |
Template getTemplate(String id); | Template getTemplate(String id); | /**
* Returns the template with the given ID
*
* @param id the ID of the template
* @return the template with the given ID or <code>null</code> if no template
* exists in this Process Group with the given ID
*/ | Returns the template with the given ID | getTemplate | {
"repo_name": "InspurUSA/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/groups/ProcessGroup.java",
"license": "apache-2.0",
"size": 33748
} | [
"org.apache.nifi.controller.Template"
] | import org.apache.nifi.controller.Template; | import org.apache.nifi.controller.*; | [
"org.apache.nifi"
] | org.apache.nifi; | 2,821,290 |
public Vertex matches(Vertex source, Vertex text, Vertex pattern) {
if (pattern.isPrimitive()) {
pattern = pattern.getRelationship(Primitive.REGEX);
if (pattern == null) {
return null;
}
}
if (text.printString().matches(pattern.printString())) {
return source.getNetwork().createVertex(Primitive.TRUE);
} else {
return source.getNetwork().createVertex(Primitive.FALSE);
}
} | Vertex function(Vertex source, Vertex text, Vertex pattern) { if (pattern.isPrimitive()) { pattern = pattern.getRelationship(Primitive.REGEX); if (pattern == null) { return null; } } if (text.printString().matches(pattern.printString())) { return source.getNetwork().createVertex(Primitive.TRUE); } else { return source.getNetwork().createVertex(Primitive.FALSE); } } | /**
* Convert the pattern to a regex and return if the text matches the expression.
*/ | Convert the pattern to a regex and return if the text matches the expression | matches | {
"repo_name": "BOTlibre/BOTlibre",
"path": "ai-engine/source/org/botlibre/tool/Utils.java",
"license": "epl-1.0",
"size": 10785
} | [
"org.botlibre.api.knowledge.Vertex",
"org.botlibre.knowledge.Primitive"
] | import org.botlibre.api.knowledge.Vertex; import org.botlibre.knowledge.Primitive; | import org.botlibre.api.knowledge.*; import org.botlibre.knowledge.*; | [
"org.botlibre.api",
"org.botlibre.knowledge"
] | org.botlibre.api; org.botlibre.knowledge; | 2,584,059 |
private static RecordDescriptor getServerOutputRecordDescriptor() {
RecordDescriptor rd = new RecordDescriptor("WSOS", "Server Output Record Descriptor");
rd.getFields().add(new FieldDescriptor("DFCODE", "Response Code", "responseCode", "CHAR", 7, 0));
rd.getFields().add(new FieldDescriptor("DFPARM", "Service Parameters", "responseText", "CHAR", 32000, 0));
return rd;
} | static RecordDescriptor function() { RecordDescriptor rd = new RecordDescriptor("WSOS", STR); rd.getFields().add(new FieldDescriptor(STR, STR, STR, "CHAR", 7, 0)); rd.getFields().add(new FieldDescriptor(STR, STR, STR, "CHAR", 32000, 0)); return rd; } | /**
* Returns the input record format for a WS Message
*
* @return
*/ | Returns the input record format for a WS Message | getServerOutputRecordDescriptor | {
"repo_name": "mhapanow/iseries-ws",
"path": "ws-services/src/main/java/org/dcm/services/impl/WSBrokerImpl.java",
"license": "apache-2.0",
"size": 22560
} | [
"org.dcm.services.model.FieldDescriptor",
"org.dcm.services.model.RecordDescriptor"
] | import org.dcm.services.model.FieldDescriptor; import org.dcm.services.model.RecordDescriptor; | import org.dcm.services.model.*; | [
"org.dcm.services"
] | org.dcm.services; | 2,628,014 |
// Setter
public void setWorld(World world) {
this.world = world;
} | void function(World world) { this.world = world; } | /**
* Sets <code>world</code>
*
* @param world
*/ | Sets <code>world</code> | setWorld | {
"repo_name": "Blockhaus2000/SelfMadeRegion",
"path": "src/main/java/de/whichdesign/selfmaderegion/types/Region.java",
"license": "gpl-3.0",
"size": 9819
} | [
"org.bukkit.World"
] | import org.bukkit.World; | import org.bukkit.*; | [
"org.bukkit"
] | org.bukkit; | 817,532 |
protected void bindPropertyToField(Object rowId, Object colId,
Property property, Field field) {
// check if field has a property that is Viewer set. In that case we
// expect developer has e.g. PropertyFormatter that he wishes to use and
// assign the property to the Viewer instead.
boolean hasFilterProperty = field.getPropertyDataSource() != null
&& (field.getPropertyDataSource() instanceof Property.Viewer);
if (hasFilterProperty) {
((Property.Viewer) field.getPropertyDataSource())
.setPropertyDataSource(property);
} else {
field.setPropertyDataSource(property);
}
} | void function(Object rowId, Object colId, Property property, Field field) { boolean hasFilterProperty = field.getPropertyDataSource() != null && (field.getPropertyDataSource() instanceof Property.Viewer); if (hasFilterProperty) { ((Property.Viewer) field.getPropertyDataSource()) .setPropertyDataSource(property); } else { field.setPropertyDataSource(property); } } | /**
* Binds an item property to a field generated by TableFieldFactory. The
* default behavior is to bind property straight to Field. If
* Property.Viewer type property (e.g. PropertyFormatter) is already set for
* field, the property is bound to that Property.Viewer.
*
* @param rowId
* @param colId
* @param property
* @param field
* @since 6.7.3
*/ | Binds an item property to a field generated by TableFieldFactory. The default behavior is to bind property straight to Field. If Property.Viewer type property (e.g. PropertyFormatter) is already set for field, the property is bound to that Property.Viewer | bindPropertyToField | {
"repo_name": "jdahlstrom/vaadin.react",
"path": "server/src/main/java/com/vaadin/ui/Table.java",
"license": "apache-2.0",
"size": 223299
} | [
"com.vaadin.data.Property"
] | import com.vaadin.data.Property; | import com.vaadin.data.*; | [
"com.vaadin.data"
] | com.vaadin.data; | 755,785 |
private String loadAndValidateFormat(String property, String deflt) {
String format = loadFormat(property, deflt);
// construct new SDF to make sure it's properly formatted
new SimpleDateFormat(format);
return format;
} | String function(String property, String deflt) { String format = loadFormat(property, deflt); new SimpleDateFormat(format); return format; } | /**
* Loads a particular date format from the config, using a default for fallback,
* and validates the format.
* @param property the config property
* @param deflt the default value
* @return the validated config value or default value
*/ | Loads a particular date format from the config, using a default for fallback, and validates the format | loadAndValidateFormat | {
"repo_name": "ua-eas/ua-rice-2.1.9",
"path": "core/impl/src/main/java/org/kuali/rice/core/impl/datetime/DateTimeServiceImpl.java",
"license": "apache-2.0",
"size": 14530
} | [
"java.text.SimpleDateFormat"
] | import java.text.SimpleDateFormat; | import java.text.*; | [
"java.text"
] | java.text; | 1,115,450 |
public byte[] exportPreferences(SharedPreferences preferences) throws IOException {
ByteArrayOutputStream bufStream = new ByteArrayOutputStream(BUFFER_SIZE);
DataOutputStream outWriter = new DataOutputStream(bufStream);
exportPreferences(preferences, outWriter);
return bufStream.toByteArray();
} | byte[] function(SharedPreferences preferences) throws IOException { ByteArrayOutputStream bufStream = new ByteArrayOutputStream(BUFFER_SIZE); DataOutputStream outWriter = new DataOutputStream(bufStream); exportPreferences(preferences, outWriter); return bufStream.toByteArray(); } | /**
* Exports all shared preferences from the given object as a byte array.
*
* @param preferences the preferences to export
* @return the corresponding byte array
* @throws IOException if there are any errors while writing to the byte array
*/ | Exports all shared preferences from the given object as a byte array | exportPreferences | {
"repo_name": "Plonk42/mytracks",
"path": "myTracks/src/main/java/com/google/android/apps/mytracks/io/backup/PreferenceBackupHelper.java",
"license": "apache-2.0",
"size": 8003
} | [
"android.content.SharedPreferences",
"java.io.ByteArrayOutputStream",
"java.io.DataOutputStream",
"java.io.IOException"
] | import android.content.SharedPreferences; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; | import android.content.*; import java.io.*; | [
"android.content",
"java.io"
] | android.content; java.io; | 2,290,658 |
public void deleteModule(String moduleName) throws Exception {
OpenCms.getModuleManager().deleteModule(
m_cms,
moduleName,
false,
new CmsShellReport(m_cms.getRequestContext().getLocale()));
}
/**
* Deletes a project by name.<p>
*
* @param name the name of the project to delete
| void function(String moduleName) throws Exception { OpenCms.getModuleManager().deleteModule( m_cms, moduleName, false, new CmsShellReport(m_cms.getRequestContext().getLocale())); } /** * Deletes a project by name.<p> * * @param name the name of the project to delete | /**
* Deletes a module.<p>
*
* @param moduleName the name of the module
* @throws Exception if something goes wrong
*/ | Deletes a module | deleteModule | {
"repo_name": "comundus/opencms-comundus",
"path": "src/main/java/org/opencms/main/CmsShellCommands.java",
"license": "lgpl-2.1",
"size": 43138
} | [
"org.opencms.report.CmsShellReport"
] | import org.opencms.report.CmsShellReport; | import org.opencms.report.*; | [
"org.opencms.report"
] | org.opencms.report; | 1,696,410 |
private static File[] getCachedDirectoryList(final Context context) {
return new File(getWordListCacheDirectory(context)).listFiles();
} | static File[] function(final Context context) { return new File(getWordListCacheDirectory(context)).listFiles(); } | /**
* Helper method to the list of cache directories, one for each distinct locale.
*/ | Helper method to the list of cache directories, one for each distinct locale | getCachedDirectoryList | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java",
"license": "gpl-2.0",
"size": 21034
} | [
"android.content.Context",
"java.io.File"
] | import android.content.Context; import java.io.File; | import android.content.*; import java.io.*; | [
"android.content",
"java.io"
] | android.content; java.io; | 21,241 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.