buggy_function
stringlengths 1
391k
| fixed_function
stringlengths 0
392k
|
---|---|
public static java.lang.String getMarkerTitle(im.goody.android.data.dto.Deal deal) {
java.lang.String title;
if (deal == null)
return null;
if (im.goody.android.utils.TextUtils.isEmpty(deal.getTitle()))
title = (deal.getDescription().substring(0, Constants.TITLE_CHARACTERS_COUNT).trim()) + "...";
else
title = deal.getTitle();
return title;
} | public static java.lang.String getMarkerTitle(im.goody.android.data.dto.Deal deal) {
java.lang.String title;
if (deal == null)
return null;
if (im.goody.android.utils.TextUtils.isEmpty(deal.getTitle()))
title = deal.getDescription();
else
title = deal.getTitle();
return title;
} |
public void backButtonClicked() {
javafx.stage.Stage primaryStage = ((javafx.stage.Stage) (floorChoiceBox.getScene().getWindow()));
try {
loadScene(primaryStage, "/MainMenu.fxml", ((int) (anchorPane.getWidth())), ((int) (anchorPane.getHeight())));
} catch (java.lang.Exception e) {
java.lang.System.out.println("Cannot load main menu");
e.printStackTrace();
}
} | public void backButtonClicked() {
javafx.stage.Stage primaryStage = ((javafx.stage.Stage) (floorChoiceBox.getScene().getWindow()));
try {
loadScene(primaryStage, "/MainMenu.fxml");
} catch (java.lang.Exception e) {
java.lang.System.out.println("Cannot load main menu");
e.printStackTrace();
}
} |
public void resumeJob(space.SpaceImpl space) {
for (java.lang.Long key : this.shadow.keySet()) {
try {
this.readyQueue.put(this.shadow.get(key));
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
}
for (system.Computer computer : this.computerList) {
system.ComputerProxy computerProxy = new system.ComputerProxy(space, computer, this.jobId, this.lock);
computerProxy.startWorker();
}
} | public void resumeJob(space.SpaceImpl space) {
for (java.lang.Long key : this.shadow.keySet()) {
try {
synchronized(this.readyQueue) {
this.readyQueue.put(this.shadow.get(key));
}
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
}
for (system.Computer computer : this.computerList) {
system.ComputerProxy computerProxy = new system.ComputerProxy(space, computer, this.jobId, this.lock);
computerProxy.startWorker();
}
} |
public void setup() {
size(800, 600, de.fhpotsdam.unfolding.OPENGL);
map = new de.fhpotsdam.unfolding.UnfoldingMap(this);
map.zoomAndPanTo(new de.fhpotsdam.unfolding.geo.Location(52.5F, 13.4F), 10);
map.setZoomRange(minZoomLevel, maxZoomLevel);
map.setTweening(true);
de.fhpotsdam.unfolding.utils.MapUtils.createDefaultEventDispatcher(this, map);
} | public void setup() {
size(800, 600, de.fhpotsdam.unfolding.OPENGL);
map = new de.fhpotsdam.unfolding.UnfoldingMap(this);
map.zoomAndPanTo(10, new de.fhpotsdam.unfolding.geo.Location(52.5F, 13.4F));
map.setZoomRange(minZoomLevel, maxZoomLevel);
map.setTweening(true);
de.fhpotsdam.unfolding.utils.MapUtils.createDefaultEventDispatcher(this, map);
} |
public void stopService() {
android.util.Log.d(com.github.pires.obd.reader.io.ObdGatewayService.TAG, "Stopping service..");
notificationManager.cancel(com.github.pires.obd.reader.io.NOTIFICATION_ID);
jobsQueue.clear();
isRunning = false;
if ((sock) != null)
try {
sock.close();
} catch (java.io.IOException e) {
android.util.Log.e(com.github.pires.obd.reader.io.ObdGatewayService.TAG, e.getMessage());
}
stopSelf();
} | public void stopService() {
android.util.Log.d(com.github.pires.obd.reader.io.ObdGatewayService.TAG, "Stopping service..");
jobsQueue.clear();
isRunning = false;
if ((sock) != null)
try {
sock.close();
} catch (java.io.IOException e) {
android.util.Log.e(com.github.pires.obd.reader.io.ObdGatewayService.TAG, e.getMessage());
}
stopSelf();
} |
private void dropPartition(java.lang.String databaseName, java.lang.String tableName, java.lang.String partitionName) {
if (!(partitions.containsKey(tableName))) {
throw new org.apache.tajo.catalog.store.NoSuchPartitionException(databaseName, tableName, partitionName);
}else {
partitions.get(tableName).remove(partitionName);
}
} | private void dropPartition(java.lang.String databaseName, java.lang.String tableName, java.lang.String partitionName) {
if ((partitions.containsKey(tableName)) && (!(partitions.get(tableName).containsKey(partitionName)))) {
throw new org.apache.tajo.catalog.store.NoSuchPartitionException(databaseName, tableName, partitionName);
}else {
partitions.get(tableName).remove(partitionName);
}
} |
public org.moqui.impl.entity.EntityValue previous() {
try {
if (rs.previous()) {
org.moqui.impl.entity.EntityValueBase evb = ((org.moqui.impl.entity.EntityValueBase) (currentEntityValue()));
if ((txCache) != null) {
org.moqui.impl.entity.EntityJavaUtil.WriteMode writeMode = txCache.checkUpdateValue(evb);
if (writeMode.equals(EntityJavaUtil.WriteMode.DELETE))
return this.previous();
}
return evb;
}else {
return null;
}
} catch (java.sql.SQLException e) {
throw new org.moqui.impl.entity.EntityException("Error getting previous result", e);
}
} | public org.moqui.impl.entity.EntityValue previous() {
try {
if (rs.previous()) {
org.moqui.impl.entity.EntityValueBase evb = ((org.moqui.impl.entity.EntityValueBase) (currentEntityValue()));
if ((txCache) != null) {
org.moqui.impl.entity.EntityJavaUtil.WriteMode writeMode = txCache.checkUpdateValue(evb);
if (writeMode == (EntityJavaUtil.WriteMode.DELETE))
return this.previous();
}
return evb;
}else {
return null;
}
} catch (java.sql.SQLException e) {
throw new org.moqui.impl.entity.EntityException("Error getting previous result", e);
}
} |
public void call(final rx.Subscriber<java.lang.Object> subscriber) {
subscriber.add(rx.subscriptions.Subscriptions.from(future.addListener(new io.netty.util.concurrent.GenericFutureListener<io.netty.util.concurrent.Future>() {
@java.lang.Override
public void operationComplete(final io.netty.util.concurrent.Future future) throws java.lang.Exception {
if (!(future.isSuccess())) {
subscriber.onError(future.cause());
}
}
})));
} | public void call(final rx.Subscriber<java.lang.Object> subscriber) {
subscriber.add(rx.subscriptions.Subscriptions.from(future.addListener(new io.netty.util.concurrent.GenericFutureListener<io.netty.util.concurrent.Future<java.lang.Object>>() {
@java.lang.Override
public void operationComplete(final io.netty.util.concurrent.Future<java.lang.Object> f) throws java.lang.Exception {
if (!(f.isSuccess())) {
subscriber.onError(f.cause());
}
}
})));
} |
public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setupItems();
android.content.SharedPreferences sp = android.preference.PreferenceManager.getDefaultSharedPreferences(getActivity());
mUserShownDrawer = sp.getBoolean(com.jvanier.android.sendtocar.controllers.NavigationDrawerFragment.PREF_USER_SHOWN_DRAWER, false);
if (savedInstanceState != null) {
mFromSavedInstanceState = true;
}
} | public void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
android.content.SharedPreferences sp = android.preference.PreferenceManager.getDefaultSharedPreferences(getActivity());
mUserShownDrawer = sp.getBoolean(com.jvanier.android.sendtocar.controllers.NavigationDrawerFragment.PREF_USER_SHOWN_DRAWER, false);
if (savedInstanceState != null) {
mFromSavedInstanceState = true;
}
} |
public boolean shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.ItemRenderType type, net.minecraft.item.ItemStack item, net.doubledoordev.itemblacklist.client.ItemRendererHelper helper) {
net.minecraft.item.ItemStack unpacked = net.doubledoordev.itemblacklist.util.ItemBlacklisted.unpack(item);
net.minecraftforge.client.IItemRenderer renderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(unpacked, type);
if (renderer != null)
return renderer.shouldUseRenderHelper(type, unpacked, helper);
return helper != (ItemRendererHelper.INVENTORY_BLOCK);
} | public boolean shouldUseRenderHelper(net.minecraftforge.client.IItemRenderer.ItemRenderType.ItemRenderType type, net.minecraft.item.ItemStack item, net.doubledoordev.itemblacklist.client.ItemRendererHelper helper) {
net.minecraft.item.ItemStack unpacked = net.doubledoordev.itemblacklist.util.ItemBlacklisted.unpack(item);
if (unpacked == item)
return helper != (ItemRendererHelper.INVENTORY_BLOCK);
net.minecraftforge.client.IItemRenderer renderer = net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(unpacked, type);
if (renderer != null)
return renderer.shouldUseRenderHelper(type, unpacked, helper);
return helper != (ItemRendererHelper.INVENTORY_BLOCK);
} |
public void paste() {
ca.mcgill.cs.stg.jetuml.framework.GraphFrame frame = ((ca.mcgill.cs.stg.jetuml.framework.GraphFrame) (aDesktop.getSelectedFrame()));
if (frame == null) {
return ;
}
ca.mcgill.cs.stg.jetuml.graph.Graph curGraph = frame.getGraph();
ca.mcgill.cs.stg.jetuml.framework.GraphPanel panel = frame.getGraphPanel();
try {
ca.mcgill.cs.stg.jetuml.framework.SelectionList updatedSelectionList = aClipboard.pasteInto(curGraph);
panel.setSelectionList(updatedSelectionList);
panel.repaint();
} finally {
}
} | public void paste() {
ca.mcgill.cs.stg.jetuml.framework.GraphFrame frame = ((ca.mcgill.cs.stg.jetuml.framework.GraphFrame) (aDesktop.getSelectedFrame()));
if (frame == null) {
return ;
}
ca.mcgill.cs.stg.jetuml.graph.Graph curGraph = frame.getGraph();
ca.mcgill.cs.stg.jetuml.framework.GraphPanel panel = frame.getGraphPanel();
try {
ca.mcgill.cs.stg.jetuml.framework.SelectionList updatedSelectionList = aClipboard.pasteInto(panel);
panel.setSelectionList(updatedSelectionList);
panel.repaint();
} finally {
}
} |
public boolean match(java.lang.String resource, int line) {
if (line < (matches.length)) {
java.util.Set set = matches[line];
if (set != null) {
return set.contains(resource);
}
}
return false;
} | public boolean match(java.lang.String resource, int line) {
if (line < (matches.length)) {
if (line >= 0) {
java.util.Set set = matches[line];
if (set != null) {
return set.contains(resource);
}
}
}
return false;
} |
public boolean fire(int x, int y, com.michaelspoehr.warship.game.Map map) {
if (fireFilters.isEmpty()) {
com.michaelspoehr.warship.ships.Ship enemy = map.getObjectAt(x, y);
return enemy != null ? enemy.hit(x, y) : false;
}
boolean result = false;
for (com.michaelspoehr.warship.utils.ActionFilter filter : fireFilters) {
result = result & (filter.fire(x, y));
}
return result;
} | public boolean fire(int x, int y, com.michaelspoehr.warship.game.Map map) {
if (fireFilters.isEmpty()) {
com.michaelspoehr.warship.ships.Ship enemy = map.getObjectAt(x, y);
return enemy != null ? enemy.hit(x, y) : false;
}
boolean result = false;
for (com.michaelspoehr.warship.utils.ActionFilter filter : fireFilters) {
result = result | (filter.fire(x, y));
}
return result;
} |
private java.lang.Long mapRowToLong(java.lang.String... lst) {
long res = 0;
assert (lst.length) == (getN());
lst = lst;
for (int i = 0; i < (lst.length); ++i)
res |= ((long) (m.get(i).get(lst[i]))) << (offset[i]);
assert res != 0;
return res;
} | private java.lang.Long mapRowToLong(java.lang.String... lst) {
long res = 0;
assert (lst.length) == (getN());
for (int i = 0; i < (lst.length); ++i)
res |= ((long) (m.get(i).get(lst[i].toLowerCase()))) << (offset[i]);
assert res != 0;
return res;
} |
public void launchVocabGame(java.util.ArrayList<java.lang.String> titlesTopics, VocabularySystem.TypeOfGame type, int numberOfWords) {
for (java.lang.String s : titlesTopics) {
this.addSelectedTopic(s);
}
this.mergeTopicVocabulary();
this.vocabGame = new VocabularySystem.VocabularyGame(this.selectedTopic, type, numberOfWords, this.modeleLogger);
this.modeleLogger.addLog("MODELE A new game is launched.", LogLevel.INFO);
} | public void launchVocabGame(java.util.ArrayList<java.lang.String> titlesTopics, VocabularySystem.TypeOfGame type, int numberOfWords) {
this.mergeTopicVocabulary();
this.vocabGame = new VocabularySystem.VocabularyGame(this.selectedTopic, type, numberOfWords, this.modeleLogger);
this.modeleLogger.addLog("MODELE A new game is launched.", LogLevel.INFO);
} |
public void clear(final int index) {
if (locked)
throw new java.lang.IllegalAccessError("AreaSet is locked");
int pos;
if ((list.size()) < (uk.me.parabola.splitter.AreaSet.BIN_SEARCH_LIMIT)) {
list.rem(index);
}else {
pos = java.util.Arrays.binarySearch(list.elements(), index);
if (pos >= 0) {
list.removeInt(pos);
}
}
} | public void clear(final int index) {
if (locked)
throw new java.lang.IllegalAccessError("AreaSet is locked");
int pos;
if ((list.size()) < (uk.me.parabola.splitter.AreaSet.BIN_SEARCH_LIMIT)) {
list.rem(index);
}else {
pos = java.util.Arrays.binarySearch(list.elements(), 0, list.size(), index);
if (pos >= 0) {
list.removeInt(pos);
}
}
} |
public void resetView() {
isNotePageShow = false;
addButton.setVisibility(View.VISIBLE);
fragment_layout.setEnabled(true);
showDiary();
if ((lineChart) != null)
lineChart.invalidate();
updateCalendarView();
android.util.Log.d(com.ubicomp.ketdiary.fragment.DaybookFragment.TAG, ("DiaryCount:" + (diaryList.getChildCount())));
} | public void resetView() {
isNotePageShow = false;
addButton.setVisibility(View.VISIBLE);
fragment_layout.setEnabled(true);
showDiary();
if ((lineChart) != null)
lineChart.invalidate();
updateCalendarView((-1));
android.util.Log.d(com.ubicomp.ketdiary.fragment.DaybookFragment.TAG, ("DiaryCount:" + (diaryList.getChildCount())));
} |
public void remove(org.geogebra.common.kernel.geos.GeoElement output) {
for (int i = 0; i < (points.length); i++) {
if (((points[i]) == output) && (!(points[i].isDefined()))) {
removePoint(i);
return ;
}
}
super.remove();
} | public void remove(org.geogebra.common.kernel.geos.GeoElement output) {
for (int i = 0; i < (points.length); i++) {
if (((points[i]) == output) && (!(points[i].isDefined()))) {
removePoint(i);
if ((points.length) == 0) {
super.remove();
}
return ;
}
}
super.remove();
} |
public long insertItem(demo.kolorob.kolorobdemoversion.model.Health.HealthNewDBModelHospital hospital) {
if (!(isFieldExist(hospital.getHealthId()))) {
return insertItem(hospital.getId(), hospital.getHealthId(), hospital.getEmergencyavailable(), hospital.getEmergencynumber(), hospital.getAmbulanceavailable(), hospital.getAmbulancenumber(), hospital.getMaternityavailable(), hospital.getMaternitynumber(), hospital.getMaternityprivacy());
}else
return updateItem(hospital);
} | public long insertItem(demo.kolorob.kolorobdemoversion.model.Health.HealthNewDBModelHospital hospital) {
if (!(isFieldExist(hospital.getId()))) {
return insertItem(hospital.getId(), hospital.getHealthId(), hospital.getEmergencyavailable(), hospital.getEmergencynumber(), hospital.getAmbulanceavailable(), hospital.getAmbulancenumber(), hospital.getMaternityavailable(), hospital.getMaternitynumber(), hospital.getMaternityprivacy());
}else
return updateItem(hospital);
} |
public void sumWithChildren() {
long transactionId = 293;
double amount = 23.5;
double expectedAmount = amount + (AMOUNT);
transactionService.addTransaction(TRANSACTION_ID, transaction);
skroll.n26test.model.Transaction child = buildTransaction(transactionId, "car", amount);
child.setParentId(TRANSACTION_ID);
transactionService.addTransaction(transactionId, child);
double sum = skroll.n26test.TransactionService.calculateSum(TRANSACTION_ID);
assertEquals(expectedAmount, sum, DELTA);
} | public void sumWithChildren() {
long transactionId = 293;
double amount = 23.5;
double expectedAmount = amount + (AMOUNT);
transactionService.addTransaction(TRANSACTION_ID, transaction);
skroll.n26test.model.Transaction child = buildTransaction(transactionId, "car", amount);
child.setParentId(TRANSACTION_ID);
transactionService.addTransaction(transactionId, child);
double sum = transactionService.calculateSum(TRANSACTION_ID);
assertEquals(expectedAmount, sum, DELTA);
} |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_counter);
mCountText = ((android.widget.TextView) (findViewById(R.id.count)));
mGoogleApiClient = new com.google.android.gms.common.api.GoogleApiClient.Builder(this).addApi(Wearable.API).addConnectionCallbacks(mConnectionCallbacks).build();
} | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_counter);
mCountText = ((android.widget.TextView) (findViewById(R.id.count)));
mCountText.setText("0");
mGoogleApiClient = new com.google.android.gms.common.api.GoogleApiClient.Builder(this).addApi(Wearable.API).addConnectionCallbacks(mConnectionCallbacks).build();
} |
public void onRemoval(com.google.common.cache.RemovalNotification<java.lang.String, org.apache.storm.tuple.Tuple[]> removal) {
if (!(removal.wasEvicted()))
return ;
com.digitalpebble.stormcrawler.elasticsearch.persistence.StatusUpdaterBolt.LOG.error("Purged from waitAck {} with {} values", removal.getKey(), removal.getValue().length);
for (org.apache.storm.tuple.Tuple t : removal.getValue()) {
com.digitalpebble.stormcrawler.elasticsearch.persistence.StatusUpdaterBolt.super._collector.fail(t);
}
} | public void onRemoval(com.google.common.cache.RemovalNotification<java.lang.String, java.util.List<org.apache.storm.tuple.Tuple>> removal) {
if (!(removal.wasEvicted()))
return ;
com.digitalpebble.stormcrawler.elasticsearch.persistence.StatusUpdaterBolt.LOG.error("Purged from waitAck {} with {} values", removal.getKey(), removal.getValue().size());
for (org.apache.storm.tuple.Tuple t : removal.getValue()) {
_collector.fail(t);
}
} |
private void writeFile(xyz.luan.web.cthulhu.GcsFilename fileName, xyz.luan.web.cthulhu.GcsService gcsService, xyz.luan.web.cthulhu.Proxy.Request req) throws java.io.IOException {
xyz.luan.web.cthulhu.GcsFileOptions options = new xyz.luan.web.cthulhu.GcsFileOptions.Builder().mimeType(req.contentType).build();
xyz.luan.web.cthulhu.GcsOutputChannel outputChannel = gcsService.createOrReplace(fileName, options);
com.google.common.io.ByteStreams.copy(req.is, java.nio.channels.Channels.newOutputStream(outputChannel));
req.is.reset();
outputChannel.close();
} | private void writeFile(xyz.luan.web.cthulhu.GcsFilename fileName, xyz.luan.web.cthulhu.Proxy.Request req) throws java.io.IOException {
xyz.luan.web.cthulhu.GcsFileOptions options = new xyz.luan.web.cthulhu.GcsFileOptions.Builder().mimeType(req.contentType).build();
xyz.luan.web.cthulhu.GcsOutputChannel outputChannel = gcsService.createOrReplace(fileName, options);
com.google.common.io.ByteStreams.copy(req.is, java.nio.channels.Channels.newOutputStream(outputChannel));
req.is.reset();
outputChannel.close();
} |
static java.util.List<java.lang.Integer> createAlleleIndexMap(final java.util.List<org.broadinstitute.hellbender.utils.test.Allele> originalAlleles, final java.util.List<org.broadinstitute.hellbender.utils.test.Allele> sortedAlleles) {
final java.util.List<java.lang.Integer> mapping = new java.util.ArrayList(originalAlleles.size());
for (final org.broadinstitute.hellbender.utils.test.Allele a : originalAlleles) {
final int newIndex = sortedAlleles.indexOf(a);
mapping.add(newIndex);
}
return mapping;
} | static java.util.List<java.lang.Integer> createAlleleIndexMap(final java.util.List<org.broadinstitute.hellbender.utils.test.Allele> originalAlleles, final java.util.List<org.broadinstitute.hellbender.utils.test.Allele> sortedAlleles) {
final java.util.List<java.lang.Integer> mapping = new java.util.ArrayList(originalAlleles.size());
for (final org.broadinstitute.hellbender.utils.test.Allele a : sortedAlleles) {
final int newIndex = originalAlleles.indexOf(a);
mapping.add(newIndex);
}
return mapping;
} |
public double charge(net.minecraft.tileentity.TileEntity tile, double amt, boolean ignoreBandwidth) {
cofh.api.energy.IEnergyReceiver rec = asReceiver(tile);
return rec == null ? 0 : amt - ((rec.receiveEnergy(cn.academy.support.rf.RFReceiverManager.DEFAULT_DIR, ((int) (amt / (RFSupport.CONV_RATE))), false)) * (RFSupport.CONV_RATE));
} | public double charge(net.minecraft.tileentity.TileEntity tile, double amt, boolean ignoreBandwidth) {
cofh.api.energy.IEnergyReceiver rec = asReceiver(tile);
return rec == null ? amt : amt - (rec.receiveEnergy(cn.academy.support.rf.RFReceiverManager.DEFAULT_DIR, ((int) (amt)), false));
} |
public void handleMessage(@android.support.annotation.NonNull
android.os.Message msg) {
synchronized(com.alexvasilkov.events.cache.MemoryCache.CACHE) {
long now = android.os.SystemClock.uptimeMillis();
for (java.util.Iterator<java.util.Map.Entry<java.lang.String, com.alexvasilkov.events.cache.MemoryCache.CacheEntry>> iterator = com.alexvasilkov.events.cache.MemoryCache.CACHE.entrySet().iterator(); iterator.hasNext();) {
com.alexvasilkov.events.cache.MemoryCache.CacheEntry entry = iterator.next().getValue();
if ((entry.isClearExpired) && ((entry.expires) < now))
iterator.remove();
}
}
} | public void handleMessage(@android.support.annotation.NonNull
android.os.Message msg) {
synchronized(com.alexvasilkov.events.cache.MemoryCache.CACHE) {
long now = android.os.SystemClock.uptimeMillis();
java.util.Iterator<java.util.Map.Entry<java.lang.String, com.alexvasilkov.events.cache.MemoryCache.CacheEntry>> iterator = com.alexvasilkov.events.cache.MemoryCache.CACHE.entrySet().iterator();
while (iterator.hasNext()) {
com.alexvasilkov.events.cache.MemoryCache.CacheEntry entry = iterator.next().getValue();
if ((entry.isClearExpired) && ((entry.expires) < now))
iterator.remove();
}
}
} |
public final java.lang.String getSourceMacAddress() {
if ((this.sourceMacAddress) != null) {
return this.sourceMacAddress;
}
try {
return io.pkts.packet.impl.MACPacketImpl.toHexString(this.headers, 0, 6);
} catch (final java.io.IOException e) {
throw new java.lang.RuntimeException("Unable to read data from the underlying Buffer.", e);
}
} | public final java.lang.String getSourceMacAddress() {
if ((this.sourceMacAddress) != null) {
return this.sourceMacAddress;
}
try {
return io.pkts.packet.impl.MACPacketImpl.toHexString(this.headers, 6, 6);
} catch (final java.io.IOException e) {
throw new java.lang.RuntimeException("Unable to read data from the underlying Buffer.", e);
}
} |
public void release() {
if ((mServiceInterface) != null) {
try {
mServiceInterface.unregisterRemoteController(mCallbackHandler);
} catch (java.lang.IllegalStateException e) {
} catch (android.os.RemoteException e) {
}
mServiceInterface = null;
}
if ((mServiceConnection) != null) {
try {
mCtx.unbindService(mServiceConnection);
} catch (java.lang.IllegalStateException e) {
}
mServiceConnection = null;
}
mCallbackHandler = null;
} | public synchronized void release() {
if (((mServiceInterface) != null) && ((mCallbackHandler) != null)) {
try {
mServiceInterface.unregisterRemoteController(mCallbackHandler);
} catch (java.lang.IllegalStateException e) {
} catch (android.os.RemoteException e) {
}
mServiceInterface = null;
}
if ((mServiceConnection) != null) {
try {
mCtx.unbindService(mServiceConnection);
} catch (java.lang.IllegalStateException e) {
}
mServiceConnection = null;
}
mCallbackHandler = null;
} |
public void onAuthStateChanged(@android.support.annotation.NonNull
com.google.firebase.auth.FirebaseAuth firebaseAuth) {
if ((mUser) != null) {
android.widget.TextView loginInfor = ((android.widget.TextView) (findViewById(R.id.logininfor)));
loginInfor.setText((("Welcome, " + (mUser.getDisplayName())) + "!"));
android.util.Log.d(android.content.ContentValues.TAG, ((com.riversidecorps.rebuy.SingleListingActivity.AUTH_IN) + (mUser.getUid())));
}else {
android.util.Log.d(android.content.ContentValues.TAG, com.riversidecorps.rebuy.SingleListingActivity.AUTH_OUT);
}
} | public void onAuthStateChanged(@android.support.annotation.NonNull
com.google.firebase.auth.FirebaseAuth firebaseAuth) {
if ((mUser) != null) {
android.util.Log.d(android.content.ContentValues.TAG, ((com.riversidecorps.rebuy.SingleListingActivity.AUTH_IN) + (mUser.getUid())));
}else {
android.util.Log.d(android.content.ContentValues.TAG, com.riversidecorps.rebuy.SingleListingActivity.AUTH_OUT);
}
} |
public void onResolved(org.projectbuendia.client.diagnostics.HealthIssue healthIssue) {
synchronized(mIssuesLock) {
if (!(mActiveIssues.remove(healthIssue))) {
org.projectbuendia.client.diagnostics.Troubleshooter.LOG.w(("Attempted to remove health issue '%1$s' that the troubleshooter was not " + "previously aware of."), healthIssue.toString());
}
}
postTroubleshootingEvents();
} | public void onResolved(org.projectbuendia.client.diagnostics.HealthIssue healthIssue) {
synchronized(mIssuesLock) {
if (!(mActiveIssues.remove(healthIssue))) {
org.projectbuendia.client.diagnostics.Troubleshooter.LOG.w(("Attempted to remove health issue '%1$s' that the troubleshooter was not " + "previously aware of."), healthIssue.toString());
}
}
postTroubleshootingEvents(healthIssue);
} |
public void onSuccess(gobblin.writer.WriteResponse writeResponse) {
synchronized(this) {
_writeResponse = writeResponse;
_callbackFired = true;
if ((_innerCallback) != null) {
try {
_innerCallback.onSuccess(writeResponse);
} catch (java.lang.Exception e) {
log.error("Ignoring error thrown in callback", e);
}
}
notifyAll();
}
} | public void onSuccess(gobblin.writer.WriteResponse writeResponse) {
_writeResponse = writeResponse;
synchronized(this) {
_callbackFired = true;
if ((_innerCallback) != null) {
try {
_innerCallback.onSuccess(writeResponse);
} catch (java.lang.Exception e) {
log.error("Ignoring error thrown in callback", e);
}
}
notifyAll();
}
} |
public java.util.Optional<V> putBack(K key, V value) {
java.util.Optional<V> previous = get(key);
piotrrr.collections.DoublyLinkedMap.DoublyLinkedList.Node<V> node = list.pushBack(value);
map.put(key, node);
return previous;
} | public java.util.Optional<V> putBack(K key, V value) {
java.util.Optional<V> previous = remove(key);
piotrrr.collections.DoublyLinkedMap.DoublyLinkedList.Node<V> node = list.pushBack(value);
map.put(key, node);
return previous;
} |
public int read() throws java.io.IOException {
try {
if (this.endReached) {
return -1;
}
final java.lang.Integer value = queue.poll(org.restlet.engine.io.PipeStream.QUEUE_TIMEOUT, java.util.concurrent.TimeUnit.SECONDS);
this.endReached = value == (-1);
if (value == null) {
throw new java.io.IOException("Timeout while reading from the queue-based input stream");
}else {
return value.intValue();
}
} catch (java.lang.InterruptedException ie) {
throw new java.io.IOException("Interruption occurred while writing in the queue");
}
} | public int read() throws java.io.IOException {
try {
if (this.endReached) {
return -1;
}
final java.lang.Integer value = queue.poll(org.restlet.engine.io.PipeStream.QUEUE_TIMEOUT, java.util.concurrent.TimeUnit.SECONDS);
if (value == null) {
throw new java.io.IOException("Timeout while reading from the queue-based input stream");
}else {
this.endReached = value == (-1);
return value.intValue();
}
} catch (java.lang.InterruptedException ie) {
throw new java.io.IOException("Interruption occurred while writing in the queue");
}
} |
private static org.osgi.framework.Bundle bundleLookupWithInactive(java.lang.String bundleId) {
org.osgi.framework.Bundle[] bundles = org.eclipse.core.runtime.adaptor.EclipseStarter.getSystemBundleContext().getBundles();
org.osgi.framework.Bundle result = null;
org.osgi.framework.Version currVersion = org.osgi.framework.Version.emptyVersion;
for (org.osgi.framework.Bundle bundle : bundles) {
if ((bundle.getSymbolicName().contains(bundleId)) && ((bundle.getVersion().compareTo(currVersion)) > 0)) {
result = bundle;
currVersion = bundle.getVersion();
}
}
return result;
} | private static org.osgi.framework.Bundle bundleLookupWithInactive(java.lang.String bundleId) {
org.osgi.framework.Bundle[] bundles = org.eclipse.core.runtime.adaptor.EclipseStarter.getSystemBundleContext().getBundles();
org.osgi.framework.Bundle result = null;
org.osgi.framework.Version currVersion = org.osgi.framework.Version.emptyVersion;
for (org.osgi.framework.Bundle bundle : bundles) {
if ((bundle.getSymbolicName().equals(bundleId)) && ((bundle.getVersion().compareTo(currVersion)) > 0)) {
result = bundle;
currVersion = bundle.getVersion();
}
}
return result;
} |
private void dispatchClickEventToMarker(java.lang.String markerID) {
if (org.wwarn.mapcore.client.utils.StringUtils.isEmpty(markerID)) {
throw new java.lang.IllegalArgumentException("markerID was empty");
}
for (org.wwarn.mapcore.client.components.customwidgets.map.GenericMarker marker : markers) {
org.wwarn.mapcore.client.components.customwidgets.map.OfflineMapMarker offlineMapMarker = ((org.wwarn.mapcore.client.components.customwidgets.map.OfflineMapMarker) (marker));
if (offlineMapMarker.getMarkerID().equals(markerID)) {
offlineMapMarker.fireClickEvent();
}
}
} | private void dispatchClickEventToMarker(java.lang.String markerID, double x, double y) {
if (org.wwarn.mapcore.client.utils.StringUtils.isEmpty(markerID)) {
throw new java.lang.IllegalArgumentException("markerID was empty");
}
for (org.wwarn.mapcore.client.components.customwidgets.map.GenericMarker marker : markers) {
org.wwarn.mapcore.client.components.customwidgets.map.OfflineMapMarker offlineMapMarker = ((org.wwarn.mapcore.client.components.customwidgets.map.OfflineMapMarker) (marker));
if (offlineMapMarker.getMarkerID().equals(markerID)) {
offlineMapMarker.fireClickEvent(x, y);
}
}
} |
public boolean userExists(java.lang.String user) {
boolean userExists = false;
for (int i = 0; i < (userInfo.size()); i++) {
if (user == (userInfo.get(i).username)) {
userExists = true;
break;
}
}
return userExists;
} | public boolean userExists(java.lang.String user) {
boolean userExists = false;
for (int i = 0; i < (userInfo.size()); i++) {
if (user.equals(userInfo.get(i).username)) {
userExists = true;
break;
}
}
return userExists;
} |
if ((com.wizzer.mle.parts.actors.MleModelActor.m_delta) == null)
com.wizzer.mle.parts.actors.MleModelActor.m_delta = new com.wizzer.mle.math.MlRotation(new com.wizzer.mle.math.MlVector3(com.wizzer.mle.math.MlScalar.ML_SCALAR_ZERO, com.wizzer.mle.math.MlScalar.ML_SCALAR_ONE, com.wizzer.mle.math.MlScalar.ML_SCALAR_ZERO), ((float) (0.035)));
com.wizzer.mle.math.MlRotation rotation = actor.orientation.getProperty();
rotation.mul(com.wizzer.mle.parts.actors.MleModelActor.m_delta);
try {
actor.orientation.push(actor);
} catch (com.wizzer.mle.runtime.core.MleRuntimeException ex) {
}
} | if ((actor == null) || ((actor.orientation) == null))
return ;
if ((com.wizzer.mle.parts.actors.MleModelActor.m_delta) == null)
com.wizzer.mle.parts.actors.MleModelActor.m_delta = new com.wizzer.mle.math.MlRotation(new com.wizzer.mle.math.MlVector3(com.wizzer.mle.math.MlScalar.ML_SCALAR_ZERO, com.wizzer.mle.math.MlScalar.ML_SCALAR_ONE, com.wizzer.mle.math.MlScalar.ML_SCALAR_ZERO), ((float) (0.035)));
com.wizzer.mle.math.MlRotation rotation = actor.orientation.getProperty();
rotation.mul(com.wizzer.mle.parts.actors.MleModelActor.m_delta);
try {
actor.orientation.push(actor);
} catch (com.wizzer.mle.runtime.core.MleRuntimeException ex) {
}
} |
public static controllers.Result orderFail() {
java.lang.String email = session().get("email");
controllers.User user = controllers.User.find(email);
int userid = user.id;
controllers.Cart cart = controllers.Cart.getCart(email);
cart.clear(userid);
flash("failBuy", "Transaction canceled!");
return ok(orderresult.render());
} | public static controllers.Result orderFail() {
java.lang.String email = session().get("email");
controllers.User user = controllers.User.find(email);
int userid = user.id;
controllers.Cart cart = controllers.Cart.getCart(email);
controllers.Cart.clear(userid);
flash("failBuy", "Transaction canceled!");
return ok(orderresult.render());
} |
public double slopeTo(Point that) {
if ((this) == that)
return java.lang.Double.NEGATIVE_INFINITY;
if ((this.y) == (that.y))
return java.lang.Double.POSITIVE_INFINITY;
return ((that.y) - (this.y)) / ((that.x) - (this.x));
} | public double slopeTo(Point that) {
if ((this.compareTo(that)) == 0)
return java.lang.Double.NEGATIVE_INFINITY;
if ((this.y) == (that.y))
return java.lang.Double.POSITIVE_INFINITY;
return ((double) ((that.y) - (this.y))) / ((double) ((that.x) - (this.x)));
} |
public boolean checkDupUsername(java.lang.String username) throws java.sql.SQLException {
java.sql.Statement stmt = conn.createStatement();
java.sql.ResultSet rs = stmt.executeQuery((("SELECT COUNT(*) FROM TTEDB.Users where UserName = '" + username) + "'"));
rs.next();
int cnt = rs.getInt(1);
stmt.close();
return cnt == 0;
} | public boolean checkDupUsername(java.lang.String username) throws java.sql.SQLException {
java.sql.Statement stmt = conn.createStatement();
java.sql.ResultSet rs = stmt.executeQuery((("SELECT COUNT(*) FROM TTEDB.Users where UserName = '" + username) + "'"));
rs.next();
int cnt = rs.getInt(1);
stmt.close();
conn.close();
return cnt == 0;
} |
private com.molina.cvmfs.catalog.Catalog getOpenedCatalogForPath(java.lang.String path) {
com.molina.cvmfs.catalog.Catalog bestCatalog = retrieveRootCatalog();
int maxLength = 0;
for (com.molina.cvmfs.catalog.Catalog catalog : openedCatalogs.values()) {
int currentLength = path.indexOf(catalog.getRootPrefix());
if (currentLength > maxLength) {
bestCatalog = catalog;
}
}
return bestCatalog;
} | private com.molina.cvmfs.catalog.Catalog getOpenedCatalogForPath(java.lang.String path) {
com.molina.cvmfs.catalog.Catalog bestCatalog = retrieveRootCatalog();
int maxLength = 0;
for (com.molina.cvmfs.catalog.Catalog catalog : openedCatalogs.values()) {
if (((path.indexOf(catalog.getRootPrefix())) == 0) && ((catalog.getRootPrefix().length()) > maxLength)) {
bestCatalog = catalog;
maxLength = catalog.getRootPrefix().length();
}
}
return bestCatalog;
} |
public void run() {
setPosx(getX());
setPosy(getY());
setRunning(true);
setMoveTime(java.lang.System.currentTimeMillis());
while (isRunning()) {
try {
java.lang.Thread.sleep(frogger.REFRESH_RATE);
checkBehaviors();
update();
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
}
} | public void run() {
setPosx(getX());
setPosy(getY());
setRunning(true);
setMoveTime(java.lang.System.currentTimeMillis());
while (isRunning()) {
try {
java.lang.Thread.sleep(frogger.REFRESH_RATE);
update();
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
}
} |
public boolean onOptionsItemSelected(android.view.MenuItem item) {
int id = item.getItemId();
if (id == (R.id.action_settings)) {
android.content.Intent myIntent = new android.content.Intent(this, org.fslhome.videl.curiosityapplication.SettingsActivity.class);
startActivity(myIntent);
}
return super.onOptionsItemSelected(item);
} | public boolean onOptionsItemSelected(android.view.MenuItem item) {
int id = item.getItemId();
if (id == (R.id.action_settings)) {
android.content.Intent myIntent = new android.content.Intent(this, org.fslhome.videl.curiosityapplication.SettingsActivity.class);
startActivity(myIntent);
return true;
}
return super.onOptionsItemSelected(item);
} |
public int[] generate() {
int[] result = new int[6];
for (int i = 0; i < 6; i++) {
result[i] = random.nextInt(45);
}
return result;
} | public int[] generate() {
int[] result = new int[6];
for (int i = 0; i < 6; i++) {
result[i] = (random.nextInt(45)) + 1;
}
return result;
} |
public void bestGuessForString_nestedClass() {
com.google.common.truth.Truth.assert_().that(dagger.internal.codegen.writer.ClassName.bestGuessFromString(java.util.Map.Entry.class.getCanonicalName())).isEqualTo(dagger.internal.codegen.writer.ClassName.create("java.util", com.google.common.collect.ImmutableList.of("Map"), "Entry"));
com.google.common.truth.Truth.assert_().that(dagger.internal.codegen.writer.ClassName.bestGuessFromString(dagger.internal.codegen.writer.ClassNameTest.OuterClass.InnerClass.class.getCanonicalName())).isEqualTo(dagger.internal.codegen.writer.ClassName.create("dagger.internal.codegen.writer", com.google.common.collect.ImmutableList.of("ClassNameTest", "OuterClass"), "InnerClass"));
} | public void bestGuessForString_nestedClass() {
com.google.common.truth.Truth.assertThat(dagger.internal.codegen.writer.ClassName.bestGuessFromString(java.util.Map.Entry.class.getCanonicalName())).isEqualTo(dagger.internal.codegen.writer.ClassName.create("java.util", com.google.common.collect.ImmutableList.of("Map"), "Entry"));
com.google.common.truth.Truth.assertThat(dagger.internal.codegen.writer.ClassName.bestGuessFromString(dagger.internal.codegen.writer.ClassNameTest.OuterClass.InnerClass.class.getCanonicalName())).isEqualTo(dagger.internal.codegen.writer.ClassName.create("dagger.internal.codegen.writer", com.google.common.collect.ImmutableList.of("ClassNameTest", "OuterClass"), "InnerClass"));
} |
public void onActivated(net.minecraft.entity.player.EntityPlayer player, net.minecraft.item.ItemStack itemStack) {
if (occupied) {
if (itemStack == null) {
player.inventory.setInventorySlotContents(player.inventory.currentItem, getSwordToEject());
}else {
dropSword();
}
occupied = false;
markDirty();
}else {
if (ModItems.leechSword.equals(itemStack.getItem())) {
this.startRitual(player, itemStack);
}
}
} | public void onActivated(net.minecraft.entity.player.EntityPlayer player, net.minecraft.item.ItemStack itemStack) {
if (occupied) {
if (itemStack == null) {
player.inventory.setInventorySlotContents(player.inventory.currentItem, getSwordToEject());
}else {
dropSword();
}
occupied = false;
markDirty();
}else
if (itemStack != null) {
if (ModItems.leechSword.equals(itemStack.getItem())) {
this.startRitual(player, itemStack);
}
}
} |
public java.sql.ResultSet getDetails(java.lang.String qry, java.lang.String param, Main.ConnDetails connDeets) {
try {
java.sql.Connection conn = connecting.CreateConnection(connDeets);
java.sql.PreparedStatement st2 = conn.prepareStatement((qry + param));
qryResults = st2.executeQuery();
if ((qryResults) == null) {
java.lang.System.out.println("null query");
}
} catch (java.lang.Exception ex) {
javax.swing.JOptionPane.showMessageDialog(null, ex.toString());
}
return qryResults;
} | public java.sql.ResultSet getDetails(java.lang.String qry, java.lang.String param, Main.ConnDetails connDeets) {
try {
java.sql.Connection conn = connecting.CreateConnection(connDeets);
java.sql.PreparedStatement st2 = conn.prepareStatement((qry + param));
qryResults = st2.executeQuery();
if ((qryResults) == null) {
javax.swing.JOptionPane.showMessageDialog(null, "null query");
}
} catch (java.lang.Exception ex) {
javax.swing.JOptionPane.showMessageDialog(null, ex.toString());
}
return qryResults;
} |
public void run() {
controller.addClient(new net.ddns.akd.wincleaner.model.Client(Connections.handler.get(("" + (other.getInetAddress())))));
Connections.handler.put(("" + (other.getInetAddress())), new net.ddns.akd.wincleaner.network.ConnectionHandler(other));
Connections.handler.get(("" + (other.getInetAddress()))).startIncome(controller.getMainApp());
} | public void run() {
Connections.handler.put(("" + (other.getInetAddress())), new net.ddns.akd.wincleaner.network.ConnectionHandler(other));
controller.addClient(new net.ddns.akd.wincleaner.model.Client(Connections.handler.get(("" + (other.getInetAddress())))));
Connections.handler.get(("" + (other.getInetAddress()))).startIncome(controller.getMainApp());
} |
private void registerRecipe() {
if (!(this.getConfig().getBoolean("enableTakeEnchantment"))) {
for (org.bukkit.Material enchItem : func.getEnchantableMaterial()) {
org.bukkit.inventory.ShapelessRecipe sr = new org.bukkit.inventory.ShapelessRecipe(new org.bukkit.inventory.ItemStack(org.bukkit.Material.ENCHANTED_BOOK, 1));
sr.addIngredient(Material.BOOK);
sr.addIngredient(Material.EXP_BOTTLE);
sr.addIngredient(enchItem);
this.getServer().addRecipe(sr);
}
}
} | private void registerRecipe() {
if (this.getConfig().getBoolean("enableTakeEnchantment")) {
for (org.bukkit.Material enchItem : func.getEnchantableMaterial()) {
org.bukkit.inventory.ShapelessRecipe sr = new org.bukkit.inventory.ShapelessRecipe(new org.bukkit.inventory.ItemStack(org.bukkit.Material.ENCHANTED_BOOK, 1));
sr.addIngredient(Material.BOOK);
sr.addIngredient(Material.EXP_BOTTLE);
sr.addIngredient(enchItem);
this.getServer().addRecipe(sr);
}
}
} |
private void visitForPotentialSolutions(it.unibas.lunatic.model.chase.chasemc.DeltaChaseStep step) {
for (it.unibas.lunatic.model.chase.chasemc.DeltaChaseStep child : step.getChildren()) {
if (isLeaf(child)) {
if ((!(child.isDuplicate())) && (!(child.isInvalid()))) {
(counter)++;
}
}else {
visitForPotentialSolutions(child);
}
}
} | private void visitForPotentialSolutions(it.unibas.lunatic.model.chase.chasemc.DeltaChaseStep step) {
if (isLeaf(step)) {
if ((!(step.isDuplicate())) && (!(step.isInvalid()))) {
(counter)++;
}
}
for (it.unibas.lunatic.model.chase.chasemc.DeltaChaseStep child : step.getChildren()) {
visitForPotentialSolutions(child);
}
} |
public static models.NotificationEvent forNewIssue(models.Issue issue, models.User author) {
models.NotificationEvent notiEvent = models.NotificationEvent.createFrom(author, issue);
notiEvent.title = models.NotificationEvent.formatNewTitle(issue);
notiEvent.receivers = models.NotificationEvent.getReceivers(issue);
notiEvent.eventType = NEW_ISSUE;
notiEvent.oldValue = null;
notiEvent.newValue = issue.body;
return notiEvent;
} | public static models.NotificationEvent forNewIssue(models.Issue issue, models.User author) {
models.NotificationEvent notiEvent = models.NotificationEvent.createFrom(author, issue);
notiEvent.title = models.NotificationEvent.formatNewTitle(issue);
notiEvent.receivers = models.NotificationEvent.getReceivers(issue, author);
notiEvent.eventType = NEW_ISSUE;
notiEvent.oldValue = null;
notiEvent.newValue = issue.body;
return notiEvent;
} |
private void initialize() {
java.lang.System.out.println("Menu initialized");
newGameButton.setOnAction(( event) -> {
main.gui.NewGameViewController.show();
});
loadGameButton.setOnAction(( event) -> {
main.gui.NewGameViewController.show();
});
settingsButton.setOnAction(( event) -> {
main.gui.NewGameViewController.show();
});
} | private void initialize() {
newGameButton.setOnAction(( event) -> {
main.gui.NewGameViewController.show();
});
loadGameButton.setOnAction(( event) -> {
});
settingsButton.setOnAction(( event) -> {
});
} |
protected int getPref(java.util.List<java.lang.String> valeur) {
for (int i = 0; i < ((nbMod) - 1); i++)
if (ordrePref.get(i).equals(valeur))
return i;
return (nbMod) - 1;
} | protected int getPref(java.util.List<java.lang.String> valeur) {
for (int i = 0; i < ((nbMod) - 1); i++)
if (ordrePref.get(i).equals(valeur))
return i;
assert ordrePref.get(((nbMod) - 1)).equals(valeur);
return (nbMod) - 1;
} |
public void surfaceCreated(android.view.SurfaceHolder holder) {
createLifeList();
if ((gameLoopThread.getState()) == (java.lang.Thread.State.NEW)) {
gameLoopThread.setRunning(true);
gameLoopThread.start();
java.lang.Runnable task = new java.lang.Runnable() {
@java.lang.Override
public void run() {
scores.score = (scores.score) + 1;
handler.postDelayed(this, 500);
}
};
handler.removeCallbacks(task);
handler.post(task);
}
} | public void surfaceCreated(android.view.SurfaceHolder holder) {
createLifeList();
java.lang.Runnable task = new java.lang.Runnable() {
@java.lang.Override
public void run() {
scores.score = (scores.score) + 1;
handler.postDelayed(this, 500);
}
};
if ((gameLoopThread.getState()) == (java.lang.Thread.State.NEW)) {
gameLoopThread.setRunning(true);
gameLoopThread.start();
scores.score = -1;
handler.removeCallbacks(task);
handler.post(task);
}
} |
private void setImage(final android.content.Context ctx, final java.lang.String Image) {
final android.widget.ImageView post_image = ((android.widget.ImageView) (mView.findViewById(R.id.postImage)));
com.squareup.picasso.Picasso.with(ctx).load(Image).networkPolicy(NetworkPolicy.OFFLINE).into(post_image, new com.squareup.picasso.Callback() {
@java.lang.Override
public void onSuccess() {
}
@java.lang.Override
public void onError() {
com.squareup.picasso.Picasso.with(ctx).load(Image).into(post_image);
}
});
} | public void setImage(final android.content.Context ctx, final java.lang.String Image) {
final android.widget.ImageView post_image = ((android.widget.ImageView) (mView.findViewById(R.id.postImage)));
com.squareup.picasso.Picasso.with(ctx).load(Image).networkPolicy(NetworkPolicy.OFFLINE).into(post_image, new com.squareup.picasso.Callback() {
@java.lang.Override
public void onSuccess() {
}
@java.lang.Override
public void onError() {
com.squareup.picasso.Picasso.with(ctx).load(Image).into(post_image);
}
});
} |
public void run() {
if ((rate) <= 0) {
return ;
}
while (!(java.lang.Thread.interrupted())) {
try {
beat();
java.lang.Thread.sleep(((rate) * 51));
} catch (java.lang.InterruptedException e) {
}
}
} | public void run() {
if ((rate) <= 0) {
return ;
}
while (!(java.lang.Thread.interrupted())) {
try {
java.lang.Thread.sleep(((rate) * 51));
beat();
} catch (java.lang.InterruptedException e) {
}
}
} |
public java.lang.String FoundDeviceName(int index) {
if (index <= (mLeDevices.size())) {
LogMessage("Device Name is found", "i");
return mLeDevices.get(index).getName();
}else {
LogMessage("Device Name isn't found", "e");
return null;
}
} | public java.lang.String FoundDeviceName(int index) {
if (index <= (mLeDevices.size())) {
LogMessage("Device Name is found", "i");
return mLeDevices.get((index - 1)).getName();
}else {
LogMessage("Device Name isn't found", "e");
return null;
}
} |
public void start(javafx.stage.Stage primaryStage) {
this.primaryStage = primaryStage;
this.primaryStage.setTitle("Michelangelo");
java.lang.Boolean isFirstStart = prefs.getBoolean("first_start", true);
if (isFirstStart) {
java.lang.System.out.println("First Start");
showFirstStartView();
prefs.putBoolean("first_start", false);
}else {
this.connection = application.DBConnect.getInstance();
initRootLayout();
showTableView();
}
} | public void start(javafx.stage.Stage primaryStage) {
this.primaryStage = primaryStage;
this.primaryStage.setTitle("Michelangelo");
java.lang.Boolean isFirstStart = prefs.getBoolean("first_start", true);
if (isFirstStart) {
java.lang.System.out.println("First Start");
showFirstStartView();
}else {
this.connection = application.DBConnect.getInstance();
initRootLayout();
showTableView();
}
} |
public void onResume() {
if (((adapter) == null) | ((parentPath) == null))
return ;
super.onResume();
try {
getDir(parentPath);
edit.setEnabled(false);
select.setText(R.string.select_all);
} catch (java.io.IOException | com.example.admin.mp3tagger.mp3agic.InvalidDataException | com.example.admin.mp3tagger.mp3agic.UnsupportedTagException e) {
e.printStackTrace();
}
} | public void onResume() {
super.onResume();
if (((adapter) == null) | ((parentPath) == null))
return ;
try {
getDir(parentPath);
edit.setEnabled(false);
select.setText(R.string.select_all);
} catch (java.io.IOException | com.example.admin.mp3tagger.mp3agic.InvalidDataException | com.example.admin.mp3tagger.mp3agic.UnsupportedTagException e) {
e.printStackTrace();
}
} |
public void windowActivated(java.awt.event.WindowEvent event) {
megan.viewer.MainViewer.setLastActiveFrame(getFrame());
if ((java.util.Formatter.getInstance()) != null) {
java.util.Formatter.getInstance().setViewer(dir, this);
}
megan.dialogs.input.InputDialog inputDialog = megan.dialogs.input.InputDialog.getInstance();
if (inputDialog != null)
inputDialog.setViewer(dir, this);
this.requestFocus();
} | public void windowActivated(java.awt.event.WindowEvent event) {
megan.viewer.MainViewer.setLastActiveFrame(getFrame());
if ((java.util.Formatter.getInstance()) != null) {
java.util.Formatter.getInstance().setViewer(dir, this);
}
megan.dialogs.input.InputDialog inputDialog = megan.dialogs.input.InputDialog.getInstance();
if (inputDialog != null)
inputDialog.setViewer(dir, this);
} |
public boolean contains(int x, int y) {
return (((x >= (pos.getX())) && (x <= ((pos.getX()) + (getWidth())))) && (y >= (pos.getY()))) && (y <= ((pos.getY()) + (getHeight())));
} | public boolean contains(int x, int y) {
return (((x >= (pos.getX())) && (x < ((pos.getX()) + (getWidth())))) && (y >= (pos.getY()))) && (y < ((pos.getY()) + (getHeight())));
} |
public void onClick(android.view.View view) {
switch (view.getId()) {
case R.id.btn_search :
if ((keymap) != null) {
keymap.clear();
}
if (checkInput()) {
com.gdou.www.gdouaqualib.utils.ToastUtil.show(this, ("执行检索..." + (urlstr)));
getDataFromPost();
}else
if (!(checkInput())) {
com.gdou.www.gdouaqualib.utils.ToastUtil.show(this, "请至少输入一项");
}
break;
case R.id.btn_reset :
allReset();
break;
}
} | public void onClick(android.view.View view) {
switch (view.getId()) {
case R.id.btn_search :
if ((keymap) != null) {
keymap.clear();
}
if (checkInput()) {
getDataFromPost();
}else
if (!(checkInput())) {
com.gdou.www.gdouaqualib.utils.ToastUtil.show(this, "请至少输入一项");
}
break;
case R.id.btn_reset :
allReset();
break;
}
} |
private void moveDown() {
(histPosition)--;
if ((histPosition) <= 0) {
histPosition = 0;
typeText("", false);
}else
typeText(lines.get(((lines.size()) - (histPosition))), true);
} | private void moveDown() {
(histPosition)--;
if ((histPosition) <= 0) {
histPosition = 0;
typeText("", false);
}else
if (!(lines.isEmpty()))
typeText(lines.get(((lines.size()) - (histPosition))), true);
} |