buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public static org.json.JSONArray toJsonArray(@android.support.annotation.NonNull
java.lang.Iterable<?> objects) {
net.openid.appauth.Preconditions.checkNotNull(objects, "objects cannot be null");
org.json.JSONArray jsonArray = new org.json.JSONArray();
for (java.lang.Object obj : objects) {
java.lan... | public static org.json.JSONArray toJsonArray(@android.support.annotation.NonNull
java.lang.Iterable<?> objects) {
net.openid.appauth.Preconditions.checkNotNull(objects, "objects cannot be null");
org.json.JSONArray jsonArray = new org.json.JSONArray();
for (java.lang.Object obj : objects) {
java.lan... |
public Models.Unit getOneUnit(java.lang.String uni) {
Models.Unit unit = null;
try {
if ((units.get(uni)) == null)
throw new java.lang.Exception();
unit = new Models.Unit(uni, units.get(uni));
} catch (java.lang.Exception e) {
java.lang.System.out.println("Error ... | public Models.Unit getOneUnit(java.lang.String uni) {
Models.Unit unit = null;
try {
if ((units.get(uni)) == null)
throw new java.lang.Exception();
unit = new Models.Unit(uni, units.get(uni));
} catch (java.lang.Exception e) {
java.lang.System.err.println("Error ... |
protected final GridLayoutManager.SpanSizeLookup getSpanSizeLookup() {
return new android.support.v7.widget.GridLayoutManager.SpanSizeLookup() {
@java.lang.Override
public int getSpanSize(int position) {
return supportEndless() ? getGridSpan() : (adapter.getItemViewType(position)) == (na... | protected final GridLayoutManager.SpanSizeLookup getSpanSizeLookup() {
if (!(supportEndless())) {
return super.getSpanSizeLookup();
}
return new android.support.v7.widget.GridLayoutManager.SpanSizeLookup() {
@java.lang.Override
public int getSpanSize(int position) {
retur... |
public void test() {
org.junit.Assert.assertEquals(2, numDecodings("12"));
org.junit.Assert.assertEquals(2, numDecodings("26"));
org.junit.Assert.assertEquals(0, numDecodings("0"));
org.junit.Assert.assertEquals(1, numDecodings("10"));
org.junit.Assert.assertEquals(1, numDecodings("100"));
} | public void test() {
org.junit.Assert.assertEquals(2, numDecodings("12"));
org.junit.Assert.assertEquals(2, numDecodings("26"));
org.junit.Assert.assertEquals(0, numDecodings("0"));
org.junit.Assert.assertEquals(1, numDecodings("10"));
org.junit.Assert.assertEquals(0, numDecodings("100"));
} |
public final void writeStringNoTag(java.lang.String value) throws java.io.IOException {
final int oldPosition = position;
try {
position = com.google.protobench.Utf8.encodeReverse(value, buffer, offset, spaceLeft());
int length = oldPosition - (position);
writeUInt32NoTag(length);
} ... | public final void writeStringNoTag(java.lang.String value) throws java.io.IOException {
final int oldPosition = position;
try {
int length = com.google.protobench.Utf8.encodeReverse(value, buffer, offset, spaceLeft());
position -= length;
writeUInt32NoTag(length);
} catch (com.google... |
public void executeTerritoryAddUnits(int playerID, int territoryID, int numUnits) {
sg.com.yahoo.ryanlouck.orbital2015.Player currPlayer = playersMap.get(playerID);
territoriesMap.get(territoryID).addUnits(numUnits);
currPlayer.minusResources((numUnits * 10));
currPlayer.minusNumTurns();
if ((currPl... | public void executeTerritoryAddUnits(int playerID, int territoryID, int numUnits) {
sg.com.yahoo.ryanlouck.orbital2015.Player currPlayer = playersMap.get(playerID);
territoriesMap.get(territoryID).addUnits(numUnits);
currPlayer.minusResources(numUnits);
currPlayer.minusNumTurns();
if ((currPlayer.is... |
public void disconnect(sx.blah.discord.api.internal.DiscordDisconnectedEvent.Reason reason) {
if (isConnected.get()) {
client.dispatcher.dispatch(new sx.blah.discord.api.internal.DiscordDisconnectedEvent(reason));
isConnected.set(false);
session.close();
executorService.shutdownNow()... | public void disconnect(sx.blah.discord.api.internal.DiscordDisconnectedEvent.Reason reason) {
if (isConnected.get()) {
client.dispatcher.dispatch(new sx.blah.discord.api.internal.DiscordDisconnectedEvent(reason));
isConnected.set(false);
executorService.shutdownNow();
session.close()... |
public void onFoodDelete() {
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(getActivity());
builder.setMessage(R.string.dialog_food_delete_message);
builder.setPositiveButton(R.string.dialog_food_delete_ok, new android.content.DialogInterface.OnClickListener() {
@java.... | private void onFoodDelete() {
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(getActivity());
builder.setMessage(R.string.dialog_food_delete_message);
builder.setPositiveButton(R.string.dialog_food_delete_ok, new android.content.DialogInterface.OnClickListener() {
@java... |
public void onClientDisconnected(java.lang.String identifier) throws java.lang.InterruptedException {
connectionSemaphore.acquire();
it.polimi.spf.wfd.WfdLog.d(it.polimi.spf.wfd.GroupOwnerActor.TAG, ("Client lost id : " + identifier));
it.polimi.spf.wfd.GOInternalClient c = gOInternalClients.remove(identifi... | public void onClientDisconnected(java.lang.String identifier) throws java.lang.InterruptedException {
connectionSemaphore.acquire();
it.polimi.spf.wfd.WfdLog.d(it.polimi.spf.wfd.GroupOwnerActor.TAG, ("Client lost id : " + identifier));
it.polimi.spf.wfd.GOInternalClient c = gOInternalClients.remove(identifi... |
public org.vsg.cusp.engine.rapidoid.specimpl.AsyncHttpRequestImpl call() throws java.lang.Exception {
injectParameterInstanceToMethod(mpMetaInfo, hreq, fullPath.toString());
try {
for (java.lang.Object param : mpMetaInfo.getParams()) {
java.lang.System.out.println(((("param : " + param) + " ... | public org.vsg.cusp.engine.rapidoid.specimpl.AsyncHttpRequestImpl call() throws java.lang.Exception {
injectParameterInstanceToMethod(mpMetaInfo, hreq, fullPath.toString());
try {
java.lang.Object returnVal = method.invoke(inst, mpMetaInfo.getParams());
} catch (java.lang.Exception e) {
e.pr... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new com.oneafricamedia.classifieds.ui.MainActivity.FetchData().execute();
swipeStack = ((com.oneafricamedia.classifieds.widget.swipestack.SwipeStack) (findViewById(... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
swipeStack = ((com.oneafricamedia.classifieds.widget.swipestack.SwipeStack) (findViewById(R.id.swipeStack)));
swipeStack.setListener(this);
swipeStack.setSwipeP... |
public boolean isItemValidForSlot(int slot, net.minecraft.item.ItemStack item) {
return ((inv[slot]) == null) || ((inv[slot].isItemEqual(item)) && ((inv[slot].getMaxStackSize()) != (inv[slot].getCount())));
} | public boolean isItemValidForSlot(int slot, net.minecraft.item.ItemStack item) {
return (inv.get(slot).isEmpty()) || ((inv.get(slot).isItemEqual(item)) && ((inv.get(slot).getMaxStackSize()) != (inv.get(slot).getCount())));
} |
protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if ((requestCode == (com.selfscore.selfscoreapp.Activities.DashboardActivities.UpdateInfoActivity.GET_FROM_GALLERY)) && (resultCode == (android.app.Activity.RESU... | protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if ((requestCode == (com.selfscore.selfscoreapp.Activities.DashboardActivities.UpdateInfoActivity.GET_FROM_GALLERY)) && (resultCode == (android.app.Activity.RESU... |
public org.hibernate.validator.metadata.aggregated.BeanMetaDataImpl<T> build() {
java.util.Set<org.hibernate.validator.metadata.aggregated.ConstraintMetaData> aggregatedElements = org.hibernate.validator.metadata.aggregated.BeanMetaDataImpl.BeanMetaDataBuilder.newHashSet();
for (org.hibernate.validator.metadata... | public org.hibernate.validator.metadata.aggregated.BeanMetaDataImpl<T> build() {
java.util.Set<org.hibernate.validator.metadata.aggregated.ConstraintMetaData> aggregatedElements = org.hibernate.validator.metadata.aggregated.BeanMetaDataImpl.BeanMetaDataBuilder.newHashSet();
for (org.hibernate.validator.metadata... |
public java.lang.Object pop() {
if (this.outStack.isEmpty()) {
while (!(this.inStack.isEmpty()))
this.outStack.push(this.inStack.pop());
this.inStack = new java.util.Stack<java.lang.Object>();
}
return this.outStack.pop();
} | public java.lang.Object pop() {
if (this.outStack.isEmpty()) {
while (!(this.inStack.isEmpty()))
this.outStack.push(this.inStack.pop());
this.inStack = new java.util.Stack<java.lang.Object>();
}
return !(this.outStack.isEmpty()) ? this.outStack.pop() : false;
} |
public void testSetCredentials() {
vcs.setCredentials("user", "password");
org.eclipse.jgit.transport.CredentialItem.Username u = new org.eclipse.jgit.transport.CredentialItem.Username();
org.eclipse.jgit.transport.CredentialItem.Password p = new org.eclipse.jgit.transport.CredentialItem.Password();
org... | public void testSetCredentials() {
vcs.setCredentials("user", "password");
org.eclipse.jgit.transport.CredentialItem.Username u = new org.eclipse.jgit.transport.CredentialItem.Username();
org.eclipse.jgit.transport.CredentialItem.Password p = new org.eclipse.jgit.transport.CredentialItem.Password();
ass... |
public void readContact() {
android.content.Intent intent = new android.content.Intent(android.content.Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent, PICK_CONTACT);
if (((Build.VERSION.SDK_INT) >= (Build.VERSION_CODES.M)) && ((checkSelfPermission(Manifest.permissi... | public void readContact() {
if (((Build.VERSION.SDK_INT) >= (Build.VERSION_CODES.M)) && ((checkSelfPermission(Manifest.permission.READ_CONTACTS)) == (android.content.pm.PackageManager.PERMISSION_GRANTED))) {
android.content.Intent intent = new android.content.Intent(android.content.Intent.ACTION_PICK, Conta... |
public void setWatchlistAdapter() {
if ((baseWatchlistAdapter) == null) {
baseWatchlistAdapter = new de.cineaste.android.adapter.WatchlistAdapter(getActivity(), this, this);
}
if ((baseWatchlistAdapter.getItemCount()) == 0) {
baseWatchlistRecyclerView.setVisibility(View.GONE);
emptyL... | public void setWatchlistAdapter() {
if ((baseWatchlistAdapter.getItemCount()) == 0) {
baseWatchlistRecyclerView.setVisibility(View.GONE);
emptyListTextView.setVisibility(View.VISIBLE);
emptyListTextView.setText(R.string.noMoviesOnWatchList);
}else {
baseWatchlistRecyclerView.setV... |
public void run() {
int newRotation;
while ((mWaitCounter) < (WAIT_TIMES_MS.length)) {
com.android.server.audio.RotationHelper.updateOrientation();
int waitTimeMs;
synchronized(mCounterLock) {
waitTimeMs = WAIT_TIMES_MS[mWaitCounter];
(mWaitCounter)++;
}
... | public void run() {
while ((mWaitCounter) < (WAIT_TIMES_MS.length)) {
int waitTimeMs;
synchronized(mCounterLock) {
waitTimeMs = ((mWaitCounter) < (WAIT_TIMES_MS.length)) ? WAIT_TIMES_MS[mWaitCounter] : 0;
(mWaitCounter)++;
}
try {
if (waitTimeMs > ... |
public static long transfer(java.io.File source, java.io.OutputStream out) throws java.io.IOException {
java.io.FileInputStream in = null;
try {
in = new java.io.FileInputStream(source);
return org.qfox.jestful.core.io.IOUtils.transfer(in, out);
} finally {
in.close();
}
} | public static long transfer(java.io.File source, java.io.OutputStream out) throws java.io.IOException {
java.io.FileInputStream in = null;
try {
in = new java.io.FileInputStream(source);
return org.qfox.jestful.core.io.IOUtils.transfer(in, out);
} finally {
org.qfox.jestful.core.io.I... |
public void setUp() throws java.lang.Exception {
input = org.mockito.Mockito.mock(model.Input.class);
levelController = org.mockito.Mockito.mock(controller.LevelController.class);
screenController = org.mockito.Mockito.mock(controller.ScreenController.class);
player = new model.Player(0, 0, 0, 0, 0, 0, ... | public void setUp() throws java.lang.Exception {
input = mock(model.Input.class);
levelController = mock(controller.LevelController.class);
screenController = mock(controller.ScreenController.class);
player = new model.Player(0, 0, 0, 0, 0, 0, Settings.PLAYER_SPEED, input, levelController);
} |
public org.apache.calcite.rel.RelNode convert(org.apache.calcite.rel.RelNode rel) {
final org.apache.calcite.rel.core.Sort sort = ((org.apache.calcite.rel.core.Sort) (rel));
final org.apache.phoenix.calcite.RelTraitSet traitSet = sort.getTraitSet().replace(out).replace(sort.getCollation());
return new org.a... | public org.apache.calcite.rel.RelNode convert(org.apache.calcite.rel.RelNode rel) {
final org.apache.calcite.rel.core.Sort sort = ((org.apache.calcite.rel.core.Sort) (rel));
final org.apache.phoenix.calcite.RelTraitSet traitSet = sort.getTraitSet().replace(out).replace(sort.getCollation());
return new org.a... |
private boolean isCustomizableBlock(net.minecraft.block.Block par1Block) {
if ((((((par1Block == (org.freeforums.geforce.securitycraft.main.mod_SecurityCraft.portableRadar)) || (par1Block == (org.freeforums.geforce.securitycraft.main.mod_SecurityCraft.Keypad))) || (par1Block == (org.freeforums.geforce.securitycraft... | private boolean isCustomizableBlock(net.minecraft.block.Block par1Block) {
return (((((par1Block == (org.freeforums.geforce.securitycraft.main.mod_SecurityCraft.portableRadar)) || (par1Block == (org.freeforums.geforce.securitycraft.main.mod_SecurityCraft.Keypad))) || (par1Block == (org.freeforums.geforce.securitycr... |
private void processMsg(java.lang.String msg) {
if (chkMsg(msg, com.robic.zoran.arduinoemulator.BlueToothService.MOVE)) {
android.util.Log.d(com.robic.zoran.arduinoemulator.BlueToothService.TAG, "Process MV message from Client)");
rdy();
return ;
}
if (chkMsg(msg, com.robic.zoran.ard... | private void processMsg(java.lang.String msg) {
if (chkMsg(msg, com.robic.zoran.arduinoemulator.BlueToothService.MOVE)) {
android.util.Log.d(com.robic.zoran.arduinoemulator.BlueToothService.TAG, "Process MV message from Client)");
rdy();
return ;
}
if (chkMsg(msg, com.robic.zoran.ard... |
public void autologin(java.lang.String username, java.lang.String password) {
org.springframework.security.core.userdetails.UserDetails userDetails = userDetailsService.loadUserByUsername(username);
org.springframework.security.authentication.UsernamePasswordAuthenticationToken authenticationToken = new org.spr... | public void autologin(java.lang.String username, java.lang.String password) {
org.springframework.security.core.userdetails.UserDetails userDetails = userDetailsService.loadUserByUsername(username);
org.springframework.security.authentication.UsernamePasswordAuthenticationToken authenticationToken = new org.spr... |
private android.content.Intent createShareIntent() {
android.content.Intent shareIntent = new android.content.Intent(android.content.Intent.ACTION_SEND);
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
shareIntent.setType("text/plain");
java.lang.String msg = (movie.getTitle()) + " ";
... | private android.content.Intent createShareIntent() {
android.content.Intent shareIntent = new android.content.Intent(android.content.Intent.ACTION_SEND);
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
shareIntent.setType("text/plain");
java.lang.String msg = (movie.getTitle()) + " ";
... |
public boolean moreExpensiveThan(Apartment otherApartment) {
int aptPrice = (this.squareMeters) * (this.pricePerSquareMeter);
int otherAptPrice = (otherApartment.squareMeters) * (otherApartment.pricePerSquareMeter);
if (aptPrice > otherApartment) {
return true;
}else {
return false;
... | public boolean moreExpensiveThan(Apartment otherApartment) {
int aptPrice = (this.squareMeters) * (this.pricePerSquareMeter);
int otherAptPrice = (otherApartment.squareMeters) * (otherApartment.pricePerSquareMeter);
if (aptPrice > otherAptPrice) {
return true;
}else {
return false;
}... |
public void submit(org.openlmis.ivdform.service.VaccineReport report, java.lang.Long userId) {
report.setStatus(ReportStatus.SUBMITTED);
org.openlmis.ivdform.service.VaccineReport reportFromDb = getVaccineReportFromDbForUpdate(report);
repository.update(reportFromDb, report, userId);
repository.changeSt... | public void submit(org.openlmis.ivdform.service.VaccineReport report, java.lang.Long userId) {
report.setStatus(ReportStatus.SUBMITTED);
org.openlmis.ivdform.service.VaccineReport reportFromDb = getVaccineReportFromDbForUpdate(report);
repository.update(reportFromDb, report, userId);
repository.changeSt... |
public void onClick(android.view.View v) {
de.ollosoft.jarvis.common.data.JobExecutionResult response = de.ollosoft.jarvis.common.RequestHandler.sendRequest(mActivity, "j", de.ollosoft.jarvis.common.JobStringFactory.getRadiatorDisableString(java.util.Arrays.asList(rowPos.getName())));
if ((response.getHttpStatu... | public void onClick(android.view.View v) {
de.ollosoft.jarvis.common.data.JobExecutionResult response = de.ollosoft.jarvis.common.RequestHandler.sendRequest(mActivity, "j", de.ollosoft.jarvis.common.JobStringFactory.getRadiatorDisableString(java.util.Arrays.asList(rowPos.getName())));
if ((response.getHttpStatu... |
private java.util.List<hudson.plugins.cobertura.targets.CoverageMetric> findEmptyMetrics(java.util.Map<hudson.plugins.cobertura.targets.CoverageMetric, hudson.plugins.cobertura.Ratio> currMetricSet) {
java.util.List<hudson.plugins.cobertura.targets.CoverageMetric> allMetrics = new java.util.LinkedList<hudson.plugin... | private java.util.List<hudson.plugins.cobertura.targets.CoverageMetric> findEmptyMetrics(java.util.Map<hudson.plugins.cobertura.targets.CoverageMetric, hudson.plugins.cobertura.Ratio> currMetricSet) {
java.util.List<hudson.plugins.cobertura.targets.CoverageMetric> allMetrics = new java.util.LinkedList<hudson.plugin... |
public void addPointAsActive(java.awt.Point xy) {
int offset = (N) / 2;
for (int i = (xy.x) - offset; i <= ((xy.x) + offset); i++)
for (int j = (xy.y) - offset; j <= ((xy.y) + offset); j++)
active2.put(new java.awt.Point(i, j), false);
} | public void addPointAsActive(java.awt.Point xy) {
int offset = (N) / 2;
for (int i = (xy.x) - offset; i <= ((xy.x) + offset); i++)
for (int j = (xy.y) - offset; j <= ((xy.y) + offset); j++)
active2.add(new java.awt.Point(i, j));
} |
public int launch() {
try {
java.net.ServerSocket myconnex = new java.net.ServerSocket(port, 6);
this.state = STATE_LISTENING;
int currentByte = -1;
while (true) {
java.net.Socket connexion = server.accept();
try {
java.io.InputStream is = conn... | public int launch() {
try {
java.net.ServerSocket myconnex = new java.net.ServerSocket(port, 6);
this.state = STATE_LISTENING;
int currentByte = -1;
while (true) {
java.net.Socket connexion = myconnex.accept();
try {
java.io.InputStream is = co... |
private static com.badlogic.gdx.math.Vector2 levelToPhysicsPosition(float x, float y) {
x /= com.inhavok.fallen.Application.PIXELS_PER_METER;
y /= -(com.inhavok.fallen.Application.PIXELS_PER_METER);
y += ((com.inhavok.fallen.states.Level.tiles.length) * (com.inhavok.fallen.states.Level.tileSize)) / (com.inh... | private static com.badlogic.gdx.math.Vector2 levelToPhysicsPosition(float x, float y) {
x /= com.inhavok.fallen.Application.PIXELS_PER_METER;
y /= -(com.inhavok.fallen.Application.PIXELS_PER_METER);
y += (((com.inhavok.fallen.states.Level.tiles.length) - 1) * (com.inhavok.fallen.states.Level.tileSize)) / (c... |
public void updateProduktBatch(dto01917.ProduktBatchDTO produktbatch) throws daointerfaces01917.DALException {
try {
connector.doUpdate((((("UPDATE produktbatch SET status = " + (produktbatch.getStatus())) + " WHERE pb_id = ") + (produktbatch.getPbId())) + ")"));
} catch (java.sql.SQLException e) {
... | public void updateProduktBatch(dto01917.ProduktBatchDTO produktbatch) throws daointerfaces01917.DALException {
try {
connector.doUpdate(((("UPDATE produktbatch SET status = " + (produktbatch.getStatus())) + " WHERE pb_id = ") + (produktbatch.getPbId())));
} catch (java.sql.SQLException e) {
e.... |
protected void onDraw(android.graphics.Canvas canvas) {
android.util.Log.d("CoverFlowView", "onDraw");
final float offset = mOffset;
if ((offset - ((int) (offset))) == 0.0F) {
int top = getActuallyPosition(((int) (offset)));
if (top != (lastViewOnTopIndex)) {
lastViewOnTopIndex =... | protected void onDraw(android.graphics.Canvas canvas) {
final float offset = mOffset;
if ((offset - ((int) (offset))) == 0.0F) {
int top = getActuallyPosition(((int) (offset)));
if (top != (lastViewOnTopIndex)) {
lastViewOnTopIndex = top;
if ((mViewOnTopListener) != null)... |
public static int getTimeRemaining(org.bukkit.entity.Player player) {
java.lang.String name = player.getName();
long time = (java.lang.System.currentTimeMillis()) - (me.becja10.TogglePvP.Utils.Toggle.toggled.get(name));
return (me.becja10.TogglePvP.Main.getInstance().getConfig().getInt("Toggle Delay")) - ((... | public static int getTimeRemaining(java.lang.String name) {
long time = (java.lang.System.currentTimeMillis()) - (me.becja10.TogglePvP.Utils.Toggle.toggled.get(name));
return (me.becja10.TogglePvP.Main.getInstance().getConfig().getInt("Toggle Delay")) - (((int) (time)) / 1000);
} |
public static void loadCustomVillagerData() {
java.util.HashMap<java.lang.String, java.lang.String> villagerFiles = net.crazysnailboy.mods.villagertrades.util.FileUtils.createFileMap("villagers", ModConfiguration.loadVillagersFromJar);
net.crazysnailboy.mods.villagertrades.loaders.VillagerLoader.sortVillagers(v... | public static void loadCustomVillagerData() {
java.util.Map<java.lang.String, java.lang.String> villagerFiles = net.crazysnailboy.mods.villagertrades.loaders.VillagerLoader.sortVillagers(net.crazysnailboy.mods.villagertrades.util.FileUtils.createFileMap("villagers", ModConfiguration.loadVillagersFromJar));
for ... |
public void onRemoteClose(org.apache.qpid.proton.engine.Connection connection) {
synchronized(getLock()) {
connection.close();
connection.free();
for (org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext protonSession : sessions.values()) {
protonSession.close();
... | public void onRemoteClose(org.apache.qpid.proton.engine.Connection connection) {
synchronized(getLock()) {
connection.close();
connection.free();
}
for (org.apache.activemq.artemis.protocol.amqp.proton.AMQPSessionContext protonSession : sessions.values()) {
protonSession.close();
... |
private boolean dispatchUp(android.view.MotionEvent ev, int actionIndex) {
android.util.Log.d(com.github.alexpfx.fieldonmap.lib.InputDetector.TAG, ("dispatchUp: " + actionIndex));
int pointerId = ev.getPointerId(actionIndex);
int pointerIndex = ev.findPointerIndex(pointerId);
control.up(ev.getX(pointerI... | private boolean dispatchUp(android.view.MotionEvent ev, int actionIndex) {
android.util.Log.d(com.github.alexpfx.fieldonmap.lib.InputDetector.TAG, ("dispatchUp: " + actionIndex));
int pointerId = ev.getPointerId(actionIndex);
int pointerIndex = ev.findPointerIndex(pointerId);
control.up(ev.getX(pointerI... |
public void onAnimationFinished(android.graphics.drawable.AnimationDrawable animation, android.widget.ImageView view) {
if (animation.isRunning()) {
animation.stop();
}
if (view != null) {
view.setVisibility(View.GONE);
}
if ((mListener) != null) {
if ((animation.equals(mAniE... | public void onAnimationFinished(android.graphics.drawable.AnimationDrawable animation, android.widget.ImageView view) {
animation.stop();
if (view != null) {
view.setVisibility(View.GONE);
}
if ((mListener) != null) {
if ((animation.equals(mAniEvolutionSuccess)) || (animation.equals(mAni... |
public static com.etesync.syncadapter.model.JournalEntity fetch(io.requery.sql.EntityDataStore<io.requery.Persistable> data, java.lang.String url) {
com.etesync.syncadapter.model.JournalEntity ret = data.select(com.etesync.syncadapter.model.JournalEntity.class).where(JournalEntity.UID.eq(url)).limit(1).get().firstO... | public static com.etesync.syncadapter.model.JournalEntity fetch(io.requery.sql.EntityDataStore<io.requery.Persistable> data, java.lang.String url) {
com.etesync.syncadapter.model.JournalEntity ret = data.select(com.etesync.syncadapter.model.JournalEntity.class).where(JournalEntity.UID.eq(url)).limit(1).get().firstO... |
public void actionPerformed(java.awt.event.ActionEvent e) {
if ((radioButtonChan5.isSelected()) == false) {
try {
c.sendCommand("CONN 5");
} catch (java.io.IOException e1) {
e1.printStackTrace();
}
}else {
try {
c.sendCommand("DISC 5");
... | public void actionPerformed(java.awt.event.ActionEvent e) {
if ((radioButtonChan5.isSelected()) == true) {
try {
c.sendCommand("CONN 5");
} catch (java.io.IOException e1) {
e1.printStackTrace();
}
}else {
try {
c.sendCommand("DISC 5");
... |
private void loadReportList() {
if ((reportDirectory.length()) == 0)
return ;
java.io.File folder = new java.io.File(reportDirectory);
java.io.File[] listOfFiles = folder.listFiles();
for (int i = 0; i < (listOfFiles.length); i++) {
if (listOfFiles[i].isFile()) {
reports... | private void loadReportList() {
if ((reportDirectory.length()) == 0)
return ;
java.io.File folder = new java.io.File(reportDirectory);
java.io.File[] listOfFiles = folder.listFiles();
if (listOfFiles != null) {
for (int i = 0; i < (listOfFiles.length); i++) {
if (listOfF... |
void shutdownEmulator() {
mFpsCangedHandler = new android.os.Handler();
java.util.Calendar calendar = java.util.Calendar.getInstance();
mLastFpsChangedTime = calendar.get(java.util.Calendar.SECOND);
android.util.Log.e("CoreService", "STARTING TIMER 1");
mFpsCangedHandler.postDelayed(mLastFpsChangedC... | void shutdownEmulator() {
java.util.Calendar calendar = java.util.Calendar.getInstance();
mLastFpsChangedTime = calendar.get(java.util.Calendar.SECOND);
android.util.Log.e("CoreService", "STARTING TIMER 1");
mFpsCangedHandler.postDelayed(mLastFpsChangedChecker, 500);
mIsShuttingDown = true;
upda... |
public void handleSetEncryptionKeyExchangeOnGMeterResponse(final java.lang.String deviceIdentification, final java.lang.String organisationIdentification, final java.lang.String correlationUid, final java.lang.String messageType, final com.alliander.osgp.shared.infra.jms.ResponseMessageResultType responseMessageResultT... | public void handleSetEncryptionKeyExchangeOnGMeterResponse(final java.lang.String deviceIdentification, final java.lang.String organisationIdentification, final java.lang.String correlationUid, final java.lang.String messageType, final com.alliander.osgp.shared.infra.jms.ResponseMessageResultType responseMessageResultT... |
public java.lang.String[] getColumnNames() {
java.lang.String[] colNames = new java.lang.String[columns.length];
int colIndex = 0;
for (org.apache.spark.sql.api.java.StructField col : columns) {
colNames[colIndex] = col.getName();
}
return colNames;
} | public java.lang.String[] getColumnNames() {
java.lang.String[] colNames = new java.lang.String[columns.length];
int colIndex = 0;
for (org.apache.spark.sql.api.java.StructField col : columns) {
colNames[colIndex] = col.getName();
colIndex++;
}
return colNames;
} |
public void startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback scanCallback) {
if (isBluetoothLowEnergySupported()) {
if (((bluetoothAdapter.getState()) == (android.bluetooth.BluetoothAdapter.STATE_ON)) && (permissionChecker.hasScanPermissionCheckAndroid6())) {
android.util.Log.i("blu... | public void startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback scanCallback) {
if ((isBluetoothLowEnergySupported()) && ((crashCallBackWrapper) != null)) {
if (((bluetoothAdapter.getState()) == (android.bluetooth.BluetoothAdapter.STATE_ON)) && (permissionChecker.hasScanPermissionCheckAndroid6()))... |
protected void onSaveInstanceState(android.os.Bundle outState) {
super.onSaveInstanceState(outState);
outState.putString(com.huhx0015.doordashchallenge.view.activities.MainActivity.INSTANCE_FRAGMENT_TAG, mFragmentTag);
outState.putBoolean(com.huhx0015.doordashchallenge.view.activities.MainActivity.INSTANCE_... | protected void onSaveInstanceState(android.os.Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(com.huhx0015.doordashchallenge.view.activities.MainActivity.INSTANCE_IS_LOCATION_PERMISSIONS_ASKED, mIsLocationPermissionsAsked);
if ((mFragmentTag) != null) {
outState.putString... |
private double rangeErrorTroposphericModel(final org.orekit.estimation.measurements.GroundStation station, final org.orekit.propagation.SpacecraftState state) throws org.orekit.errors.OrekitException {
final org.hipparchus.geometry.euclidean.threed.Vector3D position = state.getPVCoordinates().getPosition();
fin... | private double rangeErrorTroposphericModel(final org.orekit.estimation.measurements.GroundStation station, final org.orekit.propagation.SpacecraftState state) throws org.orekit.errors.OrekitException {
final org.hipparchus.geometry.euclidean.threed.Vector3D position = state.getPVCoordinates().getPosition();
fin... |
public void onLoaderReset(android.support.v4.content.Loader<android.database.Cursor> loader) {
android.util.Log.v(com.example.kacyn.popularmovies.DetailActivityFragment.LOG_TAG, "in onLoaderReset");
switch (loader.getId()) {
case com.example.kacyn.popularmovies.DetailActivityFragment.DETAIL_LOADER :
... | public void onLoaderReset(android.support.v4.content.Loader<android.database.Cursor> loader) {
android.util.Log.v(com.example.kacyn.popularmovies.DetailActivityFragment.LOG_TAG, "in onLoaderReset");
switch (loader.getId()) {
case com.example.kacyn.popularmovies.DetailActivityFragment.DETAIL_LOADER :
... |
private void evalPossible() {
while (!(_deq.isEmpty())) {
int look = _deq.getTail();
if (isBranch(look)) {
_deq.pushFront(next1[look]);
_deq.pushFront(next2[look]);
}else {
_deq.pushFront(next1[look]);
}
}
if ((_deq.peekHead()) == 0) {
... | private void evalPossible() {
while (!(_deq.isEmpty())) {
int look = _deq.getTail();
if (isBranch(look)) {
_deq.pushFront(next1[look]);
_deq.pushFront(next2[look]);
}else {
_deq.pushFront(next1[look]);
}
}
if ((_deq.peekHead()) == 0) {
... |
public com.amazonaws.services.kinesis.scaling.ScalingOperationReport scaleUp(java.lang.String streamName, java.lang.String shardId, int byShardCount, java.lang.Integer minShards, java.lang.Integer maxShards) throws java.lang.Exception {
int openShardCount = com.amazonaws.services.kinesis.scaling.StreamScalingUtils.... | public com.amazonaws.services.kinesis.scaling.ScalingOperationReport scaleUp(java.lang.String streamName, java.lang.String shardId, int byShardCount, java.lang.Integer minShards, java.lang.Integer maxShards) throws java.lang.Exception {
int openShardCount = com.amazonaws.services.kinesis.scaling.StreamScalingUtils.... |
public static java.util.ArrayList<modles.Student> filterStudentsByInstrument(java.util.HashMap<java.lang.String, modles.Student> students, java.lang.String instrument) {
java.util.ArrayList<modles.Student> matches = new java.util.ArrayList<>();
for (java.lang.String key : students.keySet()) {
java.lang.... | public static java.util.ArrayList<modles.Student> filterStudentsByInstrument(java.util.HashMap<java.lang.String, modles.Student> students, java.lang.String instrument) {
java.util.ArrayList<modles.Student> matches = new java.util.ArrayList<>();
for (java.lang.String key : students.keySet()) {
if (studen... |
public static int choix2Jr() {
byte choix = 0;
do {
java.lang.System.out.println(source.pendu.LSD.getString("pen_choix2JR_msg1"));
java.lang.System.out.println(source.pendu.LSD.getString("pen_choix2JR_msg2"));
java.lang.System.out.println(source.pendu.LSD.getString("pen_choix2JR_msg3"));... | private static int choix2Jr() {
byte choix = 0;
do {
java.lang.System.out.println(source.pendu.LSD.getString("pen_choix2JR_msg1"));
java.lang.System.out.println(source.pendu.LSD.getString("pen_choix2JR_msg2"));
java.lang.System.out.println(source.pendu.LSD.getString("pen_choix2JR_msg3"))... |
public synchronized void run() {
while (true) {
DrumMachineUI.player.setTimeSignature4(DrumMachineUI.controlPanel.getTimeSignature());
if (DrumMachineUI.controlPanel.isPlaying()) {
java.lang.System.out.println("Test1");
DrumMachineUI.rhythmPanel.play();
try {
... | public synchronized void run() {
while (true) {
DrumMachineUI.player.setTimeSignature4(DrumMachineUI.controlPanel.getTimeSignature());
if (DrumMachineUI.controlPanel.isPlaying()) {
DrumMachineUI.rhythmPanel.play();
try {
java.lang.Thread.sleep(((60000 / (DrumM... |
public java.lang.String generateHTML(eu.excitementproject.eop.alignmentedas.p1eda.TEDecisionWithAlignment decision) throws eu.excitementproject.eop.alignmentedas.p1eda.visualization.VisualizerGenerationException {
org.apache.uima.jcas.JCas jCas = decision.getJCasWithAlignment();
java.util.Vector<eu.excitementpr... | public java.lang.String generateHTML(eu.excitementproject.eop.alignmentedas.p1eda.TEDecisionWithAlignment decision) throws eu.excitementproject.eop.alignmentedas.p1eda.visualization.VisualizerGenerationException {
init();
org.apache.uima.jcas.JCas jCas = decision.getJCasWithAlignment();
java.util.Vector<eu.... |
private boolean canMoveWithoutBeingChecked(java.util.ArrayList<pieces.piece.Piece> enemyPieces) {
for (int i = 0; i < (chessboard.Utils.BOARD_LENGTH); i++) {
for (int j = 0; j < (chessboard.Utils.BOARD_LENGTH); j++) {
boolean p = (canMove(i, j)) || (canCapture(i, j));
boolean q = !(w... | private boolean canMoveWithoutBeingChecked(java.util.ArrayList<pieces.piece.Piece> enemyPieces) {
for (int i = 0; i < (chessboard.Utils.BOARD_LENGTH); i++) {
for (int j = 0; j < (chessboard.Utils.BOARD_LENGTH); j++) {
if (((canMove(i, j)) || (canCapture(i, j))) && (!(would_be_checked(enemyPieces... |
public void add(java.lang.Character c) {
characters.add(c);
java.lang.System.out.println(("Before: " + (space)));
calcSpace();
java.lang.System.out.println(("After: " + (space)));
c.setCellMult(((c.getCellMult()) + (cellMult)));
c.setMoneyMult(((c.getMoneyMult()) + (moneyMult)));
c.setSuperC... | public void add(java.lang.Character c) {
characters.add(c);
calcSpace();
c.setCellMult(((c.getCellMult()) + (cellMult)));
c.setMoneyMult(((c.getMoneyMult()) + (moneyMult)));
c.setSuperCellMult(((c.getSuperCellMult()) + (superCellMult)));
} |
private java.lang.String getStringFromRegion(char[] source, org.eclipse.jface.text.IRegion region) {
java.lang.String str = "";
int beginIndex = region.getOffset();
int endIndex = beginIndex + (region.getLength());
for (int i = beginIndex; i < endIndex; i++) {
str += source[i];
}
return ... | private java.lang.String getStringFromRegion(char[] source, org.eclipse.jface.text.IRegion region) {
java.lang.String str = "";
int beginIndex = region.getOffset();
int endIndex = beginIndex + (region.getLength());
for (int i = beginIndex; i < endIndex; i++) {
if (i >= (source.length)) {
... |
public java.lang.Double getVariance() {
java.lang.Double mean = getMean();
java.lang.Double temp = 0.0;
for (java.lang.Double a : this.data)
temp += (mean - a) * (mean - a);
return temp / (this.size);
} | public java.lang.Double getVariance() {
java.lang.Double mean = getMean();
java.lang.Double temp = 0.0;
for (java.lang.Double a : this.data)
temp += (mean - a) * (mean - a);
return temp / ((this.size) - 1);
} |
public java.io.InputStream getInputStream(java.lang.String name) {
initPaths();
try {
for (java.util.Iterator iter = classPath.iterator(); iter.hasNext();) {
soot.JastAddJ.PathPart part = ((soot.JastAddJ.PathPart) (iter.next()));
if (part.selectCompilationUnit(name))
... | public java.io.InputStream getInputStream(java.lang.String name) {
initPaths();
try {
for (java.util.Iterator iter = classPath.iterator(); iter.hasNext();) {
soot.JastAddJ.PathPart part = ((soot.JastAddJ.PathPart) (iter.next()));
if (part.selectCompilationUnit(name))
... |
public android.content.ContentValues getRecipeContentValues(rstead.bgoff.mshultz.therecipebook.Recipe recipe) {
android.content.ContentValues recipeValues = new android.content.ContentValues();
recipeValues.put(NAME_COL, recipe.getName());
recipeValues.put(IMAGE_COL, recipe.getImageLink());
recipeValues... | private android.content.ContentValues getRecipeContentValues(rstead.bgoff.mshultz.therecipebook.Recipe recipe) {
android.content.ContentValues recipeValues = new android.content.ContentValues();
recipeValues.put(NAME_COL, recipe.getName());
recipeValues.put(IMAGE_COL, recipe.getImageLink());
recipeValue... |
public void onTextInput(java.lang.String content) {
if (content == null)
return ;
if ("".equals(content)) {
view.setTranslatedText("");
return ;
}
translatePreferences.setInputText(content);
if ((view) != null) {
view.detailsAreAvailable(false);
view.isSt... | public void onTextInput(java.lang.String content) {
if (content == null)
return ;
if ("".equals(content)) {
view.setTranslatedText(content, "");
return ;
}
translatePreferences.setInputText(content);
if ((view) != null) {
view.detailsAreAvailable(false);
... |
public void onAuthenticationHelp(final int helpMsgId, final java.lang.CharSequence helpString) {
com.tencent.soter.core.model.SLogger.w(com.tencent.soter.wrapper.wrap_task.TaskAuthentication.TAG, "soter: on authentication help. you do not need to cancel the authentication: %d, %s", helpMsgId, helpString);
com.t... | public void onAuthenticationHelp(final int helpMsgId, final java.lang.CharSequence helpString) {
com.tencent.soter.core.model.SLogger.w(com.tencent.soter.wrapper.wrap_task.TaskAuthentication.TAG, "soter: on authentication help. you do not need to cancel the authentication: %d, %s", helpMsgId, helpString);
com.t... |
public static void main(java.lang.String[] args) {
int ANZAHL_PARAMETER = 1;
int PARAMETER_NR_PROPERTY_FILE = 0;
java.lang.String USAGE = "USAGE: java -jar MusikPlayerGui <pfadDerPropertyDatei>";
if ((args.length) < ANZAHL_PARAMETER) {
java.lang.System.err.println(USAGE);
java.lang.Syste... | public static void main(java.lang.String[] args) {
int ANZAHL_PARAMETER = 1;
int PARAMETER_NR_PROPERTY_FILE = 0;
java.lang.String USAGE = "USAGE: java -jar MusikPlayerGui <pfadDerPropertyDatei>";
if ((args.length) < ANZAHL_PARAMETER) {
java.lang.System.err.println(USAGE);
java.lang.Syste... |
public java.lang.String showCityCenter(@org.springframework.web.bind.annotation.RequestParam
java.util.Map<java.lang.String, java.lang.String> allRequestParams, org.springframework.ui.Model model) {
org.exschool.pocketworld.controllers.city.center.CityCenterController.LOGGER.info(("Requested params:" + allRequestPa... | public java.lang.String showCityCenter(@org.springframework.web.bind.annotation.RequestParam
java.util.Map<java.lang.String, java.lang.String> allRequestParams, org.springframework.ui.Model model) {
org.exschool.pocketworld.controllers.city.center.CityCenterController.LOGGER.info(("Requested params:" + allRequestPa... |
public com.capitalone.dashboard.model.DataResponse<java.lang.Iterable<com.capitalone.dashboard.model.Dashboard>> getByServiceAndApplication(java.lang.String component, java.lang.String app) throws com.capitalone.dashboard.misc.HygieiaException {
com.capitalone.dashboard.model.Cmdb cmdbCompItem = cmdbService.configu... | public com.capitalone.dashboard.model.DataResponse<java.lang.Iterable<com.capitalone.dashboard.model.Dashboard>> getByServiceAndApplication(java.lang.String component, java.lang.String app) throws com.capitalone.dashboard.misc.HygieiaException {
com.capitalone.dashboard.model.Cmdb cmdbCompItem = cmdbService.configu... |
protected void onTextChanged(java.lang.CharSequence text, int start, int lengthBefore, int lengthAfter) {
super.onTextChanged(text, start, lengthBefore, lengthAfter);
if ((handler) == null) {
handler = new android.os.Handler();
}
handler.removeCallbacks(textChangeRunnable);
handler.postDelay... | protected void onTextChanged(java.lang.CharSequence text, int start, int lengthBefore, int lengthAfter) {
super.onTextChanged(text, start, lengthBefore, lengthAfter);
if ((handler) == null) {
handler = new android.os.Handler();
}
handler.removeCallbacks(textChangeRunnable);
handler.postDelay... |
private int getNextChangingElement(final int a0, final boolean white) {
int start = (white) ? 0 : 1;
for (int i = start; i < (changesReferenceRowCount); i += 2) {
if (a0 < (changesReferenceRow[i])) {
return i;
}
}
return 0;
} | private int getNextChangingElement(final int a0, final boolean white) {
int start = (white) ? 0 : 1;
for (int i = start; i < (changesReferenceRowCount); i += 2) {
if ((a0 < (changesReferenceRow[i])) || ((a0 == 0) && ((changesReferenceRow[i]) == 0))) {
return i;
}
}
return -1;... |
protected void onResume() {
super.onResume();
org.smap.smapTask.android.activities.MainTabsActivity.setupNFCDispatch(this, mNfcAdapter);
if (!(listenerRegistered)) {
android.content.IntentFilter filter = new android.content.IntentFilter();
filter.addAction("startTask");
filter.addAct... | protected void onResume() {
super.onResume();
if ((mNfcAdapter) != null) {
org.smap.smapTask.android.activities.MainTabsActivity.setupNFCDispatch(this, mNfcAdapter);
}
if (!(listenerRegistered)) {
android.content.IntentFilter filter = new android.content.IntentFilter();
filter.ad... |
public static boolean isValidDateStr(java.lang.String date) {
try {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd");
sdf.setLenient(false);
sdf.parse(date);
} catch (java.text.ParseException e) {
return false;
} catch (java.lang.IllegalArgumentExce... | private static boolean isValidDateStr(java.lang.String date) {
try {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd");
sdf.setLenient(false);
sdf.parse(date);
} catch (java.text.ParseException e) {
return false;
} catch (java.lang.IllegalArgumentExc... |
private static void setOption() {
me.leaver.assist.sqlclient.SqlClient.JDUL.addOption("d", "driver", true, "The driver name for your database");
me.leaver.assist.sqlclient.SqlClient.JDUL.addOption("u", "url", true, "The url for your database");
me.leaver.assist.sqlclient.SqlClient.JDUL.addOption("n", "name... | private static void setOption() {
me.leaver.assist.sqlclient.SqlClient.JDUL.addOption("d", "driver", true, "The driver name for your database");
me.leaver.assist.sqlclient.SqlClient.JDUL.addOption("u", "url", true, "The url for your database");
me.leaver.assist.sqlclient.SqlClient.JDUL.addOption("n", "name... |
public static void main(java.lang.String[] args) throws java.lang.InterruptedException {
int numberOfTests = 10;
for (int i = 0; i < numberOfTests; i++) {
boolean success = Main.testLauf();
if (!success) {
break;
}
}
} | public static void main(java.lang.String[] args) throws java.lang.InterruptedException {
int numberOfTests = 1;
for (int i = 0; i < numberOfTests; i++) {
boolean success = Main.testLauf();
if (!success) {
break;
}
}
} |
protected void writeToLog(org.apache.commons.logging.Log logger, java.lang.String message, java.lang.Throwable ex) {
if (ex != null) {
logger.error(ex);
}else
if (message.contains("ENTER")) {
logger.info(message);
}else
if (message.contains("EXIT")) {
... | protected void writeToLog(org.apache.commons.logging.Log logger, java.lang.String message, java.lang.Throwable ex) {
if (ex != null) {
logger.error(ex);
}else
if (message.contains("ENTER")) {
logger.debug(message);
}else
if (message.contains("EXIT")) {
... |
public static void writeObject(org.json.JSONObject object, java.lang.String path) {
try {
java.nio.file.Path p = new java.io.File(path).toPath();
if (!(p.toFile().exists())) {
throw new java.lang.RuntimeException("Configuration file does not exist!");
}
java.nio.file.File... | public static void writeObject(org.json.JSONObject object, java.lang.String path) {
try {
java.nio.file.Path p = new java.io.File(path).toPath();
if (!(p.toFile().exists())) {
java.lang.System.out.println("Configuration file does not exist!");
return ;
}
java.... |
public int getCanvasWidth() {
int width = 0;
int tempWidth = 0;
try {
for (HtmlComponent component : htmlComponents)
if (component.isVisible())
if (isBreak(component)) {
width = java.lang.Math.max(width, tempWidth);
tempWidth = 0;
... | public int getCanvasWidth() {
int width = 0;
int tempWidth = 0;
if ((htmlComponents) == null)
return 0;
try {
for (HtmlComponent component : htmlComponents)
if (component.isVisible())
if (isBreak(component)) {
width = java.lang.Math.ma... |
public void addCiw1w2(double[][][] oiw1w2) {
for (int i = 0; i < (Bdd.CircularCounter.imax); i++) {
for (int w1 = 0; w1 < 4; w1++) {
for (int w2 = 0; w2 < 4; w2++) {
oiw1w2[i][w1][w2] += (3 * (ciw1w2[i][w1][w2])) / (geneLength);
}
}
}
} | public void addCiw1w2(double[][][] oiw1w2) {
for (int i = 0; i <= (Bdd.CircularCounter.imax); i++) {
for (int w1 = 0; w1 < 4; w1++) {
for (int w2 = 0; w2 < 4; w2++) {
oiw1w2[i][w1][w2] += (3 * (ciw1w2[i][w1][w2])) / (geneLength);
}
}
}
} |
private boolean userNotTaggedYet(java.lang.String userName) {
boolean userFound = true;
if (!(instaTagList.isEmpty())) {
for (android.view.View user : instaTagList) {
if (((android.widget.TextView) (user.findViewById(R.id.tag_text_view))).getText().toString().equals(userName)) {
... | private boolean userNotTaggedYet(java.lang.String userName) {
boolean userFound = true;
if (!(instaTagList.isEmpty())) {
for (android.view.View user : instaTagList) {
if (((android.widget.TextView) (user.findViewById(R.id.tag_text_view))).getText().toString().equals(userName)) {
... |
public java.nio.file.FileVisitResult preVisitDirectory(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException {
if (!(dir.equals(basePath))) {
tarArchiveOutputStream.putArchiveEntry(new org.apache.commons.compress.archivers.tar.TarArchiveEntry(alien4cloud.utils... | public java.nio.file.FileVisitResult preVisitDirectory(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException {
if (!(dir.equals(basePath))) {
tarArchiveOutputStream.putArchiveEntry(new org.apache.commons.compress.archivers.tar.TarArchiveEntry(alien4cloud.utils... |
private static void Subtract(double[] p_source, double p_value, double[] p_destination) {
for (int i = 0; i < ((p_source.length) - 1); i++)
p_destination[i] = (p_source[i]) - p_value;
} | private static void Subtract(double[] p_source, double[] p_value, double[] p_destination) {
for (int i = 0; i < ((p_source.length) - 1); i++)
p_destination[i] = (p_source[i]) - (p_value[i]);
} |
private boolean serializeStringInto(java.io.ByteArrayOutputStream serialized, @android.support.annotation.NonNull
java.lang.String s) {
try {
serialized.write(android.util.Base64.encode(s.getBytes(), Base64.NO_WRAP));
} catch (java.io.IOException e) {
return false;
}
serialized.write(','... | private boolean serializeStringInto(java.io.ByteArrayOutputStream serialized, @android.support.annotation.Nullable
java.lang.String s) {
if (s != null) {
try {
serialized.write(android.util.Base64.encode(s.getBytes(), Base64.NO_WRAP));
} catch (java.io.IOException e) {
return... |
private E newBufferPoll(E[] nextBuffer, final long index) {
final long offsetInNew = newBufferAndOffset(nextBuffer, index);
final E n = org.jctools.queues.MpscGrowableArrayQueue.lvElement(nextBuffer, offsetInNew);
if (null == n) {
throw new java.lang.IllegalStateException("new buffer must have at le... | private E newBufferPoll(E[] nextBuffer, final long index) {
final long offsetInNew = newBufferAndOffset(nextBuffer, index);
final E n = org.jctools.queues.MpscGrowableArrayQueue.lvElement(nextBuffer, offsetInNew);
if (null == n) {
throw new java.lang.IllegalStateException("new buffer must have at le... |
private boolean checkIfOnBoard(int[] move) {
boolean a = ((move[0]) < (board.getBoardSize())) && ((move[0]) < (board.getBoardSize()));
return a;
} | private boolean checkIfOnBoard(int[] move) {
boolean a = ((move[0]) < (board.getBoardSize())) && ((move[1]) < (board.getBoardSize()));
return a;
} |
private boolean processUserChoice(int choice) {
switch (choice) {
case 1 :
dealer.dealSingleCard(player);
player.reconcileValues();
player.valuateHand();
return checkForWin();
case 0 :
dealer.dealSingleCard(dealer);
player.recon... | private boolean processUserChoice(int choice) {
switch (choice) {
case 1 :
dealer.dealSingleCard(player);
player.reconcileValues();
return checkForWin();
case 0 :
dealer.dealSingleCard(dealer);
dealer.reconcileValues();
nextTurn... |
private void loadBindings(java.io.InputStream stream) throws java.io.IOException {
assert stream != null;
hotkeyBindings.clear();
hotkeyBindings.loadFromXML(stream);
stream.close();
for (java.lang.String keyString : hotkeyBindings.stringPropertyNames()) {
java.lang.String actionName = hotkey... | private void loadBindings(java.io.InputStream stream) throws java.io.IOException {
assert stream != null;
hotkeyBindings.clear();
hotkeyBindings.loadFromXML(stream);
for (java.lang.String keyString : hotkeyBindings.stringPropertyNames()) {
java.lang.String actionName = hotkeyBindings.getProperty... |
public static java.lang.Long calculateQuotaUsedInPercent(com.orange.clara.cloud.servicedbdumper.model.DbDumperServiceInstance dbDumperServiceInstance) {
com.orange.clara.cloud.servicedbdumper.model.DbDumperPlan dbDumperPlan = dbDumperServiceInstance.getDbDumperPlan();
if ((dbDumperPlan.getSize()) == null) {
... | public static java.lang.Long calculateQuotaUsedInPercent(com.orange.clara.cloud.servicedbdumper.model.DbDumperServiceInstance dbDumperServiceInstance) {
com.orange.clara.cloud.servicedbdumper.model.DbDumperPlan dbDumperPlan = dbDumperServiceInstance.getDbDumperPlan();
if (((dbDumperPlan.getSize()) == null) || (... |
public void changeUserRelation(java.lang.String uid, java.lang.String relation) {
com.google.firebase.database.DatabaseReference ref = mDbReference.child("users").child(getCurrentUser().getUid()).child("friendList").child(uid);
ref.removeValue();
ref.setValue(relation);
} | public void changeUserRelation(java.lang.String uid, java.lang.String relation) {
com.google.firebase.database.DatabaseReference ref = mDbReference.child("users").child(getCurrentUser().getUid()).child("friendList").child(uid);
ref.removeValue();
ref.setValue(relation);
ref = mDbReference.child("users")... |
public void execute(cz.cvut.fit.brabepa1.run.interpret.VirtualMachine vm) {
java.lang.Integer val1 = ((java.lang.Integer) (vm.stackPop()));
java.lang.Integer val2 = ((java.lang.Integer) (vm.stackPop()));
if (val1 < val2) {
vm.incrementPc();
}else {
vm.addOffsetToPc(branchOffset);
}
} | public void execute(cz.cvut.fit.brabepa1.run.interpret.VirtualMachine vm) {
java.lang.Integer val1 = ((java.lang.Integer) (vm.stackPop()));
java.lang.Integer val2 = ((java.lang.Integer) (vm.stackPop()));
if (val2 < val1) {
vm.incrementPc();
}else {
vm.addOffsetToPc(branchOffset);
}
} |
public void processFinish(java.lang.Object[] result) {
if ((result == null) || ((result.length) == 0)) {
return ;
}
android.graphics.drawable.BitmapDrawable image = ((android.graphics.drawable.BitmapDrawable) (result[0]));
android.graphics.Bitmap bitmap = image.getBitmap();
if (image != null... | public void processFinish(java.lang.Object[] result) {
if ((result == null) || ((result.length) == 0)) {
return ;
}
android.graphics.drawable.BitmapDrawable image = ((android.graphics.drawable.BitmapDrawable) (result[0]));
if (image != null) {
android.graphics.Bitmap bitmap = image.getBi... |
protected void onCreate(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_coffees);
butterknife.ButterKnife.bind(this);
setUpToolbar(mToolbar, false);
mNetworkChangeBroadca... | protected void onCreate(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_coffees);
butterknife.ButterKnife.bind(this);
setUpToolbar();
mNetworkChangeBroadcastReceiver = ne... |
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException {
core.Server serv = ((core.Server) (request.getServletContext().getAttribute("server")));
serv.decActiveUsers();
javax.servlet.http... | protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException {
javax.servlet.http.HttpSession session = request.getSession();
try {
session.invalidate();
response.sendRedirect("inde... |
public com.google.firebase.database.DatabaseReference getUserReference(java.lang.String email) {
com.google.firebase.database.DatabaseReference userReference = null;
if (email != null) {
java.lang.String emailKey = email.replace(".", "_");
userReference = dataReference.getRoot().child(luque.davi... | private com.google.firebase.database.DatabaseReference getUserReference(java.lang.String email) {
com.google.firebase.database.DatabaseReference userReference = null;
if (email != null) {
java.lang.String emailKey = email.replace(".", "_");
userReference = dataReference.getRoot().child(luque.dav... |
public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column) {
if ((row % (buttonRow)) != 0) {
this.editorValue = value;
return null;
}
return super.getTableCellEditorComponent(table, value, isSelected, row, ... | public java.awt.Component getTableCellEditorComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, int row, int column) {
java.lang.System.out.println(row);
if ((row % (buttonRow)) != 0) {
this.editorValue = value;
return null;
}
return super.getTableCellEditorCo... |
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
userIdentitySubAppSession = ((com.bitdubai.fermat_dap_android_sub_app_asset_user_identity_bitdubai.session.UserIdentitySubAppSession) (appSession));
moduleManager = userIdentitySubAppSession.ge... | public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
userIdentitySubAppSession = ((com.bitdubai.fermat_dap_android_sub_app_asset_user_identity_bitdubai.session.UserIdentitySubAppSession) (appSession));
moduleManager = userIdentitySubAppSession.ge... |
private void engineMove() {
switch (difficulty) {
case "easy" :
engine.sendCommand("go depth 1");
break;
case "medium" :
engine.sendCommand("go depth 5");
break;
case "hard" :
engine.sendCommand("go depth 10");
break;
... | private void engineMove() {
switch (difficulty) {
case "easy" :
engine.sendCommand("go depth 1");
break;
case "medium" :
engine.sendCommand("go depth 5");
break;
case "hard" :
engine.sendCommand("go depth 10");
break;
... |
public void suffer(int damage, me.trotyl.arena.effect.Effect effect) {
health -= damage;
if (effect.equals(this.effect)) {
this.effect.append(effect.getRemain());
}else
if (!(effect.equals(Effect.none))) {
this.effect = effect;
}
} | public void suffer(int damage, me.trotyl.arena.effect.Effect effect) {
health -= damage;
if (effect.getClass().equals(this.effect.getClass())) {
this.effect.append(effect.getRemain());
}else
if (!(effect.equals(Effect.none))) {
this.effect = effect;
}
} |
private void stopGPS(android.app.Activity activity) {
if (((android.support.v4.app.ActivityCompat.checkSelfPermission(activity, android.Manifest.permission.ACCESS_FINE_LOCATION)) != (android.content.pm.PackageManager.PERMISSION_GRANTED)) && ((android.support.v4.app.ActivityCompat.checkSelfPermission(activity, andro... | public void stopGPS(android.app.Activity activity) {
if (((android.support.v4.app.ActivityCompat.checkSelfPermission(activity, android.Manifest.permission.ACCESS_FINE_LOCATION)) != (android.content.pm.PackageManager.PERMISSION_GRANTED)) && ((android.support.v4.app.ActivityCompat.checkSelfPermission(activity, androi... |
private void fetchHabits() {
com.example.giddu.habittrackerapp.HabitDbHelper mDbHelper = new com.example.giddu.habittrackerapp.HabitDbHelper(this);
android.database.sqlite.SQLiteDatabase db = mDbHelper.getReadableDatabase();
java.lang.String[] projection = new java.lang.String[]{ com.example.giddu.habittrac... | private android.database.Cursor fetchHabits() {
com.example.giddu.habittrackerapp.HabitDbHelper mDbHelper = new com.example.giddu.habittrackerapp.HabitDbHelper(this);
android.database.sqlite.SQLiteDatabase db = mDbHelper.getReadableDatabase();
java.lang.String[] projection = new java.lang.String[]{ com.exam... |
public java.lang.Boolean saveMessage(com.gescc.hedwig.vo.Message message) {
try {
messageList.add(message);
} catch (java.lang.Exception e) {
e.printStackTrace();
return false;
}
try {
this.saveFile();
} catch (com.fasterxml.jackson.core.JsonGenerationException e) {
... | public java.lang.Boolean saveMessage(com.gescc.hedwig.vo.Message message) {
try {
messageList.add(message);
} catch (java.lang.Exception e) {
e.printStackTrace();
return false;
}
try {
this.saveFile();
} catch (java.lang.Throwable e) {
e.printStackTrace();
... |
public com.push.app.model.ArticlePost getCachedPosts() {
sharedPreferences = getSharedPreferences("preferences", Activity.MODE_PRIVATE);
com.push.app.model.ArticlePost articlePost = new com.push.app.model.ArticlePost();
if ((sharedPreferences) != null) {
com.google.gson.Gson gson = new com.google.gs... | public com.push.app.model.ArticlePost getCachedPosts(java.lang.String key) {
sharedPreferences = getSharedPreferences("preferences", Activity.MODE_PRIVATE);
com.push.app.model.ArticlePost articlePost = new com.push.app.model.ArticlePost();
if ((sharedPreferences) != null) {
com.google.gson.Gson gson... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.