buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public net.minecraft.item.ItemStack extractItem(int slot, int amount, boolean simulate) {
int index = getIndexForSlot(slot);
net.minecraftforge.items.IItemHandlerModifiable handler = getHandlerFromIndex(index);
slot = getSlotFromIndex(index);
return handler.extractItem(slot, amount, simulate);
} | public net.minecraft.item.ItemStack extractItem(int slot, int amount, boolean simulate) {
int index = getIndexForSlot(slot);
net.minecraftforge.items.IItemHandlerModifiable handler = getHandlerFromIndex(index);
slot = getSlotFromIndex(slot, index);
return handler.extractItem(slot, amount, simulate);
} |
private void readQueryData(java.lang.String queryFilePath) {
queries = new java.util.ArrayList<java.lang.String>();
try (java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(queryFilePath))) {
java.lang.String line = reader.readLine();
while ((line != null) && (line ... | private void readQueryData(java.lang.String queryFilePath) {
queries = new java.util.ArrayList<java.lang.String>();
try (java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(queryFilePath))) {
java.lang.String line = reader.readLine();
while ((line != null) && (line ... |
public void showPayloadDeletedAndUpdatePayloads(java.util.List<com.mifos.objects.client.ClientPayload> clients) {
mClientSyncIndex = 0;
clientPayloads.clear();
this.clientPayloads = clients;
mSyncPayloadsAdapter.notifyDataSetChanged();
if ((clientPayloads.size()) != 0) {
mSyncPayloadsPresent... | public void showPayloadDeletedAndUpdatePayloads(java.util.List<com.mifos.objects.client.ClientPayload> clients) {
mClientSyncIndex = 0;
clientPayloads.clear();
this.clientPayloads = clients;
mSyncPayloadsAdapter.notifyDataSetChanged();
if ((clientPayloads.size()) != 0) {
syncClientPayload();... |
private void Send_BtnActionPerformed(java.awt.event.ActionEvent evt) {
try {
java.lang.String Message = Message_Field.getText();
java.lang.String Destination = Keterangan_Label.getText();
java.lang.String OutputString = ((("<USER>-" + Destination) + "-") + Message) + "\r\n";
SendMess... | private void Send_BtnActionPerformed(java.awt.event.ActionEvent evt) {
try {
java.lang.String Message = Message_Field.getText();
java.lang.String Destination = Keterangan_Label.getText();
java.lang.String OutputString = ((("<USER>-" + Destination) + "-") + Message) + "\r\n";
java.lan... |
public java.lang.String addLesson(@org.springframework.web.bind.annotation.ModelAttribute(value = "lessonDTO")
com.inva.hipstertest.service.dto.LessonDTO lessonDTO) {
if ((((lessonDTO.getName()) != null) && (!(lessonDTO.getName().isEmpty()))) && ((lessonDTO.getEnabled()) != null)) {
lessonService.save(lesso... | public java.lang.String addLesson(@org.springframework.web.bind.annotation.ModelAttribute(value = "lessonDTO")
com.inva.hipstertest.service.dto.LessonDTO lessonDTO) {
if ((((lessonDTO.getName()) != null) && (!(lessonDTO.getName().isEmpty()))) && ((lessonDTO.getEnabled()) != null)) {
lessonService.save(lesso... |
protected void checkForPermissions() {
try {
if ((Build.VERSION.SDK_INT) >= (Build.VERSION_CODES.M)) {
if (((checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) != (android.content.pm.PackageManager.PERMISSION_GRANTED)) && ((checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STOR... | protected void checkForPermissions() {
try {
if ((Build.VERSION.SDK_INT) >= (Build.VERSION_CODES.M)) {
if (((checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE)) != (android.content.pm.PackageManager.PERMISSION_GRANTED)) || ((checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STOR... |
private static void renderText(final java.awt.Graphics g, final java.lang.String text, final int i) {
g.setColor(new java.awt.Color(16777215));
final java.awt.FontMetrics metrics = g.getFontMetrics();
int w = metrics.stringWidth(text);
int h = metrics.getHeight();
g.drawString(text, (698 - w), (698 ... | private static void renderText(final java.awt.Graphics g, final java.lang.String text, final int i) {
final java.awt.FontMetrics metrics = g.getFontMetrics();
int w = metrics.stringWidth(text);
int h = metrics.getHeight();
g.drawString(text, (698 - w), (698 - (h * i)));
} |
public static final java.lang.String getPath(java.lang.String uriStr) {
java.net.URI uri = null;
try {
uri = new java.net.URI(uriStr);
} catch (java.net.URISyntaxException e) {
com.xiaoleilu.hutool.Log.error("", e);
return null;
}
return uri.getPath();
} | public static final java.lang.String getPath(java.lang.String uriStr) {
java.net.URI uri = null;
try {
uri = new java.net.URI(uriStr);
} catch (java.net.URISyntaxException e) {
com.xiaoleilu.hutool.Log.error("", e);
}
return uri == null ? null : uri.getPath();
} |
public void getTitleAndIcon(com.android.launcher3.AppInfo application, com.android.launcher3.compat.LauncherActivityInfoCompat info, java.util.HashMap<java.lang.Object, java.lang.CharSequence> labelCache) {
synchronized(mCache) {
com.android.launcher3.IconCache.CacheEntry entry = cacheLocked(application.com... | public synchronized void getTitleAndIcon(com.android.launcher3.AppInfo application, com.android.launcher3.compat.LauncherActivityInfoCompat info, java.util.HashMap<java.lang.Object, java.lang.CharSequence> labelCache) {
com.android.launcher3.IconCache.CacheEntry entry = cacheLocked(application.componentName, info, ... |
public void actionPerformed(java.awt.event.ActionEvent e) {
javax.swing.JButton source = ((javax.swing.JButton) (e.getSource()));
for (int i = 0; i < (view.GameBoard.MAX_TILES); i++) {
if (source == (view.GameBoard.tiles.get(i))) {
view.GameBoard.displayMove(i);
controller.GameMa... | public void actionPerformed(java.awt.event.ActionEvent e) {
javax.swing.JButton source = ((javax.swing.JButton) (e.getSource()));
for (int i = 0; i < (view.GameBoard.MAX_TILES); i++) {
if (source == (view.GameBoard.tiles.get(i))) {
controller.GameManager.selectedMove = i;
control... |
public double[] centre() {
if (!(isValid())) {
return null;
}
double[] center = new double[min.length];
for (int i = 0; i < (min.length); i++) {
center[i] = ((min[i]) + (max[i])) / 2.0;
}
return center;
} | public double[] centre() {
if (!(isValid())) {
return null;
}
double[] center = new double[min.length];
for (int i = 0; i < (min.length); i++) {
center[i] = centre(i);
}
return center;
} |
void setAlias(android.bluetooth.BluetoothDevice device, java.lang.String mAlias) {
synchronized(mObject) {
this.mAlias = mAlias;
com.android.bluetooth.btservice.RemoteDevices.mAdapterService.setDevicePropertyNative(mAddress, AbstractionLayer.BT_PROPERTY_REMOTE_FRIENDLY_NAME, mAlias.getBytes());
... | void setAlias(android.bluetooth.BluetoothDevice device, java.lang.String mAlias) {
synchronized(mObject) {
this.mAlias = mAlias;
if (mAlias == null)
return ;
com.android.bluetooth.btservice.RemoteDevices.mAdapterService.setDevicePropertyNative(mAddress, AbstractionLayer.... |
private byte[] putColumnFamilySchemaEntity(byte[] tableForeignKey, org.apache.hadoop.hbase.HColumnDescriptor hcd, org.apache.hadoop.hbase.TableName tableName) throws java.io.IOException {
java.util.Map<byte[], byte[]> entityAttributeMap = buildEntityAttributeMap(hcd.getValues(), hcd.getConfiguration());
return ... | private byte[] putColumnFamilySchemaEntity(byte[] tableForeignKey, org.apache.hadoop.hbase.HColumnDescriptor hcd, org.apache.hadoop.hbase.TableName tableName) throws java.io.IOException {
java.util.Map<byte[], byte[]> entityAttributeMap = buildEntityAttributeMap(hcd.getValues(), hcd.getConfiguration());
return ... |
public void tick(uk.co.nickthecoder.itchy.Actor actor) {
this.sop.tick(actor);
if (this.sop.isFinished()) {
if ((this.loops) > 0) {
(this.loopsRemaining)--;
}
if ((this.loopsRemaining) > 0) {
this.sop.start(actor);
}
}
super.tick(actor);
} | public void tick(uk.co.nickthecoder.itchy.Actor actor) {
this.sop.tick(actor);
if (this.sop.isFinished()) {
if ((this.loops) > 0) {
(this.loopsRemaining)--;
}
if (((this.loopsRemaining) > 0) || ((this.loops) == 0)) {
this.sop.start(actor);
}
}
supe... |
public void moveToPosition(double position) throws java.io.IOException {
double currentPosition = getPosition();
if (currentPosition > position) {
logger.debug("Moving jalousie up from {} to {}", currentPosition, position);
targetPosition = position;
fullUp();
}else
if (curre... | public void moveToPosition(double position) throws java.io.IOException {
double currentPosition = getPosition();
if ((currentPosition >= 0) && (currentPosition <= 1)) {
if (currentPosition > position) {
logger.debug("Moving jalousie up from {} to {}", currentPosition, position);
... |
public void SetBackgroundResizable(android.view.View tv) {
android.graphics.drawable.BitmapDrawable background = ((android.graphics.drawable.BitmapDrawable) (tv.getBackground()));
android.graphics.drawable.BitmapDrawable newBackground = new android.graphics.drawable.BitmapDrawable(background.getBitmap()) {
... | private void SetBackgroundResizable(android.view.View tv) {
android.graphics.drawable.BitmapDrawable background = ((android.graphics.drawable.BitmapDrawable) (tv.getBackground()));
android.graphics.drawable.BitmapDrawable newBackground = new android.graphics.drawable.BitmapDrawable(background.getBitmap()) {
... |
public void test() throws java.lang.Exception {
infoportalinterface.InfoPortalInterface ip = TestInfoPortalInterfaceFactory.getInfoPortalInterface();
java.lang.String mainPage = ip.login();
ip.fetchLehrkraefte(mainPage);
java.lang.System.out.println(ip.getLehrkraefte());
ip.fetchKlassen(mainPage, ip... | public void test() throws java.lang.Exception {
infoportalinterface.InfoPortalInterface ip = TestInfoPortalInterfaceFactory.getInfoPortalInterface();
ip.login();
ip.fetchLehrkraefte();
java.lang.System.out.println(ip.getLehrkraefte());
ip.fetchKlassen(ip.getLehrkraefte());
ip.fetchNoten();
j... |
private org.bukkit.inventory.ItemStack[] getArmor(org.bukkit.entity.Player player) {
org.bukkit.inventory.ItemStack shirt = new org.bukkit.inventory.ItemStack(org.bukkit.Material.LEATHER_CHESTPLATE);
org.bukkit.inventory.meta.LeatherArmorMeta meta = ((org.bukkit.inventory.meta.LeatherArmorMeta) (shirt.getItemMe... | private org.bukkit.inventory.ItemStack[] getArmor(org.bukkit.entity.Player player) {
org.bukkit.inventory.ItemStack shirt = new org.bukkit.inventory.ItemStack(org.bukkit.Material.LEATHER_CHESTPLATE);
org.bukkit.inventory.meta.LeatherArmorMeta meta = ((org.bukkit.inventory.meta.LeatherArmorMeta) (shirt.getItemMe... |
public int getIndexOfObject(jumpingalien.model.Characters object) throws java.lang.IllegalArgumentException {
if (!(hasAsObject(object)))
throw new java.lang.IllegalArgumentException();
int nbObjectsSoFar = 0;
int index = 0;
jumpingalien.model.Characters currentObject = objects.get(index);
... | public int getIndexOfObject(jumpingalien.model.Characters object) throws java.lang.IllegalArgumentException {
if (!(hasAsObject(object)))
throw new java.lang.IllegalArgumentException();
int nbObjectsSoFar = 0;
int index = 0;
jumpingalien.model.Characters currentObject = null;
while (cur... |
public java.util.List<graph.Graph> getSCCs() {
java.util.Stack<java.lang.Integer> vertices = getVertices();
java.util.Stack<java.lang.Integer> finished = graph.DepthFirstSearch.DepthFirstSearch(this, vertices);
graph.CapGraph transposeGraph = getTransposeGraph(this);
return findSCC(transposeGraph, verti... | public java.util.List<graph.Graph> getSCCs() {
java.util.Stack<java.lang.Integer> vertices = getVertices();
java.util.Stack<java.lang.Integer> finished = graph.DepthFirstSearch.DepthFirstSearch(this, vertices);
graph.CapGraph transposeGraph = getTransposeGraph();
return findSCC(transposeGraph, finished)... |
private void moveUpTaskInGlobalTodoItems(jp.gr.java_conf.shioyang.polyhedraltodolist.PolyTodoItem item) {
int index = globalTodoItems.indexOf(item);
if (index >= 0) {
return ;
}
jp.gr.java_conf.shioyang.polyhedraltodolist.PolyTodoItem target = globalTodoItems.get((index - 1));
globalTodoItem... | private void moveUpTaskInGlobalTodoItems(jp.gr.java_conf.shioyang.polyhedraltodolist.PolyTodoItem item) {
int index = globalTodoItems.indexOf(item);
if (index <= 0) {
return ;
}
jp.gr.java_conf.shioyang.polyhedraltodolist.PolyTodoItem target = globalTodoItems.get((index - 1));
globalTodoItem... |
public void test2() throws java.lang.Exception {
final java.lang.String PERSONS_QUERY = "persons";
session.registerQuery(PERSONS_QUERY, "MATCH (a:Person) RETURN a");
final neo4j.driver.reactive.data.RecordChangeSet changeSet1 = session.getDeltas(PERSONS_QUERY);
runUpdate(session, PERSONS_QUERY, "CREATE ... | public void test2() throws java.lang.Exception {
final java.lang.String PERSONS_QUERY = "persons";
session.registerQuery(PERSONS_QUERY, "MATCH (a:Person) RETURN a");
runUpdate(session, "CREATE (a:Person {name: $name})", org.neo4j.driver.v1.Values.parameters("name", "Alice"));
runUpdate(session, "CREATE ... |
if (!(isGuji()))
return 0;
int gujiLeftBanWidth = ((getTextAreaHeight()) - (getGujiBanxinWidth())) / 2;
int gujiLineNum = gujiLeftBanWidth / (getGujiBanxinWidth());
return gujiLineNum == 0 ? gujiLeftBanWidth : gujiLeftBanWidth / gujiLineNum;
} | if (!(isGuji()))
return 0;
int gujiLeftBanWidth = (getTextAreaHeight()) / 2;
int gujiLineNum = gujiLeftBanWidth / (getGujiBanxinWidth());
return gujiLineNum == 0 ? gujiLeftBanWidth : gujiLeftBanWidth / gujiLineNum;
} |
private boolean isExpire(com.joenee.common.model.User user) {
java.util.List<com.joenee.common.model.Product> list = productService.selectList(null);
boolean isExpire = true;
for (com.joenee.common.model.Product product : list) {
if (customService.queryProductIsExpire(product.getId(), user.getId()))... | private boolean isExpire(com.joenee.common.model.User user) {
java.util.List<com.joenee.common.model.Product> list = productService.selectList(null);
boolean isExpire = false;
for (com.joenee.common.model.Product product : list) {
if (!(customService.queryProductIsExpire(product.getId(), user.getId(... |
public void printField() {
for (int i = 0; i < (field.length); i++) {
for (int j = 0; j < (field[i].length); j++) {
java.lang.System.out.print((("[" + (field[i][j])) + "]"));
}
java.lang.System.out.println("\n");
}
} | public void printField() {
for (int i = 0; i < (field.length); i++) {
for (int j = 0; j < (field[i].length); j++) {
java.lang.System.out.print((("[" + (field[i][j])) + "]"));
}
java.lang.System.out.println("\n");
}
java.lang.System.out.println("\n");
} |
private java.lang.String calc(java.lang.String input) {
edu.gatech.oad.antlab.person.Stringbuilder str = new edu.gatech.oad.antlab.person.Stringbuilder(input);
str.append(input.substring(0, 2));
str.deleteCharAt(0);
str.deleteCharAt(0);
return str.toString();
} | private java.lang.String calc(java.lang.String input) {
java.lang.StringBuilder str = new java.lang.StringBuilder(input);
str.append(input.substring(0, 2));
str.deleteCharAt(0);
str.deleteCharAt(0);
return str.toString();
} |
private static void setupChestLoot() {
if ((mcjty.rftools.blocks.dimlets.DimletConfiguration.unknownDimletChestLootRarity) > 0) {
mcjty.rftools.items.dimlets.KnownDimletConfiguration.setupChestLoot(ChestGenHooks.DUNGEON_CHEST);
mcjty.rftools.items.dimlets.KnownDimletConfiguration.setupChestLoot(Ches... | public static void setupChestLoot() {
mcjty.rftools.items.dimlets.KnownDimletConfiguration.setupChestLoot(ChestGenHooks.DUNGEON_CHEST);
mcjty.rftools.items.dimlets.KnownDimletConfiguration.setupChestLoot(ChestGenHooks.MINESHAFT_CORRIDOR);
mcjty.rftools.items.dimlets.KnownDimletConfiguration.setupChestLoot(C... |
protected com.applitools.eyes.selenium.WebDriver open(com.applitools.eyes.selenium.WebDriver driver, java.lang.String appName, java.lang.String testName, com.applitools.eyes.selenium.RectangleSize viewportSize, com.applitools.eyes.selenium.SessionType sessionType) {
if (getIsDisabled()) {
logger.verbose("Ig... | protected com.applitools.eyes.selenium.WebDriver open(com.applitools.eyes.selenium.WebDriver driver, java.lang.String appName, java.lang.String testName, com.applitools.eyes.selenium.RectangleSize viewportSize, com.applitools.eyes.selenium.SessionType sessionType) {
if (getIsDisabled()) {
logger.verbose("Ig... |
private java.lang.String buildHtmlHeadMeta() {
final java.lang.StringBuilder html = new java.lang.StringBuilder();
html.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />").append(NewLine.CRLF);
html.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=").ap... | private java.lang.StringBuilder buildHtmlHeadMeta() {
final java.lang.StringBuilder html = new java.lang.StringBuilder();
html.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />").append(NewLine.CRLF);
html.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charse... |
public void traverseGraphClicked() {
int centreNodeID = java.lang.Integer.parseInt(getNodeTextField().getText());
drawer.changeZoom(((getEndColumn()) - (getStartColumn())), drawer.getColumnId(centreNodeID));
sequenceInfo.setText(("Sequence: " + (sequenceHashMap.get(centreNodeID))));
} | public void traverseGraphClicked() {
int centreNodeID = java.lang.Integer.parseInt(getNodeTextField().getText());
drawer.changeZoom(((getEndColumn()) - (getStartColumn())), drawer.getColumnId(centreNodeID));
sequenceInfo.setText(("Sequence: " + (sequenceHashMap.get(new java.lang.Long(centreNodeID)))));
} |
private java.lang.String getValueOf(java.lang.String field) {
java.sql.Statement stat = null;
java.lang.String sql = ("select value from properties where field = \"" + field) + "\"";
try {
stat = conn.createStatement();
java.sql.ResultSet rs = stat.executeQuery(sql);
if (rs.next()) {... | private java.lang.String getValueOf(java.lang.String field) {
java.sql.Statement stat = null;
java.lang.String sql = ("select value from properties where field = \"" + field) + "\"";
try {
stat = conn.createStatement();
java.sql.ResultSet rs = stat.executeQuery(sql);
if (rs.next()) {... |
public void onActivityResult(int requestCode, int resultCode, android.content.Intent resultData) {
if ((requestCode == (com.example.android.storeinventory.EditorActivity.PICK_IMAGE_REQUEST)) && (resultCode == (android.app.Activity.RESULT_OK))) {
if (resultData != null) {
android.net.Uri mImageUr... | public void onActivityResult(int requestCode, int resultCode, android.content.Intent resultData) {
if ((requestCode == (com.example.android.storeinventory.EditorActivity.PICK_IMAGE_REQUEST)) && (resultCode == (android.app.Activity.RESULT_OK))) {
if (resultData != null) {
mImageUri = resultData.g... |
org.ppsspp.ppsspp.Paint p;
p = new org.ppsspp.ppsspp.Paint(Paint.ANTI_ALIAS_FLAG);
org.ppsspp.ppsspp.Rect bound = new org.ppsspp.ppsspp.Rect();
p.setTextSize(textSize);
p.getTextBounds(string, 0, string.length(), bound);
int packedBounds = ((bound.width()) << 16) | (bound.height());
return p... | public static int measureText(java.lang.String string, float textSize) {
org.ppsspp.ppsspp.Paint p;
p = new org.ppsspp.ppsspp.Paint(Paint.ANTI_ALIAS_FLAG);
org.ppsspp.ppsspp.Rect bound = new org.ppsspp.ppsspp.Rect();
p.setTextSize(textSize);
p.getTextBounds(string, 0, string.length(), bound);
re... |
public static void main(java.lang.String[] args) throws java.lang.Exception {
java.lang.String serializedClassifier = "/home/1546/source/stanford-ner-2015-12-09/classifiers/english.all.3class.distsim.crf.ser.gz";
java.lang.String source_dir = args[0];
java.lang.String dest_dir = args[1];
File[] director... | public static void main(java.lang.String[] args) throws java.lang.Exception {
java.lang.String serializedClassifier = "/home/1546/source/stanford-ner-2015-12-09/classifiers/english.all.3class.distsim.crf.ser.gz";
java.lang.String source_dir = args[0];
java.lang.String dest_dir = args[1];
java.io.File[] ... |
private void restoreFromFuzzyCheckPoint(com.orientechnologies.orient.core.storage.impl.local.OFuzzyCheckpointStartRecord checkPointRecord) throws java.io.IOException {
com.orientechnologies.common.log.OLogManager.instance().info(this, "Data restore procedure from FUZZY checkpoint is started.");
com.orientechnol... | private boolean restoreFromFuzzyCheckPoint(com.orientechnologies.orient.core.storage.impl.local.OFuzzyCheckpointStartRecord checkPointRecord) throws java.io.IOException {
com.orientechnologies.common.log.OLogManager.instance().info(this, "Data restore procedure from FUZZY checkpoint is started.");
com.orientech... |
public void run() {
android.widget.TextView levelCount = ((android.widget.TextView) (findViewById(R.id.watch_level_count)));
android.widget.TextView pointCount = ((android.widget.TextView) (findViewById(R.id.watch_affinity_point)));
stopAnimation();
startIdleAnimation();
levelCount.setText(("" + (co... | public void run() {
android.widget.TextView levelCount = ((android.widget.TextView) (findViewById(R.id.watch_level_count)));
android.widget.TextView pointCount = ((android.widget.TextView) (findViewById(R.id.watch_affinity_point)));
levelCount.setText(("" + (com.orbital.thegame.spiffitnesspetsimulator.MainA... |
public boolean addPortCall(@org.springframework.web.bind.annotation.RequestBody
softproject.model.PortCall newPortCall) {
softproject.services.LocationRegistryService ls = new softproject.services.LocationRegistryService(softproject.services.PortCDMRequest.getClientInstance(), softproject.services.PortCDMRequest.ge... | public boolean addPortCall(@org.springframework.web.bind.annotation.RequestBody
softproject.model.PortCall newPortCall) {
softproject.services.LocationRegistryService ls = new softproject.services.LocationRegistryService(softproject.services.PortCDMRequest.getClientInstance(), softproject.services.PortCDMRequest.ge... |
public void click_b(android.view.View view) {
if ((count) == 1)
(count)++;
if ((answer) == 2) {
m_tv_check_b0.setVisibility(View.VISIBLE);
m_tv_check_b1.setVisibility(View.GONE);
m_radio_b.setBackgroundColor(Color.GREEN);
if ((count) == 1) {
(tw.edu.ncku.... | public void click_b(android.view.View view) {
(count)++;
if ((answer) == 2) {
m_tv_check_b0.setVisibility(View.VISIBLE);
m_tv_check_b1.setVisibility(View.GONE);
m_radio_b.setBackgroundColor(Color.GREEN);
if ((count) == 1) {
(tw.edu.ncku.igem.eduncku.QA.correct_questio... |
public void clear() {
java.util.Set<java.lang.Object> keySet = new java.util.HashSet<java.lang.Object>();
keySet.add(1);
keySet.add(2);
doReturn(keySet).when(limitedMap).keySet();
doNothing().when(indexHandler).clear();
cache.clear();
verify(limitedMap, times(2)).remove(any());
} | public void clear() {
limitedMap.put(1, new java.lang.Object());
limitedMap.put(2, new java.lang.Object());
doNothing().when(indexHandler).clear();
cache.clear();
verify(limitedMap, times(2)).remove(any());
verify(indexHandler).clear();
} |
public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
android.widget.TextView t = new android.widget.TextView(this.ctx);
t.setText(portfolio.stocks.get(position).mStockSymbol);
t.setGravity(Gravity.CENTER_HORIZONTAL);
t.setTextSize(24);
t.setE... | public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
android.widget.TextView t = new android.widget.TextView(this.ctx);
t.setText(portfolio.stocks.get(position).mStockSymbol.toUpperCase());
t.setGravity(Gravity.CENTER_HORIZONTAL);
t.setTextSize(2... |
public boolean bindAttach(com.redsteedstudios.logicalgame.node.Node attached) {
boolean retVal = false;
switch (this._node.getOwner()) {
case node_owner_static :
{
retVal = false;
}
break;
case node_owner_dynamic :
{
... | public boolean bindAttach(com.redsteedstudios.logicalgame.node.Node attached) {
boolean retVal = false;
switch (this._node.getOwner()) {
case node_owner_static :
{
retVal = false;
}
break;
case node_owner_dynamic :
{
... |
private void fillArray(int numInts, int largestInt) {
for (int loop = 0; loop < (myArray.length); loop++) {
myArray[loop] = ((int) (((java.lang.Math.random()) * largestInt) + 1));
}
} | private void fillArray(int numInts, int largestInt) {
for (int index = 0; index < (myArray.length); index++) {
myArray[index] = ((int) (((java.lang.Math.random()) * largestInt) + 1));
}
} |
public long getEntryCount(java.lang.String filter) {
if (isAdmin) {
return dao.getAllEntryCount(filter);
}
java.util.Set<org.jbei.ice.storage.model.Group> accountGroups = new java.util.HashSet(account.getGroups());
org.jbei.ice.lib.group.GroupController controller = new org.jbei.ice.lib.group.Gr... | public long getEntryCount(java.lang.String filter) {
if (isAdmin) {
return dao.getAllEntryCount(filter);
}
java.util.Set<org.jbei.ice.storage.model.Group> accountGroups = new java.util.HashSet(account.getGroups());
accountGroups.add(everybodyGroup);
return dao.visibleEntryCount(account, acco... |
public <T extends org.gradle.caching.configuration.BuildCache> T remote(java.lang.Class<T> type, org.gradle.api.Action<? super T> configuration) {
if ((remote) != null) {
org.gradle.caching.configuration.internal.DefaultBuildCacheConfiguration.LOGGER.debug("Replacing remote build cache type {} with {}", rem... | public <T extends org.gradle.caching.configuration.BuildCache> T remote(java.lang.Class<T> type, org.gradle.api.Action<? super T> configuration) {
if ((remote) != null) {
org.gradle.caching.configuration.internal.DefaultBuildCacheConfiguration.LOGGER.debug("Replacing remote build cache type {} with {}", rem... |
public javafx.scene.image.Image getImage(info.movito.themoviedbapi.model.Multi query) {
switch (query.getMediaType()) {
case MOVIE :
return getMovieImage(((info.movito.themoviedbapi.model.MovieDb) (query)));
case TV_SERIES :
return getSeriesImage(((info.movito.themoviedbapi.m... | public final javafx.scene.image.Image getImage(final info.movito.themoviedbapi.model.Multi query) {
switch (query.getMediaType()) {
case MOVIE :
return getMovieImage(((info.movito.themoviedbapi.model.MovieDb) (query)));
case TV_SERIES :
return getSeriesImage(((info.movito.the... |
public void onClick(android.view.View v) {
com.frysoft.notifry.utils.DateSpan ds = new com.frysoft.notifry.utils.DateSpan(new com.frysoft.notifry.utils.Date(25, 7, 2016), new com.frysoft.notifry.utils.Date(27, 7, 2016));
com.frysoft.notifry.data.TimetableEntry ent = com.frysoft.notifry.data.TimetableEntry.creat... | public void onClick(android.view.View v) {
com.frysoft.notifry.utils.DateSpan ds = new com.frysoft.notifry.utils.DateSpan(new com.frysoft.notifry.utils.Date(25, 7, 2016), new com.frysoft.notifry.utils.Date(27, 7, 2016));
com.frysoft.notifry.data.TimetableEntry ent = com.frysoft.notifry.data.TimetableEntry.creat... |
public void writeControllerDataFromController() {
for (us.ihmc.robotics.screwTheory.RigidBody foot : controllerFeet) {
controllerCenterOfPressureDataHolder.getCenterOfPressureByName(centerOfPressure.get(foot.getName()), foot);
}
robotMotionStatus.set(controllerRobotMotionStatusHolder.getCurrentRobot... | public void writeControllerDataFromController() {
for (int i = 0; i < (controllerFeet.size()); i++) {
us.ihmc.robotics.screwTheory.RigidBody foot = controllerFeet.get(i);
controllerCenterOfPressureDataHolder.getCenterOfPressureByName(centerOfPressure.get(foot.getName()), foot);
}
robotMotion... |
public boolean onLongClick(android.view.View view) {
mDialog = new com.example.administrator.project_1___to_do_list.DeleteDialog(view.getContext(), new android.content.DialogInterface.OnClickListener() {
@java.lang.Override
public void onClick(android.content.DialogInterface dialogInterface, int i) ... | public boolean onLongClick(android.view.View view) {
mDialog = new com.example.administrator.project_1___to_do_list.DeleteDialog(view.getContext(), new android.content.DialogInterface.OnClickListener() {
@java.lang.Override
public void onClick(android.content.DialogInterface dialogInterface, int i) ... |
public int search(funwithcards.Card card) {
for (int i = 0; i < (cardsInDeck.size()); i++) {
funwithcards.Card candidate = cardsInDeck.get(i);
if (card == candidate) {
java.lang.System.out.println(candidate.getCardType());
java.lang.System.out.println(candidate.getSuite());
... | public int search(funwithcards.Card card) {
for (int i = 0; i < (cardsInDeck.size()); i++) {
funwithcards.Card candidate = cardsInDeck.get(i);
if (card.equals(candidate)) {
java.lang.System.out.println(candidate.getCardType());
java.lang.System.out.println(candidate.getSuite(... |
public static int randomSquare(java.util.ArrayList<java.lang.Integer> squaresList) {
java.util.Random random = new java.util.Random();
int randomNumber = 0;
if ((squaresList.size()) > 1) {
randomNumber = random.nextInt(((squaresList.size()) - 1));
}
int randomSquare = squaresList.get(randomN... | public static int randomSquare(java.util.ArrayList<java.lang.Integer> squaresList) {
java.util.Random random = new java.util.Random();
int randomNumber = 0;
if ((squaresList.size()) == 0) {
return -1;
}else
if ((squaresList.size()) > 1) {
randomNumber = random.nextInt(((squar... |
public void unregisterEventProcessor() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException {
logWithHost(java.util.logging.Level.INFO, "Stopping event processing");
this.partitionManager.stopPartitions();
try {
this.partitionManagerFuture.get();
if (com.microsoft.a... | public void unregisterEventProcessor() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException {
logWithHost(java.util.logging.Level.INFO, "Stopping event processing");
try {
this.partitionManager.stopPartitions().get();
if (com.microsoft.azure.eventprocessorhost.EventProc... |
public static java.util.List<java.lang.String> listPage() {
java.util.List<java.lang.String> list = new java.util.ArrayList<java.lang.String>();
for (int i = 0; i < (AndroidDocConfig.CLASSES_LIST.length); i++) {
java.lang.String name = AndroidDocConfig.CLASSES_LIST[i].getName();
name = name.repl... | public static java.lang.String[] listPage() {
java.lang.String[] list = new java.lang.String[AndroidDocConfig.CLASSES_LIST.length];
for (int i = 0; i < (AndroidDocConfig.CLASSES_LIST.length); i++) {
java.lang.String name = AndroidDocConfig.CLASSES_LIST[i].getName();
name = name.replace('.', '/')... |
public void onApiResponse(net.ghosttrails.www.mydetic.api.MemoryDataList newMemories) {
getMemories().clear();
try {
getMemories().mergeFrom(newMemories);
} catch (net.ghosttrails.www.mydetic.exceptions.MyDeticException e) {
net.ghosttrails.www.mydetic.AppUtils.smallToast(context, e.getMessa... | public void onApiResponse(net.ghosttrails.www.mydetic.api.MemoryDataList newMemories) {
try {
getMemories().mergeFrom(newMemories);
} catch (net.ghosttrails.www.mydetic.exceptions.MyDeticException e) {
net.ghosttrails.www.mydetic.AppUtils.smallToast(context, e.getMessage());
}
externalLi... |
public boolean equals(java.lang.Object other) {
if (other instanceof co.shinetech.dto.Profile) {
co.shinetech.dto.Profile p = Profile;
return ((this.id) == (p.getPk())) && (this.name.equals(p.getName()));
}
return false;
} | public boolean equals(java.lang.Object other) {
if (other instanceof co.shinetech.dto.Profile) {
co.shinetech.dto.Profile p = ((co.shinetech.dto.Profile) (other));
return ((this.id) == (p.getPk())) && (this.name.equals(p.getName()));
}
return false;
} |
public static java.util.Date oldest(final java.util.Date... ds) {
java.util.Date result = null;
for (final java.util.Date d : ds) {
if (d == null) {
continue;
}
if (result == null) {
result = d;
continue;
}
if (d.before(result)) {
... | public static java.util.Date oldest(final java.util.Date... ds) {
java.util.Date result = null;
for (final java.util.Date d : ds) {
if (d == null) {
continue;
}
if (result == null) {
result = d;
continue;
}
if (d.before(result)) {
... |
protected android.app.PendingIntent getPendingSelfIntent(android.content.Context context, java.lang.String action, java.lang.String extra, int mMovieid) {
android.content.Intent intent = new android.content.Intent(context, getClass());
intent.setAction(action);
android.os.Bundle bundle = new android.os.Bund... | public static android.app.PendingIntent getPendingSelfIntent(android.content.Context context, java.lang.String action, java.lang.String extra, int mMovieid) {
android.content.Intent intent = new android.content.Intent();
intent.setAction(action);
android.os.Bundle bundle = new android.os.Bundle();
bundl... |
void setupHeader(android.media.AudioRecord rec, int length, int bufferSize) throws java.io.IOException {
long byteRate = (((icechen1.com.blackbox.audio.WAVAudioFileWriter.RECORDER_BPP) * (rec.getSampleRate())) * (rec.getChannelCount())) / 8;
long totalDataLen = bufferSize + 36;
writeWaveFileHeader(os, buffe... | void setupHeader(android.media.AudioRecord rec, int length, int bufferSize) throws java.io.IOException {
long byteRate = (((icechen1.com.blackbox.audio.WAVAudioFileWriter.RECORDER_BPP) * (rec.getSampleRate())) * (rec.getChannelCount())) / 8;
long totalDataLen = length + 36;
writeWaveFileHeader(os, length, t... |
private java.lang.String getErrorMessageFromMediaError(org.wordpress.android.fluxc.store.MediaStore.OnMediaUploaded event) {
java.lang.String errorMessage = org.wordpress.android.util.WPMediaUtils.getErrorMessage(mContext, true, event.media, event.error);
if (errorMessage == null) {
errorMessage = (andr... | private java.lang.String getErrorMessageFromMediaError(org.wordpress.android.fluxc.store.MediaStore.OnMediaUploaded event) {
java.lang.String errorMessage = org.wordpress.android.util.WPMediaUtils.getErrorMessage(mContext, true, true, event.media, event.error);
if (errorMessage == null) {
errorMessage =... |
public void updateIP(org.opencv.core.Mat im) {
interestPoints = new float[32];
for (int i = 0; i < 24; i++) {
for (int j = 0; j < 480; j++) {
double val = im.get(j, (i * (xdist)))[0];
if (val == 0.0) {
interestPoints[i] = j;
break;
}
... | public void updateIP(org.opencv.core.Mat im) {
interestPoints = new float[32];
for (int i = 0; i < 32; i++) {
for (int j = 0; j < 480; j++) {
double val = im.get(j, (i * (xdist)))[0];
if (val == 0.0) {
interestPoints[i] = j;
break;
}
... |
public void organizeUserMeeting(nl.saxion.maurens.company.ProductOwner productOwner) {
userMeetingUsers.add(developer.remove());
userMeetingUsers.add(productOwner);
userMeetingUsers.addAll(getProductUsers());
releaseAllDevelopers();
releaseAllMeetingUsers();
nl.saxion.maurens.utility.LogUtil.log... | public void organizeUserMeeting(nl.saxion.maurens.company.ProductOwner productOwner) {
userMeetingUsers.add(developer.remove());
userMeetingUsers.add(productOwner);
userMeetingUsers.addAll(getProductUsers());
nl.saxion.maurens.utility.LogUtil.log(("users in meeting" + (java.util.Arrays.toString(userMeet... |
public void onBindViewHolder(com.rwpham.spotifyexample.SongAdapter.ViewHolder viewHolder, int position) {
java.lang.String artist = songList.get(position).artists.get(0).name;
java.lang.String title = songList.get(position).name;
java.lang.System.out.printf("onbindviewholder: artist: %s title: %s \n", artis... | public void onBindViewHolder(com.rwpham.spotifyexample.SongAdapter.ViewHolder viewHolder, int position) {
java.lang.String artist = songList.get(position).artists.get(0).name;
java.lang.String title = songList.get(position).name;
java.lang.System.out.printf("onbindviewholder: artist: %s title: %s \n", artis... |
public void addPoint(it.enricocandino.nel.model.Point point) {
stream.getData().add(point);
if ((stream.getData().size()) >= (length)) {
it.enricocandino.nel.model.Sequence sequence = new it.enricocandino.nel.model.Sequence();
sequence.setPoints(stream.getData());
subsequences.add(sequen... | public void addPoint(it.enricocandino.nel.model.Point point) {
stream.getData().add(point);
if ((stream.getData().size()) >= (length)) {
it.enricocandino.nel.model.Sequence sequence = new it.enricocandino.nel.model.Sequence();
sequence.setPoints(new java.util.ArrayList(stream.getData()));
... |
public void changed(javafx.beans.value.ObservableValue<? extends Definitions.Physician> ov, Definitions.Physician old_val, Definitions.Physician new_val) {
int clicked = Directory.getSelectionModel().getSelectedIndex();
if (clicked >= 0) {
selectedHPIndex = clicked;
selectedHP = docDisplay.get(s... | public void changed(javafx.beans.value.ObservableValue<? extends Definitions.Physician> ov, Definitions.Physician old_val, Definitions.Physician new_val) {
int clicked = Directory.getSelectionModel().getSelectedIndex();
if (clicked >= 0) {
selectedHPIndex = clicked;
selectedHP = new_val;
}
... |
public org.molgenis.data.Repository addEntityMeta(org.molgenis.data.EntityMetaData entityMeta) {
org.molgenis.data.view.ViewRepository repo = new org.molgenis.data.view.ViewRepository(entityMeta, dataService, searchService);
if (!(searchService.hasMapping(entityMeta)))
repo.create();
repositori... | public org.molgenis.data.Repository addEntityMeta(org.molgenis.data.EntityMetaData entityMeta) {
org.molgenis.data.view.ViewRepository repo = new org.molgenis.data.view.ViewRepository(entityMeta, dataService);
if (!(searchService.hasMapping(entityMeta)))
repo.create();
repositories.put(entityMe... |
public static com.pratilipi.data.client.CommentData createCommentData(com.pratilipi.data.type.CommentDoc commentDoc) {
com.pratilipi.data.client.CommentData commentData = new com.pratilipi.data.client.CommentData(commentDoc.getId());
commentData.setUserId(commentDoc.getUserId());
commentData.setContent(comm... | public static com.pratilipi.data.client.CommentData createCommentData(com.pratilipi.data.type.CommentDoc commentDoc) {
com.pratilipi.data.client.CommentData commentData = new com.pratilipi.data.client.CommentData(commentDoc.getId());
commentData.setUserId(commentDoc.getUserId());
commentData.setContent(comm... |
public void close() {
client.close();
sharedLocks.clear();
exclusiveLocks.clear();
if (initialized) {
if (!(stopped)) {
endLockSessionOnMaster(true);
stopped = false;
}
initialized = false;
}
} | public void close() {
client.close();
sharedLocks.clear();
exclusiveLocks.clear();
if (initialized) {
if (!(stopped)) {
endLockSessionOnMaster(true);
stopped = true;
}
initialized = false;
}
} |
public void run() {
android.widget.TextView text = ((android.widget.TextView) (findViewById(R.id.textView1)));
android.widget.TextView prob = ((android.widget.TextView) (findViewById(R.id.textView2)));
rot13.musicmagic.Graph graph = ((rot13.musicmagic.Graph) (findViewById(R.id.graph)));
graph.addSample(... | public void run() {
rot13.musicmagic.Graph graph = ((rot13.musicmagic.Graph) (findViewById(R.id.graph)));
graph.addSample((probability > 0.7 ? stepsAboveA : -1));
text.setText(note);
prob.setText(("" + probability));
} |
private java.util.Collection filterByHomeArea(java.util.Collection collection) {
java.util.ArrayList<com.example.nickozoulis.teamproj.domain.Referee> refs = ((java.util.ArrayList<com.example.nickozoulis.teamproj.domain.Referee>) (collection));
java.util.ArrayList<com.example.nickozoulis.teamproj.domain.Referee>... | private java.util.Collection filterByHomeArea(java.util.Collection collection) {
java.util.Set<com.example.nickozoulis.teamproj.domain.Referee> refs = ((java.util.HashSet<com.example.nickozoulis.teamproj.domain.Referee>) (collection));
java.util.Set<com.example.nickozoulis.teamproj.domain.Referee> filteredColle... |
protected void onPreExecute() {
if ((databaseManager) == null) {
databaseManager = new com.intbridge.projects.gaucholife.PGDatabaseManager();
}
if ((tempDataStorage) == null) {
tempDataStorage = new java.util.LinkedHashMap<>();
}
if ((currentDate) == null) {
currentDate = new... | protected void onPreExecute() {
super.onPreExecute();
if ((databaseManager) == null) {
databaseManager = new com.intbridge.projects.gaucholife.PGDatabaseManager();
}
if ((tempDataStorage) == null) {
tempDataStorage = new java.util.LinkedHashMap<>();
}
if ((currentDate) == null) {... |
public void sendYouSmart(android.view.View view) {
for (int i = 0; i < (Vibes.length); i++) {
if (!(Vibes[i].isPlaying())) {
Vibes3[i].start();
return ;
}
}
} | public void sendYouSmart(android.view.View view) {
for (int i = 0; i < (Vibes3.length); i++) {
if (!(Vibes3[i].isPlaying())) {
Vibes3[i].start();
return ;
}
}
} |
public int getAllWSSubscriptionCountForTopic(java.lang.String topic) throws org.wso2.carbon.event.admin.internal.exception.EventAdminException {
org.wso2.carbon.event.core.EventBroker eventBroker = org.wso2.carbon.event.admin.internal.util.EventAdminHolder.getInstance().getEventBroker();
try {
return ev... | public int getAllWSSubscriptionCountForTopic(java.lang.String topic) throws org.wso2.carbon.event.admin.internal.exception.EventAdminException {
org.wso2.carbon.event.core.EventBroker eventBroker = org.wso2.carbon.event.admin.internal.util.EventAdminHolder.getInstance().getEventBroker();
try {
return ev... |
public java.lang.Void doInBackground(java.lang.String... params) {
com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient ddbClient = new com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient(credentialsProvider);
com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper mapper = new com.amazonaw... | public java.lang.Void doInBackground(java.lang.String... params) {
com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient ddbClient = new com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient(credentialsProvider);
com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBMapper mapper = new com.amazonaw... |
protected void handleNavigationError(java.lang.String navigationState, java.lang.Exception e) {
com.vaadin.ui.Notification.show(((("The requested view (" + navigationState) + ") was not available, ") + "entering default screen."), Notification.Type.WARNING_MESSAGE);
if ((navigationState != null) && (!(navigatio... | protected void handleNavigationError(java.lang.String navigationState, java.lang.Exception e) {
com.vaadin.ui.Notification.show(((("The requested view (" + navigationState) + ") was not available, ") + "entering default screen."), Notification.Type.WARNING_MESSAGE);
getNavigator().navigateTo(this.viewProvider.g... |
public void testWrite() {
byte[] output = adapter.writeBytes(allTypes);
org.assertj.core.api.Assertions.assertThat(output.length).isEqualTo(TestAllTypesData.expectedOutput.length);
org.assertj.core.api.Assertions.assertThat(okio.ByteString.of(output)).isEqualTo(okio.ByteString.of(TestAllTypesData.expectedOu... | public void testWrite() {
byte[] output = adapter.writeBytes(allTypes);
org.assertj.core.api.Assertions.assertThat(output.length).isEqualTo(TestAllTypesData.expectedOutput.size());
org.assertj.core.api.Assertions.assertThat(okio.ByteString.of(output)).isEqualTo(TestAllTypesData.expectedOutput);
} |
private levelGenerators.jaspGeneticLevelGenerator.Individual selectIndividual() {
levelGenerators.jaspGeneticLevelGenerator.Individual individualToReturn = null;
double[] probabilities = getProbabilities();
double rouletteNumber = random.nextDouble();
for (int i = 0; i < (populationSize); i++) {
... | private levelGenerators.jaspGeneticLevelGenerator.Individual selectIndividual() {
levelGenerators.jaspGeneticLevelGenerator.Individual individualToReturn = null;
double[] probabilities = getProbabilities();
double rouletteNumber = random.nextDouble();
for (int i = 0; i < (populationSize); i++) {
... |
public synchronized void update(int[] countBuffer, int numCounts) {
for (int i = 0; i < numCounts; i++) {
int cmid = countBuffer[i];
int index = findOrCreateHeapIdx(cmid);
(counts[index])++;
heapifyUp(index);
if (org.jikesrvm.VM.useAOSDB) {
VM.methodDatabase.putCa... | public synchronized void update(int cmid, double numCounts) {
int index = findOrCreateHeapIdx(cmid);
counts[index] += numCounts;
heapifyUp(index);
totalCountsTaken += numCounts;
if (org.jikesrvm.adaptive.database.methodsamples.MethodCountData.DEBUG)
validityCheck();
if (org.jikesrvm... |
private com.jme3.asset.TextureKey setupMockForTexture(final java.lang.String paramName, final java.lang.String path, final boolean flipY, final com.jme3.texture.Texture texture) {
org.mockito.Mockito.when(materialDef.getMaterialParam(paramName)).thenReturn(new com.jme3.material.MatParamTexture(com.jme3.shader.VarTy... | private com.jme3.asset.TextureKey setupMockForTexture(final java.lang.String paramName, final java.lang.String path, final boolean flipY, final com.jme3.texture.Texture texture) {
org.mockito.Mockito.when(materialDef.getMaterialParam(paramName)).thenReturn(new com.jme3.material.MatParamTexture(com.jme3.shader.VarTy... |
public void test_difference_in_case() throws java.lang.Exception {
map.putSync("Read_it", 42);
map.putSync("Read_It", 43);
de.mxro.async.jre.Async.waitFor(new de.mxro.async.Operation<de.mxro.fn.Success>() {
@java.lang.Override
public void apply(final de.mxro.async.callbacks.ValueCallback<de.... | public void test_difference_in_case() throws java.lang.Exception {
map.putSync("Read_it", 42);
map.putSync("Read_It", 43);
de.mxro.async.jre.Async.waitFor(new de.mxro.async.Operation<de.mxro.fn.Success>() {
@java.lang.Override
public void apply(final de.mxro.async.callbacks.ValueCallback<de.... |
public static <T> void asJson(java.lang.Object object, java.lang.Class<T> objectType, java.io.OutputStream output, boolean pretty) throws cworks.json.JsonException {
cworks.json.Json.throwIfNull(object);
cworks.json.Json.throwIfNull(objectType);
cworks.json.Json.throwIfNull(output);
if (pretty) {
... | public static <T> void asJson(java.lang.Object object, java.lang.Class<T> objectType, java.io.OutputStream output, boolean pretty) throws cworks.json.JsonException {
cworks.json.Json.throwIfNull(object);
cworks.json.Json.throwIfNull(objectType);
cworks.json.Json.throwIfNull(output);
if (pretty) {
... |
public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors() {
org.eclipse.ui.views.properties.IPropertyDescriptor[] ipd = new org.eclipse.ui.views.properties.IPropertyDescriptor[relatedElements.size()];
for (int i = 0; i < (ipd.length); i++) {
ipd[i] = new org.eclipse.ui.views.... | public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors() {
if (((relatedElements) == null) || (relatedElements.isEmpty())) {
return new org.eclipse.ui.views.properties.IPropertyDescriptor[]{ };
}else {
org.eclipse.ui.views.properties.IPropertyDescriptor[] ipd = new ... |
private void processResult(com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer.LoadMatchResult result) {
mMatch = result.getMatch();
if (!(checkStatusCode(mMatch, result.getStatus().getStatusCode()))) {
return ;
}
try {
mTurnData.update(mMatch.getData());
if (... | private void processResult(com.google.android.gms.games.multiplayer.turnbased.TurnBasedMultiplayer.LoadMatchResult result) {
mMatch = result.getMatch();
if (!(checkStatusCode(mMatch, result.getStatus().getStatusCode()))) {
return ;
}
try {
mTurnData.update(mMatch.getData());
upda... |
public void onLoadComplete(android.media.SoundPool soundPool, int sampleId, int status) {
if ((status == 0) && (com.rjfun.cordova.plugin.nativeaudio.NativeAudio.waitingMap.containsKey(sampleId))) {
java.lang.String audioKey = com.rjfun.cordova.plugin.nativeaudio.NativeAudio.waitingMap.getString(sampleId);
... | public void onLoadComplete(android.media.SoundPool soundPool, int sampleId, int status) {
if ((status == 0) && (com.rjfun.cordova.plugin.nativeaudio.NativeAudio.waitingMap.containsKey(sampleId))) {
java.lang.String audioKey = ((java.lang.String) (com.rjfun.cordova.plugin.nativeaudio.NativeAudio.waitingMap.g... |
public void isBusSingleton() {
hu.oe.nik.automatedcar.bus.Bus first = hu.oe.nik.automatedcar.bus.Bus.getInstance();
hu.oe.nik.automatedcar.bus.Bus second = hu.oe.nik.automatedcar.bus.Bus.getInstance();
org.junit.Assert.assertEquals((first == second), true);
first.setACCMainSwitchState(true);
org.jun... | public void isBusSingleton() {
hu.oe.nik.automatedcar.bus.Bus first = hu.oe.nik.automatedcar.bus.Bus.getInstance();
hu.oe.nik.automatedcar.bus.Bus second = hu.oe.nik.automatedcar.bus.Bus.getInstance();
org.junit.Assert.assertEquals(first.equals(second), true);
first.setACCMainSwitchState(true);
org.... |
public void initialize() {
m_drivetrain.setControlMode(TalonControlMode.PercentVbus);
m_startTicks = m_drivetrain.getEncPosition();
m_endTicks = (m_startTicks) + ((m_drivetrain.getTicksPerRev()) * 4);
m_logger.info(((("initalized, start:" + (m_startTicks)) + " end:") + (m_endTicks)));
} | public void initialize() {
m_drivetrain.setControlMode(TalonControlMode.PercentVbus);
m_startTicks = m_drivetrain.getEncPosition();
m_endTicks = (m_startTicks) + (m_drivetrain.getTicksPerRev());
m_logger.info(((("initalized, start:" + (m_startTicks)) + " end:") + (m_endTicks)));
} |
public void simulate(int n) {
addParticles();
printTestCells();
for (int i = 0; i < n; i++) {
moveParticles();
checkCollisions();
if ((i % 4) == 0) {
addParticles();
}
printTestCells();
io.FileProcessor.outputState(cells, particles, "./output.txt")... | public void simulate(int n) {
printTestCells();
for (int i = 0; i < n; i++) {
moveParticles();
checkCollisions();
if ((i % 4) == 0) {
addParticles();
}
printTestCells();
io.FileProcessor.outputState(cells, particles, "./output.txt");
}
} |
public java.util.Optional<org.spongepowered.api.resourcepack.ResourcePack> poll() {
synchronized(this.queue) {
final org.spongepowered.api.resourcepack.ResourcePack resourcePack = this.waitingForResponse;
if (!(this.queue.isEmpty())) {
this.send(this.queue.remove(0));
}
r... | public java.util.Optional<org.spongepowered.api.resourcepack.ResourcePack> poll() {
synchronized(this.queue) {
final org.spongepowered.api.resourcepack.ResourcePack resourcePack = this.waitingForResponse;
if (!(this.queue.isEmpty())) {
this.send(this.queue.remove(0));
}else {
... |
protected void runSpider(br.com.softplan.security.zap.api.model.AnalysisInfo analysisInfo) {
java.lang.String targetUrl = analysisInfo.getTargetUrl();
br.com.softplan.security.zap.api.analysis.BaseAnalyzer.LOGGER.info("{} : {}", ScanType.SPIDER, targetUrl);
try {
br.com.softplan.security.zap.zaproxy... | protected void runSpider(br.com.softplan.security.zap.api.model.AnalysisInfo analysisInfo) {
java.lang.String targetUrl = analysisInfo.getTargetUrl();
br.com.softplan.security.zap.api.analysis.BaseAnalyzer.LOGGER.info("{} : {}", ScanType.SPIDER, targetUrl);
try {
br.com.softplan.security.zap.zaproxy... |
public java.lang.String translateWord(java.lang.String word, boolean isEnglish) {
java.lang.String translation = "";
if (isEnglish == true) {
translation = french.searchTree(word).getFren();
}else
if (isEnglish == false) {
translation = english.searchTree(word).getEng();
... | public java.lang.String translateWord(java.lang.String word, boolean isEnglish) {
java.lang.String translation = "";
if (isEnglish == true) {
translation = french.searchTree(word).getFren();
}else
if (isEnglish == false) {
translation = english.searchTree(word).getEng();
... |
public void getObjectConstructorAsync(java.lang.String className, com.arondor.common.reflection.api.instantiator.InstantiationCallback<com.arondor.common.reflection.noreflect.model.ObjectConstructor> callback) {
com.arondor.common.reflection.noreflect.model.ObjectConstructor sync = objectConstructorMap.get(classNam... | public void getObjectConstructorAsync(java.lang.String className, com.arondor.common.reflection.api.instantiator.InstantiationCallback<com.arondor.common.reflection.noreflect.model.ObjectConstructor> callback) {
com.arondor.common.reflection.noreflect.model.ObjectConstructor sync = objectConstructorMap.get(classNam... |
public void removeMarkersFromPlayer(org.bukkit.entity.Player p) {
if (playerMap.containsKey(p.getUniqueId())) {
me.lennartVH01.BuiltinBlockMarker.MarkedTask t = playerMap.get(p.getUniqueId());
t.cancelTask();
removeEntitys(p, t.ids, t.entities);
}
} | public void removeMarkersFromPlayer(org.bukkit.entity.Player p) {
if (playerMap.containsKey(p.getUniqueId())) {
me.lennartVH01.BuiltinBlockMarker.MarkedTask t = playerMap.get(p.getUniqueId());
t.cancelTask();
removeEntitys(p, t.ids);
}
} |
public org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.id.pool.ReleasedIdsHolder> getReleasedIdsHolderInstance(java.lang.String poolName) {
org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilde... | public org.opendaylight.yangtools.yang.binding.InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.id.pool.ReleasedIdsHolder> getReleasedIdsHolderInstance(java.lang.String poolName) {
org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilde... |
private static boolean isPathClearSameRank(final boolean towardKingside, final int startIndex, final int endIndex, final com.williamdye.dyce.board.Square[] squares) {
boolean clear = true;
if (towardKingside) {
for (int i = startIndex + 1; i < endIndex; i++)
clear &= squares[i].isEmpty();
... | private static boolean isPathClearSameRank(final boolean towardKingside, final int startIndex, final int endIndex, final com.williamdye.dyce.board.Square[] squares) {
boolean clear = true;
if (towardKingside) {
for (int i = startIndex + 1; i < endIndex; i++)
clear &= squares[i].isEmpty();
... |
private static void isIllegalBounds(java.lang.Class clazz, float minBound, float maxBound, boolean leftBound, boolean rightBound) {
if (minBound >= maxBound)
throw new java.lang.IllegalArgumentException(workshop.RandomEnchancer.ILLEGAL_BOUNDARIES);
if ((((minBound != maxBound) && (!leftBound)) && (... | private static void isIllegalBounds(java.lang.Class clazz, float minBound, float maxBound, boolean leftBound, boolean rightBound) {
if (minBound >= maxBound)
throw new java.lang.IllegalArgumentException(workshop.RandomEnchancer.ILLEGAL_BOUNDARIES);
if ((((minBound == (maxBound + 1)) && (!leftBound)... |
public boolean solve(final java.lang.String noteId) throws de.inselhome.noteapp.exception.PersistenceException {
if (com.google.common.base.Strings.isNullOrEmpty(noteId)) {
return false;
}else {
final de.inselhome.noteapp.domain.Note note = com.google.common.collect.Iterables.find(cache, new com... | public boolean open(final java.lang.String noteId) throws de.inselhome.noteapp.exception.PersistenceException {
if (com.google.common.base.Strings.isNullOrEmpty(noteId)) {
return false;
}else {
final de.inselhome.noteapp.domain.Note note = com.google.common.collect.Iterables.find(cache, new com.... |
public void on(org.mwdb.KNode foundIndex) {
if (foundIndex == null) {
throw new java.lang.RuntimeException("Index creation failed, cache is probably full !!!");
}
foundIndex.index(Constants.INDEX_ATTRIBUTE, toIndexNode, keyAttributes, new org.mwdb.KCallback<java.lang.Boolean>() {
@java.lang.... | public void on(org.mwdb.KNode foundIndex) {
if (foundIndex == null) {
throw new java.lang.RuntimeException("Index creation failed, cache is probably full !!!");
}
java.lang.System.out.println(foundIndex);
foundIndex.index(Constants.INDEX_ATTRIBUTE, toIndexNode, keyAttributes, new org.mwdb.KCallb... |
public void update() {
yvel += gravity;
if ((jumpDelay) > 0)
(jumpDelay)--;
if (((!(dead)) && ((requestJump) || (keyboard.isDown(java.awt.event.KeyEvent.VK_SPACE)))) && ((jumpDelay) <= 0)) {
yvel = -10;
jumpDelay = 10;
requestJump = false;
}
y += ((int) (yvel));
... | public void update() {
yvel += gravity;
if ((jumpDelay) > 0)
(jumpDelay)--;
if (((!(dead)) && ((requestJump) || (keyboard.isDown(java.awt.event.KeyEvent.VK_SPACE)))) && ((jumpDelay) <= 0)) {
yvel = -10;
jumpDelay = 10;
}
y += ((int) (yvel));
requestJump = false;
} |
public java.util.Map<java.lang.String, java.lang.Object> getDeviceParameters() {
java.util.Map<java.lang.String, java.lang.Object> paramaters = new java.util.HashMap<>();
paramaters.put(com.ronnie.athena.models.Device.Name, getName());
paramaters.put(com.ronnie.athena.models.Device.State, getState());
p... | public java.util.Map<java.lang.String, java.lang.Object> getDeviceParameters() {
java.util.Map<java.lang.String, java.lang.Object> parameters = new java.util.HashMap<>();
parameters.put(com.ronnie.athena.models.Device.Name, getName());
parameters.put(com.ronnie.athena.models.Device.State, getState());
p... |
public static void conceptIdsToTextFile(java.util.Collection<java.lang.String> conceptIds, java.lang.String destinationFilepath) throws java.lang.Exception {
java.nio.file.Path path = java.nio.file.Paths.get(destinationFilepath);
java.util.List<java.lang.String> conceptsOut = new java.util.ArrayList<>();
fo... | public static void conceptIdsToTextFile(java.util.Collection<java.lang.String> conceptIds, java.lang.String destinationFilepath) throws java.lang.Exception {
java.util.List<java.lang.String> conceptsOut = new java.util.ArrayList<>();
for (java.lang.String concept : conceptIds) {
conceptsOut.add((("\"" +... |
public static org.mskcc.cbio.oncokb.model.Gene getGeneByHugoSymbol(java.lang.String hugoSymbol) {
if (hugoSymbol != null) {
org.mskcc.cbio.oncokb.bo.GeneBo geneBo = org.mskcc.cbio.oncokb.util.ApplicationContextSingleton.getGeneBo();
if (org.mskcc.cbio.oncokb.util.CacheUtils.isEnabled()) {
... | public static org.mskcc.cbio.oncokb.model.Gene getGeneByHugoSymbol(java.lang.String hugoSymbol) {
if (hugoSymbol != null) {
hugoSymbol = hugoSymbol.toUpperCase();
org.mskcc.cbio.oncokb.bo.GeneBo geneBo = org.mskcc.cbio.oncokb.util.ApplicationContextSingleton.getGeneBo();
if (org.mskcc.cbio.o... |
public void setFlagsFromString(java.lang.String flagPositions) {
for (int i = 0; i < (boardSize); i++) {
for (int j = 0; j < (boardSize); j++) {
flag[i][j] = (flagPositions.charAt(((i * (boardSize)) + j))) == '1';
}
}
} | public void setFlagsFromString(java.lang.String flagPositions) {
if ((flagPositions.length()) != ((boardSize) * (boardSize))) {
return ;
}
for (int i = 0; i < (boardSize); i++) {
for (int j = 0; j < (boardSize); j++) {
flag[i][j] = (flagPositions.charAt(((i * (boardSize)) + j))) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.