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 default <A> TraversalSource withSack(final Supplier<A> initialValue, final BinaryOperator<A> mergeOperator) {
return this.withSack(initialValue, null, mergeOperator);
} | default <A> TraversalSource function(final Supplier<A> initialValue, final BinaryOperator<A> mergeOperator) { return this.withSack(initialValue, null, mergeOperator); } | /**
* Add a sack to be used throughout the life of a spawned {@link Traversal}.
* This adds a {@link org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SackStrategy} to the strategies.
*
* @param initialValue a supplier that produces the initial value of the sideEffect
* @param mergeOperator the sack merge operator
* @return a new traversal source with updated strategies
*/ | Add a sack to be used throughout the life of a spawned <code>Traversal</code>. This adds a <code>org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SackStrategy</code> to the strategies | withSack | {
"repo_name": "mike-tr-adamson/incubator-tinkerpop",
"path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java",
"license": "apache-2.0",
"size": 15465
} | [
"java.util.function.BinaryOperator",
"java.util.function.Supplier"
] | import java.util.function.BinaryOperator; import java.util.function.Supplier; | import java.util.function.*; | [
"java.util"
] | java.util; | 253,229 |
public void onVkSurfaceCreated(Surface surface) {} | public void onVkSurfaceCreated(Surface surface) {} | /**
* Called on the Vulkan thread after the surface is created and whenever the surface size
* changes.
*/ | Called on the Vulkan thread after the surface is created and whenever the surface size changes | onVkSurfaceChanged | {
"repo_name": "honix/godot",
"path": "platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java",
"license": "mit",
"size": 14918
} | [
"android.view.Surface"
] | import android.view.Surface; | import android.view.*; | [
"android.view"
] | android.view; | 2,723,398 |
public Set<K> keySet()
{
Set<K> result = new SetList<K>();
Iterator<K> i = new KeyIterator<K,V>(data.iterator());
while (i.hasNext())
{
result.add(i.next());
}
return result;
} | Set<K> function() { Set<K> result = new SetList<K>(); Iterator<K> i = new KeyIterator<K,V>(data.iterator()); while (i.hasNext()) { result.add(i.next()); } return result; } | /**
* Return a set containing the keys referenced
* by this data structure.
*
* @return a set containing the key referenced
* by this data structure.
* @post Returns a set containing the keys referenced
* by this data structure.
*/ | Return a set containing the keys referenced by this data structure | keySet | {
"repo_name": "xuzhikethinker/t4f-data",
"path": "structure/core/src/main/java/aos/data/structure5/Table.java",
"license": "apache-2.0",
"size": 11052
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 202,230 |
public Sector getSector()
{
return this.asteroidsInfoPane.getSector();
} | Sector function() { return this.asteroidsInfoPane.getSector(); } | /**
* Returns the sector
*
* @return The sector
*/ | Returns the sector | getSector | {
"repo_name": "kayahr/xadrian",
"path": "src/main/java/de/ailis/xadrian/dialogs/SetYieldsDialog.java",
"license": "mit",
"size": 8129
} | [
"de.ailis.xadrian.data.Sector"
] | import de.ailis.xadrian.data.Sector; | import de.ailis.xadrian.data.*; | [
"de.ailis.xadrian"
] | de.ailis.xadrian; | 2,853,857 |
public LocalDate getNull() {
return getNullWithServiceResponseAsync().toBlocking().single().body();
} | LocalDate function() { return getNullWithServiceResponseAsync().toBlocking().single().body(); } | /**
* Get null date value.
*
* @return the LocalDate object if successful.
*/ | Get null date value | getNull | {
"repo_name": "anudeepsharma/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodydate/implementation/DatesImpl.java",
"license": "mit",
"size": 23082
} | [
"org.joda.time.LocalDate"
] | import org.joda.time.LocalDate; | import org.joda.time.*; | [
"org.joda.time"
] | org.joda.time; | 1,273,274 |
public static void fireWebViewDidStartLoad(BrowserComponent bc, String url) {
bc.fireWebEvent("onStart", new ActionEvent(url));
} | static void function(BrowserComponent bc, String url) { bc.fireWebEvent(STR, new ActionEvent(url)); } | /**
* Callback for the native layer
*/ | Callback for the native layer | fireWebViewDidStartLoad | {
"repo_name": "diamonddevgroup/CodenameOne",
"path": "Ports/iOSPort/src/com/codename1/impl/ios/IOSImplementation.java",
"license": "gpl-2.0",
"size": 319498
} | [
"com.codename1.ui.BrowserComponent",
"com.codename1.ui.events.ActionEvent"
] | import com.codename1.ui.BrowserComponent; import com.codename1.ui.events.ActionEvent; | import com.codename1.ui.*; import com.codename1.ui.events.*; | [
"com.codename1.ui"
] | com.codename1.ui; | 1,522,641 |
public HTable createTable(byte[] tableName, byte[] family, int numVersions)
throws IOException {
return createTable(tableName, new byte[][]{family}, numVersions);
} | HTable function(byte[] tableName, byte[] family, int numVersions) throws IOException { return createTable(tableName, new byte[][]{family}, numVersions); } | /**
* Create a table.
* @param tableName
* @param family
* @param numVersions
* @return An HTable instance for the created table.
* @throws IOException
*/ | Create a table | createTable | {
"repo_name": "bcopeland/hbase-thrift",
"path": "src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java",
"license": "apache-2.0",
"size": 58875
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.client.HTable"
] | import java.io.IOException; import org.apache.hadoop.hbase.client.HTable; | import java.io.*; import org.apache.hadoop.hbase.client.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 341,157 |
public int selectBackCount(List<Association> associationsOnPath) {
if (associationsOnPath.isEmpty()) {
return 0;
}
fromLabel.setText(associationsOnPath.get(0).source.getUnqualifiedName());
backCount = -1;
ok = false;
DefaultComboBoxModel model = new DefaultComboBoxModel();
int i = 0;
ToElement element = new ToElement();
element.backCount = i++;
element.name = associationsOnPath.get(0).source.getUnqualifiedName();
model.addElement(element);
for (Association a: associationsOnPath) {
element = new ToElement();
element.backCount = i++;
element.name = a.destination.getUnqualifiedName();
model.addElement(element);
}
toComboBox.setModel(model);
toComboBox.setSelectedIndex(i - 1);
setLocation(getParent().getX() + (getParent().getWidth() - getWidth()) / 2, getParent().getY() + (getParent().getHeight() - getHeight()) / 2);
setVisible(true);
return ok? backCount : -1;
} | int function(List<Association> associationsOnPath) { if (associationsOnPath.isEmpty()) { return 0; } fromLabel.setText(associationsOnPath.get(0).source.getUnqualifiedName()); backCount = -1; ok = false; DefaultComboBoxModel model = new DefaultComboBoxModel(); int i = 0; ToElement element = new ToElement(); element.backCount = i++; element.name = associationsOnPath.get(0).source.getUnqualifiedName(); model.addElement(element); for (Association a: associationsOnPath) { element = new ToElement(); element.backCount = i++; element.name = a.destination.getUnqualifiedName(); model.addElement(element); } toComboBox.setModel(model); toComboBox.setSelectedIndex(i - 1); setLocation(getParent().getX() + (getParent().getWidth() - getWidth()) / 2, getParent().getY() + (getParent().getHeight() - getHeight()) / 2); setVisible(true); return ok? backCount : -1; } | /**
* Opens the dialog and lets select the number of tables to join.
*/ | Opens the dialog and lets select the number of tables to join | selectBackCount | {
"repo_name": "domdorn/Jailer",
"path": "src/main/net/sf/jailer/ui/databrowser/QueryBuilderPathSelector.java",
"license": "apache-2.0",
"size": 7279
} | [
"java.util.List",
"javax.swing.DefaultComboBoxModel",
"net.sf.jailer.datamodel.Association"
] | import java.util.List; import javax.swing.DefaultComboBoxModel; import net.sf.jailer.datamodel.Association; | import java.util.*; import javax.swing.*; import net.sf.jailer.datamodel.*; | [
"java.util",
"javax.swing",
"net.sf.jailer"
] | java.util; javax.swing; net.sf.jailer; | 2,382,047 |
@javax.annotation.Nullable
@ApiModelProperty(value = "Score for all attacking parties, only present in Defense Events. ")
public Float getAttackersScore() {
return attackersScore;
} | @javax.annotation.Nullable @ApiModelProperty(value = STR) Float function() { return attackersScore; } | /**
* Score for all attacking parties, only present in Defense Events.
*
* @return attackersScore
**/ | Score for all attacking parties, only present in Defense Events | getAttackersScore | {
"repo_name": "burberius/eve-esi",
"path": "src/main/java/net/troja/eve/esi/model/SovereigntyCampaignsResponse.java",
"license": "apache-2.0",
"size": 13885
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 698,809 |
void setStatus(TestResultStatus status);
| void setStatus(TestResultStatus status); | /**
* Sets overall test result status
*
* @param status
*/ | Sets overall test result status | setStatus | {
"repo_name": "sleshchenko/che",
"path": "wsagent/che-core-api-testing-shared/src/main/java/org/eclipse/che/api/testing/shared/dto/TestResultRootDto.java",
"license": "epl-1.0",
"size": 2896
} | [
"org.eclipse.che.api.testing.shared.common.TestResultStatus"
] | import org.eclipse.che.api.testing.shared.common.TestResultStatus; | import org.eclipse.che.api.testing.shared.common.*; | [
"org.eclipse.che"
] | org.eclipse.che; | 1,782,269 |
private void showEapFieldsByMethod(int eapMethod) {
// Common defaults
mView.findViewById(R.id.l_method).setVisibility(View.VISIBLE);
mView.findViewById(R.id.l_identity).setVisibility(View.VISIBLE);
// Defaults for most of the EAP methods and over-riden by
// by certain EAP methods
mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE);
mView.findViewById(R.id.password_layout).setVisibility(View.VISIBLE);
mView.findViewById(R.id.show_password_layout).setVisibility(View.VISIBLE);
Context context = mConfigUi.getContext();
switch (eapMethod) {
case WIFI_EAP_METHOD_PWD:
setPhase2Invisible();
setCaCertInvisible();
setAnonymousIdentInvisible();
setUserCertInvisible();
break;
case WIFI_EAP_METHOD_TLS:
mView.findViewById(R.id.l_user_cert).setVisibility(View.VISIBLE);
setPhase2Invisible();
setAnonymousIdentInvisible();
setPasswordInvisible();
break;
case WIFI_EAP_METHOD_PEAP:
// Reset adapter if needed
if (mPhase2Adapter != PHASE2_PEAP_ADAPTER) {
mPhase2Adapter = PHASE2_PEAP_ADAPTER;
mPhase2Spinner.setAdapter(mPhase2Adapter);
}
mView.findViewById(R.id.l_phase2).setVisibility(View.VISIBLE);
mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE);
setUserCertInvisible();
break;
case WIFI_EAP_METHOD_TTLS:
// Reset adapter if needed
if (mPhase2Adapter != PHASE2_FULL_ADAPTER) {
mPhase2Adapter = PHASE2_FULL_ADAPTER;
mPhase2Spinner.setAdapter(mPhase2Adapter);
}
mView.findViewById(R.id.l_phase2).setVisibility(View.VISIBLE);
mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE);
setUserCertInvisible();
break;
case WIFI_EAP_METHOD_SIM:
case WIFI_EAP_METHOD_AKA:
case WIFI_EAP_METHOD_AKA_PRIME:
setPhase2Invisible();
setAnonymousIdentInvisible();
setCaCertInvisible();
setUserCertInvisible();
setPasswordInvisible();
setIdentityInvisible();
break;
}
} | void function(int eapMethod) { mView.findViewById(R.id.l_method).setVisibility(View.VISIBLE); mView.findViewById(R.id.l_identity).setVisibility(View.VISIBLE); mView.findViewById(R.id.l_ca_cert).setVisibility(View.VISIBLE); mView.findViewById(R.id.password_layout).setVisibility(View.VISIBLE); mView.findViewById(R.id.show_password_layout).setVisibility(View.VISIBLE); Context context = mConfigUi.getContext(); switch (eapMethod) { case WIFI_EAP_METHOD_PWD: setPhase2Invisible(); setCaCertInvisible(); setAnonymousIdentInvisible(); setUserCertInvisible(); break; case WIFI_EAP_METHOD_TLS: mView.findViewById(R.id.l_user_cert).setVisibility(View.VISIBLE); setPhase2Invisible(); setAnonymousIdentInvisible(); setPasswordInvisible(); break; case WIFI_EAP_METHOD_PEAP: if (mPhase2Adapter != PHASE2_PEAP_ADAPTER) { mPhase2Adapter = PHASE2_PEAP_ADAPTER; mPhase2Spinner.setAdapter(mPhase2Adapter); } mView.findViewById(R.id.l_phase2).setVisibility(View.VISIBLE); mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE); setUserCertInvisible(); break; case WIFI_EAP_METHOD_TTLS: if (mPhase2Adapter != PHASE2_FULL_ADAPTER) { mPhase2Adapter = PHASE2_FULL_ADAPTER; mPhase2Spinner.setAdapter(mPhase2Adapter); } mView.findViewById(R.id.l_phase2).setVisibility(View.VISIBLE); mView.findViewById(R.id.l_anonymous).setVisibility(View.VISIBLE); setUserCertInvisible(); break; case WIFI_EAP_METHOD_SIM: case WIFI_EAP_METHOD_AKA: case WIFI_EAP_METHOD_AKA_PRIME: setPhase2Invisible(); setAnonymousIdentInvisible(); setCaCertInvisible(); setUserCertInvisible(); setPasswordInvisible(); setIdentityInvisible(); break; } } | /**
* EAP-PWD valid fields include
* identity
* password
* EAP-PEAP valid fields include
* phase2: MSCHAPV2, GTC
* ca_cert
* identity
* anonymous_identity
* password
* EAP-TLS valid fields include
* user_cert
* ca_cert
* identity
* EAP-TTLS valid fields include
* phase2: PAP, MSCHAP, MSCHAPV2, GTC
* ca_cert
* identity
* anonymous_identity
* password
*/ | EAP-PWD valid fields include identity password EAP-PEAP valid fields include phase2: MSCHAPV2, GTC ca_cert identity anonymous_identity password EAP-TLS valid fields include user_cert ca_cert identity EAP-TTLS valid fields include phase2: PAP, MSCHAP, MSCHAPV2, GTC ca_cert identity anonymous_identity password | showEapFieldsByMethod | {
"repo_name": "Ant-Droid/android_packages_apps_Settings_OLD",
"path": "src/com/android/settings/wifi/WifiConfigController.java",
"license": "apache-2.0",
"size": 43864
} | [
"android.content.Context",
"android.view.View",
"android.widget.Spinner"
] | import android.content.Context; import android.view.View; import android.widget.Spinner; | import android.content.*; import android.view.*; import android.widget.*; | [
"android.content",
"android.view",
"android.widget"
] | android.content; android.view; android.widget; | 729,559 |
void assignSerialNumbers(LOSPickRequestPosition position,
List<String> serials) throws FacadeException;
| void assignSerialNumbers(LOSPickRequestPosition position, List<String> serials) throws FacadeException; | /**
* Assigns a number of serial numbers to the picked position.
* Each picked stockunit will be splitted in serials.size() StockUnits. Each gets a serial number,
*
* @param position
* @param serials
*/ | Assigns a number of serial numbers to the picked position. Each picked stockunit will be splitted in serials.size() StockUnits. Each gets a serial number | assignSerialNumbers | {
"repo_name": "tedvals/mywms",
"path": "server.app/los.inventory-ejb/src/de/linogistix/los/inventory/pick/businessservice/PickOrderBusiness.java",
"license": "gpl-3.0",
"size": 11549
} | [
"de.linogistix.los.inventory.pick.model.LOSPickRequestPosition",
"java.util.List",
"org.mywms.facade.FacadeException"
] | import de.linogistix.los.inventory.pick.model.LOSPickRequestPosition; import java.util.List; import org.mywms.facade.FacadeException; | import de.linogistix.los.inventory.pick.model.*; import java.util.*; import org.mywms.facade.*; | [
"de.linogistix.los",
"java.util",
"org.mywms.facade"
] | de.linogistix.los; java.util; org.mywms.facade; | 958,992 |
public boolean withdraw(int bankSlot, int amount, boolean addItem) {
Item item = new Item(get(bankSlot).getId(), amount);
boolean withdrawItemNoted = item.getDefinition().isNoteable();
int withdrawAmount = amount(item.getId());
if (player.isWithdrawAsNote() && !withdrawItemNoted) {
player.getMessages().sendMessage("This item can't be withdrawn as " + "a note.");
player.setWithdrawAsNote(false);
player.getMessages().sendByteState(115, 0);
}
if (free(bankSlot)) {
return false;
}
if (item.getAmount() > withdrawAmount) {
item.setAmount(withdrawAmount);
}
if (item.getAmount() > player.getInventory().remaining() && !item.getDefinition().isStackable() && !player.isWithdrawAsNote()) {
item.setAmount(player.getInventory().remaining());
}
if (!item.getDefinition().isStackable() && !item.getDefinition().isNoted() && !player.isWithdrawAsNote()) {
if (player.getInventory().remaining() < item.getAmount()) {
player.getMessages().sendMessage("You do not have enough space" + " in your inventory!");
return false;
}
} else {
if (player.getInventory().remaining() < 1 && !player.getInventory().contains(
!player.isWithdrawAsNote() ? item.getId() : item.getId() + 1)) {
player.getMessages().sendMessage("You do not have enough space" + " in your inventory!");
return false;
}
}
super.remove(item, bankSlot);
if (player.isWithdrawAsNote()) {
item.setId(item.getId() + 1);
}
if (addItem)
player.getInventory().add(item);
refresh();
player.getMessages().sendItemsOnInterface(5064, player.getInventory().container());
return true;
}
| boolean function(int bankSlot, int amount, boolean addItem) { Item item = new Item(get(bankSlot).getId(), amount); boolean withdrawItemNoted = item.getDefinition().isNoteable(); int withdrawAmount = amount(item.getId()); if (player.isWithdrawAsNote() && !withdrawItemNoted) { player.getMessages().sendMessage(STR + STR); player.setWithdrawAsNote(false); player.getMessages().sendByteState(115, 0); } if (free(bankSlot)) { return false; } if (item.getAmount() > withdrawAmount) { item.setAmount(withdrawAmount); } if (item.getAmount() > player.getInventory().remaining() && !item.getDefinition().isStackable() && !player.isWithdrawAsNote()) { item.setAmount(player.getInventory().remaining()); } if (!item.getDefinition().isStackable() && !item.getDefinition().isNoted() && !player.isWithdrawAsNote()) { if (player.getInventory().remaining() < item.getAmount()) { player.getMessages().sendMessage(STR + STR); return false; } } else { if (player.getInventory().remaining() < 1 && !player.getInventory().contains( !player.isWithdrawAsNote() ? item.getId() : item.getId() + 1)) { player.getMessages().sendMessage(STR + STR); return false; } } super.remove(item, bankSlot); if (player.isWithdrawAsNote()) { item.setId(item.getId() + 1); } if (addItem) player.getInventory().add(item); refresh(); player.getMessages().sendItemsOnInterface(5064, player.getInventory().container()); return true; } | /**
* Withdraws an item from this bank from the {@code bankSlot} slot. This is
* used for when a player is manually withdrawing an item using the banking
* interface.
*
* @param bankSlot
* the slot from the player's bank.
* @param amount
* the amount of the item being withdrawn.
* @param addItem
* if the item should be added back into the player's inventory
* after being withdrawn.
* @return {@code true} if the item was withdrawn, {@code false} otherwise.
*/ | Withdraws an item from this bank from the bankSlot slot. This is used for when a player is manually withdrawing an item using the banking interface | withdraw | {
"repo_name": "lare96/asteria-3.0",
"path": "src/com/asteria/game/item/container/Bank.java",
"license": "gpl-3.0",
"size": 7312
} | [
"com.asteria.game.item.Item"
] | import com.asteria.game.item.Item; | import com.asteria.game.item.*; | [
"com.asteria.game"
] | com.asteria.game; | 81,259 |
public void brands_values_list(int pv_id,int brand_id,PrintWriter out,String censimento)
{
new Consts();
String query=String.format(Consts.queryBrandsValues, pv_id,brand_id);
ArrayList<HashMap<String, String>> rs = null;
try
{
rs=queryDb4BrandsValues(censimento,query);
} catch (ServletException e) {
e.printStackTrace();
}
jsonEncode(rs,out);
} | void function(int pv_id,int brand_id,PrintWriter out,String censimento) { new Consts(); String query=String.format(Consts.queryBrandsValues, pv_id,brand_id); ArrayList<HashMap<String, String>> rs = null; try { rs=queryDb4BrandsValues(censimento,query); } catch (ServletException e) { e.printStackTrace(); } jsonEncode(rs,out); } | /**
* produce e invia il json al client, per popolare la lista dei brands trattati, per popolare la tabella marchi della scheda anagrafica
* @param pv_id
* @param brand_id
* @param out
* @param censimento
*/ | produce e invia il json al client, per popolare la lista dei brands trattati, per popolare la tabella marchi della scheda anagrafica | brands_values_list | {
"repo_name": "arpho/mmasgis5web",
"path": "src/com/webgis/application/tasks/BrandsValueListTask.java",
"license": "mit",
"size": 3283
} | [
"java.io.PrintWriter",
"java.util.ArrayList",
"java.util.HashMap",
"javax.servlet.ServletException"
] | import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import javax.servlet.ServletException; | import java.io.*; import java.util.*; import javax.servlet.*; | [
"java.io",
"java.util",
"javax.servlet"
] | java.io; java.util; javax.servlet; | 2,807,463 |
void modifyTable(TableDescriptor td) throws IOException;
/**
* Modify an existing table, more IRB friendly version. Asynchronous operation. This means that
* it may be a while before your schema change is updated across all of the table.
* You can use Future.get(long, TimeUnit) to wait on the operation to complete.
* It may throw ExecutionException if there was an error while executing the operation
* or TimeoutException in case the wait timeout was not long enough to allow the
* operation to complete.
*
* @param tableName name of table.
* @param td modified description of the table
* @throws IOException if a remote or network exception occurs
* @return the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the
* operation to complete
* @deprecated since 2.0 version and will be removed in 3.0 version.
* use {@link #modifyTableAsync(TableDescriptor)} | void modifyTable(TableDescriptor td) throws IOException; /** * Modify an existing table, more IRB friendly version. Asynchronous operation. This means that * it may be a while before your schema change is updated across all of the table. * You can use Future.get(long, TimeUnit) to wait on the operation to complete. * It may throw ExecutionException if there was an error while executing the operation * or TimeoutException in case the wait timeout was not long enough to allow the * operation to complete. * * @param tableName name of table. * @param td modified description of the table * @throws IOException if a remote or network exception occurs * @return the result of the async modify. You can use Future.get(long, TimeUnit) to wait on the * operation to complete * @deprecated since 2.0 version and will be removed in 3.0 version. * use {@link #modifyTableAsync(TableDescriptor)} | /**
* Modify an existing table, more IRB friendly version.
* @param td modified description of the table
* @throws IOException if a remote or network exception occurs
*/ | Modify an existing table, more IRB friendly version | modifyTable | {
"repo_name": "vincentpoon/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/Admin.java",
"license": "apache-2.0",
"size": 104154
} | [
"java.io.IOException",
"java.util.concurrent.Future"
] | import java.io.IOException; import java.util.concurrent.Future; | import java.io.*; import java.util.concurrent.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 2,668,777 |
protected void createMessageKeyStatusMap(List<String> keys) {
if (keys == null || keys.isEmpty()) {
entries = Collections.emptyList();
return;
}
entries = new ArrayList<>(keys.size());
List<Locale> allLocales = ViewerResourceBundle.getAllLocales();
for (String k : keys) {
entries.add(MessageEntry.create(null, k, allLocales));
}
} | void function(List<String> keys) { if (keys == null keys.isEmpty()) { entries = Collections.emptyList(); return; } entries = new ArrayList<>(keys.size()); List<Locale> allLocales = ViewerResourceBundle.getAllLocales(); for (String k : keys) { entries.add(MessageEntry.create(null, k, allLocales)); } } | /**
* Checks the translation status for each of the given keys and populates <code>messageKeys</code> accordingly.
*
* @param keys
*/ | Checks the translation status for each of the given keys and populates <code>messageKeys</code> accordingly | createMessageKeyStatusMap | {
"repo_name": "intranda/goobi-viewer-core",
"path": "goobi-viewer-core/src/main/java/io/goobi/viewer/model/translations/admin/TranslationGroupItem.java",
"license": "gpl-2.0",
"size": 5990
} | [
"io.goobi.viewer.messages.ViewerResourceBundle",
"java.util.ArrayList",
"java.util.Collections",
"java.util.List",
"java.util.Locale"
] | import io.goobi.viewer.messages.ViewerResourceBundle; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Locale; | import io.goobi.viewer.messages.*; import java.util.*; | [
"io.goobi.viewer",
"java.util"
] | io.goobi.viewer; java.util; | 793,635 |
public XYDataItem remove(int index) {
XYDataItem removed = this.data.remove(index);
updateBoundsForRemovedItem(removed);
fireSeriesChanged();
return removed;
}
/**
* Removes an item with the specified x-value and sends a
* {@link SeriesChangeEvent} to all registered listeners. Note that when
* a series permits multiple items with the same x-value, this method
* could remove any one of the items with that x-value.
*
* @param x the x-value.
| XYDataItem function(int index) { XYDataItem removed = this.data.remove(index); updateBoundsForRemovedItem(removed); fireSeriesChanged(); return removed; } /** * Removes an item with the specified x-value and sends a * {@link SeriesChangeEvent} to all registered listeners. Note that when * a series permits multiple items with the same x-value, this method * could remove any one of the items with that x-value. * * @param x the x-value. | /**
* Removes the item at the specified index and sends a
* {@link SeriesChangeEvent} to all registered listeners.
*
* @param index the index.
*
* @return The item removed.
*/ | Removes the item at the specified index and sends a <code>SeriesChangeEvent</code> to all registered listeners | remove | {
"repo_name": "greearb/jfreechart-fse-ct",
"path": "src/main/java/org/jfree/data/xy/XYSeries.java",
"license": "lgpl-2.1",
"size": 33902
} | [
"org.jfree.data.general.SeriesChangeEvent"
] | import org.jfree.data.general.SeriesChangeEvent; | import org.jfree.data.general.*; | [
"org.jfree.data"
] | org.jfree.data; | 1,460,584 |
public static List<String> linesOf(URL url) {
return URLs.linesOf(url, Charset.defaultCharset());
} | static List<String> function(URL url) { return URLs.linesOf(url, Charset.defaultCharset()); } | /**
* Loads the text content of a URL into a list of strings with the default charset, each string corresponding to a
* line.
* The line endings are either \n, \r or \r\n.
*
* @param url the URL.
* @return the content of the file.
* @throws NullPointerException if the given charset is {@code null}.
* @throws RuntimeIOException if an I/O exception occurs.
*/ | Loads the text content of a URL into a list of strings with the default charset, each string corresponding to a line. The line endings are either \n, \r or \r\n | linesOf | {
"repo_name": "pimterry/assertj-core",
"path": "src/main/java/org/assertj/core/api/Assertions.java",
"license": "apache-2.0",
"size": 62714
} | [
"java.nio.charset.Charset",
"java.util.List",
"org.assertj.core.util.URLs"
] | import java.nio.charset.Charset; import java.util.List; import org.assertj.core.util.URLs; | import java.nio.charset.*; import java.util.*; import org.assertj.core.util.*; | [
"java.nio",
"java.util",
"org.assertj.core"
] | java.nio; java.util; org.assertj.core; | 1,349,184 |
public static boolean dispatchBackPress(@NonNull final Fragment fragment) {
return fragment.isResumed()
&& fragment.isVisible()
&& fragment.getUserVisibleHint()
&& fragment instanceof OnBackClickListener
&& ((OnBackClickListener) fragment).onBackClick();
} | static boolean function(@NonNull final Fragment fragment) { return fragment.isResumed() && fragment.isVisible() && fragment.getUserVisibleHint() && fragment instanceof OnBackClickListener && ((OnBackClickListener) fragment).onBackClick(); } | /**
* Dispatch the back press for fragment.
*
* @param fragment The fragment.
* @return {@code true}: the fragment consumes the back press<br>{@code false}: otherwise
*/ | Dispatch the back press for fragment | dispatchBackPress | {
"repo_name": "didi/DoraemonKit",
"path": "Android/dokit-util/src/main/java/com/didichuxing/doraemonkit/util/FragmentUtils.java",
"license": "apache-2.0",
"size": 82370
} | [
"androidx.annotation.NonNull",
"androidx.fragment.app.Fragment"
] | import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; | import androidx.annotation.*; import androidx.fragment.app.*; | [
"androidx.annotation",
"androidx.fragment"
] | androidx.annotation; androidx.fragment; | 1,160,851 |
private String getVolleyErrorCode(VolleyError error) {
if (error == null || error.networkResponse == null
|| error.networkResponse.headers.get(HaikuApiRequest.HEADER_HAIKU) == null) {
return null;
}
return error.networkResponse.headers.get(HaikuApiRequest.HEADER_HAIKU);
} | String function(VolleyError error) { if (error == null error.networkResponse == null error.networkResponse.headers.get(HaikuApiRequest.HEADER_HAIKU) == null) { return null; } return error.networkResponse.headers.get(HaikuApiRequest.HEADER_HAIKU); } | /**
* Helper method that checks the header fields for a usable error.
*
* @param error the raw error.
* @return error constant.
*/ | Helper method that checks the header fields for a usable error | getVolleyErrorCode | {
"repo_name": "googlearchive/gplus-haiku-client-android",
"path": "haikuplus/HaikuPlus/src/main/java/com/google/plus/samples/haikuplus/api/HaikuClient.java",
"license": "apache-2.0",
"size": 14487
} | [
"com.android.volley.VolleyError"
] | import com.android.volley.VolleyError; | import com.android.volley.*; | [
"com.android.volley"
] | com.android.volley; | 655,405 |
public static FastDateFormat getDateInstance(final int style, final TimeZone timeZone) {
return cache.getDateInstance(style, timeZone, null);
} | static FastDateFormat function(final int style, final TimeZone timeZone) { return cache.getDateInstance(style, timeZone, null); } | /**
* <p>Gets a date formatter instance using the specified style and
* time zone in the default locale.</p>
*
* @param style date style: FULL, LONG, MEDIUM, or SHORT
* @param timeZone optional time zone, overrides time zone of
* formatted date
* @return a localized standard date formatter
* @throws IllegalArgumentException if the Locale has no date
* pattern defined
* @since 2.1
*/ | Gets a date formatter instance using the specified style and time zone in the default locale | getDateInstance | {
"repo_name": "ur0/hermes",
"path": "TMessagesProj/src/main/java/org/hermes/android/time/FastDateFormat.java",
"license": "gpl-2.0",
"size": 22294
} | [
"java.util.TimeZone"
] | import java.util.TimeZone; | import java.util.*; | [
"java.util"
] | java.util; | 496,007 |
TypedMessageBuilder<T> replicationClusters(List<String> clusters); | TypedMessageBuilder<T> replicationClusters(List<String> clusters); | /**
* Override the geo-replication clusters for this message.
*
* @param clusters the list of clusters.
* @return the message builder instance
*/ | Override the geo-replication clusters for this message | replicationClusters | {
"repo_name": "merlimat/pulsar",
"path": "pulsar-client-api/src/main/java/org/apache/pulsar/client/api/TypedMessageBuilder.java",
"license": "apache-2.0",
"size": 10547
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,961,073 |
public List<ClassDoc> getAnnotationArrayTypes(String qualifiedAnnotationType, String key, String subKey) {
AnnotationDesc annotation = getAnnotation(qualifiedAnnotationType, false);
if (annotation == null) {
return null;
}
// we expect a single item which is an array of sub annotations
for (AnnotationDesc.ElementValuePair evp : annotation.elementValues()) {
if (evp.element().name().equals(key)) {
Object val = evp.value().value();
AnnotationValue[] vals = (AnnotationValue[]) val;
List<ClassDoc> res = new ArrayList<ClassDoc>();
for (AnnotationValue annotationVal : vals) {
AnnotationDesc subAnnotation = (AnnotationDesc) annotationVal.value();
ClassDoc classDoc = getAnnotationClassDocValue(subAnnotation, "value");
if (classDoc != null) {
res.add(classDoc);
}
}
if (res.isEmpty()) {
return null;
}
return res;
}
}
return null;
} | List<ClassDoc> function(String qualifiedAnnotationType, String key, String subKey) { AnnotationDesc annotation = getAnnotation(qualifiedAnnotationType, false); if (annotation == null) { return null; } for (AnnotationDesc.ElementValuePair evp : annotation.elementValues()) { if (evp.element().name().equals(key)) { Object val = evp.value().value(); AnnotationValue[] vals = (AnnotationValue[]) val; List<ClassDoc> res = new ArrayList<ClassDoc>(); for (AnnotationValue annotationVal : vals) { AnnotationDesc subAnnotation = (AnnotationDesc) annotationVal.value(); ClassDoc classDoc = getAnnotationClassDocValue(subAnnotation, "value"); if (classDoc != null) { res.add(classDoc); } } if (res.isEmpty()) { return null; } return res; } } return null; } | /**
* This gets a list of string values from an annotations field that is itself an array of annotations
* @param qualifiedAnnotationType The fqn of the annotation
* @param key The key of the annotation field that is the array of annotations
* @param subKey The key inside each of the annotations in the array that we want to get the value of
* @return A list of string of values
*/ | This gets a list of string values from an annotations field that is itself an array of annotations | getAnnotationArrayTypes | {
"repo_name": "teamcarma/swagger-jaxrs-doclet",
"path": "swagger-doclet/src/main/java/com/carma/swagger/doclet/parser/AnnotationParser.java",
"license": "apache-2.0",
"size": 7968
} | [
"com.sun.javadoc.AnnotationDesc",
"com.sun.javadoc.AnnotationValue",
"com.sun.javadoc.ClassDoc",
"java.util.ArrayList",
"java.util.List"
] | import com.sun.javadoc.AnnotationDesc; import com.sun.javadoc.AnnotationValue; import com.sun.javadoc.ClassDoc; import java.util.ArrayList; import java.util.List; | import com.sun.javadoc.*; import java.util.*; | [
"com.sun.javadoc",
"java.util"
] | com.sun.javadoc; java.util; | 2,512,956 |
private static void checkInitialized() {
if (Fabric.getKit(TweetUi.class) == null) {
throw new IllegalStateException(NOT_STARTED_ERROR);
}
} | static void function() { if (Fabric.getKit(TweetUi.class) == null) { throw new IllegalStateException(NOT_STARTED_ERROR); } } | /**
* Checks that the TweetUi kit has a singleton instance available.
* @throws IllegalStateException if the kit instance is null.
*/ | Checks that the TweetUi kit has a singleton instance available | checkInitialized | {
"repo_name": "rcastro78/twitter-kit-android",
"path": "tweet-ui/src/main/java/com/twitter/sdk/android/tweetui/TweetUi.java",
"license": "apache-2.0",
"size": 6858
} | [
"io.fabric.sdk.android.Fabric"
] | import io.fabric.sdk.android.Fabric; | import io.fabric.sdk.android.*; | [
"io.fabric.sdk"
] | io.fabric.sdk; | 1,673,994 |
private AsyncHttpClient getAsyncHttpClient() {
if (asyncHttpClient == null) {
asyncHttpClient = new AsyncHttpClient();
}
return asyncHttpClient;
}
| AsyncHttpClient function() { if (asyncHttpClient == null) { asyncHttpClient = new AsyncHttpClient(); } return asyncHttpClient; } | /**
* Get asynchronous http client
*/ | Get asynchronous http client | getAsyncHttpClient | {
"repo_name": "jojoaddison/oneapi-java",
"path": "src/main/java/oneapi/client/impl/OneAPIBaseClientImpl.java",
"license": "apache-2.0",
"size": 17150
} | [
"com.ning.http.client.AsyncHttpClient"
] | import com.ning.http.client.AsyncHttpClient; | import com.ning.http.client.*; | [
"com.ning.http"
] | com.ning.http; | 1,651,037 |
public static ValueBuilder simple(String value, Class<?> resultType) {
SimpleExpression exp = new SimpleExpression(value);
exp.setResultType(resultType);
return new ValueBuilder(exp);
} | static ValueBuilder function(String value, Class<?> resultType) { SimpleExpression exp = new SimpleExpression(value); exp.setResultType(resultType); return new ValueBuilder(exp); } | /**
* Returns a simple expression
*/ | Returns a simple expression | simple | {
"repo_name": "DariusX/camel",
"path": "core/camel-core-engine/src/main/java/org/apache/camel/builder/Builder.java",
"license": "apache-2.0",
"size": 7758
} | [
"org.apache.camel.model.language.SimpleExpression"
] | import org.apache.camel.model.language.SimpleExpression; | import org.apache.camel.model.language.*; | [
"org.apache.camel"
] | org.apache.camel; | 2,137,712 |
@POST
@Path("{path:.*}")
@Description("Creates a directory in the filesystem beneath the working "
+ "directory of the workflow run, or creates or updates a file's "
+ "contents, where that file is in or below the working directory "
+ "of a workflow run.")
@Nonnull
Response makeDirectoryOrUpdateFile(
@Nonnull @PathParam("path") List<PathSegment> parent,
@Nonnull MakeOrUpdateDirEntry operation,
@Nonnull @Context UriInfo ui) throws NoUpdateException,
FilesystemAccessException, NoDirectoryEntryException; | @Path(STR) @Description(STR + STR + STR + STR) Response makeDirectoryOrUpdateFile( @Nonnull @PathParam("path") List<PathSegment> parent, @Nonnull MakeOrUpdateDirEntry operation, @Nonnull @Context UriInfo ui) throws NoUpdateException, FilesystemAccessException, NoDirectoryEntryException; | /**
* Creates a directory in the filesystem beneath the working directory of
* the workflow run, or creates or updates a file's contents, where that
* file is in or below the working directory of a workflow run.
*
* @param parent
* The directory to create the directory in.
* @param operation
* What to call the directory to create.
* @param ui
* About how this method was called.
* @return An HTTP response indicating where the directory was actually made
* or what file was created/updated.
* @throws NoDirectoryEntryException
* If the name of the containing directory can't be looked up.
* @throws NoUpdateException
* If the user is not permitted to update the run.
* @throws FilesystemAccessException
* If something went wrong during the filesystem operation.
*/ | Creates a directory in the filesystem beneath the working directory of the workflow run, or creates or updates a file's contents, where that file is in or below the working directory of a workflow run | makeDirectoryOrUpdateFile | {
"repo_name": "taverna/taverna-server",
"path": "server-webapp/src/main/java/org/taverna/server/master/rest/TavernaServerDirectoryREST.java",
"license": "lgpl-2.1",
"size": 8950
} | [
"java.util.List",
"javax.annotation.Nonnull",
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.PathSegment",
"javax.ws.rs.core.Response",
"javax.ws.rs.core.UriInfo",
"org.apache.cxf.jaxrs.model.wadl.Description",
"org.taverna.server.master.exceptions.FilesystemAccessException",
"org.taverna.server.master.exceptions.NoDirectoryEntryException",
"org.taverna.server.master.exceptions.NoUpdateException"
] | import java.util.List; import javax.annotation.Nonnull; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.PathSegment; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.apache.cxf.jaxrs.model.wadl.Description; import org.taverna.server.master.exceptions.FilesystemAccessException; import org.taverna.server.master.exceptions.NoDirectoryEntryException; import org.taverna.server.master.exceptions.NoUpdateException; | import java.util.*; import javax.annotation.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.cxf.jaxrs.model.wadl.*; import org.taverna.server.master.exceptions.*; | [
"java.util",
"javax.annotation",
"javax.ws",
"org.apache.cxf",
"org.taverna.server"
] | java.util; javax.annotation; javax.ws; org.apache.cxf; org.taverna.server; | 2,604,820 |
@SuppressWarnings("unchecked")
@Override
public void sink(FlowProcess<? extends Configuration> flowProcess, SinkCall<Corc, OutputCollector> sinkCall)
throws IOException {
Corc corc = sinkCall.getContext();
TupleEntry tupleEntry = sinkCall.getOutgoingEntry();
for (Comparable<?> fieldName : tupleEntry.getFields()) {
corc.set(fieldName.toString(), tupleEntry.getObject(fieldName));
}
sinkCall.getOutput().collect(null, corc);
} | @SuppressWarnings(STR) void function(FlowProcess<? extends Configuration> flowProcess, SinkCall<Corc, OutputCollector> sinkCall) throws IOException { Corc corc = sinkCall.getContext(); TupleEntry tupleEntry = sinkCall.getOutgoingEntry(); for (Comparable<?> fieldName : tupleEntry.getFields()) { corc.set(fieldName.toString(), tupleEntry.getObject(fieldName)); } sinkCall.getOutput().collect(null, corc); } | /**
* Copies the values from the outgoing {@link TupleEntry} to the {@link Corc}.
*/ | Copies the values from the outgoing <code>TupleEntry</code> to the <code>Corc</code> | sink | {
"repo_name": "HotelsDotCom/corc",
"path": "corc-cascading/src/main/java/com/hotels/corc/cascading/OrcFile.java",
"license": "apache-2.0",
"size": 23984
} | [
"com.hotels.corc.Corc",
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.mapred.OutputCollector"
] | import com.hotels.corc.Corc; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.mapred.OutputCollector; | import com.hotels.corc.*; import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.mapred.*; | [
"com.hotels.corc",
"java.io",
"org.apache.hadoop"
] | com.hotels.corc; java.io; org.apache.hadoop; | 1,820,913 |
private Ignite startGridNoOptimize(int idx) throws Exception {
return startGridNoOptimize(getTestIgniteInstanceName(idx));
} | Ignite function(int idx) throws Exception { return startGridNoOptimize(getTestIgniteInstanceName(idx)); } | /**
* Starts new grid with given index. Method optimize is not invoked.
*
* @param idx Index of the grid to start.
* @return Started grid.
* @throws Exception If anything failed.
*/ | Starts new grid with given index. Method optimize is not invoked | startGridNoOptimize | {
"repo_name": "alexzaitzev/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySelfTest.java",
"license": "apache-2.0",
"size": 82878
} | [
"org.apache.ignite.Ignite"
] | import org.apache.ignite.Ignite; | import org.apache.ignite.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 1,284,016 |
@SuppressLint("LongLogTag")
public void setSearchedPattern(String aPattern, final OnRoomMembersSearchListener searchListener, boolean aIsRefreshForced) {
if (TextUtils.isEmpty(aPattern)) {
// refresh list members without any pattern filter (nominal display)
mSearchPattern = null;
updateRoomMembersDataModel(searchListener);
}
else {
// new pattern different from previous one?
if (!aPattern.trim().equals(mSearchPattern) || aIsRefreshForced) {
mSearchPattern = aPattern.trim().toLowerCase();
updateRoomMembersDataModel(searchListener);
} else {
// search pattern is identical, notify listener and exit
if (null != searchListener) {
int searchItemsCount = getItemsCount();
searchListener.onSearchEnd(searchItemsCount, false);
}
}
}
} | @SuppressLint(STR) void function(String aPattern, final OnRoomMembersSearchListener searchListener, boolean aIsRefreshForced) { if (TextUtils.isEmpty(aPattern)) { mSearchPattern = null; updateRoomMembersDataModel(searchListener); } else { if (!aPattern.trim().equals(mSearchPattern) aIsRefreshForced) { mSearchPattern = aPattern.trim().toLowerCase(); updateRoomMembersDataModel(searchListener); } else { if (null != searchListener) { int searchItemsCount = getItemsCount(); searchListener.onSearchEnd(searchItemsCount, false); } } } } | /**
* Search a pattern in the known members list.
* @param aPattern the pattern to search
* @param searchListener the search listener
* @param aIsRefreshForced set to tru to force the refresh
*/ | Search a pattern in the known members list | setSearchedPattern | {
"repo_name": "floviolleau/vector-android",
"path": "vector/src/main/java/im/vector/adapters/VectorRoomDetailsMembersAdapter.java",
"license": "apache-2.0",
"size": 35470
} | [
"android.annotation.SuppressLint",
"android.text.TextUtils"
] | import android.annotation.SuppressLint; import android.text.TextUtils; | import android.annotation.*; import android.text.*; | [
"android.annotation",
"android.text"
] | android.annotation; android.text; | 1,540,780 |
public JFormattedTextField getWait() {
return wait_;
}
| JFormattedTextField function() { return wait_; } | /**
* Gets the vehicle wait time TextField
*
* @return the wait_ TextField
*/ | Gets the vehicle wait time TextField | getWait | {
"repo_name": "VanetSim/VanetSim",
"path": "src/vanetsim/gui/controlpanels/EditOneVehicleControlPanel.java",
"license": "gpl-3.0",
"size": 34331
} | [
"javax.swing.JFormattedTextField"
] | import javax.swing.JFormattedTextField; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,390,346 |
public static int getSKeyFromOrganism(String aux, Statement statement) throws SQLException{
int res = -1;
ResultSet rs = statement.executeQuery("SELECT * FROM organism where organism = '"+ aux);
if(rs.next())
res = rs.getInt(1);
rs.close();
return res;
} | static int function(String aux, Statement statement) throws SQLException{ int res = -1; ResultSet rs = statement.executeQuery(STR+ aux); if(rs.next()) res = rs.getInt(1); rs.close(); return res; } | /**
* Get s_key from organism table for a given organism.
* @param aux
* @param statement
* @return String
* @throws SQLException
*/ | Get s_key from organism table for a given organism | getSKeyFromOrganism | {
"repo_name": "merlin-sysbio/database-connector",
"path": "src/main/java/pt/uminho/ceb/biosystems/merlin/database/connector/databaseAPI/ProjectAPI.java",
"license": "gpl-2.0",
"size": 100765
} | [
"java.sql.ResultSet",
"java.sql.SQLException",
"java.sql.Statement"
] | import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; | import java.sql.*; | [
"java.sql"
] | java.sql; | 395,665 |
public File getFile() throws IOException {
if (this.uri != null) {
return ResourceUtils.getFile(this.uri, getDescription());
}
else {
return ResourceUtils.getFile(this.url, getDescription());
}
} | File function() throws IOException { if (this.uri != null) { return ResourceUtils.getFile(this.uri, getDescription()); } else { return ResourceUtils.getFile(this.url, getDescription()); } } | /**
* This implementation returns a File reference for the underlying URL/URI,
* provided that it refers to a file in the file system.
* @see org.springframework.util.ResourceUtils#getFile(java.net.URL, String)
*/ | This implementation returns a File reference for the underlying URL/URI, provided that it refers to a file in the file system | getFile | {
"repo_name": "mattxia/spring-2.5-analysis",
"path": "src/org/springframework/core/io/UrlResource.java",
"license": "apache-2.0",
"size": 5526
} | [
"java.io.File",
"java.io.IOException",
"org.springframework.util.ResourceUtils"
] | import java.io.File; import java.io.IOException; import org.springframework.util.ResourceUtils; | import java.io.*; import org.springframework.util.*; | [
"java.io",
"org.springframework.util"
] | java.io; org.springframework.util; | 1,282,867 |
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
| void function(Date dueDate) { this.dueDate = dueDate; } | /**
* Due date of the instance.
*
* @param dueDate the Date.
*/ | Due date of the instance | setDueDate | {
"repo_name": "NABUCCO/org.nabucco.framework.workflow",
"path": "org.nabucco.framework.workflow.facade.message/src/main/gen/org/nabucco/framework/workflow/facade/message/engine/InitWorkflowRq.java",
"license": "epl-1.0",
"size": 21576
} | [
"org.nabucco.framework.base.facade.datatype.date.Date"
] | import org.nabucco.framework.base.facade.datatype.date.Date; | import org.nabucco.framework.base.facade.datatype.date.*; | [
"org.nabucco.framework"
] | org.nabucco.framework; | 1,703,610 |
try {
EADoc.unsetPause();
EADoc.disableButtons();
SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { | try { EADoc.unsetPause(); EADoc.disableButtons(); SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() { | /**
* Much of this mess is in place only to use a SwingWorker class allowing
* concurrent threads to operate. This is in order to leave the GUI
* accessible while the experiment runs.
*
* @author rnewhouse
*/ | Much of this mess is in place only to use a SwingWorker class allowing concurrent threads to operate. This is in order to leave the GUI accessible while the experiment runs | actionPerformed | {
"repo_name": "openxal/openxal",
"path": "apps/experimentautomator/src/xal/app/experimentautomator/listeners/StepButtonActionListener.java",
"license": "bsd-3-clause",
"size": 2250
} | [
"javax.swing.SwingWorker"
] | import javax.swing.SwingWorker; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 285,047 |
public void addString(String str, int x, int y, CharacterSet charSet) {
addObject(new GraphicsCharacterString(str, x, y, charSet));
} | void function(String str, int x, int y, CharacterSet charSet) { addObject(new GraphicsCharacterString(str, x, y, charSet)); } | /**
* Adds a string
*
* @param str the string
* @param x the x coordinate
* @param y the y coordinate
* @param charSet the character set associated with the string
*/ | Adds a string | addString | {
"repo_name": "chunlinyao/fop",
"path": "fop-core/src/main/java/org/apache/fop/afp/modca/GraphicsObject.java",
"license": "apache-2.0",
"size": 13144
} | [
"org.apache.fop.afp.fonts.CharacterSet",
"org.apache.fop.afp.goca.GraphicsCharacterString"
] | import org.apache.fop.afp.fonts.CharacterSet; import org.apache.fop.afp.goca.GraphicsCharacterString; | import org.apache.fop.afp.fonts.*; import org.apache.fop.afp.goca.*; | [
"org.apache.fop"
] | org.apache.fop; | 2,288,508 |
public T dequeue() throws NoSuchElementException {
if (size == 0) {
throw new NoSuchElementException();
}
T o = rear.next.data;
if (size == 1) {
rear = null;
}
else {
rear.next = rear.next.next;
}
size--;
return o;
} | T function() throws NoSuchElementException { if (size == 0) { throw new NoSuchElementException(); } T o = rear.next.data; if (size == 1) { rear = null; } else { rear.next = rear.next.next; } size--; return o; } | /**
* Dequeues the front item of queue and returns it.
*
* @return Item that is dequeued.
* @throws NoSuchElementException if item is not in queue.
*/ | Dequeues the front item of queue and returns it | dequeue | {
"repo_name": "USMC1941/CS112-Rutgers",
"path": "Assignments/IntervalTree/src/structures/Queue.java",
"license": "mit",
"size": 2119
} | [
"java.util.NoSuchElementException"
] | import java.util.NoSuchElementException; | import java.util.*; | [
"java.util"
] | java.util; | 1,991,798 |
@Test
public void testSetPhysicsSpace() {
final PhysicsSpace space = mock(PhysicsSpace.class);
contr.setPhysicsSpace(space);
verify(space).addTickListener(contr);
verify(space).addCollisionListener(contr);
} | void function() { final PhysicsSpace space = mock(PhysicsSpace.class); contr.setPhysicsSpace(space); verify(space).addTickListener(contr); verify(space).addCollisionListener(contr); } | /**
* Test setPhysicsSpace.
*/ | Test setPhysicsSpace | testSetPhysicsSpace | {
"repo_name": "Denpeer/ContextProject",
"path": "src/test/java/com/funkydonkies/controllers/PenguinControlTest.java",
"license": "gpl-2.0",
"size": 6218
} | [
"com.jme3.bullet.PhysicsSpace",
"org.mockito.Mockito"
] | import com.jme3.bullet.PhysicsSpace; import org.mockito.Mockito; | import com.jme3.bullet.*; import org.mockito.*; | [
"com.jme3.bullet",
"org.mockito"
] | com.jme3.bullet; org.mockito; | 2,501,657 |
static String createSuccessLog(String user, String operation, String target,
ApplicationId appId, ApplicationAttemptId attemptId, ContainerId containerId) {
StringBuilder b = new StringBuilder();
start(Keys.USER, user, b);
addRemoteIP(b);
add(Keys.OPERATION, operation, b);
add(Keys.TARGET, target ,b);
add(Keys.RESULT, AuditConstants.SUCCESS, b);
if (appId != null) {
add(Keys.APPID, appId.toString(), b);
}
if (attemptId != null) {
add(Keys.APPATTEMPTID, attemptId.toString(), b);
}
if (containerId != null) {
add(Keys.CONTAINERID, containerId.toString(), b);
}
return b.toString();
} | static String createSuccessLog(String user, String operation, String target, ApplicationId appId, ApplicationAttemptId attemptId, ContainerId containerId) { StringBuilder b = new StringBuilder(); start(Keys.USER, user, b); addRemoteIP(b); add(Keys.OPERATION, operation, b); add(Keys.TARGET, target ,b); add(Keys.RESULT, AuditConstants.SUCCESS, b); if (appId != null) { add(Keys.APPID, appId.toString(), b); } if (attemptId != null) { add(Keys.APPATTEMPTID, attemptId.toString(), b); } if (containerId != null) { add(Keys.CONTAINERID, containerId.toString(), b); } return b.toString(); } | /**
* A helper api for creating an audit log for a successful event.
*/ | A helper api for creating an audit log for a successful event | createSuccessLog | {
"repo_name": "laxman-ch/hadoop",
"path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAuditLogger.java",
"license": "apache-2.0",
"size": 12567
} | [
"org.apache.hadoop.yarn.api.records.ApplicationAttemptId",
"org.apache.hadoop.yarn.api.records.ApplicationId",
"org.apache.hadoop.yarn.api.records.ContainerId"
] | import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ContainerId; | import org.apache.hadoop.yarn.api.records.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 335,869 |
Response<MetadataModel> getWithResponse(
String resourceGroupName, String workspaceName, String metadataName, Context context); | Response<MetadataModel> getWithResponse( String resourceGroupName, String workspaceName, String metadataName, Context context); | /**
* Get a Metadata.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workspaceName The name of the workspace.
* @param metadataName The Metadata name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a Metadata along with {@link Response}.
*/ | Get a Metadata | getWithResponse | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/securityinsights/azure-resourcemanager-securityinsights/src/main/java/com/azure/resourcemanager/securityinsights/models/Metadatas.java",
"license": "mit",
"size": 7385
} | [
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context"
] | import com.azure.core.http.rest.Response; import com.azure.core.util.Context; | import com.azure.core.http.rest.*; import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 2,677,113 |
public AttributeList setAttributes(Object assignedObject, AttributeList arg0)
{
LOG.debug("Setting " + arg0.size() + " attributes.");
AttributeList updatedList = new AttributeList();
for (Object attr : arg0)
{
try
{
setAttribute(assignedObject, (Attribute) attr);
updatedList.add((Attribute) attr);
}
catch (Exception e)
{
LOG.error("Could not set : " + ((Attribute) attr).getName(), e);
}
}
return updatedList;
} | AttributeList function(Object assignedObject, AttributeList arg0) { LOG.debug(STR + arg0.size() + STR); AttributeList updatedList = new AttributeList(); for (Object attr : arg0) { try { setAttribute(assignedObject, (Attribute) attr); updatedList.add((Attribute) attr); } catch (Exception e) { LOG.error(STR + ((Attribute) attr).getName(), e); } } return updatedList; } | /**
* Set attribute list
*
* @param
* @param arg0
* @return
*/ | Set attribute list | setAttributes | {
"repo_name": "Doloops/arondor-common-reflection",
"path": "arondor-common-reflection-mbean/src/main/java/com/arondor/common/management/mbean/MBeanObjectHelper.java",
"license": "apache-2.0",
"size": 18875
} | [
"javax.management.Attribute",
"javax.management.AttributeList"
] | import javax.management.Attribute; import javax.management.AttributeList; | import javax.management.*; | [
"javax.management"
] | javax.management; | 228,325 |
public static String getMappedProperty(Object bean, String name, String key) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
{
return BeanUtilityBean.getInstance().getMappedProperty(bean, name, key);
}
| static String function(Object bean, String name, String key) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException { return BeanUtilityBean.getInstance().getMappedProperty(bean, name, key); } | /**
* </p>Return the value of the specified mapped property of the specified
* bean, as a String.</p>
* <p/>
* <p>For more details see <code>BeanUtilsBean</code>.</p>
*
* @see BeanUtilityBean#getMappedProperty(Object, String, String)
*/ | Return the value of the specified mapped property of the specified bean, as a String. For more details see <code>BeanUtilsBean</code> | getMappedProperty | {
"repo_name": "stefandmn/AREasy",
"path": "src/java/org/areasy/common/data/bean/BeanUtility.java",
"license": "lgpl-3.0",
"size": 7998
} | [
"java.lang.reflect.InvocationTargetException"
] | import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 608,745 |
public SharingSyncer getSharingSyncer() {
return this.sharingSyncer;
} | SharingSyncer function() { return this.sharingSyncer; } | /**
* Get the sharing syncer providing functionality to
* share resp. unshare elements with other users.
* <b>Note</b>: This method may return null before the node is connected
*
* @return The Sharing Syncer or null, if this peer is not yet connected
*/ | Get the sharing syncer providing functionality to share resp. unshare elements with other users. Note: This method may return null before the node is connected | getSharingSyncer | {
"repo_name": "p2p-sync/sync",
"path": "src/main/java/org/rmatil/sync/core/Sync.java",
"license": "apache-2.0",
"size": 17999
} | [
"org.rmatil.sync.core.syncer.sharing.SharingSyncer"
] | import org.rmatil.sync.core.syncer.sharing.SharingSyncer; | import org.rmatil.sync.core.syncer.sharing.*; | [
"org.rmatil.sync"
] | org.rmatil.sync; | 1,892,815 |
@XmlElement(name="row")
@XmlElementWrapper(name="database")
public List<Row> getRows() {
return rows;
} | @XmlElement(name="row") @XmlElementWrapper(name=STR) List<Row> function() { return rows; } | /**
* Gets the rows.
*
* @return the rows
*/ | Gets the rows | getRows | {
"repo_name": "aihua/opennms",
"path": "opennms-rrd/opennms-rrd-model/src/main/java/org/opennms/netmgt/rrd/model/AbstractRRA.java",
"license": "agpl-3.0",
"size": 4523
} | [
"java.util.List",
"javax.xml.bind.annotation.XmlElement",
"javax.xml.bind.annotation.XmlElementWrapper"
] | import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; | import java.util.*; import javax.xml.bind.annotation.*; | [
"java.util",
"javax.xml"
] | java.util; javax.xml; | 2,242,095 |
public static void logSelectionIsValid(boolean isSelectionValid) {
RecordHistogram.recordEnumeratedHistogram("Search.ContextualSearchSelectionValid",
isSelectionValid ? SELECTION_VALID : SELECTION_INVALID, SELECTION_BOUNDARY);
} | static void function(boolean isSelectionValid) { RecordHistogram.recordEnumeratedHistogram(STR, isSelectionValid ? SELECTION_VALID : SELECTION_INVALID, SELECTION_BOUNDARY); } | /**
* Logs whether a selection is valid.
* @param isSelectionValid Whether the selection is valid.
*/ | Logs whether a selection is valid | logSelectionIsValid | {
"repo_name": "highweb-project/highweb-webcl-html5spec",
"path": "chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchUma.java",
"license": "bsd-3-clause",
"size": 50399
} | [
"org.chromium.base.metrics.RecordHistogram"
] | import org.chromium.base.metrics.RecordHistogram; | import org.chromium.base.metrics.*; | [
"org.chromium.base"
] | org.chromium.base; | 464,589 |
@ApiModelProperty(value = "The title of the Blog post.")
public String getTitle() {
return title;
} | @ApiModelProperty(value = STR) String function() { return title; } | /**
* The title of the Blog post.
*
* @return title
**/ | The title of the Blog post | getTitle | {
"repo_name": "daflockinger/spongeblogSP",
"path": "src/main/java/com/flockinger/spongeblogSP/dto/PostDTO.java",
"license": "mit",
"size": 3025
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 96,454 |
default XWPFTable insertNewTbl(XmlCursor insertPostionCursor) {
return getTarget().insertNewTbl(insertPostionCursor);
} | default XWPFTable insertNewTbl(XmlCursor insertPostionCursor) { return getTarget().insertNewTbl(insertPostionCursor); } | /**
* insert table at position of the cursor
*
* @param insertPostionCursor
* @return the inserted table
*/ | insert table at position of the cursor | insertNewTbl | {
"repo_name": "Sayi/poi-tl",
"path": "poi-tl/src/main/java/com/deepoove/poi/xwpf/BodyContainer.java",
"license": "apache-2.0",
"size": 6497
} | [
"org.apache.poi.xwpf.usermodel.XWPFTable",
"org.apache.xmlbeans.XmlCursor"
] | import org.apache.poi.xwpf.usermodel.XWPFTable; import org.apache.xmlbeans.XmlCursor; | import org.apache.poi.xwpf.usermodel.*; import org.apache.xmlbeans.*; | [
"org.apache.poi",
"org.apache.xmlbeans"
] | org.apache.poi; org.apache.xmlbeans; | 745,241 |
public ServiceFuture<Void> rebootAsync(String resourceGroupName, String name, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(rebootWithServiceResponseAsync(resourceGroupName, name), serviceCallback);
} | ServiceFuture<Void> function(String resourceGroupName, String name, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(rebootWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } | /**
* Reboot all machines in an App Service Environment.
* Reboot all machines in an App Service Environment.
*
* @param resourceGroupName Name of the resource group to which the resource belongs.
* @param name Name of the App Service Environment.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/ | Reboot all machines in an App Service Environment. Reboot all machines in an App Service Environment | rebootAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/appservice/mgmt-v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java",
"license": "mit",
"size": 595166
} | [
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] | import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 1,234,510 |
public DebugDraw getDebugDraw(); | DebugDraw function(); | /**
* Gets the display-specific debug draw
* @return
*/ | Gets the display-specific debug draw | getDebugDraw | {
"repo_name": "ShuoShen/526-JBox2D",
"path": "jbox2d-testbed/src/main/java/org/jbox2d/testbed/framework/TestbedPanel.java",
"license": "bsd-2-clause",
"size": 2682
} | [
"org.jbox2d.callbacks.DebugDraw"
] | import org.jbox2d.callbacks.DebugDraw; | import org.jbox2d.callbacks.*; | [
"org.jbox2d.callbacks"
] | org.jbox2d.callbacks; | 265,024 |
public void removeItem(int which, float velocityX) {
if (mDragState == IDLE || mDragState == DRAGGING) {
if (mDragState == IDLE) {
// called from outside drag-sort
mSrcPos = getHeaderViewsCount() + which;
mFirstExpPos = mSrcPos;
mSecondExpPos = mSrcPos;
mFloatPos = mSrcPos;
View v = getChildAt(mSrcPos - getFirstVisiblePosition());
if (v != null) {
v.setVisibility(View.INVISIBLE);
}
}
mDragState = REMOVING;
mRemoveVelocityX = velocityX;
if (mInTouchEvent) {
switch (mCancelMethod) {
case ON_TOUCH_EVENT:
super.onTouchEvent(mCancelEvent);
break;
case ON_INTERCEPT_TOUCH_EVENT:
super.onInterceptTouchEvent(mCancelEvent);
break;
}
}
if (mRemoveAnimator != null) {
mRemoveAnimator.start();
} else {
doRemoveItem(which);
}
}
} | void function(int which, float velocityX) { if (mDragState == IDLE mDragState == DRAGGING) { if (mDragState == IDLE) { mSrcPos = getHeaderViewsCount() + which; mFirstExpPos = mSrcPos; mSecondExpPos = mSrcPos; mFloatPos = mSrcPos; View v = getChildAt(mSrcPos - getFirstVisiblePosition()); if (v != null) { v.setVisibility(View.INVISIBLE); } } mDragState = REMOVING; mRemoveVelocityX = velocityX; if (mInTouchEvent) { switch (mCancelMethod) { case ON_TOUCH_EVENT: super.onTouchEvent(mCancelEvent); break; case ON_INTERCEPT_TOUCH_EVENT: super.onInterceptTouchEvent(mCancelEvent); break; } } if (mRemoveAnimator != null) { mRemoveAnimator.start(); } else { doRemoveItem(which); } } } | /**
* Removes an item from the list and animates the removal.
*
* @param which Position to remove (NOTE: headers/footers ignored!
* this is a position in your input ListAdapter).
* @param velocityX
*/ | Removes an item from the list and animates the removal | removeItem | {
"repo_name": "Tapchicoma/ultrasonic",
"path": "core/library/src/main/java/com/mobeta/android/dslv/DragSortListView.java",
"license": "gpl-3.0",
"size": 98778
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 520,601 |
public static void convertPointsToHomogeneous(Mat src, Mat dst)
{
convertPointsToHomogeneous_0(src.nativeObj, dst.nativeObj);
return;
}
//
// C++: void correctMatches(Mat F, Mat points1, Mat points2, Mat& newPoints1, Mat& newPoints2)
// | static void function(Mat src, Mat dst) { convertPointsToHomogeneous_0(src.nativeObj, dst.nativeObj); return; } // | /**
* <p>Converts points from Euclidean to homogeneous space.</p>
*
* <p>The function converts points from Euclidean to homogeneous space by appending
* 1's to the tuple of point coordinates. That is, each point <code>(x1, x2,...,
* xn)</code> is converted to <code>(x1, x2,..., xn, 1)</code>.</p>
*
* @param src Input vector of <code>N</code>-dimensional points.
* @param dst Output vector of <code>N+1</code>-dimensional points.
*
* @see <a href="http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#convertpointstohomogeneous">org.opencv.calib3d.Calib3d.convertPointsToHomogeneous</a>
*/ | Converts points from Euclidean to homogeneous space. The function converts points from Euclidean to homogeneous space by appending 1's to the tuple of point coordinates. That is, each point <code>(x1, x2,..., xn)</code> is converted to <code>(x1, x2,..., xn, 1)</code> | convertPointsToHomogeneous | {
"repo_name": "kazuto1011/rcnn-server",
"path": "tms_ss_android/openCVLibrary2411/src/main/java/org/opencv/calib3d/Calib3d.java",
"license": "mit",
"size": 165069
} | [
"org.opencv.core.Mat"
] | import org.opencv.core.Mat; | import org.opencv.core.*; | [
"org.opencv.core"
] | org.opencv.core; | 1,442,242 |
public void resetBindingVariables()
{
_bindingVariables = new HashMap<String,Integer>();
} | void function() { _bindingVariables = new HashMap<String,Integer>(); } | /**
* Removes all binding variables
*/ | Removes all binding variables | resetBindingVariables | {
"repo_name": "moriyoshi/quercus-gae",
"path": "src/main/java/com/caucho/quercus/lib/db/OracleStatement.java",
"license": "gpl-2.0",
"size": 5778
} | [
"java.util.HashMap"
] | import java.util.HashMap; | import java.util.*; | [
"java.util"
] | java.util; | 1,859,816 |
String encodeLoginAndRefUrl(HttpServletRequest request) throws UnsupportedEncodingException; | String encodeLoginAndRefUrl(HttpServletRequest request) throws UnsupportedEncodingException; | /**
* Encodes an URL that includes a login URL and a reference to the originally-requested URL for use in a browser
* redirect.
* @param request HTTP Request
* @param loginUrl Login URL
* @return encoded redirect string
* @throws UnsupportedEncodingException
*/ | Encodes an URL that includes a login URL and a reference to the originally-requested URL for use in a browser redirect | encodeLoginAndRefUrl | {
"repo_name": "pspaude/uPortal",
"path": "uportal-war/src/main/java/org/jasig/portal/url/LoginRefUrlEncoder.java",
"license": "apache-2.0",
"size": 1527
} | [
"java.io.UnsupportedEncodingException",
"javax.servlet.http.HttpServletRequest"
] | import java.io.UnsupportedEncodingException; import javax.servlet.http.HttpServletRequest; | import java.io.*; import javax.servlet.http.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 2,830,911 |
@RunsInEDT
public void click(@Nonnull Component c, @Nonnull MouseButton button) {
click(c, button, 1);
} | void function(@Nonnull Component c, @Nonnull MouseButton button) { click(c, button, 1); } | /**
* Simulates a user clicking once the given AWT or Swing {@code Component} using the given mouse button.
*
* @param c the {@code Component} to click on.
* @param button the mouse button to use.
* @throws NullPointerException if the given {@code MouseButton} is {@code null}.
* @throws IllegalStateException if the {@code Component} is disabled.
* @throws IllegalStateException if the {@code Component} is not showing on the screen.
*/ | Simulates a user clicking once the given AWT or Swing Component using the given mouse button | click | {
"repo_name": "google/fest",
"path": "third_party/fest-swing/src/main/java/org/fest/swing/driver/ComponentDriver.java",
"license": "apache-2.0",
"size": 24185
} | [
"java.awt.Component",
"javax.annotation.Nonnull",
"org.fest.swing.core.MouseButton"
] | import java.awt.Component; import javax.annotation.Nonnull; import org.fest.swing.core.MouseButton; | import java.awt.*; import javax.annotation.*; import org.fest.swing.core.*; | [
"java.awt",
"javax.annotation",
"org.fest.swing"
] | java.awt; javax.annotation; org.fest.swing; | 2,022,206 |
SerialPort[] serialPorts = SerialPort.getCommPorts();
if (serialPorts.length == 0)
return emptyList();
return asList(serialPorts).stream().map((port) -> new AvailablePort(port)).collect(toList());
} | SerialPort[] serialPorts = SerialPort.getCommPorts(); if (serialPorts.length == 0) return emptyList(); return asList(serialPorts).stream().map((port) -> new AvailablePort(port)).collect(toList()); } | /**
* Returns the list of available ports.
*
* @return A list of the available ports, never null.
*/ | Returns the list of available ports | getAvailablePorts | {
"repo_name": "tbressler/waterrower-core",
"path": "src/main/java/de/tbressler/waterrower/utils/SerialPortWrapper.java",
"license": "apache-2.0",
"size": 852
} | [
"com.fazecast.jSerialComm.SerialPort",
"java.util.Arrays",
"java.util.Collections"
] | import com.fazecast.jSerialComm.SerialPort; import java.util.Arrays; import java.util.Collections; | import com.fazecast.*; import java.util.*; | [
"com.fazecast",
"java.util"
] | com.fazecast; java.util; | 291,375 |
public AtomicInteger getAvailableCredits() {
return availableCredits;
} | AtomicInteger function() { return availableCredits; } | /**
* To be used on tests only
*/ | To be used on tests only | getAvailableCredits | {
"repo_name": "bennetelli/activemq-artemis",
"path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerConsumerImpl.java",
"license": "apache-2.0",
"size": 46220
} | [
"java.util.concurrent.atomic.AtomicInteger"
] | import java.util.concurrent.atomic.AtomicInteger; | import java.util.concurrent.atomic.*; | [
"java.util"
] | java.util; | 85,871 |
@FIXVersion(introduced="4.0")
@TagNumRef(tagNum=TagNum.TestReqID, required=true)
public String getTestReqID() {
return testReqID;
} | @FIXVersion(introduced="4.0") @TagNumRef(tagNum=TagNum.TestReqID, required=true) String function() { return testReqID; } | /**
* Message field getter.
* @return field value
*/ | Message field getter | getTestReqID | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/TestRequestMsg.java",
"license": "gpl-3.0",
"size": 7239
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"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.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 2,423,376 |
private void growPointerArrayIfNecessary() throws IOException {
assert(inMemSorter != null);
if (!inMemSorter.hasSpaceForAnotherRecord()) {
long used = inMemSorter.getMemoryUsage();
LongArray array;
try {
// could trigger spilling
array = allocateArray(used / 8 * 2);
} catch (TooLargePageException e) {
// The pointer array is too big to fix in a single page, spill.
spill();
return;
} catch (SparkOutOfMemoryError e) {
// should have trigger spilling
if (!inMemSorter.hasSpaceForAnotherRecord()) {
logger.error("Unable to grow the pointer array");
throw e;
}
return;
}
// check if spilling is triggered or not
if (inMemSorter.hasSpaceForAnotherRecord()) {
freeArray(array);
} else {
inMemSorter.expandPointerArray(array);
}
}
} | void function() throws IOException { assert(inMemSorter != null); if (!inMemSorter.hasSpaceForAnotherRecord()) { long used = inMemSorter.getMemoryUsage(); LongArray array; try { array = allocateArray(used / 8 * 2); } catch (TooLargePageException e) { spill(); return; } catch (SparkOutOfMemoryError e) { if (!inMemSorter.hasSpaceForAnotherRecord()) { logger.error(STR); throw e; } return; } if (inMemSorter.hasSpaceForAnotherRecord()) { freeArray(array); } else { inMemSorter.expandPointerArray(array); } } } | /**
* Checks whether there is enough space to insert an additional record in to the sort pointer
* array and grows the array if additional space is required. If the required space cannot be
* obtained, then the in-memory data will be spilled to disk.
*/ | Checks whether there is enough space to insert an additional record in to the sort pointer array and grows the array if additional space is required. If the required space cannot be obtained, then the in-memory data will be spilled to disk | growPointerArrayIfNecessary | {
"repo_name": "tejasapatil/spark",
"path": "core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java",
"license": "apache-2.0",
"size": 24978
} | [
"java.io.IOException",
"org.apache.spark.memory.SparkOutOfMemoryError",
"org.apache.spark.memory.TooLargePageException",
"org.apache.spark.unsafe.array.LongArray"
] | import java.io.IOException; import org.apache.spark.memory.SparkOutOfMemoryError; import org.apache.spark.memory.TooLargePageException; import org.apache.spark.unsafe.array.LongArray; | import java.io.*; import org.apache.spark.memory.*; import org.apache.spark.unsafe.array.*; | [
"java.io",
"org.apache.spark"
] | java.io; org.apache.spark; | 1,110,102 |
static String prepareDatasourceResponse(HttpServletResponse response,
Integer templateID, IPluggableDatasource pluggableDatasouce,
Map<String, Object> description, Object datasource) {
// otherwise prepare an XML result
DownloadUtil.prepareResponse(ServletActionContext.getRequest(),
response, "TrackReport.xml", "text/xml");
try {
final OutputStream outputStream = response.getOutputStream();
final String xslt = (String) description.get("xslt");
if ((datasource != null) && (xslt != null) && (templateID != null)) {
final File template = ReportBL.getDirTemplate(templateID);
URL baseURL = null;
try {
baseURL = template.toURL();
} catch (final MalformedURLException e) {
LOGGER.error("Wrong template URL for "
+ template.getName() + e.getMessage());
LOGGER.debug(ExceptionUtils.getStackTrace(e));
}
if (baseURL != null) {
final String absolutePathXslt = baseURL.getFile() + xslt;
try {
datasource = XsltTransformer.getInstance().transform(
(Document) datasource, absolutePathXslt);
} catch (final Exception e) {
LOGGER.warn("Tranforming the datasource with "
+ absolutePathXslt + " failed with "
+ e.getMessage());
LOGGER.debug(ExceptionUtils.getStackTrace(e));
}
}
}
if (pluggableDatasouce == null) {
// the default datasource (ReportBeans from last executed query)
// serialize the DOM object into an XML stream
ReportBeansToXML.convertToXml(outputStream,
(Document) datasource);
} else {
// datasource specific serialization
pluggableDatasouce
.serializeDatasource(outputStream, datasource);
}
} catch (final Exception e) {
LOGGER.error("Serializing the datasource to output stream failed with " + e.getMessage());
LOGGER.debug(ExceptionUtils.getStackTrace(e));
}
return null;
} | static String prepareDatasourceResponse(HttpServletResponse response, Integer templateID, IPluggableDatasource pluggableDatasouce, Map<String, Object> description, Object datasource) { DownloadUtil.prepareResponse(ServletActionContext.getRequest(), response, STR, STR); try { final OutputStream outputStream = response.getOutputStream(); final String xslt = (String) description.get("xslt"); if ((datasource != null) && (xslt != null) && (templateID != null)) { final File template = ReportBL.getDirTemplate(templateID); URL baseURL = null; try { baseURL = template.toURL(); } catch (final MalformedURLException e) { LOGGER.error(STR + template.getName() + e.getMessage()); LOGGER.debug(ExceptionUtils.getStackTrace(e)); } if (baseURL != null) { final String absolutePathXslt = baseURL.getFile() + xslt; try { datasource = XsltTransformer.getInstance().transform( (Document) datasource, absolutePathXslt); } catch (final Exception e) { LOGGER.warn(STR + absolutePathXslt + STR + e.getMessage()); LOGGER.debug(ExceptionUtils.getStackTrace(e)); } } } if (pluggableDatasouce == null) { ReportBeansToXML.convertToXml(outputStream, (Document) datasource); } else { pluggableDatasouce .serializeDatasource(outputStream, datasource); } } catch (final Exception e) { LOGGER.error(STR + e.getMessage()); LOGGER.debug(ExceptionUtils.getStackTrace(e)); } return null; } | /**
* Serializes the data source into the response's output stream using a DOM
* to XML converter
*
* @param pluggableDatasouce
* @param datasource
* @return
*/ | Serializes the data source into the response's output stream using a DOM to XML converter | prepareDatasourceResponse | {
"repo_name": "trackplus/Genji",
"path": "src/main/java/com/aurel/track/admin/customize/category/report/execute/ReportExecuteBL.java",
"license": "gpl-3.0",
"size": 17294
} | [
"com.aurel.track.admin.customize.category.report.ReportBL",
"com.aurel.track.report.datasource.IPluggableDatasource",
"com.aurel.track.report.export.bl.XsltTransformer",
"com.aurel.track.util.DownloadUtil",
"java.io.File",
"java.io.OutputStream",
"java.net.MalformedURLException",
"java.util.Map",
"javax.servlet.http.HttpServletResponse",
"org.apache.commons.lang3.exception.ExceptionUtils",
"org.apache.struts2.ServletActionContext",
"org.w3c.dom.Document"
] | import com.aurel.track.admin.customize.category.report.ReportBL; import com.aurel.track.report.datasource.IPluggableDatasource; import com.aurel.track.report.export.bl.XsltTransformer; import com.aurel.track.util.DownloadUtil; import java.io.File; import java.io.OutputStream; import java.net.MalformedURLException; import java.util.Map; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.struts2.ServletActionContext; import org.w3c.dom.Document; | import com.aurel.track.admin.customize.category.report.*; import com.aurel.track.report.datasource.*; import com.aurel.track.report.export.bl.*; import com.aurel.track.util.*; import java.io.*; import java.net.*; import java.util.*; import javax.servlet.http.*; import org.apache.commons.lang3.exception.*; import org.apache.struts2.*; import org.w3c.dom.*; | [
"com.aurel.track",
"java.io",
"java.net",
"java.util",
"javax.servlet",
"org.apache.commons",
"org.apache.struts2",
"org.w3c.dom"
] | com.aurel.track; java.io; java.net; java.util; javax.servlet; org.apache.commons; org.apache.struts2; org.w3c.dom; | 2,414,224 |
void onItemSwipeMoving(Canvas canvas, RecyclerView.ViewHolder viewHolder, float dX, float dY, boolean isCurrentlyActive); | void onItemSwipeMoving(Canvas canvas, RecyclerView.ViewHolder viewHolder, float dX, float dY, boolean isCurrentlyActive); | /**
* Draw on the empty edge when swipe moving
*
* @param canvas the empty edge's canvas
* @param viewHolder The ViewHolder which is being interacted by the User or it was
* interacted and simply animating to its original position
* @param dX The amount of horizontal displacement caused by user's action
* @param dY The amount of vertical displacement caused by user's action
* @param isCurrentlyActive True if this view is currently being controlled by the user or
* false it is simply animating back to its original state.
*/ | Draw on the empty edge when swipe moving | onItemSwipeMoving | {
"repo_name": "xiaolongwuhpu/MyVideoPlayer",
"path": "library/src/main/java/com/chad/library/adapter/base/listener/OnItemSwipeListener.java",
"license": "apache-2.0",
"size": 1626
} | [
"android.graphics.Canvas",
"android.support.v7.widget.RecyclerView"
] | import android.graphics.Canvas; import android.support.v7.widget.RecyclerView; | import android.graphics.*; import android.support.v7.widget.*; | [
"android.graphics",
"android.support"
] | android.graphics; android.support; | 2,500,475 |
EReference getDocumentRoot_AllowedValues(); | EReference getDocumentRoot_AllowedValues(); | /**
* Returns the meta object for the containment reference '{@link net.opengis.ows20.DocumentRoot#getAllowedValues <em>Allowed Values</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>Allowed Values</em>'.
* @see net.opengis.ows20.DocumentRoot#getAllowedValues()
* @see #getDocumentRoot()
* @generated
*/ | Returns the meta object for the containment reference '<code>net.opengis.ows20.DocumentRoot#getAllowedValues Allowed Values</code>'. | getDocumentRoot_AllowedValues | {
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.ows/src/net/opengis/ows20/Ows20Package.java",
"license": "lgpl-2.1",
"size": 356067
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,706,277 |
public void stop() {
try {
server.stop();
} catch (Exception ex) {
handle(Companion.fatal(ex));
}
} | void function() { try { server.stop(); } catch (Exception ex) { handle(Companion.fatal(ex)); } } | /**
* Stops the server.
*/ | Stops the server | stop | {
"repo_name": "Xenoage/Zong",
"path": "webserver/src/com/xenoage/zong/webserver/Webserver.java",
"license": "agpl-3.0",
"size": 6586
} | [
"com.xenoage.utils.error.Err",
"com.xenoage.utils.log.Report"
] | import com.xenoage.utils.error.Err; import com.xenoage.utils.log.Report; | import com.xenoage.utils.error.*; import com.xenoage.utils.log.*; | [
"com.xenoage.utils"
] | com.xenoage.utils; | 2,191,713 |
this.name = ArgChecker.notNull(name, "name");
return this;
} | this.name = ArgChecker.notNull(name, "name"); return this; } | /**
* Sets the name of the curve group configuration.
*
* @param name the name of the curve group, not empty
* @return this builder
*/ | Sets the name of the curve group configuration | name | {
"repo_name": "nssales/Strata",
"path": "modules/market/src/main/java/com/opengamma/strata/market/curve/config/CurveGroupConfigBuilder.java",
"license": "apache-2.0",
"size": 4739
} | [
"com.opengamma.strata.collect.ArgChecker"
] | import com.opengamma.strata.collect.ArgChecker; | import com.opengamma.strata.collect.*; | [
"com.opengamma.strata"
] | com.opengamma.strata; | 2,306,859 |
protected boolean isAuthenticated ( final By by, final HttpServletRequest request )
{
final String[] authToks = parseAuthorization ( request );
if ( authToks == null )
{
return false;
}
// we don't enforce the "deploy" user name anymore
final String deployKey = authToks[1];
logger.debug ( "Deploy key: '{}'", deployKey );
final ChannelService service = getService ( request );
if ( service == null )
{
logger.info ( "Called 'isAuthenticated' without service" );
return false;
}
return service.getChannelDeployKeyStrings ( by ).orElse ( Collections.emptySet () ).contains ( deployKey );
} | boolean function ( final By by, final HttpServletRequest request ) { final String[] authToks = parseAuthorization ( request ); if ( authToks == null ) { return false; } final String deployKey = authToks[1]; logger.debug ( STR, deployKey ); final ChannelService service = getService ( request ); if ( service == null ) { logger.info ( STR ); return false; } return service.getChannelDeployKeyStrings ( by ).orElse ( Collections.emptySet () ).contains ( deployKey ); } | /**
* Simply test if the request is authenticated against the channels deploy
* keys
*
* @param by
* the channel locator
* @param request
* the request
* @return <code>true</code> if the request could be authenticated against
* the channels deploy keys, <code>false</code> otherwise
*/ | Simply test if the request is authenticated against the channels deploy keys | isAuthenticated | {
"repo_name": "eclipse/packagedrone",
"path": "bundles/org.eclipse.packagedrone.repo.channel/src/org/eclipse/packagedrone/repo/channel/servlet/AbstractChannelServiceServlet.java",
"license": "epl-1.0",
"size": 5741
} | [
"java.util.Collections",
"javax.servlet.http.HttpServletRequest",
"org.eclipse.packagedrone.repo.channel.ChannelService"
] | import java.util.Collections; import javax.servlet.http.HttpServletRequest; import org.eclipse.packagedrone.repo.channel.ChannelService; | import java.util.*; import javax.servlet.http.*; import org.eclipse.packagedrone.repo.channel.*; | [
"java.util",
"javax.servlet",
"org.eclipse.packagedrone"
] | java.util; javax.servlet; org.eclipse.packagedrone; | 2,469,764 |
private TaskResult calculateScoresForFixedParamSet(Double[] paramSet) {
Map<String, Double> paramMap = injectAndGetParametersFromPipeline(paramGrid, paramSet);
double[] locScores = scoreByFolds();
return new TaskResult(paramMap, locScores);
} | TaskResult function(Double[] paramSet) { Map<String, Double> paramMap = injectAndGetParametersFromPipeline(paramGrid, paramSet); double[] locScores = scoreByFolds(); return new TaskResult(paramMap, locScores); } | /**
* Calculates scores by folds and wrap it to TaskResult object.
*
* @param paramSet Parameter set.
*/ | Calculates scores by folds and wrap it to TaskResult object | calculateScoresForFixedParamSet | {
"repo_name": "SomeFire/ignite",
"path": "modules/ml/src/main/java/org/apache/ignite/ml/selection/cv/AbstractCrossValidation.java",
"license": "apache-2.0",
"size": 17415
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,344,389 |
private void measureChild(View view, int otherDirParentSpecMode, boolean alreadyMeasured) {
final GridLayoutManager.LayoutParams lp = (GridLayoutManager.LayoutParams) view.getLayoutParams();
final Rect decorInsets = lp.mDecorInsets;
final int verticalInsets = decorInsets.top + decorInsets.bottom
+ lp.topMargin + lp.bottomMargin;
final int horizontalInsets = decorInsets.left + decorInsets.right
+ lp.leftMargin + lp.rightMargin;
final int availableSpaceInOther = getSpaceForSpanRange(lp.mSpanIndex, lp.mSpanSize);
final int wSpec;
final int hSpec;
if (mOrientation == VERTICAL) {
wSpec = getChildMeasureSpec(availableSpaceInOther, otherDirParentSpecMode,
horizontalInsets, lp.width, false);
hSpec = getChildMeasureSpec(mOrientationHelper.getTotalSpace(), getHeightMode(),
verticalInsets, lp.height, true);
} else {
hSpec = getChildMeasureSpec(availableSpaceInOther, otherDirParentSpecMode,
verticalInsets, lp.height, false);
wSpec = getChildMeasureSpec(mOrientationHelper.getTotalSpace(), getWidthMode(),
horizontalInsets, lp.width, true);
}
measureChildWithDecorationsAndMargin(view, wSpec, hSpec, alreadyMeasured);
} | void function(View view, int otherDirParentSpecMode, boolean alreadyMeasured) { final GridLayoutManager.LayoutParams lp = (GridLayoutManager.LayoutParams) view.getLayoutParams(); final Rect decorInsets = lp.mDecorInsets; final int verticalInsets = decorInsets.top + decorInsets.bottom + lp.topMargin + lp.bottomMargin; final int horizontalInsets = decorInsets.left + decorInsets.right + lp.leftMargin + lp.rightMargin; final int availableSpaceInOther = getSpaceForSpanRange(lp.mSpanIndex, lp.mSpanSize); final int wSpec; final int hSpec; if (mOrientation == VERTICAL) { wSpec = getChildMeasureSpec(availableSpaceInOther, otherDirParentSpecMode, horizontalInsets, lp.width, false); hSpec = getChildMeasureSpec(mOrientationHelper.getTotalSpace(), getHeightMode(), verticalInsets, lp.height, true); } else { hSpec = getChildMeasureSpec(availableSpaceInOther, otherDirParentSpecMode, verticalInsets, lp.height, false); wSpec = getChildMeasureSpec(mOrientationHelper.getTotalSpace(), getWidthMode(), horizontalInsets, lp.width, true); } measureChildWithDecorationsAndMargin(view, wSpec, hSpec, alreadyMeasured); } | /**
* Measures a child with currently known information. This is not necessarily the child's final
* measurement. (see fillChunk for details).
*
* @param view The child view to be measured
* @param otherDirParentSpecMode The RV measure spec that should be used in the secondary
* orientation
* @param alreadyMeasured True if we've already measured this view once
*/ | Measures a child with currently known information. This is not necessarily the child's final measurement. (see fillChunk for details) | measureChild | {
"repo_name": "consp1racy/android-commons",
"path": "commons/src/main/java/android/support/v7/widget/FullWidthGridLayoutManager.java",
"license": "apache-2.0",
"size": 41932
} | [
"android.graphics.Rect",
"android.view.View"
] | import android.graphics.Rect; import android.view.View; | import android.graphics.*; import android.view.*; | [
"android.graphics",
"android.view"
] | android.graphics; android.view; | 2,464,317 |
public boolean matches(GovernanceArtifact artifact) throws GovernanceException; | boolean function(GovernanceArtifact artifact) throws GovernanceException; | /**
* Whether the given artifact matches the expected filter criteria.
*
* @param artifact the artifact.
*
* @return true if a match was found or false otherwise.
* @throws GovernanceException if the operation failed.
*/ | Whether the given artifact matches the expected filter criteria | matches | {
"repo_name": "wso2/carbon-governance",
"path": "components/governance/org.wso2.carbon.governance.api/src/main/java/org/wso2/carbon/governance/api/common/GovernanceArtifactFilter.java",
"license": "apache-2.0",
"size": 1360
} | [
"org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact",
"org.wso2.carbon.governance.api.exception.GovernanceException"
] | import org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact; import org.wso2.carbon.governance.api.exception.GovernanceException; | import org.wso2.carbon.governance.api.common.dataobjects.*; import org.wso2.carbon.governance.api.exception.*; | [
"org.wso2.carbon"
] | org.wso2.carbon; | 359,220 |
@Test
public void generateClientFileInfo() {
MutableInodeDirectory inodeDirectory = createInodeDirectory();
String path = "/test/path";
FileInfo info = inodeDirectory.generateClientFileInfo(path);
Assert.assertEquals(inodeDirectory.getId(), info.getFileId());
Assert.assertEquals(inodeDirectory.getName(), info.getName());
Assert.assertEquals(path, info.getPath());
Assert.assertEquals("", info.getUfsPath());
Assert.assertEquals(0, info.getLength());
Assert.assertEquals(0, info.getBlockSizeBytes());
Assert.assertEquals(inodeDirectory.getCreationTimeMs(), info.getCreationTimeMs());
Assert.assertTrue(info.isCompleted());
Assert.assertTrue(info.isFolder());
Assert.assertEquals(inodeDirectory.isPinned(), info.isPinned());
Assert.assertFalse(info.isCacheable());
Assert.assertNotNull(info.getBlockIds());
Assert.assertEquals(inodeDirectory.getLastModificationTimeMs(),
info.getLastModificationTimeMs());
} | void function() { MutableInodeDirectory inodeDirectory = createInodeDirectory(); String path = STR; FileInfo info = inodeDirectory.generateClientFileInfo(path); Assert.assertEquals(inodeDirectory.getId(), info.getFileId()); Assert.assertEquals(inodeDirectory.getName(), info.getName()); Assert.assertEquals(path, info.getPath()); Assert.assertEquals("", info.getUfsPath()); Assert.assertEquals(0, info.getLength()); Assert.assertEquals(0, info.getBlockSizeBytes()); Assert.assertEquals(inodeDirectory.getCreationTimeMs(), info.getCreationTimeMs()); Assert.assertTrue(info.isCompleted()); Assert.assertTrue(info.isFolder()); Assert.assertEquals(inodeDirectory.isPinned(), info.isPinned()); Assert.assertFalse(info.isCacheable()); Assert.assertNotNull(info.getBlockIds()); Assert.assertEquals(inodeDirectory.getLastModificationTimeMs(), info.getLastModificationTimeMs()); } | /**
* Tests the {@link MutableInodeDirectory#generateClientFileInfo(String)} method.
*/ | Tests the <code>MutableInodeDirectory#generateClientFileInfo(String)</code> method | generateClientFileInfo | {
"repo_name": "EvilMcJerkface/alluxio",
"path": "core/server/master/src/test/java/alluxio/master/file/meta/MutableInodeDirectoryTest.java",
"license": "apache-2.0",
"size": 8041
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 925,109 |
Optional<PiPipeconf> getPipeconf(PiPipeconfId id);
/**
* Signals that the given pipeconf is associated to the given infrastructure
* device. As a result of this method, the pipeconf for the given device can
* be later retrieved using {@link #ofDevice(DeviceId)} | Optional<PiPipeconf> getPipeconf(PiPipeconfId id); /** * Signals that the given pipeconf is associated to the given infrastructure * device. As a result of this method, the pipeconf for the given device can * be later retrieved using {@link #ofDevice(DeviceId)} | /**
* Returns the pipeconf instance associated with the given identifier, if
* present. If not present, it means that no pipeconf with such identifier
* has been registered so far.
*
* @param id a pipeconf identifier
* @return an optional pipeconf
*/ | Returns the pipeconf instance associated with the given identifier, if present. If not present, it means that no pipeconf with such identifier has been registered so far | getPipeconf | {
"repo_name": "kuujo/onos",
"path": "core/api/src/main/java/org/onosproject/net/pi/service/PiPipeconfService.java",
"license": "apache-2.0",
"size": 4217
} | [
"java.util.Optional",
"org.onosproject.net.DeviceId",
"org.onosproject.net.pi.model.PiPipeconf",
"org.onosproject.net.pi.model.PiPipeconfId"
] | import java.util.Optional; import org.onosproject.net.DeviceId; import org.onosproject.net.pi.model.PiPipeconf; import org.onosproject.net.pi.model.PiPipeconfId; | import java.util.*; import org.onosproject.net.*; import org.onosproject.net.pi.model.*; | [
"java.util",
"org.onosproject.net"
] | java.util; org.onosproject.net; | 2,725,215 |
private void drawTypeOverview(GC gc, Object element, EnumMap<OverlayType, Integer> counts, Rectangle bounds,
boolean horizontal) {
int offset = 0;
int boundsExtent = horizontal ? bounds.width : bounds.height;
int extent = Math.max((int) Math.round(boundsExtent / (double) OverlayType.values().length),
maxTypeOverviewExtent);
int numTypes = 0;
for (OverlayType type : OverlayType.values()) {
Integer count = counts.get(type);
if (count != null && count.intValue() > 0) {
numTypes++;
}
}
offset = Math.round((boundsExtent - (extent * numTypes)) * 0.5f);
for (OverlayType type : OverlayType.values()) {
int diffKindCount = 0;
Integer count = counts.get(type);
if (count != null) {
diffKindCount = count.intValue();
}
if (diffKindCount > 0) {
gc.setBackground(styleAdvisor.getBackgroundColorForOverlayType(type));
if (horizontal) {
gc.fillRectangle(bounds.x + offset, bounds.y, extent, bounds.height);
} else {
gc.fillRectangle(bounds.x, bounds.y + offset, bounds.width, extent);
}
offset += extent;
}
}
} | void function(GC gc, Object element, EnumMap<OverlayType, Integer> counts, Rectangle bounds, boolean horizontal) { int offset = 0; int boundsExtent = horizontal ? bounds.width : bounds.height; int extent = Math.max((int) Math.round(boundsExtent / (double) OverlayType.values().length), maxTypeOverviewExtent); int numTypes = 0; for (OverlayType type : OverlayType.values()) { Integer count = counts.get(type); if (count != null && count.intValue() > 0) { numTypes++; } } offset = Math.round((boundsExtent - (extent * numTypes)) * 0.5f); for (OverlayType type : OverlayType.values()) { int diffKindCount = 0; Integer count = counts.get(type); if (count != null) { diffKindCount = count.intValue(); } if (diffKindCount > 0) { gc.setBackground(styleAdvisor.getBackgroundColorForOverlayType(type)); if (horizontal) { gc.fillRectangle(bounds.x + offset, bounds.y, extent, bounds.height); } else { gc.fillRectangle(bounds.x, bounds.y + offset, bounds.width, extent); } offset += extent; } } } | /**
* draws the type overview for the given element within the given bounds.
*
* @param gc
* the {@link GC} used to draw.
* @param element
* the element to draw the type overview for.
* @param counts
* a map containing the counts for each {@link OverlayType}.
* @param bounds
* he bounds to draw the overview into.
* @param horizontal
* true if the type should be arranged horizontally, false if
* they should be arranged vertically.
*/ | draws the type overview for the given element within the given bounds | drawTypeOverview | {
"repo_name": "theArchonius/mervin",
"path": "plugins/at.bitandart.zoubek.mervin/src/at/bitandart/zoubek/mervin/review/explorer/DiffTypeOverviewLabelProvider.java",
"license": "epl-1.0",
"size": 13244
} | [
"at.bitandart.zoubek.mervin.draw2d.figures.overlay.OverlayType",
"java.util.EnumMap",
"org.eclipse.swt.graphics.Rectangle"
] | import at.bitandart.zoubek.mervin.draw2d.figures.overlay.OverlayType; import java.util.EnumMap; import org.eclipse.swt.graphics.Rectangle; | import at.bitandart.zoubek.mervin.draw2d.figures.overlay.*; import java.util.*; import org.eclipse.swt.graphics.*; | [
"at.bitandart.zoubek",
"java.util",
"org.eclipse.swt"
] | at.bitandart.zoubek; java.util; org.eclipse.swt; | 637,672 |
@Nullable
public IosVppEBook patch(@Nonnull final IosVppEBook sourceIosVppEBook) throws ClientException {
return send(HttpMethod.PATCH, sourceIosVppEBook);
} | IosVppEBook function(@Nonnull final IosVppEBook sourceIosVppEBook) throws ClientException { return send(HttpMethod.PATCH, sourceIosVppEBook); } | /**
* Patches this IosVppEBook with a source
*
* @param sourceIosVppEBook the source object with updates
* @return the updated IosVppEBook
* @throws ClientException this exception occurs if the request was unable to complete for any reason
*/ | Patches this IosVppEBook with a source | patch | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/IosVppEBookRequest.java",
"license": "mit",
"size": 5776
} | [
"com.microsoft.graph.core.ClientException",
"com.microsoft.graph.http.HttpMethod",
"com.microsoft.graph.models.IosVppEBook",
"javax.annotation.Nonnull"
] | import com.microsoft.graph.core.ClientException; import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.IosVppEBook; import javax.annotation.Nonnull; | import com.microsoft.graph.core.*; import com.microsoft.graph.http.*; import com.microsoft.graph.models.*; import javax.annotation.*; | [
"com.microsoft.graph",
"javax.annotation"
] | com.microsoft.graph; javax.annotation; | 292,632 |
private void initDisplayOrderPreference() {
StringBuffer list = new StringBuffer();
for (Entry<String, MetricDescriptor> entry : metrics.entrySet()) {
String id = entry.getKey();
String desc = entry.getValue().getName();
list.append(id).append(" - ").append(desc).append(',');
}
String def = list.substring(0, list.length() - 1);
getPreferenceStore().setDefault("METRICS.displayOrder", def);
// if metrics were added/removed, reset the value
if (getMetricIds().length != metrics.size()) {
getPreferenceStore().setToDefault("METRICS.displayOrder");
}
}
| void function() { StringBuffer list = new StringBuffer(); for (Entry<String, MetricDescriptor> entry : metrics.entrySet()) { String id = entry.getKey(); String desc = entry.getValue().getName(); list.append(id).append(STR).append(desc).append(','); } String def = list.substring(0, list.length() - 1); getPreferenceStore().setDefault(STR, def); if (getMetricIds().length != metrics.size()) { getPreferenceStore().setToDefault(STR); } } | /**
* Set the default display order.
*/ | Set the default display order | initDisplayOrderPreference | {
"repo_name": "qxo/eclipse-metrics-plugin",
"path": "net.sourceforge.metrics/src/net/sourceforge/metrics/core/MetricsPlugin.java",
"license": "epl-1.0",
"size": 13956
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 546,793 |
public void handleAnimatedAttributeChanged
(AnimatedLiveAttributeValue alav) {
if (alav.getNamespaceURI() == null) {
String ln = alav.getLocalName();
if (ln.equals(SVG_X_ATTRIBUTE)
|| ln.equals(SVG_Y_ATTRIBUTE)
|| ln.equals(SVG_DX_ATTRIBUTE)
|| ln.equals(SVG_DY_ATTRIBUTE)
|| ln.equals(SVG_ROTATE_ATTRIBUTE)
|| ln.equals(SVG_TEXT_LENGTH_ATTRIBUTE)
|| ln.equals(SVG_LENGTH_ADJUST_ATTRIBUTE)) {
// Recompute the layout of the text node.
textBridge.computeLaidoutText(ctx, textBridge.e,
textBridge.getTextNode());
return;
}
}
super.handleAnimatedAttributeChanged(alav);
}
} | void function (AnimatedLiveAttributeValue alav) { if (alav.getNamespaceURI() == null) { String ln = alav.getLocalName(); if (ln.equals(SVG_X_ATTRIBUTE) ln.equals(SVG_Y_ATTRIBUTE) ln.equals(SVG_DX_ATTRIBUTE) ln.equals(SVG_DY_ATTRIBUTE) ln.equals(SVG_ROTATE_ATTRIBUTE) ln.equals(SVG_TEXT_LENGTH_ATTRIBUTE) ln.equals(SVG_LENGTH_ADJUST_ATTRIBUTE)) { textBridge.computeLaidoutText(ctx, textBridge.e, textBridge.getTextNode()); return; } } super.handleAnimatedAttributeChanged(alav); } } | /**
* Invoked when the animated value of an animatable attribute has
* changed on a 'tspan' element.
*/ | Invoked when the animated value of an animatable attribute has changed on a 'tspan' element | handleAnimatedAttributeChanged | {
"repo_name": "sflyphotobooks/crp-batik",
"path": "sources/org/apache/batik/bridge/SVGTextElementBridge.java",
"license": "apache-2.0",
"size": 114566
} | [
"org.apache.batik.dom.svg.AnimatedLiveAttributeValue"
] | import org.apache.batik.dom.svg.AnimatedLiveAttributeValue; | import org.apache.batik.dom.svg.*; | [
"org.apache.batik"
] | org.apache.batik; | 2,202,015 |
StyleSpans<S> getStyleSpans(int paragraph, int from, int to); | StyleSpans<S> getStyleSpans(int paragraph, int from, int to); | /**
* Returns the styles in the given character range of the given paragraph.
*/ | Returns the styles in the given character range of the given paragraph | getStyleSpans | {
"repo_name": "afester/RichTextFX",
"path": "richtextfx/src/main/java/org/fxmisc/richtext/StyleActions.java",
"license": "bsd-2-clause",
"size": 7097
} | [
"org.fxmisc.richtext.model.StyleSpans"
] | import org.fxmisc.richtext.model.StyleSpans; | import org.fxmisc.richtext.model.*; | [
"org.fxmisc.richtext"
] | org.fxmisc.richtext; | 1,515,746 |
protected void fail(CContext context, MessageDescription description, Object[] params)
throws PositionedError
{
throw new CLineError(getTokenReference(), description, params);
} | void function(CContext context, MessageDescription description, Object[] params) throws PositionedError { throw new CLineError(getTokenReference(), description, params); } | /**
* Adds a compiler error.
* Redefine this method to change error handling behaviour.
* @param context the context in which the error occurred
* @param description the message ident to be displayed
* @param params the array of parameters
*
*/ | Adds a compiler error. Redefine this method to change error handling behaviour | fail | {
"repo_name": "tud-stg-lang/caesar-compiler",
"path": "src/org/caesarj/compiler/ast/phylum/JPhylum.java",
"license": "gpl-2.0",
"size": 5764
} | [
"org.caesarj.compiler.ast.CLineError",
"org.caesarj.compiler.context.CContext",
"org.caesarj.util.MessageDescription",
"org.caesarj.util.PositionedError"
] | import org.caesarj.compiler.ast.CLineError; import org.caesarj.compiler.context.CContext; import org.caesarj.util.MessageDescription; import org.caesarj.util.PositionedError; | import org.caesarj.compiler.ast.*; import org.caesarj.compiler.context.*; import org.caesarj.util.*; | [
"org.caesarj.compiler",
"org.caesarj.util"
] | org.caesarj.compiler; org.caesarj.util; | 2,536,139 |
public static void setEncodingType(IteratorSetting is, Class<? extends Encoder<List<Long>>> encoderClass) {
is.addOption(TYPE, CLASS_PREFIX + encoderClass.getName());
} | static void function(IteratorSetting is, Class<? extends Encoder<List<Long>>> encoderClass) { is.addOption(TYPE, CLASS_PREFIX + encoderClass.getName()); } | /**
* A convenience method for setting the encoding type.
*
* @param is
* IteratorSetting object to configure.
* @param encoderClass
* Class<? extends Encoder<List<Long>>> specifying the encoding type.
*/ | A convenience method for setting the encoding type | setEncodingType | {
"repo_name": "wjsl/jaredcumulo",
"path": "core/src/main/java/org/apache/accumulo/core/iterators/user/SummingArrayCombiner.java",
"license": "apache-2.0",
"size": 8848
} | [
"java.util.List",
"org.apache.accumulo.core.client.IteratorSetting"
] | import java.util.List; import org.apache.accumulo.core.client.IteratorSetting; | import java.util.*; import org.apache.accumulo.core.client.*; | [
"java.util",
"org.apache.accumulo"
] | java.util; org.apache.accumulo; | 2,566,779 |
public final native void animate(JavaScriptObject obj, EventCallback<JavaScriptObject> callback)
;
| final native void function(JavaScriptObject obj, EventCallback<JavaScriptObject> callback) ; | /**
* Animate the view
*
* @param obj
* either a dictionary of animation properties or an Animation
* object
*/ | Animate the view | animate | {
"repo_name": "urish/gwt-titanium",
"path": "src/main/java/org/urish/gwtit/titanium/ui/View.java",
"license": "apache-2.0",
"size": 21675
} | [
"com.google.gwt.core.client.JavaScriptObject",
"org.urish.gwtit.client.EventCallback"
] | import com.google.gwt.core.client.JavaScriptObject; import org.urish.gwtit.client.EventCallback; | import com.google.gwt.core.client.*; import org.urish.gwtit.client.*; | [
"com.google.gwt",
"org.urish.gwtit"
] | com.google.gwt; org.urish.gwtit; | 2,008,300 |
public Variable getVar(int i) {
return vars[i];
}
/**
* Returns the number of {@link IntVar} of the model involved in <code>this</code>,
* <b>excluding</b> {@link BoolVar} if <i>includeBoolVar</i>=<i>false</i>.
* It also counts FIXED variables and VIEWS, if any.
*
* @param includeBoolVar indicates whether or not to include {@link BoolVar} | Variable function(int i) { return vars[i]; } /** * Returns the number of {@link IntVar} of the model involved in <code>this</code>, * <b>excluding</b> {@link BoolVar} if <i>includeBoolVar</i>=<i>false</i>. * It also counts FIXED variables and VIEWS, if any. * * @param includeBoolVar indicates whether or not to include {@link BoolVar} | /**
* Returns the i<sup>th</sup> variable within the array of variables defined in <code>this</code>.
*
* @param i index of the variable to return.
* @return the i<sup>th</sup> variable of this model
*/ | Returns the ith variable within the array of variables defined in <code>this</code> | getVar | {
"repo_name": "chocoteam/choco3",
"path": "src/main/java/org/chocosolver/solver/Model.java",
"license": "bsd-3-clause",
"size": 34609
} | [
"org.chocosolver.solver.variables.BoolVar",
"org.chocosolver.solver.variables.IntVar",
"org.chocosolver.solver.variables.Variable"
] | import org.chocosolver.solver.variables.BoolVar; import org.chocosolver.solver.variables.IntVar; import org.chocosolver.solver.variables.Variable; | import org.chocosolver.solver.variables.*; | [
"org.chocosolver.solver"
] | org.chocosolver.solver; | 2,477,082 |
public java.util.List<ArcHLAPI> getOutArcsHLAPI(){
java.util.List<ArcHLAPI> retour = new ArrayList<ArcHLAPI>();
for (Arc elemnt : getOutArcs()) {
retour.add(new ArcHLAPI(elemnt));
}
return retour;
}
| java.util.List<ArcHLAPI> function(){ java.util.List<ArcHLAPI> retour = new ArrayList<ArcHLAPI>(); for (Arc elemnt : getOutArcs()) { retour.add(new ArcHLAPI(elemnt)); } return retour; } | /**
* This accessor automatically encapsulate all elements of the selected sublist.
* WARNING : this can creates a lot of new object in memory.
*/ | This accessor automatically encapsulate all elements of the selected sublist. WARNING : this can creates a lot of new object in memory | getOutArcsHLAPI | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-PTNet/src/fr/lip6/move/pnml/ptnet/hlapi/TransitionHLAPI.java",
"license": "epl-1.0",
"size": 11212
} | [
"fr.lip6.move.pnml.ptnet.Arc",
"java.util.ArrayList",
"java.util.List"
] | import fr.lip6.move.pnml.ptnet.Arc; import java.util.ArrayList; import java.util.List; | import fr.lip6.move.pnml.ptnet.*; import java.util.*; | [
"fr.lip6.move",
"java.util"
] | fr.lip6.move; java.util; | 1,284,230 |
EList<Project> getSubProjects(); | EList<Project> getSubProjects(); | /**
* Returns the value of the '<em><b>Sub Projects</b></em>' reference list.
* The list contents are of type {@link gluemodel.CIM.IEC61970.Informative.InfWork.Project}.
* It is bidirectional and its opposite is '{@link gluemodel.CIM.IEC61970.Informative.InfWork.Project#getParentProject <em>Parent Project</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Sub Projects</em>' reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Sub Projects</em>' reference list.
* @see gluemodel.CIM.IEC61970.Informative.InfWork.InfWorkPackage#getProject_SubProjects()
* @see gluemodel.CIM.IEC61970.Informative.InfWork.Project#getParentProject
* @model opposite="ParentProject"
* @generated
*/ | Returns the value of the 'Sub Projects' reference list. The list contents are of type <code>gluemodel.CIM.IEC61970.Informative.InfWork.Project</code>. It is bidirectional and its opposite is '<code>gluemodel.CIM.IEC61970.Informative.InfWork.Project#getParentProject Parent Project</code>'. If the meaning of the 'Sub Projects' reference list isn't clear, there really should be more of a description here... | getSubProjects | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/CIM/IEC61970/Informative/InfWork/Project.java",
"license": "mit",
"size": 9198
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,777,183 |
EAttribute getRenameStatement_System(); | EAttribute getRenameStatement_System(); | /**
* Returns the meta object for the attribute '{@link org.smeup.sys.db.syntax.ddl.QRenameStatement#getSystem <em>System</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>System</em>'.
* @see org.smeup.sys.db.syntax.ddl.QRenameStatement#getSystem()
* @see #getRenameStatement()
* @generated
*/ | Returns the meta object for the attribute '<code>org.smeup.sys.db.syntax.ddl.QRenameStatement#getSystem System</code>'. | getRenameStatement_System | {
"repo_name": "smeup/asup",
"path": "org.smeup.sys.db.syntax/src/org/smeup/sys/db/syntax/ddl/QDatabaseSyntaxDDLPackage.java",
"license": "epl-1.0",
"size": 58069
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 183,540 |
HashSet<HandForm> forms = new HashSet<HandForm>();
Hashtable<Long,HashSet<HandForm>> pos = new Hashtable<Long,HashSet<HandForm>>();
genNonBarred(forms);
genBarred(forms);
for (HandForm form : forms){
HashSet<Long> ns = form.calcNums();
for (long num : ns){
if (pos.get(num) == null){
pos.put(num,new HashSet<HandForm>(1,.90f));
}
pos.get(num).add(new HandForm(form));
}
}
return pos;
}
| HashSet<HandForm> forms = new HashSet<HandForm>(); Hashtable<Long,HashSet<HandForm>> pos = new Hashtable<Long,HashSet<HandForm>>(); genNonBarred(forms); genBarred(forms); for (HandForm form : forms){ HashSet<Long> ns = form.calcNums(); for (long num : ns){ if (pos.get(num) == null){ pos.put(num,new HashSet<HandForm>(1,.90f)); } pos.get(num).add(new HandForm(form)); } } return pos; } | /**
* Get at the hand forms possible on the guitar
* @return
*/ | Get at the hand forms possible on the guitar | getForms | {
"repo_name": "twschiller/optimal-guitar",
"path": "real-guitar/src/model/GuitarModel.java",
"license": "gpl-2.0",
"size": 5692
} | [
"java.util.HashSet",
"java.util.Hashtable"
] | import java.util.HashSet; import java.util.Hashtable; | import java.util.*; | [
"java.util"
] | java.util; | 1,399,821 |
@SuppressWarnings("unchecked")
public <E extends MvcEndpoint> Set<E> getEndpoints(Class<E> type) {
Set<E> result = new HashSet<E>(this.endpoints.size());
for (MvcEndpoint candidate : this.endpoints) {
if (type.isInstance(candidate)) {
result.add((E) candidate);
}
}
return Collections.unmodifiableSet(result);
} | @SuppressWarnings(STR) <E extends MvcEndpoint> Set<E> function(Class<E> type) { Set<E> result = new HashSet<E>(this.endpoints.size()); for (MvcEndpoint candidate : this.endpoints) { if (type.isInstance(candidate)) { result.add((E) candidate); } } return Collections.unmodifiableSet(result); } | /**
* Return the endpoints of the specified type.
* @param <E> the Class type of the endpoints to be returned
* @param type the endpoint type
* @return the endpoints
*/ | Return the endpoints of the specified type | getEndpoints | {
"repo_name": "jbovet/spring-boot",
"path": "spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/MvcEndpoints.java",
"license": "apache-2.0",
"size": 4177
} | [
"java.util.Collections",
"java.util.HashSet",
"java.util.Set"
] | import java.util.Collections; import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,324,540 |
T visitModifier(@NotNull JavaParser.ModifierContext ctx); | T visitModifier(@NotNull JavaParser.ModifierContext ctx); | /**
* Visit a parse tree produced by {@link JavaParser#modifier}.
* @param ctx the parse tree
* @return the visitor result
*/ | Visit a parse tree produced by <code>JavaParser#modifier</code> | visitModifier | {
"repo_name": "hgkmail/HelloJava",
"path": "src/cn/hgk/hellojava/JavaVisitor.java",
"license": "gpl-2.0",
"size": 22753
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 2,380,661 |
static <T1, T2, U1, U2> Tuple2<Seq<U1>, Seq<U2>> unzip(Seq<Tuple2<T1, T2>> stream, BiFunction<T1, T2, Tuple2<U1, U2>> unzipper) {
return stream
.map(t -> unzipper.apply(t.v1, t.v2))
.duplicate()
.map1(s -> s.map(u -> u.v1))
.map2(s -> s.map(u -> u.v2));
}
// [jooq-tools] START [zip-static] | static <T1, T2, U1, U2> Tuple2<Seq<U1>, Seq<U2>> unzip(Seq<Tuple2<T1, T2>> stream, BiFunction<T1, T2, Tuple2<U1, U2>> unzipper) { return stream .map(t -> unzipper.apply(t.v1, t.v2)) .duplicate() .map1(s -> s.map(u -> u.v1)) .map2(s -> s.map(u -> u.v2)); } | /**
* Unzip one Stream into two.
* <p>
* <code><pre>
* // tuple((1, 2, 3), (a, b, c))
* Seq.unzip(Seq.of(tuple(1, "a"), tuple(2, "b"), tuple(3, "c")));
* </pre></code>
*/ | Unzip one Stream into two. <code><code> tuple((1, 2, 3), (a, b, c)) Seq.unzip(Seq.of(tuple(1, "a"), tuple(2, "b"), tuple(3, "c"))); </code></code> | unzip | {
"repo_name": "stephenh/jOOL",
"path": "src/main/java/org/jooq/lambda/Seq.java",
"license": "apache-2.0",
"size": 198501
} | [
"java.util.function.BiFunction",
"org.jooq.lambda.tuple.Tuple2"
] | import java.util.function.BiFunction; import org.jooq.lambda.tuple.Tuple2; | import java.util.function.*; import org.jooq.lambda.tuple.*; | [
"java.util",
"org.jooq.lambda"
] | java.util; org.jooq.lambda; | 424,160 |
public void testLdapNameString013() throws Exception {
new LdapName("a=<");
new LdapName("a=<a");
new LdapName("a=a<");
new LdapName("a=a<b");
new LdapName("a=a<b<");
new LdapName("a=>");
new LdapName("a=>a");
new LdapName("a=a>");
new LdapName("a=a>b");
new LdapName("a=a>b>");
} | void function() throws Exception { new LdapName("a=<"); new LdapName("a=<a"); new LdapName("a=a<"); new LdapName("a=a<b"); new LdapName(STR); new LdapName("a=>"); new LdapName("a=>a"); new LdapName("a=a>"); new LdapName("a=a>b"); new LdapName(STR); } | /**
* <p>
* Test method for 'javax.naming.ldap.LdapName(String)'
* </p>
* <p>
* Here we are testing the constructor, this method should accept a String
* with the correct format like "a=b", In this case we are testing the
* special characters "<" and ">".
* </p>
* <p>
* The expected result is an instance of ldapname.
* </p>
*/ | Test method for 'javax.naming.ldap.LdapName(String)' Here we are testing the constructor, this method should accept a String with the correct format like "a=b", In this case we are testing the special characters "". The expected result is an instance of ldapname. | testLdapNameString013 | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/java/classlib/modules/jndi/src/test/java/org/apache/harmony/jndi/tests/javax/naming/ldap/LdapNameTest.java",
"license": "apache-2.0",
"size": 119091
} | [
"javax.naming.ldap.LdapName"
] | import javax.naming.ldap.LdapName; | import javax.naming.ldap.*; | [
"javax.naming"
] | javax.naming; | 176,833 |
public static void main(java.lang.String[] args) throws Exception {
final String[] mainArgs = { "org.jasig.portal.groups.filesystem.FileSystemGroupsTest" };
print("START TESTING FILESYSTEM GROUP STORE" + CR);
TestRunner.main(mainArgs);
print(CR + "END TESTING FILESYSTEM GROUP STORE");
} | static void function(java.lang.String[] args) throws Exception { final String[] mainArgs = { STR }; print(STR + CR); TestRunner.main(mainArgs); print(CR + STR); } | /**
* Starts the application.
* @param args an array of command-line arguments
*/ | Starts the application | main | {
"repo_name": "Jasig/SSP-Platform",
"path": "uportal-war/src/test/java/org/jasig/portal/groups/filesystem/FileSystemGroupsTest.java",
"license": "apache-2.0",
"size": 26741
} | [
"junit.textui.TestRunner"
] | import junit.textui.TestRunner; | import junit.textui.*; | [
"junit.textui"
] | junit.textui; | 814,442 |
private Card itemSelected(String selected_word)
{
String method = "itemSelected()";
Integer word_pos = word_position.get(selected_word);
Log.i(DEBUG_TAG, "word pos "+word_pos.toString()+" added "+selected_word+" to selected_words");
//FINISHED_WORDS[selected] = UtilityTo.SET;
//list_view = getListView();
//ArrayAdapter<?> adapter = (ArrayAdapter<?>) list_view.getAdapter();
//adapter.notifyDataSetChanged();
Card new_card = position_cards.get(word_pos);
//Log.i(DEBUG_TAG, method+"word pos "+word_pos.toString()+" added "+selected_word+" got card "+UtilityTo.getWord(new_card));
long new_card_id = UtilityTo.getNewID();
new_card.setCardId(new_card_id+"");
dumpCard(new_card);
return new_card;
} | Card function(String selected_word) { String method = STR; Integer word_pos = word_position.get(selected_word); Log.i(DEBUG_TAG, STR+word_pos.toString()+STR+selected_word+STR); Card new_card = position_cards.get(word_pos); long new_card_id = UtilityTo.getNewID(); new_card.setCardId(new_card_id+""); dumpCard(new_card); return new_card; } | /**
* Get the info about the card from word_position hash which has the word as the key.
* Then update the list to highlight that item. Create an id for the card.
* Put all the info about that word in a Card object and return that.
* @param selected_word
* @return
*/ | Get the info about the card from word_position hash which has the word as the key. Then update the list to highlight that item. Create an id for the card. Put all the info about that word in a Card object and return that | itemSelected | {
"repo_name": "timofeysie/wherewithal",
"path": "src/com/curchod/wherewithal/CardPlayerWordsActivity.java",
"license": "gpl-3.0",
"size": 87365
} | [
"android.util.Log",
"com.curchod.domartin.UtilityTo",
"com.curchod.dto.Card"
] | import android.util.Log; import com.curchod.domartin.UtilityTo; import com.curchod.dto.Card; | import android.util.*; import com.curchod.domartin.*; import com.curchod.dto.*; | [
"android.util",
"com.curchod.domartin",
"com.curchod.dto"
] | android.util; com.curchod.domartin; com.curchod.dto; | 1,055,903 |
@Test
public void testWalTotalSizeWithArchiveTurnedOff() throws Exception {
IgniteEx n = startGrid(
0,
(Consumer<IgniteConfiguration>)cfg -> cfg.getDataStorageConfiguration()
.setWalArchivePath(cfg.getDataStorageConfiguration().getWalPath()).setWalSegmentSize((int)(2 * U.MB))
);
n.cluster().state(ACTIVE);
populateCache(n);
disableWal(n, true);
checkWalArchiveAndTotalSize(n, false);
} | void function() throws Exception { IgniteEx n = startGrid( 0, (Consumer<IgniteConfiguration>)cfg -> cfg.getDataStorageConfiguration() .setWalArchivePath(cfg.getDataStorageConfiguration().getWalPath()).setWalSegmentSize((int)(2 * U.MB)) ); n.cluster().state(ACTIVE); populateCache(n); disableWal(n, true); checkWalArchiveAndTotalSize(n, false); } | /**
* Check whether Wal is reporting correct usage when WAL Archive is turned off.
*
* @throws Exception If failed.
*/ | Check whether Wal is reporting correct usage when WAL Archive is turned off | testWalTotalSizeWithArchiveTurnedOff | {
"repo_name": "apache/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/IgniteDataStorageMetricsSelfTest.java",
"license": "apache-2.0",
"size": 24002
} | [
"java.util.function.Consumer",
"org.apache.ignite.configuration.IgniteConfiguration",
"org.apache.ignite.internal.IgniteEx"
] | import java.util.function.Consumer; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; | import java.util.function.*; import org.apache.ignite.configuration.*; import org.apache.ignite.internal.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 899,503 |
private void addSubgroup()
{
TreeItem parent = currentLeaf;
// create a new cluster node
String dependentStyleName = GlimmpseConstants.STYLE_ODD;
if (itemCount % 2 == 0) {
dependentStyleName = GlimmpseConstants.STYLE_EVEN;
}
ClusteringPanelSubPanel subpanel =
new ClusteringPanelSubPanel(dependentStyleName,
itemCount, this);
// create a new tree item to hold the cluster node
TreeItem newLeaf = new TreeItem(subpanel);
// add the new subpanel to the clustering tree
if (currentLeaf != null) {
currentLeaf.addItem(newLeaf);
currentLeaf.setState(true);
} else {
clusteringTree.addItem(newLeaf);
newLeaf.setState(true);
}
// set the new leaf as the lowest node in the tree
currentLeaf = newLeaf;
// update the item count
itemCount++;
// update the visible buttons
updateButtons();
}
| void function() { TreeItem parent = currentLeaf; String dependentStyleName = GlimmpseConstants.STYLE_ODD; if (itemCount % 2 == 0) { dependentStyleName = GlimmpseConstants.STYLE_EVEN; } ClusteringPanelSubPanel subpanel = new ClusteringPanelSubPanel(dependentStyleName, itemCount, this); TreeItem newLeaf = new TreeItem(subpanel); if (currentLeaf != null) { currentLeaf.addItem(newLeaf); currentLeaf.setState(true); } else { clusteringTree.addItem(newLeaf); newLeaf.setState(true); } currentLeaf = newLeaf; itemCount++; updateButtons(); } | /**
* Add a Clustering Panel Sub Panel class to the tree.
*/ | Add a Clustering Panel Sub Panel class to the tree | addSubgroup | {
"repo_name": "SampleSizeShop/GlimmpseWeb",
"path": "src/edu/ucdenver/bios/glimmpseweb/client/guided/ClusteringPanel.java",
"license": "gpl-2.0",
"size": 12198
} | [
"com.google.gwt.user.client.ui.TreeItem",
"edu.ucdenver.bios.glimmpseweb.client.GlimmpseConstants"
] | import com.google.gwt.user.client.ui.TreeItem; import edu.ucdenver.bios.glimmpseweb.client.GlimmpseConstants; | import com.google.gwt.user.client.ui.*; import edu.ucdenver.bios.glimmpseweb.client.*; | [
"com.google.gwt",
"edu.ucdenver.bios"
] | com.google.gwt; edu.ucdenver.bios; | 2,066,099 |
private static void setStaticUnknownConcept(Concept currentUnknownConcept) {
ConceptServiceImpl.unknownConcept = currentUnknownConcept;
}
| static void function(Concept currentUnknownConcept) { ConceptServiceImpl.unknownConcept = currentUnknownConcept; } | /**
* Sets unknownConcept using static method
*
* @param currentUnknownConcept
*/ | Sets unknownConcept using static method | setStaticUnknownConcept | {
"repo_name": "MitchellBot/openmrs-core",
"path": "api/src/main/java/org/openmrs/api/impl/ConceptServiceImpl.java",
"license": "mpl-2.0",
"size": 60522
} | [
"org.openmrs.Concept"
] | import org.openmrs.Concept; | import org.openmrs.*; | [
"org.openmrs"
] | org.openmrs; | 1,319,245 |
@Test
public final void testBothEqualIsAllowed() {
for (final MustBeBiggerIntegerTestBean testBean : MustBeBiggerIntegerTestCases
.getCorrectTestBeans()) {
super.validationTest(testBean, true, null);
}
} | final void function() { for (final MustBeBiggerIntegerTestBean testBean : MustBeBiggerIntegerTestCases .getCorrectTestBeans()) { super.validationTest(testBean, true, null); } } | /**
* both entries are equal, allowed.
*/ | both entries are equal, allowed | testBothEqualIsAllowed | {
"repo_name": "ManfredTremmel/mt-bean-validators",
"path": "src/test/java/de/knightsoftnet/validators/server/MustBeBiggerIntegerTest.java",
"license": "apache-2.0",
"size": 2127
} | [
"de.knightsoftnet.validators.shared.beans.MustBeBiggerIntegerTestBean",
"de.knightsoftnet.validators.shared.testcases.MustBeBiggerIntegerTestCases"
] | import de.knightsoftnet.validators.shared.beans.MustBeBiggerIntegerTestBean; import de.knightsoftnet.validators.shared.testcases.MustBeBiggerIntegerTestCases; | import de.knightsoftnet.validators.shared.beans.*; import de.knightsoftnet.validators.shared.testcases.*; | [
"de.knightsoftnet.validators"
] | de.knightsoftnet.validators; | 636,642 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<ApplicationGatewayInner>> getByResourceGroupWithResponseAsync(
String resourceGroupName, String applicationGatewayName) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono
.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2018-11-01";
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.getByResourceGroup(
this.client.getEndpoint(),
resourceGroupName,
applicationGatewayName,
apiVersion,
this.client.getSubscriptionId(),
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<ApplicationGatewayInner>> function( String resourceGroupName, String applicationGatewayName) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (applicationGatewayName == null) { return Mono .error( new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String apiVersion = STR; final String accept = STR; return FluxUtil .withContext( context -> service .getByResourceGroup( this.client.getEndpoint(), resourceGroupName, applicationGatewayName, apiVersion, this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } | /**
* Gets the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 specified application gateway.
*/ | Gets the specified application gateway | getByResourceGroupWithResponseAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ApplicationGatewaysClientImpl.java",
"license": "mit",
"size": 166717
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.FluxUtil",
"com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.network.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 778,415 |
public static void addActionError( ServletRequest request, String propertyName, String messageKey )
{
InternalUtils.addActionError( propertyName, new ActionMessage( messageKey, null ), request );
} | static void function( ServletRequest request, String propertyName, String messageKey ) { InternalUtils.addActionError( propertyName, new ActionMessage( messageKey, null ), request ); } | /**
* Add a property-related message that will be shown with the Errors and Error tags.
*
* @param request the current ServletRequest.
* @param propertyName the name of the property with which to associate this error.
* @param messageKey the message-resources key for the message.
*/ | Add a property-related message that will be shown with the Errors and Error tags | addActionError | {
"repo_name": "moparisthebest/beehive",
"path": "beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowUtils.java",
"license": "apache-2.0",
"size": 80113
} | [
"javax.servlet.ServletRequest",
"org.apache.beehive.netui.pageflow.internal.InternalUtils",
"org.apache.struts.action.ActionMessage"
] | import javax.servlet.ServletRequest; import org.apache.beehive.netui.pageflow.internal.InternalUtils; import org.apache.struts.action.ActionMessage; | import javax.servlet.*; import org.apache.beehive.netui.pageflow.internal.*; import org.apache.struts.action.*; | [
"javax.servlet",
"org.apache.beehive",
"org.apache.struts"
] | javax.servlet; org.apache.beehive; org.apache.struts; | 1,122,145 |
// ===================== MINUTE function ===================== //
@Function("MINUTE")
@FunctionParameters({
@FunctionParameter("dateObject")})
public Integer MINUTE(Object dateObject){
return getCalendarFieldFromDate(dateObject,Calendar.MINUTE);
}
| @Function(STR) @FunctionParameters({ @FunctionParameter(STR)}) Integer function(Object dateObject){ return getCalendarFieldFromDate(dateObject,Calendar.MINUTE); } | /**
* Returns the minute (0-59) of the hour for a given date. Date object can be a String, long value (milliseconds) or Date instance itself.
*/ | Returns the minute (0-59) of the hour for a given date. Date object can be a String, long value (milliseconds) or Date instance itself | MINUTE | {
"repo_name": "aleatorio12/ProVentasConnector",
"path": "jasperreports-6.2.1-project/jasperreports-6.2.1/demo/samples/functions/src/net/sf/jasperreports/functions/standard/DateTimeFunctions.java",
"license": "gpl-3.0",
"size": 21272
} | [
"java.util.Calendar",
"net.sf.jasperreports.functions.annotations.Function",
"net.sf.jasperreports.functions.annotations.FunctionParameter",
"net.sf.jasperreports.functions.annotations.FunctionParameters"
] | import java.util.Calendar; import net.sf.jasperreports.functions.annotations.Function; import net.sf.jasperreports.functions.annotations.FunctionParameter; import net.sf.jasperreports.functions.annotations.FunctionParameters; | import java.util.*; import net.sf.jasperreports.functions.annotations.*; | [
"java.util",
"net.sf.jasperreports"
] | java.util; net.sf.jasperreports; | 2,648,020 |
public static boolean hasDigestMatch(final String username,
final String hashedPassword, final String rawPassword,
final String salt) {
final byte[] digest1 = getBytes(hashedPassword);
final byte[] digest2 = getBytes(generateHash(username, rawPassword,
salt));
return MessageDigest.isEqual(digest2, digest1);
}
| static boolean function(final String username, final String hashedPassword, final String rawPassword, final String salt) { final byte[] digest1 = getBytes(hashedPassword); final byte[] digest2 = getBytes(generateHash(username, rawPassword, salt)); return MessageDigest.isEqual(digest2, digest1); } | /**
* Determines if two passwords match for a specified login ID
*
* @param username
* the login ID
* @param hashedPassword
* the hashed password
* @param rawPassword
* the un-hashed password to compare to
* @param salt
* the salt
* @return true when the passwords match
*/ | Determines if two passwords match for a specified login ID | hasDigestMatch | {
"repo_name": "tectronics/ugate",
"path": "src/main/java/org/ugate/service/CredentialService.java",
"license": "apache-2.0",
"size": 11620
} | [
"java.security.MessageDigest"
] | import java.security.MessageDigest; | import java.security.*; | [
"java.security"
] | java.security; | 2,445,290 |
private void createControlPanel() {
JPanel motorsPanel = new JPanel();
motorsPanel.setLayout(new BoxLayout(motorsPanel, BoxLayout.Y_AXIS));
motorsPanel.add(createMotorsHeader());
for (int i = 0; i < 3; i++) {
motorsPanel.add(createMotorPanel(i));
}
JPanel buttonsPanel = new JPanel();
controlPanel.add(motorsPanel);
buttonsPanel.add(forwardButton);
buttonsPanel.add(backwardButton);
buttonsPanel.add(leftButton);
buttonsPanel.add(rightButton);
controlPanel.add(buttonsPanel); | void function() { JPanel motorsPanel = new JPanel(); motorsPanel.setLayout(new BoxLayout(motorsPanel, BoxLayout.Y_AXIS)); motorsPanel.add(createMotorsHeader()); for (int i = 0; i < 3; i++) { motorsPanel.add(createMotorPanel(i)); } JPanel buttonsPanel = new JPanel(); controlPanel.add(motorsPanel); buttonsPanel.add(forwardButton); buttonsPanel.add(backwardButton); buttonsPanel.add(leftButton); buttonsPanel.add(rightButton); controlPanel.add(buttonsPanel); | /**
* Create the control panel
*/ | Create the control panel | createControlPanel | {
"repo_name": "AndrewZurn/sju-compsci-archive",
"path": "CS200s/CS217b/OriginalFiles/lejos/pc/tools/NXJControl.java",
"license": "apache-2.0",
"size": 48387
} | [
"javax.swing.BoxLayout",
"javax.swing.JPanel"
] | import javax.swing.BoxLayout; import javax.swing.JPanel; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,694,377 |
if (VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setContext(IHEPackage.Literals.CONDITIONAL_DOSE);
try {
VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP);
}
catch (ParserException pe) {
throw new UnsupportedOperationException(pe.getLocalizedMessage());
}
}
if (!EOCL_ENV.createQuery(VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(conditionalDose)) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
IHEValidator.DIAGNOSTIC_SOURCE,
IHEValidator.CONDITIONAL_DOSE__CONDITIONAL_DOSE_TEMPLATE_ID,
IHEPlugin.INSTANCE.getString("ConditionalDoseTemplateId"),
new Object [] { conditionalDose }));
}
return false;
}
return true;
}
| if (VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setContext(IHEPackage.Literals.CONDITIONAL_DOSE); try { VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV = helper.createInvariant(VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP); } catch (ParserException pe) { throw new UnsupportedOperationException(pe.getLocalizedMessage()); } } if (!EOCL_ENV.createQuery(VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV).check(conditionalDose)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, IHEValidator.DIAGNOSTIC_SOURCE, IHEValidator.CONDITIONAL_DOSE__CONDITIONAL_DOSE_TEMPLATE_ID, IHEPlugin.INSTANCE.getString(STR), new Object [] { conditionalDose })); } return false; } return true; } | /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.10')
* @param conditionalDose The receiving '<em><b>Conditional Dose</b></em>' model object.
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The cache of context-specific information.
* <!-- end-model-doc -->
* @generated
*/ | self.templateId->exists(id : datatypes::II | id.root = '1.3.6.1.4.1.19376.1.5.3.1.4.10') | validateConditionalDoseTemplateId | {
"repo_name": "drbgfc/mdht",
"path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.ihe/src/org/openhealthtools/mdht/uml/cda/ihe/operations/ConditionalDoseOperations.java",
"license": "epl-1.0",
"size": 4226
} | [
"org.eclipse.emf.common.util.BasicDiagnostic",
"org.eclipse.emf.common.util.Diagnostic",
"org.eclipse.ocl.ParserException",
"org.openhealthtools.mdht.uml.cda.ihe.IHEPackage",
"org.openhealthtools.mdht.uml.cda.ihe.IHEPlugin",
"org.openhealthtools.mdht.uml.cda.ihe.util.IHEValidator"
] | import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.ocl.ParserException; import org.openhealthtools.mdht.uml.cda.ihe.IHEPackage; import org.openhealthtools.mdht.uml.cda.ihe.IHEPlugin; import org.openhealthtools.mdht.uml.cda.ihe.util.IHEValidator; | import org.eclipse.emf.common.util.*; import org.eclipse.ocl.*; import org.openhealthtools.mdht.uml.cda.ihe.*; import org.openhealthtools.mdht.uml.cda.ihe.util.*; | [
"org.eclipse.emf",
"org.eclipse.ocl",
"org.openhealthtools.mdht"
] | org.eclipse.emf; org.eclipse.ocl; org.openhealthtools.mdht; | 1,203,885 |
public void close() {
Lock writeLock = readWriteLock.writeLock();
writeLock.lock();
try {
if (!opened) {
throw new IllegalStateException("Cannot close a component context that is not opened");
}
opened = false;
if (getState() == ComponentState.ACTIVE) {
stopping(ComponentState.INACTIVE);
} else {
closeReferenceHelpers();
}
} finally {
writeLock.unlock();
}
} | void function() { Lock writeLock = readWriteLock.writeLock(); writeLock.lock(); try { if (!opened) { throw new IllegalStateException(STR); } opened = false; if (getState() == ComponentState.ACTIVE) { stopping(ComponentState.INACTIVE); } else { closeReferenceHelpers(); } } finally { writeLock.unlock(); } } | /**
* Closing the component context that stops the component instance as well if it is started.
*/ | Closing the component context that stops the component instance as well if it is started | close | {
"repo_name": "everit-org/ecm-component",
"path": "core/src/main/java/org/everit/osgi/ecm/component/ri/internal/ComponentContextImpl.java",
"license": "apache-2.0",
"size": 36004
} | [
"java.util.concurrent.locks.Lock",
"org.everit.osgi.ecm.component.resource.ComponentState"
] | import java.util.concurrent.locks.Lock; import org.everit.osgi.ecm.component.resource.ComponentState; | import java.util.concurrent.locks.*; import org.everit.osgi.ecm.component.resource.*; | [
"java.util",
"org.everit.osgi"
] | java.util; org.everit.osgi; | 2,163,193 |
private void init() {
Arrays.setAll(skills, skill -> skill == Skill.HITPOINTS ? new Skill(1154, 10, 10) : new Skill(0, 1, 1));
} | void function() { Arrays.setAll(skills, skill -> skill == Skill.HITPOINTS ? new Skill(1154, 10, 10) : new Skill(0, 1, 1)); } | /**
* Initializes the skill set.
*/ | Initializes the skill set | init | {
"repo_name": "atomicint/aj8",
"path": "server/src/main/java/org/apollo/game/model/skill/SkillSet.java",
"license": "isc",
"size": 7609
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 1,472,010 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.