buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void testSplit() {
models.Game g = new models.Game();
models.User u = new models.User();
u.hostGame = g;
models.Card card1 = new models.Card(8, Suit.Clubs, true);
models.Card card2 = new models.Card(8, Suit.Diamonds, true);
g.dealCardToCol(0, card1);
g.dealCardToCol(0, card2);
u.s... | public void testSplit() {
models.Game g = new models.Game();
models.User u = new models.User();
models.Card card1 = new models.Card(8, Suit.Clubs, true);
models.Card card2 = new models.Card(8, Suit.Diamonds, true);
u.dealCardToCol(0, card1);
u.dealCardToCol(0, card2);
u.split();
assertEq... |
private void recieveData() throws java.io.IOException {
try {
double guardPosX = ((double) (input.readDouble()));
double guardPosY = ((double) (input.readDouble()));
double guardPosZ = ((double) (input.readDouble()));
double[] newPos = new double[]{ guardPosX , guardPosY , guardPosZ ... | private void recieveData() throws java.io.IOException {
try {
double guardPosX = ((double) (input.readDouble()));
double guardPosY = ((double) (input.readDouble()));
double guardPosZ = ((double) (input.readDouble()));
java.lang.System.out.println(guardPosZ);
double[] newPos =... |
public void rawSend(java.lang.String message) throws java.io.IOException {
while (!(isConnected())) {
if (!(mConnectLock.isLocked())) {
connect();
}else {
try {
java.lang.Thread.sleep(100);
} catch (java.lang.InterruptedException e) {
... | public void rawSend(java.lang.String message) throws java.io.IOException {
while (!(mServerSocket.isConnected())) {
if (!(mConnectLock.isLocked())) {
connect();
}else {
try {
java.lang.Thread.sleep(100);
} catch (java.lang.InterruptedException e) {... |
private static void repair(amara.applications.master.client.launcher.network.backends.GameSelection gameSelection) {
for (int i = 0; i < (gameSelection.getTeams().length); i++) {
amara.applications.master.client.launcher.network.backends.GameSelectionPlayer[] team = gameSelection.getTeams()[i];
if (... | private static void repair(amara.applications.master.client.launcher.network.backends.GameSelection gameSelection) {
for (int i = 0; i < (gameSelection.getTeams().length); i++) {
amara.applications.master.client.launcher.network.backends.GameSelectionPlayer[] team = gameSelection.getTeams()[i];
if (... |
public void setUploaded(int id) {
int rows_affected = 0;
this.table = "Files";
this.values = new android.content.ContentValues();
this.values.put("uploaded", "1");
this.whereClause = "id = " + id;
this.whereArgs = null;
rows_affected = this.my_update(this.table, this.values, this.whereClause... | public void setUploaded(int id) {
int rows_affected = 0;
this.table = "Files";
this.values = new android.content.ContentValues();
this.values.put("uploaded", "1");
this.whereClause = "id = " + id;
this.whereArgs = null;
rows_affected = this.my_update(this.table, this.values, this.whereClause... |
public void testTiedSoGoToOppWrp2() {
swissTournamentRunner.Player p1 = new swissTournamentRunner.Player("P1", 3, 1, 0, 0, 0);
swissTournamentRunner.Player p2 = new swissTournamentRunner.Player("P2", 3, 1, 3, 0, 0);
t.addPlayer("P1");
t.addPlayer("P2");
org.junit.Assert.assertEquals(1, p1.compareTo(... | public void testTiedSoGoToOppWrp2() {
swissTournamentRunner.Player p1 = new swissTournamentRunner.Player("P1", 3, 1, 0, 0);
swissTournamentRunner.Player p2 = new swissTournamentRunner.Player("P2", 3, 1, 3, 0);
t.addPlayer("P1");
t.addPlayer("P2");
org.junit.Assert.assertEquals(1, p1.compareTo(p2));
... |
private void processNodeDepthUpdate(application.Message msg, application.Connection conn) {
java.lang.Integer newNodeDepth = (java.lang.Integer.parseInt(msg.getMsgText())) + 1;
setNodeDepth(newNodeDepth);
application.ChatController.getInstance().receiveDebugMessage(("after connection, set nodeDepth to " + n... | private void processNodeDepthUpdate(application.Message msg, application.Connection conn) {
java.lang.Integer newNodeDepth = (java.lang.Integer.parseInt(msg.getMsgText())) + 1;
setNodeDepth(newNodeDepth);
application.ChatController.getInstance().receiveDebugMessage(("after connection, set nodeDepth to " + n... |
protected void onDestroy() {
super.onDestroy();
com.xugaoxiang.live_vtm.utils.PreUtils.setInt(this, com.xugaoxiang.live_vtm.activity.MainActivity.PROGRAM_KEY, programIndex);
if ((receiver) != null) {
unregisterReceiver(receiver);
}
if ((mVideoView) != null) {
mVideoView.stopPlayback(... | protected void onDestroy() {
super.onDestroy();
com.xugaoxiang.live_vtm.utils.PreUtils.setInt(this, com.xugaoxiang.live_vtm.activity.MainActivity.PROGRAM_KEY, programIndex);
if ((receiver) != null) {
unregisterReceiver(receiver);
}
if ((mVideoView) != null) {
mVideoView.stopPlayback(... |
public synchronized boolean Offer(int x, int y, int z) {
TData data = new TData(x, y, z);
boolean result = queueWithData.offer(data);
synchronized(mutex) {
mutex.notify();
}
return result;
} | public synchronized boolean Offer(int x, int y, int z) {
TData data = new TData(x, y, z);
boolean result = false;
synchronized(this) {
result = queueWithData.offer(data);
}
synchronized(mutex) {
mutex.notify();
}
return result;
} |
public void type(java.lang.String xpath, java.lang.String text) {
waitElement(xpath, timeout);
org.openqa.selenium.WebElement we = getElement(xpath);
we.sendKeys(text);
try {
we.clear();
} catch (java.lang.Exception e) {
e.printStackTrace();
}
try {
we.sendKeys(text);... | public void type(java.lang.String xpath, java.lang.String text) {
waitElement(xpath, timeout);
org.openqa.selenium.WebElement element = getElement(xpath);
try {
element.clear();
} catch (java.lang.Exception e) {
e.printStackTrace();
}
try {
element.sendKeys(text);
} c... |
private void setGenome(java.lang.String genomeId) {
if ((genomeId != null) && (!(genomeId.equals(org.broad.igv.feature.genome.GenomeManager.getInstance().getGenomeId())))) {
try {
org.broad.igv.feature.genome.GenomeListItem item = org.broad.igv.feature.genome.GenomeManager.getInstance().findGeno... | private void setGenome(java.lang.String genomeId) {
if ((genomeId != null) && (!(genomeId.equals(org.broad.igv.feature.genome.GenomeManager.getInstance().getGenomeId())))) {
org.broad.igv.feature.genome.GenomeListItem item = org.broad.igv.feature.genome.GenomeManager.getInstance().findGenomeListItemById(gen... |
public boolean canEdit(java.lang.Object element) {
if (element instanceof org.yakindu.sct.simulation.core.sruntime.ExecutionSlot) {
if (!(((org.yakindu.sct.simulation.core.sruntime.ExecutionSlot) (element)).isWritable()))
return false;
org.yakindu.base.types.Type type = ((org.ya... | public boolean canEdit(java.lang.Object element) {
if (element instanceof org.yakindu.sct.simulation.core.sruntime.ExecutionSlot) {
if (!(((org.yakindu.sct.simulation.core.sruntime.ExecutionSlot) (element)).isWritable()))
return false;
org.yakindu.base.types.Type type = ((org.ya... |
public static void resolveAnnotations(org.eclipse.jdt.internal.compiler.lookup.BlockScope scope, org.eclipse.jdt.internal.compiler.ast.Annotation[] sourceAnnotations, org.eclipse.jdt.internal.compiler.lookup.Binding recipient) {
org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(scope, sourceAnnotatio... | public static void resolveAnnotations(org.eclipse.jdt.internal.compiler.lookup.BlockScope scope, org.eclipse.jdt.internal.compiler.ast.Annotation[] sourceAnnotations, org.eclipse.jdt.internal.compiler.lookup.Binding recipient) {
org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveAnnotations(scope, sourceAnnotatio... |
public synchronized java.util.List<java.lang.String> listUnmanagedDrillits() {
java.util.List<java.lang.String> drillbits = new java.util.ArrayList<>();
for (org.apache.drill.yarn.zk.ZKRegistry.DrillbitTracker item : registry.values()) {
if ((item.state) == (org.apache.drill.yarn.zk.ZKRegistry.DrillbitT... | public synchronized java.util.List<java.lang.String> listUnmanagedDrillits() {
java.util.List<java.lang.String> drillbits = new java.util.ArrayList<>();
for (org.apache.drill.yarn.zk.ZKRegistry.DrillbitTracker item : registry.values()) {
if ((item.state) == (org.apache.drill.yarn.zk.ZKRegistry.DrillbitT... |
protected boolean isUnknown() {
if ((this.queryAvailableFields) != null) {
if ((fromDatastore.isUnknown()) == false) {
if ((this.queryAvailableFields.getDatastoreDefinition(datastoreCombo.getValue())) == null) {
return false;
}
if ((this.queryAvailableFiel... | protected boolean isUnknown() {
if ((queryAvailableFields) != null) {
if ((datastoreCombo.isUnknown()) == false) {
if ((queryAvailableFields.getDatastoreDefinition(datastoreCombo.getValue())) == null) {
return false;
}
if ((queryAvailableFields.getTableDef... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
android.util.Log.d("SAMPLE: ", "Here is your example tag that displays when the application starts");
android.widget.Button B = ((android.widget.Button) (findViewBy... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
android.util.Log.d("SAMPLE: ", "Here is your example tag that displays when the application starts");
android.widget.Button B = ((android.widget.Button) (findViewBy... |
public void onBindViewHolder(cz.zcu.fav.remotestimulatorcontrol.ui.configurations.ConfigurationAdapter.ConfigurationHolder holder, int position) {
cz.zcu.fav.remotestimulatorcontrol.model.configuration.AConfiguration configuration = mConfigurations.get(position);
holder.bindTo(configuration);
boolean select... | public void onBindViewHolder(cz.zcu.fav.remotestimulatorcontrol.ui.configurations.ConfigurationAdapter.ConfigurationHolder holder, int position) {
cz.zcu.fav.remotestimulatorcontrol.model.configuration.AConfiguration configuration = mConfigurations.get(position);
holder.bindTo(configuration);
boolean select... |
private void disableCharging() {
delay(100);
pilot.sleep();
delay(200);
pilot.disable();
com.faradice.firmware.Firmware.StatusLog sl = new com.faradice.firmware.Firmware.StatusLog(false, false, true, true, true, true, true, false);
logAction(sl.faraStatus("Completed"), true);
chargingStartTi... | private void disableCharging() {
com.faradice.firmware.Firmware.StatusLog sl = new com.faradice.firmware.Firmware.StatusLog(true, true, true, true, true, true, true, true);
logAction(sl.faraStatus("Completed"), true);
delay(100);
pilot.sleep();
delay(200);
pilot.disable();
chargingStartTime ... |
public static java.lang.String[] listSystemPrinters() {
javax.print.PrintService[] printServices = javax.print.PrintServiceLookup.lookupPrintServices(null, null);
java.lang.String[] printers = new java.lang.String[printServices.length];
for (int i = 0; i < (printServices.length); i++) {
printers[i] ... | public static java.lang.String[] listSystemPrinters() {
javax.print.PrintService[] printServices = javax.print.PrintServiceLookup.lookupPrintServices(null, null);
java.lang.String[] printers = new java.lang.String[printServices.length];
for (int i = 0; i < (printServices.length); i++) {
printers[i] ... |
public courier.TramLine findTramLine(courier.Station a, courier.Station b) {
if ((a.equals(b)) || (b == null))
return null;
int index = findTramLineIndexNB(a, b);
if (index >= 0) {
return map.tramLines.get(index);
}
return null;
} | public courier.TramLine findTramLine(courier.Station a, courier.Station b) {
if ((a == null) || (b == null))
return null;
if (a.equals(b))
return null;
int index = findTramLineIndexNB(a, b);
if (index >= 0) {
return map.tramLines.get(index);
}
return null;
} |
private static co.cask.cdap.api.plugin.PluginClass getPluginClass() {
java.util.Map<java.lang.String, co.cask.cdap.api.plugin.PluginPropertyField> properties = new java.util.HashMap<>();
properties.put("field", new co.cask.cdap.api.plugin.PluginPropertyField("field", "", "string", true, false));
properties.... | private static co.cask.cdap.api.plugin.PluginClass getPluginClass() {
java.util.Map<java.lang.String, co.cask.cdap.api.plugin.PluginPropertyField> properties = new java.util.HashMap<>();
properties.put("field", new co.cask.cdap.api.plugin.PluginPropertyField("field", "", "string", true, true));
properties.p... |
public void onNewApiaryFragmentInteraction(android.net.Uri uri) {
android.util.Log.d(net.tscloud.hivenotes.MainActivity.TAG, ("MainActivity.onNewApiaryFragmentInteraction called..." + (uri.toString())));
theApiaryList = getApiaryList();
android.support.v4.app.Fragment fragment = net.tscloud.hivenotes.HomeFr... | public void onNewApiaryFragmentInteraction() {
android.util.Log.d(net.tscloud.hivenotes.MainActivity.TAG, "MainActivity.onNewApiaryFragmentInteraction called...");
theApiaryList = getApiaryList();
android.support.v4.app.Fragment fragment = net.tscloud.hivenotes.HomeFragment.newInstance(newProfile, getApiary... |
public static void removeAll() {
com.xgheaven.litecourseschedule.Course course;
for (int i = 0; i < (com.xgheaven.litecourseschedule.Course.courses.size()); i++) {
course = com.xgheaven.litecourseschedule.Course.courses.get(i);
if ((course != null) && (!(course.isDivide()))) {
com.xg... | public static void removeAll() {
com.xgheaven.litecourseschedule.Course course;
for (int i = 0; i < (com.xgheaven.litecourseschedule.Course.courses.size()); i++) {
course = com.xgheaven.litecourseschedule.Course.courses.get(i);
if (!(course.isDivide())) {
com.xgheaven.litecoursesched... |
public void temporarilyMakeImmediatelyRelevant(final org.jtrfp.trcl.obj.PositionedRenderable pr) {
if (pr instanceof org.jtrfp.trcl.obj.WorldObject)
try {
collisionManager.getCurrentlyActiveCollisionList().add(((org.jtrfp.trcl.obj.WorldObject) (pr)));
} catch (java.lang.Exception ex) {
... | public void temporarilyMakeImmediatelyRelevant(final org.jtrfp.trcl.obj.PositionedRenderable pr) {
if (pr instanceof org.jtrfp.trcl.obj.WorldObject)
try {
if (!(org.jtrfp.trcl.core.Renderer.NEW_MODE))
collisionManager.getCurrentlyActiveCollisionList().add(((org.jtrfp.trcl.obj.Wor... |
public java.lang.String getHomepage(@org.springframework.web.bind.annotation.CookieValue(value = "steamid", required = false)
java.lang.String steamid, org.springframework.ui.Model model) {
java.lang.System.out.println(("steasmid: " + steamid));
com.steamstatistics.data.SteamProfileModel steamProfileModel = nul... | public java.lang.String getHomepage(@org.springframework.web.bind.annotation.CookieValue(value = "steamid", required = false)
java.lang.String steamid, org.springframework.ui.Model model) {
com.steamstatistics.data.SteamProfileModel steamProfileModel = null;
if ((steamid != null) && (!(steamid.isEmpty())))
... |
public final void output(int size) {
try {
writer.write(event, 0, size);
int localTick = edu.ucla.pls.wiretap.recorders.BinaryLogger.tick;
if (localTick != (lastSync)) {
event[0] = edu.ucla.pls.wiretap.recorders.BinaryLogger.SYNC;
int order = edu.ucla.pls.wiretap.reco... | public final void output(int size) {
try {
writer.write(event, 0, size);
int localTick = edu.ucla.pls.wiretap.recorders.BinaryLogger.tick;
if (localTick != (lastSync)) {
event[0] = edu.ucla.pls.wiretap.recorders.BinaryLogger.SYNC;
int order = edu.ucla.pls.wiretap.reco... |
private void setupMapUI(com.amap.api.maps.AMap map) {
map.setMyLocationEnabled(false);
com.amap.api.maps.UiSettings mUiSettings = map.getUiSettings();
mUiSettings.setMyLocationButtonEnabled(false);
mUiSettings.setCompassEnabled(false);
mUiSettings.setTiltGesturesEnabled(false);
mUiSettings.setZo... | private void setupMapUI(com.amap.api.maps.AMap map) {
map.setMyLocationEnabled(false);
com.amap.api.maps.UiSettings mUiSettings = map.getUiSettings();
mUiSettings.setMyLocationButtonEnabled(false);
mUiSettings.setCompassEnabled(true);
mUiSettings.setTiltGesturesEnabled(true);
mUiSettings.setZoom... |
public boolean isExported(com.pi4j.io.gpio.impl.GpioPin... pin) {
if ((pin == null) || ((pin.length) == 0)) {
throw new java.lang.IllegalArgumentException("Missing pin argument.");
}
for (com.pi4j.io.gpio.impl.GpioPin p : pin) {
if (!(pins.contains(pin))) {
throw new com.pi4j.io.... | public boolean isExported(com.pi4j.io.gpio.impl.GpioPin... pin) {
if ((pin == null) || ((pin.length) == 0)) {
throw new java.lang.IllegalArgumentException("Missing pin argument.");
}
for (com.pi4j.io.gpio.impl.GpioPin p : pin) {
if (!(pins.contains(p))) {
throw new com.pi4j.io.gp... |
public com.yalin.style.domain.AdvanceWallpaper transform(com.yalin.style.data.entity.AdvanceWallpaperEntity wallpaperEntity) {
com.fernandocejas.arrow.checks.Preconditions.checkNotNull(wallpaperEntity, "Wallpaper can not be null.");
com.yalin.style.domain.AdvanceWallpaper wallpaper = new com.yalin.style.domain.... | public com.yalin.style.domain.AdvanceWallpaper transform(com.yalin.style.data.entity.AdvanceWallpaperEntity wallpaperEntity) {
com.fernandocejas.arrow.checks.Preconditions.checkNotNull(wallpaperEntity, "Wallpaper can not be null.");
com.yalin.style.domain.AdvanceWallpaper wallpaper = new com.yalin.style.domain.... |
private java.lang.String getLevel(TreeNode<E> curr, int level, int currLevel) {
if (curr == null) {
return "";
}else
if (level == currLevel) {
return curr.getData();
}else {
return (getLevel(curr.getLeft(), level, (currLevel + 1))) + (getLevel(curr.getRight(), lev... | private java.lang.String getLevel(TreeNode<E> curr, int level, int currLevel) {
if (curr == null) {
return "";
}else
if (level == currLevel) {
return "" + (curr.getData());
}else {
return (getLevel(curr.getLeft(), level, (currLevel + 1))) + (getLevel(curr.getRight... |
public Player.Choice makeChoice() {
java.util.Scanner keyboard = new java.util.Scanner(java.lang.System.in);
Player.Choice userChoice;
java.lang.System.out.print("Would you like to \"hit\" or \"stay?\": ");
java.lang.String userInput = keyboard.next().trim().toUpperCase();
java.lang.System.out.print... | public Player.Choice makeChoice() {
java.util.Scanner keyboard = new java.util.Scanner(java.lang.System.in);
Player.Choice userChoice;
java.lang.System.out.print("Would you like to \"hit\" or \"stay?\": ");
userInput = keyboard.next().trim().toUpperCase();
java.lang.System.out.println((("\"" + (user... |
void releaseUnsafe() throws java.lang.Exception {
if ((filter_graph) != null) {
org.bytedeco.javacpp.avfilter.avfilter_graph_free(filter_graph);
buffersink_ctx = null;
buffersrc_ctx = null;
filter_graph = null;
}
if ((image_frame) != null) {
org.bytedeco.javacpp.avuti... | void releaseUnsafe() throws java.lang.Exception {
if ((filter_graph) != null) {
avfilter_graph_free(filter_graph);
buffersink_ctx = null;
buffersrc_ctx = null;
filter_graph = null;
}
if ((image_frame) != null) {
av_frame_free(image_frame);
image_frame = null;
... |
private java.util.Set<java.io.File> calculateContainedFilesRecursively(java.io.File directory) {
java.util.Set<java.io.File> result = new java.util.TreeSet<java.io.File>();
for (java.io.File file : directory.listFiles()) {
result.add(file);
if (file.isDirectory()) {
result.addAll(cal... | private java.util.Set<java.io.File> calculateContainedFilesRecursively(java.io.File directory) {
java.util.Set<java.io.File> result = new java.util.TreeSet<java.io.File>();
if (null == (directory.listFiles())) {
return result;
}
for (java.io.File file : directory.listFiles()) {
result.ad... |
public void infobox(java.lang.String query) {
try {
getFBKey();
org.json.JSONArray topics = searchFB(query);
for (int i = 0; i < (topics.length()); i++) {
java.lang.String mid = topics.getJSONObject(i).getString("mid");
if (topicFB(mid))
break;
... | public void infobox(java.lang.String query) {
try {
org.json.JSONArray topics = searchFB(query);
for (int i = 0; i < (topics.length()); i++) {
java.lang.String mid = topics.getJSONObject(i).getString("mid");
if (topicFB(mid))
break;
}
... |
public seedu.address.logic.commands.OpenCommand parse(java.lang.String args) throws seedu.address.logic.parser.exceptions.ParseException {
java.lang.String trimmedArgs = args.trim();
trimmedArgs.replace("\\", "/");
if ((trimmedArgs.isEmpty()) || (!(trimmedArgs.matches(seedu.address.logic.parser.OpenCommandP... | public seedu.address.logic.commands.OpenCommand parse(java.lang.String args) throws seedu.address.logic.parser.exceptions.ParseException {
java.lang.String trimmedArgs = args.trim();
trimmedArgs = trimmedArgs.replace("\\", "/");
if ((trimmedArgs.isEmpty()) || (!(trimmedArgs.matches(seedu.address.logic.parse... |
public void setImageDrawable(android.graphics.drawable.Drawable img, com.example.obswitchcompat.ObSwitchCompatTab.ImagePosition imagePosition) {
switch (imagePosition) {
case LEFT :
setCompoundDrawablesWithIntrinsicBounds(img, null, null, null);
break;
case TOP :
... | public void setImageDrawable(android.graphics.drawable.Drawable img, com.example.obswitchcompat.ObSwitchCompatTab.ImagePosition imagePosition) {
if (img != null) {
switch (imagePosition) {
case LEFT :
setCompoundDrawablesWithIntrinsicBounds(img, null, null, null);
... |
public void setSelectedItem(final int index, final boolean animate) {
if ((dots.size()) > 0) {
try {
dots.get(this.selectedDotIndex).setInactive(animate);
dots.get(index).setActive(animate);
} catch (java.lang.IndexOutOfBoundsException e) {
throw new java.lang.Ind... | public void setSelectedItem(final int index, final boolean animate) {
if ((dots.size()) > 0) {
try {
if ((selectedDotIndex) < (dots.size())) {
dots.get(selectedDotIndex).setInactive(animate);
}
dots.get(index).setActive(animate);
} catch (java.lang... |
public org.flowable.app.model.editor.AppDefinitionUpdateResultRepresentation publishAppDefinition(java.lang.String modelId, org.flowable.app.model.editor.AppDefinitionPublishRepresentation publishModel) {
org.flowable.idm.api.User user = org.flowable.app.security.SecurityUtils.getCurrentUserObject();
org.flowab... | public org.flowable.app.model.editor.AppDefinitionUpdateResultRepresentation publishAppDefinition(java.lang.String modelId, org.flowable.app.model.editor.AppDefinitionPublishRepresentation publishModel) {
org.flowable.idm.api.User user = org.flowable.app.security.SecurityUtils.getCurrentUserObject();
org.flowab... |
public void onClick(android.view.View v) {
if ((((farmer.getMobileNumber()) != null) && (!(farmer.getMobileNumber().isEmpty()))) && (!(farmer.getMobileNumber().trim().equalsIgnoreCase("-")))) {
android.content.Intent intent = new android.content.Intent(android.content.Intent.ACTION_DIAL);
intent.set... | public void onClick(android.view.View v) {
if (((farmer.getMobileNumber()) != null) && (!(farmer.getMobileNumber().isEmpty()))) {
android.content.Intent intent = new android.content.Intent(android.content.Intent.ACTION_DIAL);
intent.setData(android.net.Uri.parse(("tel:" + (farmer.getMobileNumber()))... |
public boolean withdraw(java.lang.String accountNumber, int money) {
bank.Account selectedAccount = account.get(accountNumber);
boolean isDone = selectedAccount.withdraw(money);
if (isDone)
selectedAccount.addStateList(((("출금 : " + money) + " 잔액 : ") + (selectedAccount.getBalance())));
retu... | public boolean withdraw(java.lang.String accountNumber, int money) {
bank.Account selectedAccount = account.get(accountNumber);
boolean isDone = selectedAccount.withdraw(money);
if (!isDone)
selectedAccount.addStateList(((("출금 : " + money) + " 잔액 : ") + (selectedAccount.getBalance())));
ret... |
public java.lang.Object remove() {
java.lang.Object item;
while ((count) == 0);
--(count);
item = buffer[out];
out = ((out) + 1) % (BoundedBuffer.BUFFER_SIZE);
if ((count) == 0) {
java.lang.System.out.println(" Buffer EMPTY");
}
return item;
} | public java.lang.Object remove() {
while ((count) == 0);
java.lang.Object item;
--(count);
item = buffer[out];
out = ((out) + 1) % (BoundedBuffer.BUFFER_SIZE);
if ((count) == 0) {
java.lang.System.out.println(" Buffer EMPTY");
}
return item;
} |
private java.lang.String[] removeIndexUntil(int index, java.lang.String[] args) {
java.lang.String[] hulp = new java.lang.String[((args.length) - 1) - index];
int j = 0;
for (int i = index; i < (args.length); i++) {
hulp[j] = args[i];
j += 1;
}
return hulp;
} | private java.lang.String[] removeIndexUntil(int index, java.lang.String[] args) {
if ((args.length) == index)
return null;
java.lang.String[] hulp = new java.lang.String[((args.length) - 1) - index];
int j = 0;
for (int i = index; i < (args.length); i++) {
hulp[j] = args[i];
... |
private void dataGroupMinterSetup(java.lang.Boolean suffixPassThrough, java.lang.String shoulder, java.lang.Integer NAAN) {
db = new bcid.database();
conn = db.getConn();
if (shoulder == null) {
this.shoulder = "fk4";
}else {
this.shoulder = shoulder;
}
setBow(NAAN);
prefix =... | private void dataGroupMinterSetup(java.lang.Boolean suffixPassThrough, java.lang.String shoulder, java.lang.Integer NAAN) {
db = new bcid.database();
conn = db.getConn();
if (shoulder == null) {
this.shoulder = "fk4";
}else {
this.shoulder = shoulder;
}
setBow(NAAN);
prefix =... |
private void createPanel() {
this.setLayout(new java.awt.BorderLayout());
this.add(actionPanel, java.awt.BorderLayout.NORTH);
this.add(animationComponent, java.awt.BorderLayout.CENTER);
javax.swing.JPanel labels = new javax.swing.JPanel();
labels.add(radius);
labels.add(linearVelocity);
labe... | private void createPanel() {
this.setLayout(new java.awt.BorderLayout());
this.add(animationComponent, java.awt.BorderLayout.CENTER);
this.add(actionPanel, java.awt.BorderLayout.NORTH);
javax.swing.JPanel labels = new javax.swing.JPanel();
labels.add(radius);
labels.add(linearVelocity);
labe... |
public void testSetNoBoot() throws com.emc.cloud.platform.clientlib.ClientGeneralException {
com.emc.cloud.platform.ucs.out.model.LsServer lsServer = ucsmService.setServiceProfileToNoBoot(com.emc.cloud.ucsm.service.UCSMServiceTest.UCSM_SERVICE3, com.emc.cloud.ucsm.service.UCSMServiceTest.UCSM_HOST3_USERNAME, com.em... | public void testSetNoBoot() throws com.emc.cloud.platform.clientlib.ClientGeneralException {
com.emc.cloud.platform.ucs.out.model.LsServer lsServer = ucsmService.setServiceProfileToNoBoot(com.emc.cloud.ucsm.service.UCSMServiceTest.UCSM_SERVICE3, com.emc.cloud.ucsm.service.UCSMServiceTest.UCSM_HOST3_USERNAME, com.em... |
public void run() {
if (current != null) {
current.getContentPane().getUnselectedStyle().setPaddingUnit(new byte[]{ com.codename1.ui.plaf.Style.UNIT_TYPE_PIXELS , com.codename1.ui.plaf.Style.UNIT_TYPE_PIXELS , com.codename1.ui.plaf.Style.UNIT_TYPE_PIXELS , com.codename1.ui.plaf.Style.UNIT_TYPE_PIXELS });
... | public void run() {
if (current != null) {
current.getContentPane().getUnselectedStyle().setPaddingUnit(new byte[]{ com.codename1.ui.plaf.Style.UNIT_TYPE_PIXELS , com.codename1.ui.plaf.Style.UNIT_TYPE_PIXELS , com.codename1.ui.plaf.Style.UNIT_TYPE_PIXELS , com.codename1.ui.plaf.Style.UNIT_TYPE_PIXELS });
... |
public void close() throws java.lang.Exception {
logRecordHandler.close();
inboundObserverCompletion.get();
for (java.util.logging.Logger logger : configuredLoggers) {
logger.setLevel(null);
}
configuredLoggers.clear();
java.util.logging.LogManager.getLogManager().readConfiguration();
... | public void close() throws java.lang.Exception {
try {
logRecordHandler.close();
inboundObserverCompletion.get();
} finally {
for (java.util.logging.Logger logger : configuredLoggers) {
logger.setLevel(null);
}
configuredLoggers.clear();
java.util.logg... |
public void init(java.lang.String[] args) {
super.init(args);
this.filePath = args[0];
if ((args.length) >= 2) {
this.length = java.lang.Integer.valueOf(args[1]);
}
if ((args.length) >= 3) {
this.bufferSize = java.lang.Integer.valueOf(args[2]);
}
} | public void init(java.lang.String[] args) {
super.init(args);
this.filePath = args[0];
if ((args.length) < 2) {
return ;
}
this.length = java.lang.Integer.valueOf(args[1]);
if ((args.length) >= 3) {
this.bufferSize = java.lang.Integer.valueOf(args[2]);
}
} |
public void onButtonsClick(android.view.View view, android.view.MotionEvent event) {
final int X = ((int) (event.getRawX()));
if ((X <= 300) && (X > 200)) {
mPlaying = !(mPlaying);
cs446.mezzo.events.EventBus.post(new cs446.mezzo.events.control.PauseToggleEvent());
}else
if ((X <= 40... | public void onButtonsClick(android.view.View view, android.view.MotionEvent event) {
final int X = ((int) (event.getRawX()));
if (X <= 200) {
mPlaying = !(mPlaying);
cs446.mezzo.events.EventBus.post(new cs446.mezzo.events.control.PauseToggleEvent());
}else
cs446.mezzo.events.EventBus... |
public void create() {
sk.tuke.gamedev.iddqd.tukequest.TukeQuestGame.THIS = this;
Gdx.app.setApplicationLogger(new sk.tuke.gamedev.iddqd.tukequest.util.Log());
sk.tuke.gamedev.iddqd.tukequest.TukeQuestGame.manager = loadAssets();
setScreen(new sk.tuke.gamedev.iddqd.tukequest.screens.MenuScreen(this));
... | public void create() {
sk.tuke.gamedev.iddqd.tukequest.TukeQuestGame.THIS = this;
Gdx.app.setApplicationLogger(new sk.tuke.gamedev.iddqd.tukequest.util.Log());
sk.tuke.gamedev.iddqd.tukequest.TukeQuestGame.manager = loadAssets();
setScreen(new sk.tuke.gamedev.iddqd.tukequest.screens.MenuScreen(this));
... |
public boolean collides(hotel.Interval other) {
boolean caseA = (end.after(other.getBegin())) && (begin.before(other.getEnd()));
boolean caseB = (begin.after(other.getEnd())) && (end.before(other.getBegin()));
return caseA || caseB;
} | public boolean collides(hotel.Interval other) {
boolean caseA = ((begin.compareTo(other.getBegin())) >= 0) && ((begin.compareTo(other.getEnd())) >= 0);
boolean caseB = ((end.compareTo(other.getBegin())) <= 0) && ((end.compareTo(other.getEnd())) <= 0);
return !(caseA || caseB);
} |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_movie_grid);
mRecyclerView = ((android.support.v7.widget.RecyclerView) (findViewById(R.id.rv_movie_grid)));
mGridLayoutManager = new android.support.v7.widget.GridLayoutMa... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_movie_grid);
mRecyclerView = ((android.support.v7.widget.RecyclerView) (findViewById(R.id.rv_movie_grid)));
mGridLayoutManager = new android.support.v7.widget.GridLayoutMa... |
private static android.content.ContentValues getContentValues(com.alvinsvitzer.blamegame.model.Crime crime) {
android.content.ContentValues values = new android.content.ContentValues();
values.put(CrimeTable.Cols.UUID, crime.getId().toString());
values.put(CrimeTable.Cols.TITLE, crime.getTitle());
value... | private static android.content.ContentValues getContentValues(com.alvinsvitzer.blamegame.model.Crime crime) {
android.content.ContentValues values = new android.content.ContentValues();
values.put(CrimeTable.Cols.UUID, crime.getId().toString());
values.put(CrimeTable.Cols.TITLE, crime.getTitle());
value... |
public void constructPostDomination(microbat.codeanalysis.bytecode.CFG cfg) {
for (microbat.codeanalysis.bytecode.CFGNode node : cfg.getNodeList()) {
for (microbat.codeanalysis.bytecode.CFGNode parent : node.getParents()) {
if (!(parent.isBranch())) {
node.addPostDominatee(parent... | public void constructPostDomination(microbat.codeanalysis.bytecode.CFG cfg) {
for (microbat.codeanalysis.bytecode.CFGNode node : cfg.getNodeList()) {
for (microbat.codeanalysis.bytecode.CFGNode parent : node.getParents()) {
if (!(parent.isBranch())) {
node.addPostDominatee(parent... |
private static java.util.Map<java.lang.String, java.lang.Object> attributes(org.atmosphere.websocket.WebSocket webSocket, org.atmosphere.cpr.AtmosphereRequest request) {
java.util.Map<java.lang.String, java.lang.Object> m = new java.util.concurrent.ConcurrentHashMap<java.lang.String, java.lang.Object>();
try {
... | private static java.util.Map<java.lang.String, java.lang.Object> attributes(org.atmosphere.websocket.WebSocket webSocket, org.atmosphere.cpr.AtmosphereRequest request) {
java.util.Map<java.lang.String, java.lang.Object> m = new java.util.concurrent.ConcurrentHashMap<java.lang.String, java.lang.Object>();
m.putA... |
public java.util.ArrayList<aug.manas.mtconnect.mdata.model.MachineData> data() throws aug.manas.mtconnect.mdata.exception.AgentNotAvailableException {
logger.debug("Entering the data method corresponding to /data");
logger.debug("Calling the mdataService's callAgent method");
java.util.ArrayList<aug.manas.m... | public java.util.List<aug.manas.mtconnect.mdata.model.MachineData> data() throws aug.manas.mtconnect.mdata.exception.AgentNotAvailableException {
logger.debug("Entering the data method corresponding to /data");
logger.debug("Calling the mdataService's callAgent method");
java.util.List<aug.manas.mtconnect.m... |
public void run() {
final double[] mapPoint = mapController.toMapPoint(((int) (x)), ((int) (y)));
if (null != mapPoint) {
chemLightController.sendChemLight(mapPoint[0], mapPoint[1], mapController.getSpatialReference().getID(), color);
}else {
android.util.Log.i(com.esri.squadleader.view.Squa... | public void run() {
final double[] mapPoint = mapController.toMapPoint(((int) (x)), ((int) (y)));
if ((null != mapPoint) && (null != (getSpatialReference()))) {
chemLightController.sendChemLight(mapPoint[0], mapPoint[1], getSpatialReference().getID(), color);
}else {
android.util.Log.i(com.e... |
public static void showProgressDialog(android.content.Context c, android.app.Activity a) {
android.view.View v = a.getLayoutInflater().inflate(R.layout.custom_progress, null);
thebat.lib.validutil.ValidUtils.progress = com.kaopiz.kprogresshud.KProgressHUD.create(a).setCustomView(v).setCancellable(true).show();
... | public static void showProgressDialog(android.content.Context c, android.app.Activity a) {
android.view.View v = a.getLayoutInflater().inflate(R.layout.custom_progress, null);
if ((thebat.lib.validutil.ValidUtils.progress) == null) {
thebat.lib.validutil.ValidUtils.progress = com.kaopiz.kprogresshud.KPr... |
public void actionPerformed(java.awt.event.ActionEvent e) {
if ((!(videoOn)) && (!(objectDetect)))
return ;
if ((altitudeField.getText().equals("")) || (radiusField.getText().equals("")))
return ;
setFlightParams();
dispose();
com.capstone.groundstation.ControlPage controlP... | public void actionPerformed(java.awt.event.ActionEvent e) {
if ((!(videoOn)) && (!(objectDetect)))
return ;
if ((altitudeField.getText().equals("")) || (radiusField.getText().equals("")))
return ;
setFlightParams();
dispose();
com.capstone.groundstation.ControlPage controlP... |
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) {
android.view.View rootView = inflater.inflate(R.layout.fragment_workflow_run_history, container, false);
mRecyclerView = ((android.support.v7.widget.RecyclerView)... | public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) {
android.view.View rootView = inflater.inflate(R.layout.fragment_workflow_run_history, container, false);
mRecyclerView = ((android.support.v7.widget.RecyclerView)... |
private void setTotalLengthOfRow(android.widget.TableRow pR, java.lang.String pTotalLength) {
for (int i = 0; i < (pR.getChildCount()); i++) {
if ((pR.getChildAt(i).getId()) == (R.id.measurementsTableColumnActual)) {
android.widget.TextView tV = ((android.widget.TextView) (pR.getChildAt(i)));
... | private void setTotalLengthOfRow(android.widget.TableRow pR, java.lang.String pTotalLength) {
for (int i = 0; i < (pR.getChildCount()); i++) {
if ((pR.getChildAt(i).getId()) == (R.id.measurementsTableColumnActual)) {
android.widget.TextView tV = ((android.widget.TextView) (pR.getChildAt(i)));
... |
public void registerBlock(com.builtbroken.mc.core.registry.ModManager manager, java.lang.String name, java.lang.String prefix, net.minecraft.block.Block block, java.lang.Class<? extends net.minecraft.item.ItemBlock> itemBlock) {
cpw.mods.fml.common.registry.GameRegistry.registerBlock(block, (itemBlock != null ? ite... | public void registerBlock(com.builtbroken.mc.core.registry.ModManager manager, java.lang.String name, java.lang.String modPrefix, net.minecraft.block.Block block, java.lang.Class<? extends net.minecraft.item.ItemBlock> itemBlock) {
cpw.mods.fml.common.registry.GameRegistry.registerBlock(block, (itemBlock != null ? ... |
public void initialize() {
freeway.numberOfCars = control.getInt("Number of cars");
freeway.roadLength = control.getInt("Road length");
freeway.p = control.getDouble("Slow down probability");
freeway.maximumVelocity = control.getInt("Maximum velocity");
display.setPreferredMinMax(0, freeway.roadLeng... | public void initialize() {
freeway.numberOfCars = control.getInt("Number of cars");
freeway.roadLength = control.getInt("Road length");
freeway.p = control.getDouble("Slow down probability");
freeway.maximumVelocity = control.getInt("Maximum velocity");
display.setPreferredMinMax(0, freeway.roadLeng... |
private static java.lang.String sign(java.lang.String input, java.lang.String key, java.lang.String method) throws java.io.UnsupportedEncodingException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException {
javax.crypto.Mac hmac = javax.crypto.Mac.getInstance(method);
javax.crypto.SecretKe... | private static byte[] sign(java.lang.String input, java.lang.String key, java.lang.String method) throws java.io.UnsupportedEncodingException, java.security.InvalidKeyException, java.security.NoSuchAlgorithmException {
javax.crypto.Mac hmac = javax.crypto.Mac.getInstance(method);
javax.crypto.SecretKey secretKe... |
public static boolean cointoss(int chance) {
java.util.Random r = new java.util.Random();
int Low = 1;
int High = 100;
int Result = (r.nextInt((High - Low))) + Low;
if (Result < chance)
return true;
else
return false;
} | private static boolean cointoss(int chance) {
java.util.Random r = new java.util.Random();
int Low = 1;
int High = 100;
int Result = (r.nextInt((High - Low))) + Low;
if (Result < chance)
return true;
else
return false;
} |
public void execute(final java.lang.Runnable asyncCode, final java.lang.Runnable onSuccess) {
execute(new javafx.concurrent.Task<java.lang.Void>() {
@java.lang.Override
protected java.lang.Void call() throws java.lang.Exception {
asyncCode.run();
return null;
}
},... | public void execute(final java.lang.Runnable asyncCode, final java.lang.Runnable onSuccess) {
execute(() -> {
asyncCode.run();
return null;
}, (java.lang.Void result) -> {
if (onSuccess != null) {
onSuccess.run();
}
});
} |
public static void write(java.io.FileWriter writer, java.lang.String project, java.util.Date start) throws java.io.IOException {
if (start != null) {
final java.text.SimpleDateFormat dateFormat = new java.text.SimpleDateFormat(timer.TimerStatus.DATE_FORMAT);
writer.write(java.lang.String.format(time... | public static void write(java.io.FileWriter writer, java.lang.String project, java.util.Date start) throws java.io.IOException {
if (start != null) {
writer.write(java.lang.String.format(timer.TimerStatus.LINE_FORMAT, project, start.getTime()));
}else {
writer.write(timer.TimerStatus.NULL);
... |
public eu.mihosoft.vrl.lang.model.ElseDeclaration transform(org.codehaus.groovy.ast.stmt.BlockStatement obj, eu.mihosoft.vrl.lang.model.IfDeclaration parent, eu.mihosoft.vrl.instrumentation.transform.TransformContext ctx) {
if ((parent.getControlFlow().getInvocations().size()) == 1) {
return builder.invokeE... | public eu.mihosoft.vrl.lang.model.ElseDeclaration transform(org.codehaus.groovy.ast.stmt.BlockStatement obj, eu.mihosoft.vrl.lang.model.IfDeclaration parent, eu.mihosoft.vrl.instrumentation.transform.TransformContext ctx) {
if ((parent.getControlFlow().getInvocations().size()) > 0) {
return builder.invokeEl... |
private android.widget.CheckBox addSupport(android.widget.CheckBox check, dev.ukanth.ufirewall.util.AppListArrayAdapter.ViewHolder entry, dev.ukanth.ufirewall.Api.PackageInfoData app, int flag) {
if (check != null) {
check.setTag(app);
switch (flag) {
case 0 :
check.setCh... | private android.widget.CheckBox addSupport(android.widget.CheckBox check, dev.ukanth.ufirewall.Api.PackageInfoData app, int flag) {
if (check != null) {
check.setTag(app);
switch (flag) {
case 0 :
check.setChecked(app.selected_roam);
break;
cas... |
private void showDateInfoView() {
weather_current_date.setText(currentWeather.getWeather_current_date());
android.content.SharedPreferences sharedPreferences = android.preference.PreferenceManager.getDefaultSharedPreferences(this);
java.lang.String dateResult = sharedPreferences.getString("date_format", "yy... | private void showDateInfoView() {
weather_current_date.setText(currentWeather.getWeather_current_date());
java.lang.String dateResult = sharedPreferences.getString("date_format", "yyyy年MM月dd日");
java.text.SimpleDateFormat simpleDateFormat = new java.text.SimpleDateFormat(dateResult);
java.lang.String da... |
private void getVisibleItem() {
mFixedItem.clear();
int firstVisiblePosition = getFirstVisiblePosition();
int lastVisiblePosition = firstVisiblePosition + (itemCountOnScreen);
for (int i = firstVisiblePosition; i <= lastVisiblePosition; i++) {
mFixedItem.add(mContainer.getChildAt(i));
}
} | private void getVisibleItem() {
mFixedItem.clear();
firstVisiblePosition = getFirstVisiblePosition();
lastVisiblePosition = ((firstVisiblePosition) + (itemCountOnScreen)) - 1;
for (int i = firstVisiblePosition; i <= (lastVisiblePosition); i++) {
mFixedItem.add(mContainer.getChildAt(i));
}
} |
public static double readDouble(java.util.Scanner sc, java.lang.String prompt) {
double result = 0.0;
do {
mishmart.ServiceClass.inputEmployeeMessage(prompt);
if (innerRead.hasNextDouble()) {
result = innerRead.nextDouble();
return result;
}else {
mish... | public static double readDouble(java.util.Scanner sc, java.lang.String prompt) {
double result = 0.0;
do {
mishmart.ServiceClass.inputEmployeeMessage(prompt);
if (sc.hasNextDouble()) {
result = sc.nextDouble();
return result;
}else {
mishmart.ServiceCl... |
public ar.edu.itba.models.ImageMatrix applyNoise(int band, ar.edu.itba.constants.NoiseType noiseType, ar.edu.itba.models.random.generators.RandomNumberGenerator generator, double percentage) {
if (band == (-1)) {
return this.applyAllBands(( b) -> this.applyNoise(b, noiseType, generator, percentage));
}
... | public ar.edu.itba.models.ImageMatrix applyNoise(int band, ar.edu.itba.constants.NoiseType noiseType, ar.edu.itba.models.random.generators.RandomNumberGenerator generator, double percentage) {
if (band == (-1)) {
return this.applyAllBands(( b) -> this.applyNoise(b, noiseType, generator, percentage));
}
... |
public void put(com.inursoft.Automata.Point p, int value) {
if (value == 0) {
worldMap.remove(p);
return ;
}
if ((p.getX()) > (width)) {
width = p.getX();
}
if ((p.getY()) > (height)) {
height = p.getY();
}
worldMap.put(p, value);
} | public void put(com.inursoft.Automata.Point p, int value) {
if ((p.getX()) > (width)) {
width = (p.getX()) + 1;
}
if ((p.getY()) > (height)) {
height = (p.getY()) + 1;
}
worldMap.put(p, value);
} |
public static boolean requestAutoTracking(@android.support.annotation.NonNull
android.content.Context context, @android.support.annotation.NonNull
java.lang.Class tClass) {
if ((!(com.adsamcik.signalcollector.services.ActivityService.backgroundTracking)) && ((com.adsamcik.signalcollector.utility.Preferences.get(con... | public static boolean requestAutoTracking(@android.support.annotation.NonNull
android.content.Context context, @android.support.annotation.NonNull
java.lang.Class tClass) {
if ((!(com.adsamcik.signalcollector.services.ActivityService.backgroundTracking)) && ((com.adsamcik.signalcollector.utility.Preferences.get(con... |
public void sos(int idUser, int idContact, double x, double y) {
try {
com.example.hjk.testing.WorkWithDataBase.connection = com.example.hjk.testing.WorkWithDataBase.setInstance();
java.sql.Statement statement = com.example.hjk.testing.WorkWithDataBase.connection.createStatement();
statement... | public void sos(int idUser, int idContact, double x, double y) {
try {
com.example.hjk.testing.WorkWithDataBase.connection = com.example.hjk.testing.WorkWithDataBase.setInstance();
java.sql.Statement statement = com.example.hjk.testing.WorkWithDataBase.connection.createStatement();
statement... |
private java.lang.String getSelectedFavList() {
for (int i = 0; i < (radioButtonsSelectFavs.length); i++) {
if (radioButtonsSelectFavs[i].isSelected()) {
return radioButtonsSelectFavs[i].getText();
}
}
return "Alle";
} | protected java.lang.String getSelectedFavList() {
for (int i = 0; i < (radioButtonsSelectFavs.length); i++) {
if (radioButtonsSelectFavs[i].isSelected()) {
return radioButtonsSelectFavs[i].getText();
}
}
return "Alle";
} |
private static java.lang.String decodeStringToDefaultCharSet(final java.lang.String input) {
java.lang.String decodedValue = input;
try {
decodedValue = new java.lang.String(input.getBytes("ISO-8859-1"), password.pwm.PwmConstants.DEFAULT_CHARSET);
if (decodedValue.contains("?")) {
de... | private static java.lang.String decodeStringToDefaultCharSet(final java.lang.String input) {
java.lang.String decodedValue = input;
try {
decodedValue = new java.lang.String(input.getBytes("ISO-8859-1"), password.pwm.PwmConstants.DEFAULT_CHARSET);
} catch (java.io.UnsupportedEncodingException e) {
... |
public void addNewMessage(final Message msg) {
Message copy = new Message(msg);
java.sql.Timestamp curTime = new java.sql.Timestamp(java.util.Calendar.getInstance().getTime().getTime());
copy.setTimestamp(curTime);
copy.setId(nextID);
nextID = nextID.add(java.math.BigInteger.ONE);
messages.add(c... | public void addNewMessage(final Message msg) {
Message copy = new Message(msg);
java.sql.Timestamp curTime = new java.sql.Timestamp(java.util.Calendar.getInstance().getTime().getTime());
copy.setTimestamp(curTime);
copy.setId(nextID);
nextID = nextID.add(java.math.BigInteger.ONE);
messages.add(c... |
private java.util.List<java.lang.String> convertToPattern(java.lang.String input) {
if (input == null)
return new java.util.ArrayList<java.lang.String>();
java.util.ArrayList<java.lang.String> result = new java.util.ArrayList<java.lang.String>();
java.util.List<java.lang.String> permutations = ... | private java.util.List<java.lang.String> convertToPattern(java.lang.String input) {
if (input == null)
return new java.util.ArrayList<java.lang.String>();
java.util.ArrayList<java.lang.String> result = new java.util.ArrayList<java.lang.String>();
input = toLowerCase(input);
java.util.List<j... |
public void incrementSuccessfulPolls(long time) {
successfulPolls.incrementAndGet();
boolean lastPollSuccessful = this.lastPollSuccessful.getAndSet(true);
if (lastPollSuccessful) {
int eventId = vo.getPollAbortedExceptionEventId();
if (eventId >= 0) {
returnToNormal(eventId, time... | public void incrementSuccessfulPolls(long time) {
successfulPolls.incrementAndGet();
boolean lastPollSuccessful = this.lastPollSuccessful.getAndSet(true);
if (!lastPollSuccessful) {
int eventId = vo.getPollAbortedExceptionEventId();
if (eventId >= 0) {
returnToNormal(eventId, tim... |
protected boolean doHandleRequest(final com.github.bordertech.wcomponents.Request request) {
java.util.Set<java.lang.String> values = getRequestValue(request);
java.util.Set<java.lang.String> current = getValue();
boolean changed = selectionsEqual(values, current);
if (changed) {
setData(values)... | protected boolean doHandleRequest(final com.github.bordertech.wcomponents.Request request) {
java.util.Set<java.lang.String> values = getRequestValue(request);
java.util.Set<java.lang.String> current = getValue();
boolean changed = !(selectionsEqual(values, current));
if (changed) {
setData(valu... |
public void test_if_request_no_rxmethod_is_legal() throws java.lang.Exception {
com.tspoon.benchit.Benchit.begin("request-call-noRX");
retrofit2.Call<com.alterego.stackoverflow.test.data.SearchResponse> call = mStackOverflowApiManager.doSearchForTitleAndTagsNormal("", "");
org.fest.assertions.api.Assertions... | public void test_if_request_no_rxmethod_is_legal() throws java.lang.Exception {
com.tspoon.benchit.Benchit.begin("request-call-noRX");
retrofit2.Call<com.alterego.stackoverflow.test.data.SearchResponse> call = mStackOverflowApiManager.doSearchForTitleAndTagsNormal("", "");
com.tspoon.benchit.Benchit.end("re... |
public static int formatDateOfWeek(java.lang.String s) {
switch (s) {
case "MON" :
return 1;
case "TUE" :
return 2;
case "WED" :
return 3;
case "THU" :
return 4;
case "FRI" :
return 5;
case "SAT" :
... | public static int formatDateOfWeek(java.lang.String s) {
switch (s) {
case "MON" :
return 1;
case "TUE" :
return 2;
case "WED" :
return 3;
case "THU" :
return 4;
case "FRI" :
return 5;
case "SAT" :
... |
private java.lang.String extractId(java.lang.String url) {
java.lang.String[] urlParts = url.split("&");
java.lang.String[] idPart = urlParts[0].split("=");
if (idPart[1].contains(".")) {
java.lang.String[] id = idPart[1].split("[.]");
return id[1];
}else {
return idPart[1];
... | private java.lang.String extractId(java.lang.String url) {
java.lang.String[] urlParts = url.split("&");
java.lang.String[] idPart = urlParts[0].split("=");
if ((idPart.length) > 1) {
if (idPart[1].contains(".")) {
java.lang.String[] id = idPart[1].split("[.]");
return id[1];... |
private void drawModelObject(com.example.glttt.ModelObject modelObject) {
float[] mvpMatrix = new float[16];
android.opengl.Matrix.multiplyMM(mvpMatrix, 0, viewMatrix, 0, modelObject.getModelMatrix(), 0);
android.opengl.Matrix.multiplyMM(mvpMatrix, 0, projectionMatrix, 0, mvpMatrix, 0);
android.opengl.G... | private void drawModelObject(com.example.glttt.ModelObject modelObject) {
float[] mvpMatrix = new float[16];
android.opengl.Matrix.multiplyMM(mvpMatrix, 0, viewMatrix, 0, modelObject.getModelMatrix(), 0);
android.opengl.Matrix.multiplyMM(mvpMatrix, 0, projectionMatrix, 0, mvpMatrix, 0);
android.opengl.G... |
public boolean isQueryable(java.lang.String layerName) {
uk.ac.rdg.resc.edal.catalogue.jaxb.VariableConfig xmlVariable = getXmlVariable(layerName);
if (xmlVariable != null) {
xmlVariable.isQueryable();
}else {
uk.ac.rdg.resc.edal.ncwms.config.NcwmsDynamicService dynamicService = getDynamicSe... | public boolean isQueryable(java.lang.String layerName) {
uk.ac.rdg.resc.edal.catalogue.jaxb.VariableConfig xmlVariable = getXmlVariable(layerName);
if (xmlVariable != null) {
return xmlVariable.isQueryable();
}else {
uk.ac.rdg.resc.edal.ncwms.config.NcwmsDynamicService dynamicService = getDy... |
public void createNew() {
if (((selectedDto) instanceof com.bics.fcitrack.model.AbstractModel) && ((((com.bics.fcitrack.model.AbstractModel) (selectedDto)).getRelease()) != null)) {
try {
getService().create(selectedDto);
} catch (java.lang.Exception e) {
com.bics.fcitrack.ut... | public void createNew() {
if (((selectedDto) instanceof com.bics.fcitrack.model.AbstractModel) && ((((com.bics.fcitrack.model.AbstractModel) (selectedDto)).getRelease()) == null)) {
com.bics.fcitrack.utils.FacesUtils.error("Realise is not selected.");
return ;
}
try {
getService().cr... |
public void printBoard() {
java.lang.System.out.println();
for (int i = 0; i < (board.length); i++) {
if (((i % 3) == 0) && (i != 0)) {
java.lang.System.out.println();
java.lang.System.out.println("-------------");
}
java.lang.System.out.println((" | " + (board[i]... | public void printBoard() {
java.lang.System.out.println();
for (int i = 0; i < (board.length); i++) {
if (((i % 3) == 0) && (i != 0)) {
java.lang.System.out.println();
java.lang.System.out.println("-------------");
}
java.lang.System.out.print((" | " + (board[i]))... |
public void setBarImage(int index) {
android.widget.ImageView stringImageView = getStringImageView(getFretLayout(index), com.example.webprog26.guitarchords.guitar_chords_engine.helpers.FretViewsHelper.NOTE_IMAGE_VIEW_INDEX);
stringImageView.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
stri... | private void setBarImage(int index) {
android.widget.ImageView stringImageView = getStringImageView(getFretLayout(index), com.example.webprog26.guitarchords.guitar_chords_engine.helpers.FretViewsHelper.NOTE_IMAGE_VIEW_INDEX);
stringImageView.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
str... |
public java.lang.String forgetPwProcess(@org.springframework.web.bind.annotation.ModelAttribute(value = "retrieve")
com.sj.repository.util.RetrievePasswordForm form, org.springframework.validation.BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
}
com.sj.model.model.SiteUser user = userServic... | public java.lang.String forgetPwProcess(@org.springframework.web.bind.annotation.ModelAttribute(value = "retrieve")
com.sj.repository.util.RetrievePasswordForm form, org.springframework.validation.BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
}
com.sj.model.model.SiteUser user = userServic... |
public static void displayResult(int comboSelection) {
java.lang.String selection = null;
if (comboSelection == (-1)) {
selection = ((("Indexing time of " + (tracing.views.VariableResources.getNumberOfFiles())) + " requirement(s) is: ") + (tracing.views.VariableResources.getIndexTime())) + " seconds.";
... | public static void displayResult(int comboSelection) {
java.lang.String selection = null;
if (comboSelection == (-1)) {
selection = ((("Indexing time of " + (tracing.views.VariableResources.getNumberOfFiles())) + " requirement(s) is: ") + (tracing.views.VariableResources.getIndexTime())) + " seconds.";
... |
public android.view.View onCreateView(android.view.LayoutInflater inflater, @android.support.annotation.Nullable
android.view.ViewGroup container, @android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
mBinding = com.framgia.... | public android.view.View onCreateView(android.view.LayoutInflater inflater, @android.support.annotation.Nullable
android.view.ViewGroup container, @android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
mBinding = com.framgia.... |
public java.util.List<org.ikasan.topology.model.RoleFilter> getRoleFiltersByRoleId(java.util.List<java.lang.Long> roleIds) {
org.hibernate.criterion.DetachedCriteria criteria = org.hibernate.criterion.DetachedCriteria.forClass(org.ikasan.topology.model.RoleFilter.class);
criteria.add(org.hibernate.criterion.Res... | public java.util.List<org.ikasan.topology.model.RoleFilter> getRoleFiltersByRoleId(java.util.List<java.lang.Long> roleIds) {
if ((roleIds == null) || (roleIds.isEmpty())) {
return new java.util.ArrayList<org.ikasan.topology.model.RoleFilter>();
}
org.hibernate.criterion.DetachedCriteria criteria = o... |
public java.lang.String ReadLine() {
java.lang.String content = null;
super.ReadLine();
try {
if (null == (reader)) {
return null;
}
java.io.LineNumberReader tmpReader = ((java.io.LineNumberReader) (reader));
tmpReader.setLineNumber(lineNumber);
content = ... | public java.lang.String ReadLine() {
java.lang.String content = null;
super.ReadLine();
try {
java.io.LineNumberReader tmpReader = ((java.io.LineNumberReader) (reader));
tmpReader.setLineNumber(lineNumber);
content = ((java.io.LineNumberReader) (reader)).readLine();
lineNumbe... |
public void afterTextChanged(android.text.Editable s) {
if ((com.appteamnith.hillffair.Utils.checkData(Password.getText().toString())) && ((Password.getText().toString().length()) > 8)) {
passwordTextInputLayout.setErrorEnabled(false);
}else {
passwordTextInputLayout.setErrorEnabled(true);
... | public void afterTextChanged(android.text.Editable s) {
if ((com.appteamnith.hillffair.Utils.checkData(Password.getText().toString())) && ((Password.getText().toString().length()) > 8)) {
passwordTextInputLayout.setErrorEnabled(false);
}else {
passwordTextInputLayout.setErrorEnabled(true);
... |
public int getNextEmptyPetIndex() {
petLock.lock();
try {
for (int i = 0; i < 3; i++) {
if ((pets[i]) == null) {
return i;
}
}
return 3;
} finally {
petLock.unlock();
}
} | public int getNextEmptyPetIndex() {
petLock.lock();
try {
for (int i = 0; i < (pets.length); i++) {
if ((pets[i]) == null) {
return i;
}
}
return 3;
} finally {
petLock.unlock();
}
} |
public void setTimeoutInfinite() {
try {
if (!(isConnected())) {
connect();
}
socket.setKeepAlive(true);
socket.setSoTimeout(0);
} catch (java.net.SocketException ex) {
broken = true;
throw new redis.clients.jedis.exceptions.JedisConnectionException(ex... | public void setTimeoutInfinite() {
try {
if (!(isConnected())) {
connect();
}
socket.setSoTimeout(0);
} catch (java.net.SocketException ex) {
broken = true;
throw new redis.clients.jedis.exceptions.JedisConnectionException(ex);
}
} |
public boolean saveData(Entity.Contact contact) {
session = setSession();
try {
session.beginTransaction();
session.persist(contact);
session.save(contact);
session.getTransaction().commit();
} catch (org.hibernate.HibernateException he) {
he.printStackTrace();
... | public boolean saveData(Entity.Contact contact) {
session = setSession();
try {
session.beginTransaction();
session.persist(contact);
session.save(contact);
session.getTransaction().commit();
} catch (org.hibernate.HibernateException he) {
he.printStackTrace();
... |
public org.cdltax.canteen.master.domain.ItemInventory mapRow(java.sql.ResultSet rs, int rowNum) throws java.sql.SQLException {
double stock = rs.getDouble(5);
double totalCost = rs.getDouble(6);
double unitCost = 0;
if (stock != 0) {
unitCost = (java.lang.Math.round(((totalCost / stock) * 100.0)... | public org.cdltax.canteen.master.domain.ItemInventory mapRow(java.sql.ResultSet rs, int rowNum) throws java.sql.SQLException {
double stock = rs.getDouble(5);
double totalCost = rs.getDouble(6);
double unitCost = 0;
if (stock != 0) {
unitCost = totalCost / stock;
}
return new org.cdltax.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.