buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void run() {
android.widget.TextView tv1 = ((android.widget.TextView) (fragment.getView().findViewById(R.id.achievementscreen_IR_temperature)));
tv1.setText((("IR Temperatur: " + (iR_Temperature)) + " \u00b0C"));
android.widget.TextView tv2 = ((android.widget.TextView) (fragment.getView().findViewByI... | public void run() {
if ((fragment.getView()) != null) {
android.widget.TextView tv1 = ((android.widget.TextView) (fragment.getView().findViewById(R.id.achievementscreen_IR_temperature)));
tv1.setText((("IR Temperatur: " + (iR_Temperature)) + " \u00b0C"));
android.widget.TextView tv2 = ((andr... |
private java.util.List<java.util.List<java.lang.Number>> buildOriginalList(java.lang.String name) {
java.lang.String filePath = ((path) + (java.io.File.separator)) + name;
try (java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader(new java.io.File(filePath)))) {
ignoreFirstLine(b... | private java.util.List<java.util.List<java.lang.Number>> buildOriginalList(java.lang.String name) {
try (java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader(new java.io.File(name)))) {
ignoreFirstLine(br);
return com.alphatica.genotick.data.DataUtils.createLineList(br);
... |
public static jmri.jmrix.lenz.XNetMessage getZ21TurnoutInfoRequestMessage(int address) {
jmri.jmrix.lenz.XNetMessage msg = new jmri.jmrix.lenz.XNetMessage(4);
msg.setElement(0, Z21Constants.LAN_X_GET_TURNOUT_INFO);
msg.setElement(1, ((address & 65280) >> 8));
msg.setElement(2, (address & 255));
msg.... | public static jmri.jmrix.lenz.XNetMessage getZ21TurnoutInfoRequestMessage(int address) {
jmri.jmrix.lenz.XNetMessage msg = new jmri.jmrix.lenz.XNetMessage(4);
msg.setElement(0, Z21Constants.LAN_X_GET_TURNOUT_INFO);
msg.setElement(1, (((address - 1) & 65280) >> 8));
msg.setElement(2, ((address - 1) & 255... |
public void onImageAvailable(android.media.ImageReader reader) {
if (!(mIsWritingRawImage)) {
android.media.Image image = reader.acquireLatestImage();
if (image != null) {
mBackgroundHandler.post(new com.example.mjk.camera2videoimage.Camera2VideoImageActivity.ImageSaver(image, mCaptureRe... | public void onImageAvailable(android.media.ImageReader reader) {
if (!(mIsWritingRawImage)) {
mIsWritingRawImage = true;
android.media.Image image = reader.acquireLatestImage();
if (image != null) {
mBackgroundHandler.post(new com.example.mjk.camera2videoimage.Camera2VideoImageAc... |
void AI(Bleach.LevelInteractable activeLevel) {
if (((java.lang.System.nanoTime()) % 1000000000) == 0) {
bMoving = !(bMoving);
if (bMoving)
setVectorAngle(((((java.lang.Math.random()) % 10000) / 10000.0) * (2 * (java.lang.Math.PI))));
}
} | void AI(Bleach.LevelInteractable activeLevel) {
if (((java.lang.System.nanoTime()) % 1000000000) == 0) {
bMoving = !(bMoving);
if (bMoving)
setVectorAngle(((java.lang.Math.random()) * (2 * (java.lang.Math.PI))));
}
} |
public org.apache.spark.sql.types.DataType getSchemaType() {
org.apache.spark.sql.types.StructField[] fields = new org.apache.spark.sql.types.StructField[children.size()];
for (int i = 0; i < (children.size()); i++) {
fields[i] = new org.apache.spark.sql.types.StructField(children.get(i).getName(), chil... | public org.apache.spark.sql.types.DataType getSchemaType() {
org.apache.spark.sql.types.StructField[] fields = new org.apache.spark.sql.types.StructField[children.size()];
for (int i = 0; i < (children.size()); i++) {
fields[i] = new org.apache.spark.sql.types.StructField(children.get(i).getName(), null... |
public void run() {
while (true)
try {
for (StrongholdCrusader.Network.ServerPlayer player : players) {
for (StrongholdCrusader.GameObjects.GameObject gameObject : getGameObjectByPlayerName(player.playerName)) {
if ((gameObject instanceof StrongholdCrusader.Ga... | public void run() {
while (true)
try {
for (StrongholdCrusader.Network.ServerPlayer player : players) {
for (StrongholdCrusader.GameObjects.GameObject gameObject : getGameObjectByPlayerName(player.playerName)) {
if ((gameObject instanceof StrongholdCrusader.Ga... |
responsesError.inc();
com.hazelcast.spi.impl.operationservice.impl.Invocation invocation = invocationRegistry.get(callId);
if (invocation == null) {
responsesMissing.inc();
if (nodeEngine.isRunning()) {
logger.warning(((("No Invocation found for error response with callId: " + ca... | responsesError.inc();
com.hazelcast.spi.impl.operationservice.impl.Invocation invocation = invocationRegistry.get(callId);
if (invocation == null) {
responsesMissing.inc();
if ((nodeEngine.isRunning()) && (callId != 0)) {
logger.warning(((("No Invocation found for error response ... |
public void addReference(org.dbflute.erflute.editor.model.diagram_contents.element.node.table.column.NormalColumn referredColumn, org.dbflute.erflute.editor.model.diagram_contents.element.connection.Relationship relationship) {
this.foreignKeyDescription = getDescription();
this.foreignKeyLogicalName = getLogic... | public void addReference(org.dbflute.erflute.editor.model.diagram_contents.element.node.table.column.NormalColumn referredColumn, org.dbflute.erflute.editor.model.diagram_contents.element.connection.Relationship relationship) {
this.foreignKeyDescription = getDescription();
this.foreignKeyLogicalName = getLogic... |
public boolean save() {
if (mSavedChanges)
return true;
try {
java.io.FileOutputStream out = new java.io.FileOutputStream(mFile);
mSavedChanges = save(out);
out.close();
} catch (java.io.IOException e) {
e.printStackTrace();
}
if ((mFile.isFile()) && ((mF... | public boolean save() {
if (mSavedChanges)
return true;
try {
java.io.FileOutputStream out = new java.io.FileOutputStream(mFile);
mSavedChanges = save(out);
out.close();
} catch (java.io.IOException e) {
e.printStackTrace();
}
if ((mFile.isFile()) && ((mF... |
public void setLeftNavigationBar() {
if ((drawerLayout) != null) {
drawerLayout = ((android.support.v4.widget.DrawerLayout) (findViewById(R.id.drawer_layout)));
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
}
user = com.vsokoltsov.uprogress.authentication.models.Authorizat... | public void setLeftNavigationBar() {
if ((drawerLayout) == null) {
drawerLayout = ((android.support.v4.widget.DrawerLayout) (findViewById(R.id.drawer_layout)));
drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
}
user = com.vsokoltsov.uprogress.authentication.models.Authorizat... |
public void createCurrentOracleLinuxInstance(java.lang.String name, java.lang.String vcnName, java.lang.String subnetName, java.lang.String shapeName, java.lang.String userdataFilePath, java.lang.String profile) throws java.io.IOException, java.lang.Exception {
h.help(name, "<name> <vcn-name> <subnet-name> <shape-n... | public void createCurrentOracleLinuxInstance(java.lang.String name, java.lang.String vcnName, java.lang.String subnetName, java.lang.String shapeName, java.lang.String userdataFilePath, java.lang.String profile) throws java.io.IOException, java.lang.Exception {
h.help(name, "<name> <vcn-name> <subnet-name> <shape-n... |
private void remove(java.lang.String[] words) {
if ((current.getEntries().size()) > 0) {
java.util.ArrayList<Entry> result = view(words);
java.lang.System.out.println("Enter the number of the entry you wish to remove, -1 to cancel: ");
int input = cur.nextInt();
if (input < (words.le... | private void remove(java.lang.String[] words) {
if ((current.getEntries().size()) > 0) {
java.util.ArrayList<Entry> result = view(words);
java.lang.System.out.println("Enter the number of the entry you wish to remove, -1 to cancel: ");
int input = cur.nextInt();
if ((input - 1) < (re... |
private com.pv165.airportmanagerpersistence.entity.Flight flight(java.util.Date arrivalTime, java.util.Date departureTime, com.pv165.airportmanagerpersistence.entity.Destination origin, com.pv165.airportmanagerpersistence.entity.Destination target, com.pv165.airportmanagerpersistence.entity.Plane plane) {
com.pv165... | private com.pv165.airportmanagerpersistence.entity.Flight flight(java.util.Date departureTime, java.util.Date arrivalTime, com.pv165.airportmanagerpersistence.entity.Destination origin, com.pv165.airportmanagerpersistence.entity.Destination target, com.pv165.airportmanagerpersistence.entity.Plane plane) {
com.pv165... |
public Radioactivity_Sim.DecayChainRule puGetRule(int index) {
if ((prNumRule) > 0) {
if (index >= 0) {
if (index < (prNumRule)) {
return new Radioactivity_Sim.DecayChainRule(prRules[index]);
}else {
java.lang.System.out.println("(puGetRule) has failed... | public Radioactivity_Sim.DecayChainRule puGetRule(int index) {
if ((prNumRule) > 0) {
if (index >= 0) {
if (index < (prNumRule)) {
return prRules[index];
}else {
java.lang.System.out.println("(puGetRule) has failed! The supplied index is out of bounds!... |
public void actionPerformed(java.awt.event.ActionEvent e) {
MusicGenerator gen = new MusicGenerator();
history.addItem(gen);
tempOut.setText(java.lang.String.valueOf(gen.getTempo()));
NoteOut.setText(gen.getNote());
TimeSignatureOut.setText(gen.getTimeSignature());
ScaleOut.setText(gen.getScale(... | public void actionPerformed(java.awt.event.ActionEvent e) {
MusicGenerator gen = new MusicGenerator();
history.addItem(gen);
tempOut.setText(java.lang.String.valueOf(gen.getTempo()));
NoteOut.setText(gen.getNote());
TimeSignatureOut.setText(gen.getTimeSignature().toString());
ScaleOut.setText(ge... |
public org.jetbrains.kotlin.js.translate.context.JsName getNameForPackage(@org.jetbrains.annotations.NotNull
final org.jetbrains.kotlin.name.FqName packageFqName) {
return com.intellij.util.containers.ContainerUtil.getOrCreate(packageNames, packageFqName, new com.intellij.openapi.util.Factory<org.jetbrains.kotlin.j... | private org.jetbrains.kotlin.js.translate.context.JsName getNameForPackage(@org.jetbrains.annotations.NotNull
final org.jetbrains.kotlin.name.FqName packageFqName) {
return com.intellij.util.containers.ContainerUtil.getOrCreate(packageNames, packageFqName, new com.intellij.openapi.util.Factory<org.jetbrains.kotlin.... |
public javax.ws.rs.core.Response delete(@ge.edu.freeuni.sdp.iot.router.PathParam(value = "house_id")
int houseId, @ge.edu.freeuni.sdp.iot.router.PathParam(value = "mac_id")
java.lang.String macId, @ge.edu.freeuni.sdp.iot.router.HeaderParam(value = "Origin")
java.lang.String origin) {
ge.edu.freeuni.sdp.iot.router.H... | public javax.ws.rs.core.Response delete(@ge.edu.freeuni.sdp.iot.router.PathParam(value = "house_id")
java.lang.String houseId, @ge.edu.freeuni.sdp.iot.router.PathParam(value = "mac_id")
java.lang.String macId) {
ge.edu.freeuni.sdp.iot.router.Houses houses = ge.edu.freeuni.sdp.iot.router.Houses.getInstance();
ge... |
private void parseReturnAddress(java.util.List<ActivationRecord> stack, java.lang.String[] parameters) throws java.lang.Exception {
for (ActivationRecord ar : stack) {
if (ar.function.equals(parameters[0])) {
ar.returnAddress = java.lang.Long.parseUnsignedLong(parameters[1].substring(2), 16);
... | private void parseReturnAddress(java.util.List<ActivationRecord> stack, java.lang.String[] parameters) throws java.lang.Exception {
for (ActivationRecord ar : stack) {
if (ar.function.equals(parameters[0])) {
ar.returnAddress = parameters[1];
return ;
}
}
} |
public void onSelect(com.sencha.gxt.widget.core.client.event.SelectEvent event) {
org.iplantc.de.client.models.tool.Tool tool = detailsPanel.getTool();
if (detailsPanel.isValid()) {
presenter.updateTool(tool);
dialogWindow.hide();
try {
grid.getSelectionModel().deselect(grid.... | public void onSelect(com.sencha.gxt.widget.core.client.event.SelectEvent event) {
org.iplantc.de.client.models.tool.Tool tool = detailsPanel.getTool();
if (detailsPanel.isValid()) {
presenter.updateTool(tool);
dialogWindow.hide();
grid.getSelectionModel().deselect(grid.getSelectionModel(... |
public void move(double timeStep) {
double temp;
for (int i = 0; i < 3; i++) {
prevPosition[i] = position[i];
position[i] = ((position[i]) + ((velocity[i]) * timeStep)) + ((((deltaAccel[i]) * timeStep) * timeStep) * 0.5);
velocity[i] += deltaAccel[i];
}
} | public void move(double timeStep) {
double temp;
for (int i = 0; i < 3; i++) {
prevPosition[i] = position[i];
position[i] = ((position[i]) + ((velocity[i]) * timeStep)) + ((((deltaAccel[i]) * timeStep) * timeStep) * 0.5);
velocity[i] += (deltaAccel[i]) * timeStep;
}
} |
public javax.lang.model.element.AnnotationMirror getCombinedSameLen(java.util.List<java.lang.String> a1Names, java.util.List<java.lang.String> a2Names) {
java.util.HashSet<java.lang.String> newValues = new java.util.HashSet<java.lang.String>(((a1Names.size()) + (a2Names.size())));
newValues.addAll(a1Names);
... | public javax.lang.model.element.AnnotationMirror getCombinedSameLen(java.util.List<java.lang.String> a1Names, java.util.List<java.lang.String> a2Names) {
java.util.HashSet<java.lang.String> newValues = new java.util.HashSet<java.lang.String>(((a1Names.size()) + (a2Names.size())));
newValues.addAll(a1Names);
... |
public gab.opencv.PVector getAverageFlowInRegion(int x, int y, int w, int h) {
gab.opencv.PVector total = getTotalFlowInRegion(x, y, w, h);
return new gab.opencv.PVector(((total.x) / ((flow.width()) * (flow.height()))), ((total.y) / ((flow.width()) * (flow.height()))));
} | public gab.opencv.PVector getAverageFlowInRegion(int x, int y, int w, int h) {
gab.opencv.PVector total = getTotalFlowInRegion(x, y, w, h);
return new gab.opencv.PVector(((total.x) / (w * h)), ((total.y) / (w * h)));
} |
public void run() {
while (true) {
try {
java.lang.Thread.sleep(100);
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
(value)++;
if ((value) > (framwork.ProgressBar.goal)) {
value = 0;
done = true;
}
... | public void run() {
while (true) {
(value)++;
if ((value) > (framwork.ProgressBar.goal)) {
value = 0;
done = true;
}
try {
java.lang.Thread.sleep(100);
} catch (java.lang.InterruptedException e) {
e.printStackTrace();
}
... |
public void setPlaying(boolean playingValue) {
try {
mediaPlayerComponent.getMediaPlayer().setPause((!playingValue));
} catch (java.lang.Exception ex) {
org.eclipse.core.runtime.IStatus status = new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.IStatus.ERROR, synergyviewcore.Activator... | public void setPlaying(boolean playingValue) {
try {
mediaPlayerComponent.setPause((!playingValue));
} catch (java.lang.Exception ex) {
org.eclipse.core.runtime.IStatus status = new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.IStatus.ERROR, synergyviewcore.Activator.PLUGIN_ID, ex.ge... |
private boolean validateCsvFields(java.lang.String[] fields, java.util.List<java.lang.String> properties, java.util.List<java.lang.String> unusedFields) {
boolean containsId = false;
for (java.lang.String f : fields) {
if (Configuration.ID_FIELD_NAME.equals(f)) {
containsId = true;
}... | private boolean validateCsvFields(java.lang.String[] fields, java.util.List<java.lang.String> properties, java.util.List<java.lang.String> unusedFields) {
boolean containsId = false;
if (fields == null)
return false;
for (java.lang.String f : fields) {
if (Configuration.ID_FIELD_NAME.eq... |
public static void startTrainingCognitiv(EmoState.EE_CognitivAction_t cognitivAction) {
if ((API_Main.activeCognitivMap.containsKey(cognitivAction)) && ((API_Main.activeCognitivMap.get(cognitivAction)) == true)) {
Edk.INSTANCE.EE_CognitivSetTrainingAction(0, cognitivAction.ToInt());
Edk.INSTANCE.EE_... | public static void startTrainingCognitiv(EmoState.EE_CognitivAction_t cognitivAction) {
if ((API_Main.activeCognitivMap.containsKey(cognitivAction.ToInt())) && ((API_Main.activeCognitivMap.get(cognitivAction.ToInt())) == true)) {
Edk.INSTANCE.EE_CognitivSetTrainingAction(0, cognitivAction.ToInt());
... |
public static java.lang.String getMessage(java.lang.String key, long guildId) {
java.lang.String lang = com.cloudcraftgaming.discal.database.DatabaseManager.getManager().getSettings(guildId).getLang();
java.util.Map<java.lang.String, java.lang.String> messages;
if ((lang != null) && (com.cloudcraftgaming.di... | public static java.lang.String getMessage(java.lang.String key, long guildId) {
java.lang.String lang = com.cloudcraftgaming.discal.database.DatabaseManager.getManager().getSettings(guildId).getLang();
java.util.Map<java.lang.String, java.lang.String> messages;
if ((lang != null) && (com.cloudcraftgaming.di... |
private final synchronized java.util.concurrent.ScheduledExecutorService getScheduledExecutor() {
if ((scheduler) == null) {
if ((baseThreadName) != null)
scheduler = java.util.concurrent.Executors.newSingleThreadScheduledExecutor(new java.util.concurrent.ThreadFactory() {
@java.... | private final synchronized java.util.concurrent.ScheduledExecutorService getScheduledExecutor() {
if ((scheduler) == null) {
if ((baseThreadName) != null)
scheduler = java.util.concurrent.Executors.newSingleThreadScheduledExecutor(( r) -> new java.lang.Thread(r, (((baseThreadName) + "-") + (sequ... |
public java.lang.String save(javax.servlet.http.HttpServletRequest request) {
org.springframework.security.core.Authentication auth = org.springframework.security.core.context.SecurityContextHolder.getContext().getAuthentication();
if (!(auth instanceof org.springframework.security.authentication.AnonymousAuthe... | public java.lang.String save(javax.servlet.http.HttpServletRequest request) {
org.springframework.security.core.Authentication auth = org.springframework.security.core.context.SecurityContextHolder.getContext().getAuthentication();
if (!(auth instanceof org.springframework.security.authentication.AnonymousAuthe... |
public Common.Battle.Combatant goInOrder() {
Common.Battle.Combatant goingNext = null;
for (Common.Battle.Combatant comb : combatants) {
if ((comb.ready) == false)
continue;
if ((goingNext == null) || ((comb.getSpeed()) > (goingNext.getSpeed()))) {
comb.ready = f... | public Common.Battle.Combatant goInOrder(Common.Battle.Combatant goingNext) {
for (Common.Battle.Combatant comb : combatants) {
if ((comb.ready) == false)
continue;
if ((goingNext == null) || ((comb.getSpeed()) > (goingNext.getSpeed()))) {
comb.ready = false;
... |
public void setRoundingParams(@javax.annotation.Nullable
com.facebook.drawee.generic.RoundingParams roundingParams) {
if (hasHierarchy()) {
getHierarchy().setRoundingParams(roundingParams);
}
if (((Build.VERSION.SDK_INT) >= 21) && ((roundingParams.getRoundingMethod()) == (RoundingParams.RoundingMeth... | public void setRoundingParams(@javax.annotation.Nullable
com.facebook.drawee.generic.RoundingParams roundingParams) {
if (hasHierarchy()) {
getHierarchy().setRoundingParams(roundingParams);
}
if ((Build.VERSION.SDK_INT) >= 21) {
if ((roundingParams != null) && ((roundingParams.getRoundingMet... |
public void draw(algvis.fingertree.View v) {
if ((f) == null) {
v.drawImage(algvis.fingertree.Finger.img, 50, 50, 20, 20);
}else {
v.drawImage(algvis.fingertree.Finger.img, ((f.x) + 5), ((f.y) + 5), (2 * (f.D.radius)), (2 * (f.D.radius)));
}
} | public void draw(algvis.fingertree.View v) {
if ((f) == null) {
v.drawImage(algvis.fingertree.Finger.img, 50, 50, 20, 20);
}else {
v.drawImage(algvis.fingertree.Finger.img, ((f.x) + 5), ((f.y) + 5), 20, 20);
}
} |
public void scaleBy(double scaleFactor, GeometryHelper.Vector center) {
GeometryHelper.Vector newPoint;
for (int i = 0; i < (points.size()); i++) {
newPoint = points.get(i);
newPoint.multiplyInPlace(scaleFactor);
}
newPoint = origin;
newPoint.subtractInPlace(center);
newPoint.mul... | public void scaleBy(double scaleFactor, GeometryHelper.Vector center) {
for (int i = 0; i < (points.size()); i++) {
points.get(i).multiplyInPlace(scaleFactor);
}
origin.multiplyInPlace(scaleFactor);
} |
private T removeNode(com.dici.collection.DoublyLinkedList.ListNode<T> node) {
if (node == (first))
first = node.next;
if (node == (last))
last = node.prev;
if ((node.prev) != null)
com.dici.collection.DoublyLinkedList.ListNode.biLinkNext(node.prev, node.next);
retu... | private T removeNode(com.dici.collection.DoublyLinkedList.ListNode<T> node) {
if (node == (first))
first = node.next;
if (node == (last))
last = node.prev;
if ((node.prev) != null)
com.dici.collection.DoublyLinkedList.ListNode.biLinkNext(node.prev, node.next);
(siz... |
public int getMaxThreads() {
java.lang.String maxThreadsStr = getMatchValue(edu.cmu.ml.rtw.generic.parse.Obj.curlyBracedValue("maxThreads"));
if (maxThreadsStr != null)
return java.lang.Integer.valueOf(maxThreadsStr);
if ((this.dataTools.getProperties().getMaxThreads()) != null)
return ... | public int getMaxThreads() {
java.lang.String maxThreadsStr = getMatchValue(edu.cmu.ml.rtw.generic.parse.Obj.curlyBracedValue("maxThreads"));
if (maxThreadsStr != null)
return java.lang.Integer.valueOf(maxThreadsStr);
if (((this.dataTools.getProperties()) != null) && ((this.dataTools.getPropert... |
public seedu.address.logic.commands.CommandResult execute() {
if ((keywords) == null) {
model.updateFilteredListToShowAllTasks();
return new seedu.address.logic.commands.CommandResult(seedu.address.logic.commands.ListCommand.MESSAGE_SUCCESS);
}else
if (!(isKeywordMatchingTaglist())) {
... | public seedu.address.logic.commands.CommandResult execute() {
if ((keywords) == null) {
model.updateFilteredListToShowAllTasks();
return new seedu.address.logic.commands.CommandResult(seedu.address.logic.commands.ListCommand.MESSAGE_SUCCESS);
}else
if (keywords.contains(seedu.address.log... |
public void deleteStudyReport(org.sagebionetworks.bridge.models.studies.StudyIdentifier studyId, java.lang.String identifier) {
org.sagebionetworks.bridge.models.reports.ReportDataKey key = new org.sagebionetworks.bridge.models.reports.ReportDataKey.Builder().withReportType(ReportType.STUDY).withIdentifier(identifi... | public void deleteStudyReport(org.sagebionetworks.bridge.models.studies.StudyIdentifier studyId, java.lang.String identifier) {
org.sagebionetworks.bridge.models.reports.ReportDataKey key = new org.sagebionetworks.bridge.models.reports.ReportDataKey.Builder().withReportType(ReportType.STUDY).withIdentifier(identifi... |
public com.teamdev.Fraction normalize() {
if ((n) == 0)
d = 1;
else
for (int i = 0; i < 20; ++i) {
long x = common_divider(n, d);
if (x == 1)
break;
n /= x;
d /= x;
}
return this;
} | public com.teamdev.Fraction normalize() {
if ((n) == 0)
d = 1;
else {
for (int i = 0; i < 20; ++i) {
long x = common_divider(n, d);
if (x == 1)
break;
n /= x;
d /= x;
}
if ((d) < 0) {
d = -(d... |
public void printErr(java.lang.String text) {
if ((pout) == null) {
java.lang.System.err.println(("Output file undefined: " + (this.outFile.getName())));
return ;
}
pout.println(text);
pout.flush();
} | public void printErr(java.lang.String text) {
if ((pout) == null) {
java.lang.System.err.println(("Output file undefined: " + (this.outFile.getName())));
return ;
}
pout.flush();
pout.println(text);
} |
public static void cancel(@play.data.binding.As(value = ",")
java.util.List<java.net.URI> ids) {
try {
for (java.net.URI id : ids) {
util.BourneUtil.getViprClient().blockConsistencyGroups().migrationCancel(id);
}
flash.success(util.MessagesUtils.get(controllers.arrays.StorageGrou... | public static void cancel(@play.data.binding.As(value = ",")
java.util.List<java.net.URI> ids) {
try {
for (java.net.URI id : ids) {
util.BourneUtil.getViprClient().blockConsistencyGroups().migrationCancel(id, false);
}
flash.success(util.MessagesUtils.get(controllers.arrays.Stor... |
private void seeder(java.lang.String table, java.lang.String[] values) {
java.lang.String sql = (("INSERT INTO " + table) + " ") + (preValuesSql(values));
try {
exeUpdate(sql);
} catch (java.sql.SQLException e) {
e.printStackTrace();
}
} | private void seeder(java.lang.String table, java.lang.String[] values) {
java.lang.String sql = (("INSERT INTO " + table) + " ") + (preValuesSql(values));
show(sql);
try {
exeUpdate(sql);
} catch (java.sql.SQLException e) {
e.printStackTrace();
}
} |
private byte[] getFileInBytes() {
byte[] returnFile = new byte[1];
try {
java.io.FileInputStream file_in = new java.io.FileInputStream(this.inFile);
returnFile = new byte[file_in.available()];
file_in.read(returnFile);
file_in.close();
} catch (java.io.FileNotFoundException e... | private byte[] getFileInBytes() {
byte[] returnFile = new byte[1];
try {
java.io.FileInputStream file_in = new java.io.FileInputStream(this.inFile);
returnFile = new byte[file_in.available()];
file_in.read(returnFile);
} catch (java.io.FileNotFoundException e) {
java.lang.Sys... |
public void onDataChange(com.firebase.client.DataSnapshot snapshot) {
((android.widget.TextView) (findViewById(R.id.votecounter))).setText(snapshot.child("voter_turnout").getValue().toString());
if ((((java.lang.Long) (snapshot.child("sabotage_counter").getValue())).longValue()) == (((java.lang.Long) (snapshot.... | public void onDataChange(com.firebase.client.DataSnapshot snapshot) {
((android.widget.TextView) (findViewById(R.id.votecounter))).setText(snapshot.child("sabotage_counter").getValue().toString());
if ((((java.lang.Long) (snapshot.child("sabotage_counter").getValue())).longValue()) == (((java.lang.Long) (snapsh... |
public void enterInfoFillingTheFormTwice(java.lang.String patientIdentifier) throws java.lang.Exception {
findPatient(patientIdentifier);
clickOnCheckIn();
selectFirstOptionFor("typeOfVisit");
selectSecondOptionFor("paymentAmount");
findInputInsideSpan("receiptNumber").sendKeys(("receipt #" + (org.o... | public void enterInfoFillingTheFormTwice(java.lang.String patientIdentifier) throws java.lang.Exception {
findPatient(patientIdentifier);
clickOnCheckIn();
selectFirstOptionFor("typeOfVisit");
selectSecondOptionFor("paymentAmount");
findInputInsideSpan("receiptNumber").sendKeys(("receipt #" + (org.o... |
public void onClick(android.view.View v) {
if ((comprobador1) == false) {
android.widget.Toast.makeText(this, "Seleccione La fecha", Toast.LENGTH_SHORT).show();
}
if ((comprobador2) == false) {
android.widget.Toast.makeText(this, "Seleccione La Cantidad de Días", Toast.LENGTH_SHORT).show();
... | public void onClick(android.view.View v) {
if (!(comprobador1)) {
android.widget.Toast.makeText(this, "Seleccione La fecha", Toast.LENGTH_SHORT).show();
}
if (!(comprobador2)) {
android.widget.Toast.makeText(this, "Seleccione La Cantidad de Días", Toast.LENGTH_SHORT).show();
}
} |
public void test_01_Calculate() {
model.Tariff tariff = new model.Tariff(0, 0);
model.TariffRange r1 = new model.TariffRange(0, java.lang.Integer.MAX_VALUE, 2.5);
tariff.addTariffRange(r1);
double res = tariff.calculate(15);
org.junit.Assert.assertEquals(37.5, res, 0);
} | public void test_01_Calculate() {
model.Tariff tariff = new model.Tariff(0);
model.TariffRange r1 = new model.TariffRange(0, java.lang.Integer.MAX_VALUE, 2.5);
tariff.addTariffRange(r1);
double res = tariff.calculate(15);
org.junit.Assert.assertEquals(37.5, res, 0);
} |
public int[] invertida() {
for (int i = (this.lista.length) - 1; i >= 0; i--) {
this.lista[i] = ((int) (i));
}
return this.lista;
} | public int[] invertida() {
for (int i = (this.lista.length) - 1; i >= 0; i--) {
this.lista[(((this.lista.length) - i) - 1)] = ((int) (i));
}
return this.lista;
} |
public void onCreate() {
super.onCreate();
org.kotemaru.android.taskkiller.persistent.Config.init(this);
mDatabase = new org.kotemaru.android.taskkiller.persistent.Database(this);
mDbMap = mDatabase.getMap();
org.kotemaru.android.taskkiller.receiver.ScreenOffReceiver.create(this);
mProcessMonito... | public void onCreate() {
super.onCreate();
org.kotemaru.android.taskkiller.persistent.Config.init(this);
mDatabase = new org.kotemaru.android.taskkiller.persistent.Database(this);
mDbMap = mDatabase.getMap();
org.kotemaru.android.taskkiller.receiver.ScreenOffReceiver.create(this);
mProcessMonito... |
public rx.Observable<java.lang.String> refreshToken(final java.lang.String user, final java.lang.String password) {
return rx.Observable.create(new rx.Observable.OnSubscribe() {
@java.lang.Override
public void call(java.lang.Object t) {
rx.Subscriber mySubscriber = ((rx.Subscriber) (t));... | public rx.Observable<java.lang.String> refreshToken(final java.lang.String user, final java.lang.String password) {
return rx.Observable.create(new rx.Observable.OnSubscribe() {
@java.lang.Override
public void call(java.lang.Object t) {
rx.Subscriber<java.lang.String> mySubscriber = ((rx... |
private boolean isNegative(java.lang.String raw) {
boolean retval = false;
raw = raw.toUpperCase();
if ((raw.contains("N")) || (raw.contains("W")))
retval = false;
else
if ((raw.contains("S")) || (raw.contains("E")))
retval = true;
return retval;
} | private boolean isNegative(java.lang.String raw) {
boolean retval = false;
raw = raw.toUpperCase();
if ((raw.contains("N")) || (raw.contains("E")))
retval = false;
else
if ((raw.contains("S")) || (raw.contains("W")))
retval = true;
return retval;
} |
private void updateList() {
tvao.mmad.itu.tingle.Model.ThingRepository thingRepository = tvao.mmad.itu.tingle.Model.ThingRepository.get(getActivity());
java.util.List<tvao.mmad.itu.tingle.Model.Thing> things = thingRepository.getThings();
mSearchHandler.sortDefault(things);
if ((mAdapter) == null) {
... | private void updateList() {
tvao.mmad.itu.tingle.Model.ThingRepository thingRepository = tvao.mmad.itu.tingle.Model.ThingRepository.get(getActivity());
java.util.List<tvao.mmad.itu.tingle.Model.Thing> things = thingRepository.getThings();
if (!(things.isEmpty())) {
mSearchHandler.sortDefault(things)... |
public void handleNode(com.fasterxml.jackson.databind.JsonNode node, java.io.OutputStream ops) throws java.io.IOException {
if (node.isObject()) {
handleObject(com.fasterxml.jackson.databind.node.ObjectNode.class.cast(node), ops);
}else
if (node.isArray()) {
handleArray(com.fasterxml... | public int handleNode(com.fasterxml.jackson.databind.JsonNode node, java.io.OutputStream ops) throws java.io.IOException {
if (node.isObject()) {
return handleObject(com.fasterxml.jackson.databind.node.ObjectNode.class.cast(node), ops);
}else
if (node.isArray()) {
return handleArray(... |
public boolean onMyLocationButtonClick() {
android.location.Location newLocation = mLocationCallback.getCurrentLocation();
com.google.android.gms.maps.model.LatLng latLng = new com.google.android.gms.maps.model.LatLng(newLocation.getLatitude(), newLocation.getLongitude());
mGoogleMap.moveCamera(com.google.a... | public boolean onMyLocationButtonClick() {
android.location.Location newLocation = mLocationCallback.getCurrentLocation();
if (newLocation != null) {
com.google.android.gms.maps.model.LatLng latLng = new com.google.android.gms.maps.model.LatLng(newLocation.getLatitude(), newLocation.getLongitude());
... |
public static java.lang.String getLastWords(java.lang.String string, int n) {
java.lang.String[] split = string.split(" ");
java.lang.String words = "";
for (int i = (split.length) - n; i < (split.length); i++) {
if (i == ((split.length) - n))
words += (split[i]) + " ";
}
... | public static java.lang.String getLastWords(java.lang.String string, int n) {
java.lang.String[] split = string.split(" ");
java.lang.String words = "";
for (int i = (split.length) - n; i < (split.length); i++) {
words += (split[i]) + " ";
}
return words;
} |
public float avg() {
long sum = 0;
java.lang.Long[] iheap = history.toArray(new java.lang.Long[0]);
for (java.lang.Long lz : iheap)
sum += lz;
return ((float) (sum)) / ((float) (history.size()));
} | public float avg() {
long sum = 0;
java.lang.Long[] iheap;
synchronized(history) {
iheap = history.toArray(new java.lang.Long[0]);
}
for (java.lang.Long lz : iheap)
sum += lz;
return ((float) (sum)) / ((float) (iheap.length));
} |
public void forward() {
if ((head) == null) {
java.lang.System.out.println("The list is empty");
}
placeHolder = head;
for (int i = 0; i < (size); i++) {
java.lang.System.out.println(placeHolder.getName());
placeHolder = placeHolder.getNext();
}
} | public void forward() {
if ((head) == null) {
java.lang.System.out.println("The list is empty");
}
placeHolder = head;
for (int i = 0; i < ((size) - 1); i++) {
java.lang.System.out.println(placeHolder.getName());
placeHolder = placeHolder.getNext();
}
} |
public void addPosten(model.Posten posten) {
int lastElement = (this.ausgaben.size()) - 1;
int key = this.ausgaben.get(lastElement).getKey();
posten.setKey((key + 1));
this.ausgaben.add(posten);
} | public void addPosten(model.Posten posten) {
int key;
int lastElement = (this.ausgaben.size()) - 1;
if (lastElement > (-1))
key = this.ausgaben.get(lastElement).getKey();
else
key = 0;
posten.setKey((key + 1));
this.ausgaben.add(posten);
} |
public com.erbis.java.courses.algorithms.sort.SortStat sortWeights(com.erbis.java.courses.algorithms.sort.Dog[] dogs) {
int[] arrayToSort = new int[dogs.length];
for (int index = 0; index < (dogs.length); index++) {
arrayToSort[index] = dogs[index].getWeight();
}
com.erbis.java.courses.algorithm... | public com.erbis.java.courses.algorithms.sort.SortStat sortWeights(com.erbis.java.courses.algorithms.sort.Dog[] dogs) {
int[] arrayToSort = new int[dogs.length];
for (int index = 0; index < (dogs.length); index++) {
arrayToSort[index] = dogs[index].getWeight();
}
com.erbis.java.courses.algorithm... |
public void loop() {
hu.oe.nik.szfmv17t.automatedcar.bus.VirtualFunctionBus.sendSignal(new hu.oe.nik.szfmv17t.automatedcar.bus.Signal(hu.oe.nik.szfmv17t.automatedcar.powertrainsystem.PowertrainSystem.CAMERA_SENSOR_ID, null));
fieldView = cameraSensor.getSensorFieldView(car);
seenWorldObjects = world.checkSe... | public void loop() {
hu.oe.nik.szfmv17t.automatedcar.bus.VirtualFunctionBus.sendSignal(new hu.oe.nik.szfmv17t.automatedcar.bus.Signal(hu.oe.nik.szfmv17t.automatedcar.powertrainsystem.PowertrainSystem.CAMERA_SENSOR_ID, null));
fieldView = cameraSensor.getSensorFieldView(car);
seenWorldObjects = world.checkSe... |
protected void performDefaults() {
java.lang.System.out.println("PERFORM DEFAULTS CALLED, SET CLEARED");
com.soartech.soar.ide.ui.SoarEditorUIPlugin.getDefault().initializeDefaultPreferences(com.soartech.soar.ide.ui.SoarEditorUIPlugin.getDefault().getPreferenceStore());
if ((keywordList) != null) {
... | protected void performDefaults() {
java.lang.System.out.println("PERFORM DEFAULTS CALLED, SET CLEARED");
com.soartech.soar.ide.ui.SoarEditorUIPlugin.getDefault().initializeDefaultPreferences(com.soartech.soar.ide.ui.SoarEditorUIPlugin.getDefault().getPreferenceStore());
newKeywordSet.clear();
if ((keywo... |
public me.grantammons.banhammer.core.entities.Entity nextEntity() {
if (((current) != null) && ((repeat.indexOf(current)) != (-1))) {
queue.add(current, current.speed);
}
current = queue.get();
duration = current.speed;
java.lang.System.out.println(("Next entity is " + (current.name)));
... | public me.grantammons.banhammer.core.entities.Entity nextEntity() {
if (((current) != null) && ((repeat.indexOf(current)) != (-1))) {
queue.add(current, current.speed);
}
current = queue.get();
duration = current.speed;
return current;
} |
private int indexOf(T value) {
MyLinkedList<T>.LNode current = start;
for (int i = 0; i < (size); i++) {
if (current.getValue().equals(value)) {
return i;
}
current = current.getNext();
}
return -1;
} | public int indexOf(T value) {
MyLinkedList<T>.LNode current = start;
for (int i = 0; i < (size); i++) {
if (current.getValue().equals(value)) {
return i;
}
current = current.getNext();
}
return -1;
} |
public void onClick(android.content.DialogInterface dialog, int item) {
switch (item) {
case 0 :
languageCode = "Sv";
break;
case 1 :
languageCode = "En";
break;
case 2 :
languageCode = "Fa";
break;
case 3 :
... | public void onClick(android.content.DialogInterface dialog, int item) {
switch (item) {
case 0 :
languageCode = "Sv";
break;
case 1 :
languageCode = "En";
break;
case 2 :
languageCode = "Fa";
break;
case 3 :
... |
public int read(byte[] buffer, int byteOffset, int byteCount) throws java.io.IOException {
byteCount = java.lang.Math.min(((end) - (pos)), byteCount);
if (byteCount > 0) {
int bytesRead = in.read(buffer, byteOffset, byteCount);
pos += bytesRead;
return bytesRead;
}else {
retu... | public int read(byte[] buffer, int byteOffset, int byteCount) throws java.io.IOException {
byteCount = java.lang.Math.min((((end) + 1) - (pos)), byteCount);
if (byteCount > 0) {
int bytesRead = in.read(buffer, byteOffset, byteCount);
pos += bytesRead;
return bytesRead;
}else {
... |
resetRulesRecyclerView();
android.support.v7.widget.LinearLayoutManager manager = new pl.mareklangiewicz.myintent.WCLinearLayoutManager(mRulesRecyclerView.getContext());
mRulesRecyclerView.setLayoutManager(manager);
mRulesRecyclerView.setItemAnimator(null);
final pl.mareklangiewicz.myintent.RERulesA... | resetRulesRecyclerView();
mRulesRecyclerView.setItemAnimator(null);
final pl.mareklangiewicz.myintent.RERulesAdapter adapter = new pl.mareklangiewicz.myintent.RERulesAdapter();
adapter.setRules(rules);
mRulesRecyclerView.setAdapter(adapter);
mItemTouchHelper = new android.support.v7.widget.helpe... |
public void setPiece(int row, int column, net.etfbl.connectfour.Game.Player player) {
java.lang.System.out.println(((("Inserting piece " + player) + "; ordinal: ") + ((java.lang.Integer) (player.ordinal()))));
if (((row != (net.etfbl.connectfour.GameBoard.COLUMN_FULL)) && (column >= 0)) && (column < (this.nCols... | public void setPiece(int row, int column, net.etfbl.connectfour.Game.Player player) {
if (((row != (net.etfbl.connectfour.GameBoard.COLUMN_FULL)) && (column >= 0)) && (column < (this.nCols))) {
this.board[row][column] = ((java.lang.Integer) (player.ordinal()));
}
} |
public boolean onTouchEvent(android.view.MotionEvent ev) {
if ((!(isEnabled())) || (!(isTouchEnabled()))) {
return super.onTouchEvent(ev);
}
final int action = android.support.v4.view.MotionEventCompat.getActionMasked(ev);
try {
mDragHelper.processTouchEvent(ev);
return true;
... | public boolean onTouchEvent(@android.support.annotation.NonNull
android.view.MotionEvent ev) {
if ((!(isEnabled())) || (!(isTouchEnabled()))) {
return super.onTouchEvent(ev);
}
try {
mDragHelper.processTouchEvent(ev);
return true;
} catch (java.lang.Exception ex) {
return... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_member);
android.widget.RelativeLayout wrapper = ((android.widget.RelativeLayout) (findViewById(R.id.edit_members_wrapper)));
wrapper.setVisibility(View.GONE);
jav... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_member);
android.widget.RelativeLayout wrapper = ((android.widget.RelativeLayout) (findViewById(R.id.edit_members_wrapper)));
wrapper.setVisibility(View.GONE);
and... |
public org.gbif.validation.api.model.RecordEvaluationResult.Builder addBaseDetail(org.gbif.validation.api.model.EvaluationType evaluationType, java.lang.String expected, java.lang.String found, java.lang.String message) {
if ((details) == null) {
details = new java.util.ArrayList<>();
}
details.add(... | public org.gbif.validation.api.model.RecordEvaluationResult.Builder addBaseDetail(org.gbif.validation.api.model.EvaluationType evaluationType, java.lang.String expected, java.lang.String found) {
if ((details) == null) {
details = new java.util.ArrayList<>();
}
details.add(new org.gbif.validation.ap... |
public void draw() {
if (SAVE_PDF)
beginRecord(PDF, "exportPDF_###.pdf");
colorMode(HSB, 360, 100, 100);
background(0, 0, 100);
updatePGraphics();
agents.drawTypeAgents();
nScale = (KEN_P_FACT) * (KEN_F_AMM);
if (SAVE_PDF) {
endRecord();
SAVE_PDF = false;
}
} | public void draw() {
if (SAVE_PDF)
beginRecord(PDF, "exportPDF_###.pdf");
colorMode(HSB, 360, 100, 100);
background(0, 0, 100);
updatePGraphics();
agents.drawTypeAgents();
if (SAVE_PDF) {
endRecord();
SAVE_PDF = false;
}
} |
private void playSongFromScratch(java.io.File song) {
theSoundPlayer.stop();
theSoundPlayer.setInputFile(song);
theSoundPlayer.play();
while ((theSoundPlayer.queryDuration().toSeconds()) <= 0) {
}
setupTrackSeekForSong();
play.setImage(new org.eclipse.swt.graphics.Image(com.attuned.main.Att... | public void playSongFromScratch(java.io.File song) {
theSoundPlayer.stop();
theSoundPlayer.setInputFile(song);
theSoundPlayer.play();
while ((theSoundPlayer.queryDuration().toSeconds()) <= 0) {
}
setupTrackSeekForSong();
play.setImage(new org.eclipse.swt.graphics.Image(com.attuned.main.Attu... |
public void onItemClick(final android.widget.AdapterView<?> parent, final android.view.View view, final int position, final long id) {
mItem = mAdapter.getItem(position);
com.andrew.apollo.utils.NavUtils.openAlbumProfile(getActivity(), mItem.mAlbumName, mItem.mArtistName, mItem.mAlbumId, com.andrew.apollo.utils... | public void onItemClick(final android.widget.AdapterView<?> parent, final android.view.View view, final int position, final long id) {
mItem = mAdapter.getItem(position);
com.andrew.apollo.utils.NavUtils.openAlbumProfile(getActivity(), mItem.mAlbumName, mItem.mArtistName, mItem.mAlbumId, com.andrew.apollo.utils... |
protected void execute() {
float finalSpeed;
Robot.chasis.move(Robot.oi.getRightSpeed(), Robot.oi.getLeftSpeed());
if ((Robot.chasis.stafeSolenoid.get()) != (DoubleSolenoid.Value.kForward)) {
Robot.chasis.chasisStrafe(Robot.oi.rightJoy.getX());
}
} | protected void execute() {
Robot.chasis.move(Robot.oi.getRightSpeed(), Robot.oi.getLeftSpeed());
if ((Robot.chasis.stafeSolenoid.get()) != (DoubleSolenoid.Value.kForward)) {
Robot.chasis.chasisStrafe(Robot.oi.rightJoy.getX());
}
} |
public void disconnect() {
android.util.Log.i(com.monmouth.fayePG.FayeService.LOG_TAG, "FayeService disconnect");
if ((mClient) != null) {
mClient.setShouldRetryConnection(false);
mClient.disconnectFromServer();
}
if ((mHandlerThread) != null) {
mHandlerThread.quitSafely();
}... | public void disconnect() {
android.util.Log.i(com.monmouth.fayePG.FayeService.LOG_TAG, "FayeService disconnect");
if ((mClient) != null) {
mClient.setShouldRetryConnection(false);
mClient.disconnectFromServer();
}
mHandlerThread.quitSafely();
mHandler = null;
stopForeground(true)... |
public static Runner.StockInfo classify(java.lang.String stockIndex) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException {
bayes.Classifier classifier = new bayes.BayesClassifier();
network.StockHistoryModule stock = new network.StockHistoryModule();
boolean ... | public static Runner.StockInfo classify(java.lang.String stockIndex) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException {
bayes.Classifier classifier = new bayes.BayesClassifier();
network.StockHistoryModule stock = new network.StockHistoryModule();
boolean ... |
public static float findMax(float[][] a) {
float max = java.lang.Float.NEGATIVE_INFINITY;
for (int i = 0; i < (a.length); i++) {
for (int j = 0; j < (a.length); j++) {
if ((a[i][j]) > max) {
max = a[i][j];
}
}
}
return max;
} | public static float findMax(float[][] a) {
float max = java.lang.Float.NEGATIVE_INFINITY;
for (int i = 0; i < (a.length); i++) {
for (int j = 0; j < (a[i].length); j++) {
if ((a[i][j]) > max) {
max = a[i][j];
}
}
}
return max;
} |
public int silentGiveMan10Score(java.lang.String name, java.util.UUID uuid, java.lang.String nameTo, java.util.UUID uuidTo, long value, java.lang.String reason) {
if (value == 0L) {
return 1;
}
if (value < 0L) {
return 2;
}
int i = createMan10Score(name, uuid, nameTo, uuidTo, value, ... | public int silentGiveMan10Score(java.lang.String name, java.util.UUID uuid, java.lang.String nameTo, java.util.UUID uuidTo, long value, java.lang.String reason) {
if (value == 0L) {
return 1;
}
if (value < 0L) {
return 2;
}
createMan10Score(name, uuid, nameTo, uuidTo, value, reason, ... |
public void refresh() {
if ((mPullRefreshEnabled) && ((mRefreshListener) != null)) {
mRefreshHeader.onRefreshing();
int offSet = mRefreshHeader.getHeaderView().getMeasuredHeight();
mRefreshHeader.onMove(offSet, offSet);
mRefreshing = true;
mFootView.setVisibility(com.github.j... | public void refresh() {
if (mRefreshing) {
return ;
}
if ((mPullRefreshEnabled) && ((mRefreshListener) != null)) {
mRefreshHeader.onRefreshing();
int offSet = mRefreshHeader.getHeaderView().getMeasuredHeight();
mRefreshHeader.onMove(offSet, offSet);
mRefreshing = true... |
public int[] returnResult() {
for (int i = 0; i < (givenArray.length); i++) {
int temp = (target) - (givenArray[i]);
if (binarySearch(temp)) {
java.lang.System.out.println(i);
}
}
} | public int[] returnResult() {
int[] index = new int[givenArray.length];
int a = 0;
for (int i = 0; i < (givenArray.length); i++) {
int temp = (target) - (givenArray[i]);
if (binarySearch(temp)) {
java.lang.System.out.println(i);
index[a] = i;
a++;
... |
public void sendMessage(java.lang.String message, java.io.DataOutputStream dos) throws java.lang.Exception {
message += "\n";
dos.writeUTF((((((Testing3.ClientComm.sender) + ":SEND:") + (Testing3.ClientComm.rcvr)) + ":") + message));
dos.flush();
dos.close();
} | public void sendMessage(java.lang.String message, java.io.DataOutputStream dos) throws java.lang.Exception {
dos.writeUTF((((((Testing3.ClientComm.sender) + ":SEND:") + (Testing3.ClientComm.rcvr)) + ":") + message));
dos.flush();
dos.close();
} |
public java.util.List<jp.blanktar.ruumusic.util.RuuDirectory> getDirectoriesRecursive() {
java.util.ArrayList<jp.blanktar.ruumusic.util.RuuDirectory> list = new java.util.ArrayList<>();
java.util.List<jp.blanktar.ruumusic.util.RuuDirectory> dirs = getDirectories();
for (jp.blanktar.ruumusic.util.RuuDirector... | public java.util.List<jp.blanktar.ruumusic.util.RuuDirectory> getDirectoriesRecursive() {
java.util.ArrayList<jp.blanktar.ruumusic.util.RuuDirectory> list = new java.util.ArrayList<>();
java.util.List<jp.blanktar.ruumusic.util.RuuDirectory> dirs = getDirectories();
for (jp.blanktar.ruumusic.util.RuuDirector... |
private void inputAdvertInfo() {
exampleAdvert = new Adverts();
exampleAdvert.nextID(exampleAdvert.getAdvertID());
exampleAdvert.setTitle(javax.swing.JOptionPane.showInputDialog("Please enter advert title"));
exampleAdvert.setDescription(javax.swing.JOptionPane.showInputDialog("Please enter advert descr... | private void inputAdvertInfo() {
exampleAdvert = new Adverts();
exampleAdvert.nextID(exampleAdvert.getAdvertID());
exampleAdvert.setTitle(javax.swing.JOptionPane.showInputDialog("Please enter advert title"));
exampleAdvert.setDescription(javax.swing.JOptionPane.showInputDialog("Please enter advert descr... |
public void update(java.awt.Graphics g) {
if ((image) == null) {
image = createImage(this.getWidth(), this.getHeight());
second = image.getGraphics();
}
second.setColor(getBackground());
second.fillRect(0, 0, getWidth(), getHeight());
second.setColor(getForeground());
paint(secon... | public void update(java.awt.Graphics g) {
if ((image) == null) {
image = createImage(this.getWidth(), this.getHeight());
second = image.getGraphics();
}
second.fillRect(0, 0, getWidth(), getHeight());
second.setColor(getForeground());
paint(second);
g.drawImage(image, 0, 0, this)... |
private void runTaskResize() throws java.lang.Exception {
final java.lang.String taskIdStr = nextArgRequired();
final int taskId = java.lang.Integer.valueOf(taskIdStr);
final android.graphics.Rect bounds = getBounds();
if (bounds == null) {
java.lang.System.err.println("Error: invalid input boun... | private void runTaskResize() throws java.lang.Exception {
final java.lang.String taskIdStr = nextArgRequired();
final int taskId = java.lang.Integer.parseInt(taskIdStr);
final android.graphics.Rect bounds = getBounds();
if (bounds == null) {
java.lang.System.err.println("Error: invalid input bou... |
private void deleteMethod(com.intellij.codeInspection.emptyMethod.RefMethod refMethod, java.util.List<com.intellij.codeInspection.emptyMethod.PsiElement> result, java.util.List<com.intellij.codeInspection.emptyMethod.RefElement> refElements) {
refElements.add(refMethod);
com.intellij.codeInspection.emptyMethod.... | private void deleteMethod(com.intellij.codeInspection.emptyMethod.RefMethod refMethod, java.util.List<com.intellij.codeInspection.emptyMethod.PsiElement> result) {
com.intellij.codeInspection.emptyMethod.PsiElement psiElement = refMethod.getElement();
if (psiElement == null)
return ;
if (!(resu... |
public T poll() {
java.lang.Object object = null;
final java.util.concurrent.locks.Lock lock = this.lock;
lock.lock();
try {
object = dequeue();
} finally {
lock.unlock();
}
return ((T) (object));
} | public T poll() {
java.lang.Object object = null;
final java.util.concurrent.locks.Lock lock = this.lock;
lock.lock();
try {
if ((count) <= 0)
return null;
object = dequeue();
} finally {
lock.unlock();
}
return ((T) (object));
} |
public java.sql.Time getTime(java.lang.String columnLabel) throws java.sql.SQLException {
try {
java.util.Date date = document.field(columnLabel, OType.DATETIME);
if (date == null)
return null;
return new java.sql.Time(date.getTime());
} catch (java.lang.Exception e)... | public java.sql.Time getTime(java.lang.String columnLabel) throws java.sql.SQLException {
try {
java.util.Date date = document.field(columnLabel, OType.DATETIME);
return getTime(date);
} catch (java.lang.Exception e) {
throw new java.sql.SQLException((("An error occurred during the retri... |
protected void doStart() throws java.lang.Exception {
super.doStart();
if ((clientConfig) == null) {
clientConfig = new org.apache.xmlrpc.client.XmlRpcClientConfigImpl();
}
java.util.Map<java.lang.String, java.lang.Object> params = new java.util.HashMap<java.lang.String, java.lang.Object>();
... | protected void doStart() throws java.lang.Exception {
super.doStart();
if ((clientConfig) == null) {
clientConfig = new org.apache.xmlrpc.client.XmlRpcClientConfigImpl();
}
java.util.Map<java.lang.String, java.lang.Object> params = new java.util.HashMap<java.lang.String, java.lang.Object>();
... |
protected void complete(com.emc.storageos.db.client.DbClient dbClient, com.emc.storageos.db.client.model.Operation.Status status, com.emc.storageos.svcs.errorhandling.model.ServiceCoded coded) throws com.emc.storageos.exceptions.DeviceControllerException {
try {
setDbClient(dbClient);
recordMirrorOp... | protected void complete(com.emc.storageos.db.client.DbClient dbClient, com.emc.storageos.db.client.model.Operation.Status status, com.emc.storageos.svcs.errorhandling.model.ServiceCoded coded) throws com.emc.storageos.exceptions.DeviceControllerException {
try {
setDbClient(dbClient);
recordMirrorOp... |
public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
warlock.draw(batch);
batch.end();
menuStage.act(delta);
menuStage.draw();
} | public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
warlock.draw(batch);
batch.end();
menuStage.act(delta);
menuStage.draw();
java.lang.System.out.println(i);
} |
public void handleResponse(E newEntity) {
weborb.writer.MessageWriter.setObjectSubstitutor(null);
com.backendless.FootprintsManager.getInstance().Inner.duplicateFootprintForObject(serializedEntity, entity, newEntity);
com.backendless.Footprint footprint = com.backendless.FootprintsManager.getInstance().getE... | public void handleResponse(E newEntity) {
weborb.writer.MessageWriter.setObjectSubstitutor(null);
com.backendless.FootprintsManager.getInstance().Inner.duplicateFootprintForObject(serializedEntity, newEntity, entity);
com.backendless.Footprint footprint = com.backendless.FootprintsManager.getInstance().getE... |
public void describeFormat(org.jtrfp.jfdt.Parser prs) throws org.jtrfp.jfdt.UnrecognizedFormatException {
prs.stringEndingWith(",", prs.property("x", java.lang.Integer.class), false);
prs.stringEndingWith(",", prs.property("y", java.lang.Integer.class), false);
prs.stringEndingWith("\r\n", prs.property("z",... | public void describeFormat(org.jtrfp.jfdt.Parser prs) throws org.jtrfp.jfdt.UnrecognizedFormatException {
prs.stringEndingWith(",", prs.property("x", java.lang.Integer.class), false);
prs.stringEndingWith(",", prs.property("y", java.lang.Integer.class), false);
prs.stringEndingWith(new java.lang.String[]{ "... |
public boolean equals(java.lang.Object obj) {
if ((obj.getClass().getName()) == (dictionaryBinaryTree.MySortedTree.MyTreeNode.class.getName())) {
dictionaryBinaryTree.MySortedTree.MyTreeNode node = ((dictionaryBinaryTree.MySortedTree.MyTreeNode) (obj));
return (this.item.compareTo(node.item)) == 0;
... | public boolean equals(java.lang.Object obj) {
if (obj instanceof dictionaryBinaryTree.MySortedTree.MyTreeNode<?>) {
if (((dictionaryBinaryTree.MySortedTree.MyTreeNode<?>) (obj)).item.equals(this.item)) {
return true;
}
}
return false;
} |
public void execute(net.md_5.bungee.api.CommandSender sender, java.lang.String[] strings) {
sender.sendMessage(new net.md_5.bungee.api.chat.ComponentBuilder(msg.replaceAll("{name}", server)).color(ChatColor.AQUA).create());
net.md_5.bungee.api.connection.ProxiedPlayer p = ((net.md_5.bungee.api.connection.Proxie... | public void execute(net.md_5.bungee.api.CommandSender sender, java.lang.String[] strings) {
sender.sendMessage(new net.md_5.bungee.api.chat.ComponentBuilder(msg.replace("{name}", server)).color(ChatColor.AQUA).create());
net.md_5.bungee.api.connection.ProxiedPlayer p = ((net.md_5.bungee.api.connection.ProxiedPl... |
public void onViewAttachedToWindow(H holder) {
mInnerAdapter.onViewAttachedToWindow(holder);
int position = holder.getLayoutPosition();
if ((isHeaderViewPos(position)) || (isFooterViewPos(position))) {
com.corelibs.views.recycler.WrapperUtils.setFullSpan(holder);
}
} | public void onViewAttachedToWindow(H holder) {
if ((mInnerAdapter) != null)
mInnerAdapter.onViewAttachedToWindow(holder);
int position = holder.getLayoutPosition();
if ((isHeaderViewPos(position)) || (isFooterViewPos(position))) {
com.corelibs.views.recycler.WrapperUtils.setFullSpan(hol... |
public static synchronized boolean deleteClockEntry(int id) {
int entryId = mine.android.api.ClockEntryAPI.findById(id);
if (entryId == (-1))
return false;
mine.android.api.AlarmAPI.cancelClock(id);
mine.android.api.ClockEntryAPI.list.remove(entryId);
mine.android.api.ClockEntryAPI.save... | public static synchronized int deleteClockEntry(int id) {
int entryId = mine.android.api.ClockEntryAPI.findById(id);
if (entryId == (-1))
return -1;
mine.android.api.ClockEntryAPI.list.remove(entryId);
mine.android.api.ClockEntryAPI.save();
return id;
} |
public void testEmptyTopLevelFilter() {
client().prepareIndex("test", "type", "1").setSource("field", "value").setRefresh(true).get();
org.elasticsearch.action.search.SearchResponse searchResponse = client().prepareSearch().setPostFilter("{}").get();
org.elasticsearch.test.hamcrest.ElasticsearchAssertions.a... | public void testEmptyTopLevelFilter() {
client().prepareIndex("test", "type", "1").setSource("field", "value").setRefresh(true).get();
org.elasticsearch.action.search.SearchResponse searchResponse = client().prepareSearch().setPostFilter("{}").get();
assertHitCount(searchResponse, 1L);
} |
public void onBackPressed() {
if ((mHandler) == null) {
mHandler = new android.os.Handler();
}
if (mBackPressed) {
super.onBackPressed();
}else {
mCancelExit = new java.lang.Runnable() {
@java.lang.Override
public void run() {
mBackPressed ... | public void onBackPressed() {
if (mBackPressed) {
super.onBackPressed();
}else {
mBackPressed = true;
mHandler.postDelayed(mCancelExit, 2000);
android.support.design.widget.Snackbar.make(findViewById(R.id.task_list_activity_container), getString(R.string.press_back_again_to_exit)... |
public static void test_016() {
framework.common.GalleryCommon.deleteMoreGallery();
framework.common.GalleryCommon.morePicture();
framework.common.GalleryCommon.clickGroup();
check(testcase.Object_Description, testcase.Operation_WaitForExists, "更多选项", "10000");
excute(testcase.Object_Description, te... | public static void test_016() {
framework.common.GalleryCommon.deleteMoreGallery();
framework.common.GalleryCommon.morePicture();
framework.common.GalleryCommon.clickGroup();
excute(testcase.Object_Description, testcase.Operation_WaitForExists, "更多选项", "10000");
excute(testcase.Object_Description, t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.