buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
private void persistClassicGame(int victories) {
int tempVictories = persist.getInt(getString(R.string.achievements_persist_classic), 0);
tempVictories += victories;
android.content.SharedPreferences.Editor editor = persist.edit();
editor.putInt(getString(R.string.achievements_persist_classic), tempVict... | private void persistClassicGame() {
int tempVictories = persist.getInt(getString(R.string.achievements_persist_classic), 0);
tempVictories += 1;
android.content.SharedPreferences.Editor editor = persist.edit();
editor.putInt(getString(R.string.achievements_persist_classic), tempVictories);
editor.ap... |
public void run() {
java.lang.String hexColor = textFieldHexColor.getText();
int length = hexColor.length();
if (((!(co.lujun.colorpanelhelper.ColorPanel.isHexNumber(hexColor))) || (length < 6)) || (length > 8)) {
return ;
}
java.lang.String alphaHexStr;
if (length == 6) {
alphaH... | public void run() {
java.lang.String hexColor = textFieldHexColor.getText();
int length = hexColor.length();
if (((!(co.lujun.colorpanelhelper.ColorPanel.isHexNumber(hexColor))) || (length < 6)) || (length > 8)) {
return ;
}
java.lang.String alphaHexStr = hexColor.substring(0, (length - 6));... |
private java.util.Set<java.util.UUID> putIgnoreCache(java.util.UUID uuid, java.lang.String data) {
if (data == null) {
synchronized(ignoreCache) {
ignoreCache.remove(uuid);
}
return null;
}
java.util.HashSet<java.util.UUID> dataSet = new java.util.HashSet<>();
for (ja... | private java.util.Set<java.util.UUID> putIgnoreCache(java.util.UUID uuid, java.lang.String data) {
java.util.HashSet<java.util.UUID> dataSet = new java.util.HashSet<>();
if ((data != null) && (!(data.isEmpty()))) {
for (java.lang.String entry : data.split(",")) {
dataSet.add(java.util.UUID.f... |
private void recordNewRiderFromNfc(final java.lang.String nfcRiderText) throws java.io.IOException {
if (android.util.Log.isLoggable(net.bbuzz.busman.ManifestActivity.TAG, Log.DEBUG)) {
android.util.Log.d(net.bbuzz.busman.ManifestActivity.TAG, (("recordLatestRider " + (mIsAddingToManifest ? "add " : "drop "... | private void recordNewRiderFromNfc(final java.lang.String nfcRiderText) throws java.io.IOException {
if (android.util.Log.isLoggable(net.bbuzz.busman.ManifestActivity.TAG, Log.DEBUG)) {
android.util.Log.d(net.bbuzz.busman.ManifestActivity.TAG, (("recordLatestRider " + (mIsAddingToManifest ? "add " : "drop "... |
public int getSum() {
int sum = 0;
for (int row = 0; row < (this.rows); row++) {
for (int column = 0; column < (this.columns); (columns)++) {
Model.ScoreBoard.ScoreBoardCell cell = this.getCell(row, column);
sum += cell.getValue();
}
}
return sum;
} | public int getSum() {
int sum = 0;
for (int row = 0; row < (this.rows); row++) {
for (int column = 0; column < (this.columns); column++) {
Model.ScoreBoard.ScoreBoardCell cell = this.getCell(row, column);
sum += cell.getValue();
}
}
return sum;
} |
public static void main(java.lang.String[] args) {
Deque dq = new Deque();
dq.addFirst(1);
dq.addFirst(2);
edu.princeton.cs.algs4.StdOut.print(dq.removeLast());
edu.princeton.cs.algs4.StdOut.print(dq.removeLast());
} | public static void main(java.lang.String[] args) {
Deque<java.lang.Integer> dq = new Deque<java.lang.Integer>();
dq.addFirst(1);
dq.addFirst(2);
edu.princeton.cs.algs4.StdOut.print(dq.removeLast());
edu.princeton.cs.algs4.StdOut.print(dq.removeLast());
} |
public void step(sim.engine.SimState state) {
edu.vt.ece5574.sim.Simulation simState = ((edu.vt.ece5574.sim.Simulation) (state));
simState.getEventsForRobotID(robotID);
currEvents.addAll(simState.getEventsForRobotID(robotID));
if ((busy) == true) {
reactToEvent();
}
if (currEvents.isEmpt... | public void step(sim.engine.SimState state) {
edu.vt.ece5574.sim.Simulation simState = ((edu.vt.ece5574.sim.Simulation) (state));
if ((busy) == true) {
reactToEvent(simState);
}
currEvents = simState.getEventsForRobotID(robotID);
if ((currEvents) == null) {
if (currEvents.isEmpty()) ... |
public void run() {
for (org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer container : containers) {
org.apache.hadoop.yarn.api.records.ContainerStatus status = org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils.createPreemptedContainerStatus(container.getContainerId(... | public void run() {
for (org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer container : containers) {
org.apache.hadoop.yarn.api.records.ContainerStatus status = org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerUtils.createPreemptedContainerStatus(container.getContainerId(... |
public void writeToParcel(android.os.Parcel out, int i) {
java.text.SimpleDateFormat simpleDateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
out.writeString(mId);
out.writeString(mTaskId);
out.writeString(mUserId);
out.writeString(mDate);
out.writeDouble(mHour);
out.writeSt... | public void writeToParcel(android.os.Parcel out, int i) {
out.writeString(mId);
out.writeString(mTaskId);
out.writeString(mUserId);
out.writeString(mDate);
out.writeDouble(mHour);
out.writeString(mEntryDate);
out.writeString(mEntryUserId);
out.writeDouble(mOldValue);
out.writeString(... |
public org.json.JSONObject favourite(int plaqueId, int userId) {
org.json.JSONObject response = new org.json.JSONObject();
boolean result = false;
try {
ubiserv.simple.tom.PlaqueAction plaqueAction = new ubiserv.simple.tom.plaqueAction(plaqueId, userId);
result = plaqueAction.favourite();
... | public org.json.JSONObject favourite(int plaqueId, int userId) {
org.json.JSONObject response = new org.json.JSONObject();
int id = 0;
try {
ubiserv.simple.tom.PlaqueAction plaqueAction = new ubiserv.simple.tom.PlaqueAction(plaqueId, userId);
result = plaqueAction.favourite();
respon... |
public void onInit(int status) {
org.jraf.android.util.log.wrapper.Log.d(("status=" + status));
mStatus = status;
mTextToSpeech.addEarcon(mContext.getString(R.string.speak_activate_ride), mContext.getPackageName(), R.raw.start);
mTextToSpeech.addEarcon(mContext.getString(R.string.speak_pause_ride), mCon... | public void onInit(int status) {
org.jraf.android.util.log.wrapper.Log.d(("status=" + status));
mStatus = status;
if ((mTextToSpeech) != null) {
mTextToSpeech.addEarcon(mContext.getString(R.string.speak_activate_ride), mContext.getPackageName(), R.raw.start);
mTextToSpeech.addEarcon(mContext... |
public void mouseMoved(java.awt.event.MouseEvent arg0) {
if ((view.isTimeline()) == false) {
view.setToolText(arg0.getX(), arg0.getY());
javax.swing.ToolTipManager.sharedInstance().setDismissDelay(12000);
javax.swing.ToolTipManager.sharedInstance().registerComponent(view);
}
} | public void mouseMoved(java.awt.event.MouseEvent arg0) {
if ((view.isTimeline()) == false) {
view.setToolText(arg0.getX(), arg0.getY());
javax.swing.ToolTipManager.sharedInstance().setEnabled(true);
javax.swing.ToolTipManager.sharedInstance().setDismissDelay(12000);
javax.swing.ToolT... |
public java.util.Map<java.lang.String, java.lang.String> headers() {
java.util.Map<java.lang.String, java.lang.String> retHeaders = new java.util.HashMap<java.lang.String, java.lang.String>();
java.util.Set<java.lang.String> keys = headers.keySet();
for (java.lang.String key : keys) {
java.util.List... | public java.util.Map<java.lang.String, java.lang.String> headers() {
java.util.Map<java.lang.String, java.lang.String> retHeaders = new java.util.HashMap<java.lang.String, java.lang.String>();
java.util.Set<java.lang.String> keys = headers.keySet();
for (java.lang.String key : keys) {
if (key == nul... |
public static void showSnack(android.content.Context mContext, android.view.View mViewById, java.lang.String msg) {
android.support.design.widget.Snackbar snack = android.support.design.widget.Snackbar.make(mViewById, msg, Snackbar.LENGTH_SHORT);
android.view.ViewGroup group = ((android.view.ViewGroup) (snack.g... | public static void showSnack(android.content.Context mContext, android.view.View mViewById, java.lang.String msg) {
android.support.design.widget.Snackbar snack = android.support.design.widget.Snackbar.make(mViewById, msg, Snackbar.LENGTH_SHORT);
android.view.ViewGroup group = ((android.view.ViewGroup) (snack.g... |
public void play(battlecode.common.RobotController rc) throws battlecode.common.GameActionException {
initializeArchon(rc);
if ((team316.utils.Turn.currentTurn()) == 1) {
figureOutRank(rc);
}
checkInbox(rc);
seekHelpIfNeeded(rc);
broadcastLateMessages(rc);
figureOutDistribution();
... | public void play(battlecode.common.RobotController rc) throws battlecode.common.GameActionException {
initializeArchon(rc);
checkInbox(rc);
seekHelpIfNeeded(rc);
broadcastLateMessages(rc);
figureOutDistribution();
attemptActivateRobots(rc);
if (!(inDanger)) {
rc.setIndicatorString(1,... |
public void onAppStop(com.wowza.wms.application.IApplicationInstance appInstance) {
try {
if ((transferManager) != null) {
transferManager.shutdownNow();
}
} catch (java.lang.Exception e) {
logger.error((((((com.wowza.wms.plugin.s3upload.ModuleS3Upload.MODULE_NAME) + ".onAppS... | public void onAppStop(com.wowza.wms.application.IApplicationInstance appInstance) {
try {
if ((transferManager) != null) {
transferManager.shutdownNow(false);
}
} catch (java.lang.Exception e) {
logger.error((((((com.wowza.wms.plugin.s3upload.ModuleS3Upload.MODULE_NAME) + ".o... |
public void updateThinking(float delta) {
if ((!(moving)) && (!(waiting))) {
if ((random.nextFloat()) < (CHANCE_WAIT)) {
moving = true;
move_current = 0.0F;
move_time_random = random.nextFloat();
direction = com.jacl.capstone.data.enums.Direction.values()[rand... | public void updateThinking(float delta) {
if ((!(moving)) && (!(waiting))) {
if ((random.nextFloat()) < (CHANCE_WAIT)) {
waiting = true;
wait_current = 0.0F;
wait_time_random = random.nextFloat();
}else {
moving = true;
move_current = 0.0F;... |
public void run() {
if ((!(writing)) || (!(isOpen())))
return ;
writing = false;
try {
doWrite();
if (writeQueue.isEmpty()) {
socketEventHandler.onWrite();
}
} catch (java.io.IOException e) {
closeWithError(e, true);
}
} | public void run() {
if ((!(writing)) || (!(isOpen())))
return ;
writing = false;
try {
doWrite();
} catch (java.io.IOException e) {
closeWithError(e, true);
}
} |
private java.lang.String[] getLine(int line) {
java.util.ArrayList current_line = ((java.util.ArrayList) (_lines.get(line)));
java.lang.String[] tmp = new java.lang.String[current_line.size()];
for (int i = 0; i < (tmp.length); i++)
tmp[i] = ((java.lang.String) (current_line.get(i)));
retur... | public java.lang.String[] getLine(int line) {
java.util.ArrayList current_line = ((java.util.ArrayList) (_lines.get(line)));
java.lang.String[] tmp = new java.lang.String[current_line.size()];
for (int i = 0; i < (tmp.length); i++)
tmp[i] = ((java.lang.String) (current_line.get(i)));
return... |
public static void main(java.lang.String[] args) {
java.lang.System.out.printf("%10s====A====%n", "");
int[] a = new int[]{ 1 , 0 , 3 , 2 , 3 , 4 , 2 , 3 };
Quick.printArr(a);
Quick.printArr("Returned %a", Quick.partition(a, 0, ((a.length) - 1), 3));
Quick.printArr(a);
} | public static void main(java.lang.String[] args) {
java.lang.System.out.printf("%10s====A====%n", "");
int[] a = new int[]{ 1 , 0 , 3 , 2 , 3 , 4 , 2 , 3 };
Quick.printArr(a);
Quick.printArr("Returned %a", Quick.partition(a, 0, ((a.length) - 1), 1));
Quick.printArr(a);
} |
private void checkStateButton(tannt275.babyfood.model.FoodModel foods) {
deleteImage.setImageResource(((foods.get_admins()) == 1 ? R.mipmap.app_delete_deactive_icon : R.mipmap.app_delete_active_icon));
deleteImage.setEnabled(((foods.get_admins()) == 2));
favoriteImage.setImageResource(((foods.get_favorite()... | private void checkStateButton(tannt275.babyfood.model.FoodModel foods) {
deleteImage.setImageResource(((foods.get_admins()) == 1 ? R.mipmap.app_delete_deactive_icon : R.mipmap.app_delete_active_icon));
deleteImage.setEnabled(((foods.get_admins()) == 2));
favoriteImage.setImageResource(((foods.get_favorite()... |
public boolean rewriteable() {
if ((((this.input) == null) || ((this.fileOffset) < 0)) || ((((getTrueSize()) + (nom.tam.fits.Data.FITS_BLOCK_SIZE_MINUS_ONE)) / (FitsFactory.FITS_BLOCK_SIZE)) != (((this.dataSize) + (nom.tam.fits.Data.FITS_BLOCK_SIZE_MINUS_ONE)) / (FitsFactory.FITS_BLOCK_SIZE)))) {
return fal... | public boolean rewriteable() {
return (((this.input) != null) && ((this.fileOffset) >= 0)) && ((((getTrueSize()) + (nom.tam.fits.Data.FITS_BLOCK_SIZE_MINUS_ONE)) / (FitsFactory.FITS_BLOCK_SIZE)) == (((this.dataSize) + (nom.tam.fits.Data.FITS_BLOCK_SIZE_MINUS_ONE)) / (FitsFactory.FITS_BLOCK_SIZE)));
} |
private void setDefaultEdgeOption(org.grandviewtech.userinterface.screen.ColumnScreen columnScreen) {
org.grandviewtech.entity.enums.Edge edge = columnScreen.getEdge();
if (edge != null)
switch (edge) {
case FALLING :
{
risingEdge.setSelected(false);
... | private void setDefaultEdgeOption(org.grandviewtech.userinterface.screen.ColumnScreen columnScreen) {
org.grandviewtech.entity.enums.Edge edge = columnScreen.getEdge();
if (edge != null)
switch (edge) {
case FALLING :
{
risingEdge.setSelected(false);
... |
public void startingShutdown() {
org.apache.ode.bpel.iapi.Scheduler scheduler = ((org.wso2.carbon.bpel.core.ode.integration.BPELServerImpl) (org.wso2.carbon.bpel.core.internal.BPELServiceComponent.getBPELServer())).getScheduler();
if (scheduler != null) {
if (org.wso2.carbon.bpel.core.ode.integration.BP... | public void startingShutdown() {
org.apache.ode.bpel.iapi.Scheduler scheduler = ((org.wso2.carbon.bpel.core.ode.integration.BPELServerImpl) (org.wso2.carbon.bpel.core.internal.BPELServiceComponent.getBPELServer())).getScheduler();
if (scheduler != null) {
if (org.wso2.carbon.bpel.core.ode.integration.BP... |
public org.mappingviolence.poi.date.Date.Builder setMonth(java.lang.String month) {
if (((!(org.mappingviolence.poi.date.Date.Builder.monthsWith30.contains(month))) && (!(org.mappingviolence.poi.date.Date.Builder.monthsWith31.contains(month)))) && ("February".equals(month))) {
throw new java.lang.IllegalArg... | public org.mappingviolence.poi.date.Date.Builder setMonth(java.lang.String month) {
if (((!(org.mappingviolence.poi.date.Date.Builder.monthsWith30.contains(month))) && (!(org.mappingviolence.poi.date.Date.Builder.monthsWith31.contains(month)))) && (!("February".equals(month)))) {
throw new java.lang.Illegal... |
private void saveSession(java.lang.String pathToSave) throws java.io.IOException {
hr.fer.kba_authentication.profiling.gui.PausedSessionInfoHolder pausedSession = new hr.fer.kba_authentication.profiling.gui.PausedSessionInfoHolder(queue, userProfile, sessionInfo, currentAttempt, challengesGenerated, answeredCounter... | private void saveSession(java.lang.String pathToSave) throws java.io.IOException {
hr.fer.kba_authentication.profiling.gui.PausedSessionInfoHolder pausedSession = new hr.fer.kba_authentication.profiling.gui.PausedSessionInfoHolder(queue, userProfile, sessionInfo, currentAttempt, challengesGenerated, answeredCounter... |
private static double getLandingHeight(int[][] futureFields, int firstCol, int length, int rowsCleared) {
int height = 0;
for (int i = firstCol; i < (firstCol + length); i++) {
if (height < (Heuristic.heights[i])) {
height = Heuristic.heights[i];
java.lang.System.out.println(("co... | private static double getLandingHeight(int[][] futureFields, int firstCol, int length, int rowsCleared) {
int height = 0;
for (int i = firstCol; i < (firstCol + length); i++) {
if (height < (Heuristic.heights[i])) {
height = Heuristic.heights[i];
}
}
height -= rowsCleared;
... |
public static java.awt.image.BufferedImage getScaledImage(java.awt.image.BufferedImage srcImg, int w, int h) {
java.awt.image.BufferedImage resizedImg = srcImg;
if ((w < 10) || (h < 10)) {
w = 10;
h = 10;
}
try {
resizedImg = net.coobird.thumbnailator.Thumbnails.of(srcImg).size(w... | public static java.awt.image.BufferedImage getScaledImage(java.awt.image.BufferedImage srcImg, int w, int h) {
java.awt.image.BufferedImage resizedImg = srcImg;
if ((w < 1) || (h < 1)) {
return resizedImg;
}
try {
resizedImg = net.coobird.thumbnailator.Thumbnails.of(srcImg).size(w, h).as... |
public java.util.ArrayList<java.lang.String> splitText(java.lang.String text) {
java.util.ArrayList<java.lang.String> words = new java.util.ArrayList<java.lang.String>();
int pos = 0;
while ((text.indexOf(' ', pos)) > 0) {
int nextPos = text.indexOf(' ', pos);
java.lang.String word = text.su... | public java.util.ArrayList<java.lang.String> splitText(java.lang.String text) {
java.util.ArrayList<java.lang.String> words = new java.util.ArrayList<java.lang.String>();
int pos = 0;
while ((text.indexOf(' ', pos)) > 0) {
int nextPos = text.indexOf(' ', pos);
java.lang.String word = text.su... |
public void onReceive(android.content.Context context, android.content.Intent intent) {
android.net.ConnectivityManager connMgr = ((android.net.ConnectivityManager) (context.getSystemService(Context.CONNECTIVITY_SERVICE)));
android.net.NetworkInfo wifi = connMgr.getActiveNetworkInfo();
boolean isAvailable =... | public void onReceive(android.content.Context context, android.content.Intent intent) {
android.net.ConnectivityManager connMgr = ((android.net.ConnectivityManager) (context.getSystemService(Context.CONNECTIVITY_SERVICE)));
android.net.NetworkInfo wifi = connMgr.getActiveNetworkInfo();
boolean isAvailable =... |
private io.reactivex.Observable<?> pending(final java.lang.String... permissions) {
for (java.lang.String p : permissions) {
if (!(mRxPermissionsFragment.containsByPermission(p))) {
return io.reactivex.Observable.empty();
}
}
return io.reactivex.Observable.just(null);
} | private io.reactivex.Observable<?> pending(final java.lang.String... permissions) {
for (java.lang.String p : permissions) {
if (!(mRxPermissionsFragment.containsByPermission(p))) {
return io.reactivex.Observable.empty();
}
}
return io.reactivex.Observable.just(new java.lang.Obje... |
public org.springframework.boot.actuate.health.Health health() {
org.springframework.boot.actuate.health.Health.Builder builder = new org.springframework.boot.actuate.health.Health.Builder();
if ((timeEntryRepo.list().size()) > (io.pivotal.pal.tracker.TimeEntryHealthIndicator.MAX_TIME_ENTRIES)) {
builde... | public org.springframework.boot.actuate.health.Health health() {
org.springframework.boot.actuate.health.Health.Builder builder = new org.springframework.boot.actuate.health.Health.Builder();
if ((timeEntryRepo.list().size()) < (io.pivotal.pal.tracker.TimeEntryHealthIndicator.MAX_TIME_ENTRIES)) {
builde... |
public void fillWithdefaultValues() {
java.util.Set<java.lang.String> users = new java.util.HashSet<java.lang.String>();
java.util.Set<java.lang.String> types = new java.util.HashSet<java.lang.String>();
users.add("Bob Marley");
users.add("Marilyn Monroe");
types.add("blue");
types.add("green");... | private void fillWithdefaultValues() {
java.util.Set<java.lang.String> users = new java.util.HashSet<java.lang.String>();
java.util.Set<java.lang.String> types = new java.util.HashSet<java.lang.String>();
users.add("Bob Marley");
users.add("Marilyn Monroe");
types.add("blue");
types.add("green")... |
private void obtainStyledAttributes(final android.util.AttributeSet attributeSet) {
if (attributeSet != null) {
android.content.res.TypedArray typedArray = getContext().obtainStyledAttributes(attributeSet, R.styleable.FloatingActionButton);
try {
obtainSize(typedArray);
obtai... | private void obtainStyledAttributes(final android.util.AttributeSet attributeSet) {
android.content.res.TypedArray typedArray = getContext().obtainStyledAttributes(attributeSet, R.styleable.FloatingActionButton);
try {
obtainSize(typedArray);
obtainColor(typedArray);
obtainActivatedColor... |
private void syncCategories(java.lang.String categoriesString, boolean newIdsNeeded) {
java.lang.String loftToken = getLoftToken();
java.lang.String googleToken = getGoogleToken();
if (mNetworkStatusChecker.isNetworkAvailable()) {
com.valevich.moneytracker.network.rest.model.CategoriesSyncModel apiC... | private void syncCategories(java.lang.String categoriesString) {
java.lang.String loftToken = getLoftToken();
java.lang.String googleToken = getGoogleToken();
if (mNetworkStatusChecker.isNetworkAvailable()) {
com.valevich.moneytracker.network.rest.model.CategoriesSyncModel apiCategories = mRestServi... |
public java.util.LinkedList<diag.stn.STN.Vertex> adjacentNodes(diag.stn.STN.Vertex last) {
java.util.LinkedHashSet<diag.stn.STN.DEdge> edges = map.get(last);
java.util.LinkedList<diag.stn.STN.Vertex> adjacent = new java.util.LinkedList<>();
for (diag.stn.STN.DEdge edg : edges) {
adjacent.add(edg.get... | public java.util.LinkedList<diag.stn.STN.Vertex> adjacentNodes(diag.stn.STN.Vertex last) {
java.util.LinkedHashSet<diag.stn.STN.DEdge> edges = map.get(last);
if (edges == null)
return null;
java.util.LinkedList<diag.stn.STN.Vertex> adjacent = new java.util.LinkedList<>();
for (diag.stn.STN.... |
private void saveSession(com.github.thorqin.toolkit.web.session.WebSession session) {
try {
if (((session != null) && (session.isSaved())) && (session.isNew())) {
session.save();
}
} catch (java.lang.Exception e) {
java.lang.System.err.println(("Save session failed: " + (e.ge... | private static void saveSession(com.github.thorqin.toolkit.web.session.WebSession session) {
try {
if (((session != null) && (!(session.isSaved()))) && (!(session.isNew()))) {
session.save();
}
} catch (java.lang.Exception e) {
java.lang.System.err.println(("Save session fail... |
private void reload(java.lang.String botName) throws java.io.IOException, org.eclipse.jgit.api.errors.GitAPIException {
org.eclipse.jgit.storage.file.FileRepositoryBuilder builder = new org.eclipse.jgit.storage.file.FileRepositoryBuilder();
org.eclipse.jgit.lib.Repository repository = builder.setGitDir(new java... | private void reload(java.lang.String botName) throws java.io.IOException, org.eclipse.jgit.api.errors.GitAPIException {
org.eclipse.jgit.storage.file.FileRepositoryBuilder builder = new org.eclipse.jgit.storage.file.FileRepositoryBuilder();
org.eclipse.jgit.lib.Repository repository = builder.setGitDir(new java... |
protected void onPostExecute(java.util.List<com.bignerdranch.android.photogallery.GalleryItem> galleryItems) {
if ((lastPageFetched) > 0) {
mItems.addAll(galleryItems);
mPhotoRecyclerView.getAdapter().notifyDataSetChanged();
}else {
mItems = galleryItems;
setupAdapter();
}
... | protected void onPostExecute(java.util.List<com.bignerdranch.android.photogallery.GalleryItem> galleryItems) {
if ((lastPageFetched) > 1) {
mItems.addAll(galleryItems);
mPhotoRecyclerView.getAdapter().notifyDataSetChanged();
}else {
mItems = galleryItems;
setupAdapter();
}
... |
public void defaultLocale() throws java.lang.Exception {
this.resolver.setDefaultLocale(java.util.Locale.JAPANESE);
org.springframework.mock.web.test.MockHttpServletRequest request = new org.springframework.mock.web.test.MockHttpServletRequest();
org.junit.Assert.assertEquals(java.util.Locale.JAPANESE, this... | public void defaultLocale() throws java.lang.Exception {
this.resolver.setDefaultLocale(java.util.Locale.JAPANESE);
org.springframework.mock.web.test.MockHttpServletRequest request = new org.springframework.mock.web.test.MockHttpServletRequest();
assertEquals(java.util.Locale.JAPANESE, this.resolver.resolve... |
public static void enterSearchQuery(android.app.Activity activity, java.lang.String query) {
org.xbmc.kore.testhelpers.TestUtils.clickMenuItem(activity, activity.getString(R.string.action_search), R.id.action_search);
android.support.test.espresso.Espresso.onView(org.hamcrest.Matchers.allOf(android.support.test... | public static void enterSearchQuery(android.app.Activity activity, java.lang.String query) {
org.xbmc.kore.testhelpers.TestUtils.clickMenuItem(activity, activity.getString(R.string.action_search), R.id.action_search);
android.support.test.espresso.Espresso.onView(android.support.test.espresso.matcher.ViewMatche... |
public java.lang.String getCountry(java.lang.String locationFullText) {
java.lang.String country = "";
if ((!(country.matches(","))) || (country.matches("\\d"))) {
return country;
}
try {
java.lang.String[] addressData = locationFullText.split(",");
country = addressData[((addres... | public java.lang.String getCountry(java.lang.String locationFullText) {
java.lang.String country = "";
if ((!(locationFullText.contains(","))) || (locationFullText.matches("\\d"))) {
return country;
}
try {
java.lang.String[] addressData = locationFullText.split(",");
country = a... |
public boolean removeTimer(com.napontaratan.vibernate.model.TimerSession timerSession) {
if (timerSession != null) {
timerController.removeAlarm(timerSession);
timersIdMap.remove(timerSession.getId());
timers.remove(timerSession);
notifyListViewChanged();
return true;
}
... | public boolean removeTimer(com.napontaratan.vibernate.model.TimerSession timerSession) {
if (timerSession != null) {
timerController.removeAlarm(timerSession);
timersIdMap.remove(timerSession.getId());
for (com.napontaratan.vibernate.model.TimerSession t : timers) {
if ((t.getId(... |
private java.lang.String getMainDecodeFunctionName(java.lang.String playerJS) {
java.lang.String test1 = "(?<new>network=\\\\{|(?!^)\\\\G)\\\\s*(?<key>\\\\w+)=\\\"?(?<value>[^\\\"\\n]+)\\\"?";
java.lang.String test2 = "(network=\\\\{|(?!^)\\\\G)\\\\s*(\\\\w+)=\\\"?([^\\\"\\n]+)\\\"?";
java.util.regex.Patter... | private java.lang.String getMainDecodeFunctionName(java.lang.String playerJS) {
java.util.regex.Pattern decodeFunctionName = java.util.regex.Pattern.compile("([\"\'])signature\\1\\s*,\\s*([a-zA-Z0-9$]+)\\(");
java.util.regex.Matcher decodeFunctionNameMatch = decodeFunctionName.matcher(playerJS);
if (decodeF... |
public void waitForMyTurn(final java.lang.String playerName) throws java.lang.InterruptedException {
final fourinarowbot.domain.MarkerColor playerColor = getPlayerColor(playerName);
while (true) {
if ((playerColor.equals(MarkerColor.RED)) && (isRedPlayerTurn.get())) {
break;
}else
... | public void waitForMyTurn(final java.lang.String playerName) throws java.lang.InterruptedException {
final fourinarowbot.domain.MarkerColor playerColor = getPlayerColor(playerName);
while (true) {
synchronized(isRedPlayerTurn) {
if ((playerColor.equals(MarkerColor.RED)) && (isRedPlayerTurn))... |
public void prepareAudio(java.lang.String audioFileName, android.media.MediaPlayer mp) {
try {
mp.reset();
android.content.res.AssetFileDescriptor afd;
afd = getAssets().openFd(audioFileName);
mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
m... | private void prepareAudio(java.lang.String audioFileName, android.media.MediaPlayer mp) {
try {
mp.reset();
android.content.res.AssetFileDescriptor afd;
afd = getAssets().openFd(audioFileName);
mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());
... |
public org.orcid.pojo.IdentifierType fetchIdentifierTypeByDatabaseName(java.lang.String name, java.util.Locale loc) {
java.util.Locale l = (loc == null) ? loc : java.util.Locale.ENGLISH;
org.orcid.persistence.jpa.entities.IdentifierTypeEntity entity = idTypeDao.getEntityByName(name);
org.orcid.pojo.Identifi... | public org.orcid.pojo.IdentifierType fetchIdentifierTypeByDatabaseName(java.lang.String name, java.util.Locale loc) {
loc = (loc == null) ? java.util.Locale.ENGLISH : loc;
org.orcid.persistence.jpa.entities.IdentifierTypeEntity entity = idTypeDao.getEntityByName(name);
org.orcid.pojo.IdentifierType type = a... |
private <T> boolean tryAdd(com.google.common.collect.ConcurrentHashMultiset<T> multiset, T value, int max) {
while (true) {
int count = multiset.count(value);
if ((count >= max) || (max == 0))
return false;
if (multiset.setCount(value, count, (count + 1)))
re... | private <T> boolean tryAdd(com.google.common.collect.ConcurrentHashMultiset<T> multiset, T value, int max) {
while (true) {
int count = multiset.count(value);
if ((count >= max) && (max != 0))
return false;
if (multiset.setCount(value, count, (count + 1)))
re... |
public void onAddUpdate(final java.lang.String front, final java.lang.String back) {
if (mCard.exists()) {
update(front, back);
}else {
add(front, back);
if (mAddEditCardView.addReversedCard()) {
add(front, back);
}
}
} | public void onAddUpdate(final java.lang.String front, final java.lang.String back) {
if (mCard.exists()) {
update(front, back);
}else {
add(front, back);
if (mAddEditCardView.addReversedCard()) {
add(back, front);
}
}
} |
protected void saveData(javafx.event.ActionEvent event) {
com.CS6359Team1.RecipeBook.DbClass db = new com.CS6359Team1.RecipeBook.DbClass();
javafx.collections.ObservableList<com.CS6359Team1.RecipeBook.IngredientProperty> ingredientsNameList = ingredientsTableView.getItems();
javafx.collections.ObservableLis... | protected void saveData(javafx.event.ActionEvent event) {
com.CS6359Team1.RecipeBook.DbClass db = new com.CS6359Team1.RecipeBook.DbClass();
javafx.collections.ObservableList<com.CS6359Team1.RecipeBook.IngredientProperty> ingredientsNameList = ingredientsTableView.getItems();
javafx.collections.ObservableLis... |
public T create(java.lang.Class<T> clazz) {
final java.lang.reflect.Constructor<T> constructor = getConstructor(clazz);
try {
return constructor.newInstance();
} catch (java.lang.InstantiationException | java.lang.IllegalAccessException | java.lang.reflect.InvocationTargetException e) {
e.pr... | public T create(java.lang.Class<T> clazz) {
final java.lang.reflect.Constructor<T> constructor = getConstructor(clazz);
try {
return constructor.newInstance();
} catch (java.lang.InstantiationException e) {
e.printStackTrace();
} catch (java.lang.reflect.InvocationTargetException e) {
... |
public void bindSermonToView(int position, android.view.View sermonView) {
android.widget.TextView titleView = ((android.widget.TextView) (sermonView.findViewById(R.id.primary_text)));
android.widget.TextView dateView = ((android.widget.TextView) (sermonView.findViewById(R.id.secondary_text)));
com.appspot.... | public void bindSermonToView(int position, android.view.View sermonView) {
android.widget.TextView titleView = ((android.widget.TextView) (sermonView.findViewById(R.id.primary_text)));
android.widget.TextView dateView = ((android.widget.TextView) (sermonView.findViewById(R.id.secondary_text)));
com.appspot.... |
public void response(byte[] msg) {
program.add(msg[0]);
program.add(msg[0]);
android.util.Log.w("LOLZ", java.lang.Integer.toHexString(msg[0]));
android.util.Log.w("LOLZ", java.lang.Integer.toHexString(msg[1]));
if (current == (programSize - 1)) {
callback.response(program);
}
} | public void response(byte[] msg) {
program.add(msg[0]);
program.add(msg[1]);
android.util.Log.w("LOLZ", java.lang.Integer.toHexString(msg[0]));
android.util.Log.w("LOLZ", java.lang.Integer.toHexString(msg[1]));
if (current == (programSize - 1)) {
callback.response(program);
}
} |
private void runTest(com.nfsdb.collections.experimental.NWayHashMap<java.lang.Integer, java.lang.Integer> map) {
com.nfsdb.utils.Rnd rnd = new com.nfsdb.utils.Rnd(java.lang.System.currentTimeMillis(), java.lang.System.nanoTime());
for (int i = 0; i < (iterations); i++) {
int key = rnd.nextInt();
... | private void runTest(com.nfsdb.collections.experimental.NWayHashMap<java.lang.CharSequence, java.lang.CharSequence> map) {
for (int i = 0; i < (iterations); i++) {
java.lang.CharSequence key = keys[i];
if ((map.get(key)) == null) {
map.put(key, key);
}
}
} |
public void onReceive(android.content.Context context, android.content.Intent intent) {
boolean isSuccess = intent.getBooleanExtra("is_success", false);
java.lang.String action = intent.getAction();
if (action.equals(com.wafflestudio.siksha.service.DownloadingJsonReceiver.ACTION_CURRENT_DOWNLOAD)) {
... | public void onReceive(android.content.Context context, android.content.Intent intent) {
boolean isSuccess = intent.getBooleanExtra("is_success", false);
java.lang.String action = intent.getAction();
if ((action != null) && (action.equals(com.wafflestudio.siksha.service.DownloadingJsonReceiver.ACTION_CURRENT... |
public void onLocationChanged(android.location.Location location) {
mCurrentLocation = location;
if ((mCurrentLocation) != null) {
btn_location.clearAnimation();
btn_location.setBackgroundResource(R.drawable.location_success);
}
try {
checkPermission(getActivity());
} catch (... | public void onLocationChanged(android.location.Location location) {
mCurrentLocation = location;
btn_location.clearAnimation();
btn_location.setBackgroundResource(R.drawable.location_success);
try {
checkPermission(getActivity());
} catch (goodthingmap.android.prada.lab.goodthingmap.componen... |
public java.util.Map<java.lang.String, java.lang.Object> getEquCheckByShopId(@org.springframework.web.bind.annotation.PathVariable
java.lang.String shopId) {
java.util.List<cn.springmvc.model.Equipment> lists = null;
try {
lists = equService.getAllEquipments();
} catch (java.lang.Exception ex) {
... | public java.util.Map<java.lang.String, java.lang.Object> getEquCheckByShopId() {
java.util.List<cn.springmvc.model.Equipment> lists = null;
try {
lists = equService.getAllEquipments();
} catch (java.lang.Exception ex) {
ex.printStackTrace();
return com.springmvc.utils.HttpUtils.gener... |
public static int open(int port, int expiresSeconds, java.lang.String htmlPath, boolean force) throws java.io.IOException {
int ap = 0;
while (true) {
try {
net.yacy.grid.http.APIServer.open((port + ap), expiresSeconds, htmlPath);
return port + ap;
} catch (java.io.IOExce... | public static int open(int port, java.lang.String htmlPath, boolean force) throws java.io.IOException {
int ap = 0;
while (true) {
try {
net.yacy.grid.http.APIServer.open((port + ap), htmlPath);
return port + ap;
} catch (java.io.IOException e) {
if (force || ... |
public void onCreate(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if ((presenter) == null) {
setPresenter(new husaynhakeem.io.popularmovies.features.favorites.FavoritesPresenter());
presenter.setView(this);
}
presenter.s... | public void onCreate(@android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if ((presenter) == null)
setPresenter(new husaynhakeem.io.popularmovies.features.favorites.FavoritesPresenter());
presenter.setView(this);
presenter.start();... |
public boolean validate() {
java.io.Serializable value = getPropertyValue();
java.lang.String error = null;
if (((isRequired) && ((isMultiSelect) && (selectedChoices.isEmpty()))) || (org.apache.commons.lang3.StringUtils.isBlank(value.toString()))) {
error = "Required, cannot be blank";
}
set... | public boolean validate() {
java.io.Serializable value = getPropertyValue();
java.lang.String error = null;
if ((isRequired) && (((isMultiSelect) && (selectedChoices.isEmpty())) || (org.apache.commons.lang3.StringUtils.isBlank(value.toString())))) {
error = "Required, cannot be blank";
}
set... |
public void onClick(android.view.View v) {
android.support.v4.app.Fragment fragment = getSupportFragmentManager().findFragmentByTag(getString(R.string.create_ticket));
if (fragment == null)
fragment = new co.helpdesk.faveo.frontend.fragments.CreateTicket();
android.support.v4.app.FragmentManage... | public void onClick(android.view.View v) {
android.support.v4.app.Fragment fragment = new co.helpdesk.faveo.frontend.fragments.CreateTicket();
android.support.v4.app.FragmentManager fragmentManager = getSupportFragmentManager();
android.support.v4.app.FragmentTransaction fragmentTransaction = fragmentManage... |
public void updateAmount(java.lang.Float amount) {
txtviewTotal.setText("");
txtviewTotal.setText(getResources().getText(R.string.message_lista_total_cartera));
txtviewTotal.setText((((txtviewTotal.getText()) + " ") + (java.lang.String.valueOf(amount))));
} | public void updateAmount(java.lang.Float amount) {
if ((txtviewTotal) != null) {
txtviewTotal.setText("");
txtviewTotal.setText(getResources().getText(R.string.message_lista_total_cartera));
txtviewTotal.setText((((txtviewTotal.getText()) + " ") + (java.lang.String.valueOf(amount))));
}
... |
public java.lang.String getParam(java.lang.String key) {
if (mRequest.getMethod().equals("GET")) {
try {
return mParams.containsKey(key) ? new java.lang.String(mParams.get(key)[0].getBytes("iso-8859-1"), com.coderyuan.api.BaseWebApiServlet.DES_CHARSET) : null;
} catch (java.io.Unsupporte... | public java.lang.String getParam(java.lang.String key) {
try {
return mParams.containsKey(key) ? new java.lang.String(mParams.get(key)[0].getBytes("iso-8859-1"), com.coderyuan.api.BaseWebApiServlet.DES_CHARSET) : null;
} catch (java.io.UnsupportedEncodingException e) {
e.printStackTrace();
}... |
public void testGetNumAgentForSameAgent() {
for (int i = 0; i < (numLoop); i++) {
sim.util.Double2D location = toTest.getAvailableRandomLocation();
toTest.setDistributedObjectLocation(location, sa, ss);
}
assertEquals(1, toTest.getNumAgents());
} | public void testGetNumAgentForSameAgent() {
for (int i = 0; i < (numLoop); i++) {
sim.util.Double2D location = toTest.getAvailableRandomLocation();
java.lang.System.out.println(location);
toTest.setDistributedObjectLocation(location, sa, ss);
}
assertEquals(1, toTest.getNumAgents());... |
public static int getConsoleInt(java.lang.String text, boolean nulltable, int vdefault) {
boolean valid = false;
int data = 0;
while (!valid) {
java.lang.System.out.print(text);
try {
data = java.lang.Integer.parseInt(consoleUI.UtilsUI.reader.nextLine());
} catch (java.la... | public static int getConsoleInt(java.lang.String text, boolean nulltable, int vdefault) {
boolean valid = false;
int data = 0;
while (!valid) {
java.lang.System.out.print(text);
try {
data = java.lang.Integer.parseInt(consoleUI.UtilsUI.reader.nextLine());
valid = true... |
private static int kadansModToWorkWithNegs(int[] nums) {
int maxSoFar = nums[0];
int maxEndingHere = nums[0];
for (int i = 0; i < (nums.length); i++) {
maxEndingHere = java.lang.Math.max((maxEndingHere + (nums[i])), nums[i]);
maxSoFar = java.lang.Math.max(maxSoFar, maxEndingHere);
if... | private static int kadansModToWorkWithNegs(int[] nums) {
int maxSoFar = nums[0];
int maxEndingHere = nums[0];
for (int i = 1; i < (nums.length); i++) {
maxEndingHere = java.lang.Math.max((maxEndingHere + (nums[i])), nums[i]);
maxSoFar = java.lang.Math.max(maxSoFar, maxEndingHere);
if... |
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
if ((org.nschmidt.ldparteditor.project.Project.getFileToEdit()) != null) {
org.nschmidt.ldparteditor.project.Project.getFileToEdit().getVertexManager().addSnapshot();
org.nschmidt.ldparteditor.project.Project.getFileToEdit().getVe... | public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
if ((org.nschmidt.ldparteditor.project.Project.getFileToEdit()) != null) {
org.nschmidt.ldparteditor.project.Project.getFileToEdit().getVertexManager().addSnapshot();
org.nschmidt.ldparteditor.project.Project.getFileToEdit().getVe... |
private void cancelConnection() {
connecting = false;
if ((GlobalData.client) != null)
GlobalData.client.disconnect("Connecting cancelled");
if ((GlobalData.server) != null)
GlobalData.server.stop();
resetForms();
if ((connectedFrom) == null) {
mainForm.setActive(tr... | public void cancelConnection() {
connecting = false;
if ((GlobalData.client) != null)
GlobalData.client.disconnect("Connecting cancelled");
if ((GlobalData.server) != null)
GlobalData.server.stop();
resetForms();
if ((connectedFrom) == null) {
mainForm.setActive(tru... |
private int getOrientation(java.lang.String inputImage) {
android.media.ExifInterface exif = null;
try {
exif = new android.media.ExifInterface(inputImage);
} catch (java.io.IOException e) {
android.util.Log.e(hu.sandorfehervari.analogdisplayreader.DisplayDetector.TAG, "Failed to red exif in... | private int getOrientation(java.lang.String inputImage) {
int orientation = 0;
try {
android.media.ExifInterface exif = new android.media.ExifInterface(inputImage);
orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_UNDEFINED);
} catch (java.io.IOExce... |
public void resume() throws java.lang.InterruptedException {
org.junit.Assert.assertThat(OperatingPool.CORE.getStatus().isPaused(), org.hamcrest.CoreMatchers.is(false));
OperatingPool.CORE.pause();
OperatingPool.CORE.resume();
java.lang.Thread.sleep(6000);
org.junit.Assert.assertThat(OperatingPool.C... | public void resume() throws java.lang.InterruptedException {
org.junit.Assert.assertThat(OperatingPool.CORE.getStatus().isPaused(), org.hamcrest.CoreMatchers.is(false));
OperatingPool.CORE.pause();
OperatingPool.CORE.resume();
org.junit.Assert.assertThat(OperatingPool.CORE.getStatus().isPaused(), org.ha... |
private org.nusco.narjillos.shared.things.Thing findThingAt_WithLabel(org.nusco.narjillos.shared.physics.Vector position, java.lang.String label) {
org.nusco.narjillos.shared.things.Thing result = null;
double minDistance = java.lang.Double.MAX_VALUE;
for (org.nusco.narjillos.shared.things.Thing thing : new... | private org.nusco.narjillos.shared.things.Thing findThingAt_WithLabel(org.nusco.narjillos.shared.physics.Vector position, java.lang.String label) {
org.nusco.narjillos.shared.things.Thing result = null;
double minDistance = java.lang.Double.MAX_VALUE;
for (org.nusco.narjillos.shared.things.Thing thing : env... |
public void showDailyAlarmNotification() {
com.hcyclone.zen.Challenge challenge = com.hcyclone.zen.ChallengeModel.getInstance().getSerializedCurrentChallenge();
if (challenge != null) {
com.hcyclone.zen.Log.e(com.hcyclone.zen.NotificationService.TAG, "Ignore daily alarm notification as challenge is null... | public void showDailyAlarmNotification() {
com.hcyclone.zen.Challenge challenge = com.hcyclone.zen.ChallengeModel.getInstance().getSerializedCurrentChallenge();
if (challenge == null) {
com.hcyclone.zen.Log.e(com.hcyclone.zen.NotificationService.TAG, "Ignore daily alarm notification as challenge is null... |
public void onTextChanged(java.lang.CharSequence s, int start, int before, int count) {
if ((editTextBPM.getText().toString().length()) != 0)
seekBar.setProgress(java.lang.Integer.valueOf(editTextBPM.getText().toString()));
} | public void onTextChanged(java.lang.CharSequence s, int start, int before, int count) {
if ((s.length()) != 0)
seekBar.setProgress(java.lang.Integer.valueOf(editTextBPM.getText().toString()));
} |
public void onClick(final android.view.View view) {
android.graphics.Bitmap canvasImage = ((android.graphics.drawable.BitmapDrawable) (selectedImage.getDrawable())).getBitmap();
java.io.ByteArrayOutputStream bs = new java.io.ByteArrayOutputStream();
canvasImage.compress(Bitmap.CompressFormat.JPEG, combis.ha... | public void onClick(final android.view.View view) {
java.io.ByteArrayOutputStream bs = new java.io.ByteArrayOutputStream();
canvasImage.compress(Bitmap.CompressFormat.JPEG, combis.hackathon.ui.photo.SelectedPhotoFragment.COMPRESS_QUALITY, bs);
byte[] bytes = bs.toByteArray();
java.lang.String encodedIma... |
public com.metabroadcast.common.base.Maybe<org.atlasapi.media.channel.Channel> fromKey(java.lang.String key) {
for (org.atlasapi.media.channel.Channel channel : channels.get()) {
if ((java.util.Objects.nonNull(channel.getKey())) && (channel.getKey().equals(key))) {
return com.metabroadcast.commo... | public com.metabroadcast.common.base.Maybe<org.atlasapi.media.channel.Channel> fromKey(java.lang.String key) {
for (org.atlasapi.media.channel.Channel channel : channels.get()) {
if (java.util.Objects.equals(channel.getKey(), key)) {
return com.metabroadcast.common.base.Maybe.just(channel);
... |
public static at.sw2017.awesomeinc.awesomeplayer.Song nextSongInformation() {
(at.sw2017.awesomeinc.awesomeplayer.Database.currentIndex)++;
if ((at.sw2017.awesomeinc.awesomeplayer.Database.currentIndex) != (at.sw2017.awesomeinc.awesomeplayer.Database.all_songs.size())) {
if ((at.sw2017.awesomeinc.awesom... | public static at.sw2017.awesomeinc.awesomeplayer.Song nextSongInformation() {
if ((at.sw2017.awesomeinc.awesomeplayer.Database.currentIndex) != (at.sw2017.awesomeinc.awesomeplayer.Database.all_songs.size())) {
if (((at.sw2017.awesomeinc.awesomeplayer.Database.currentIndex) + 1) >= (at.sw2017.awesomeinc.awes... |
protected void onReceivedMsg(java.lang.String msg) throws java.lang.Exception {
com.leap12.common.Log.debugNewlineChars(msg);
for (com.leap12.databuddy.Commands.StrCommand<?> cmd : com.leap12.databuddy.aspects.UserDelegate.commands) {
if (1.0F == (cmd.isCommand(msg))) {
com.leap12.databuddy.... | protected void onReceivedMsg(java.lang.String msg) throws java.lang.Exception {
msg = msg.trim();
com.leap12.common.Log.debugNewlineChars(msg);
for (com.leap12.databuddy.Commands.StrCommand<?> cmd : com.leap12.databuddy.aspects.UserDelegate.commands) {
if (1.0F == (cmd.isCommand(msg))) {
... |
public static boolean isPrimitiveOrStringOrWrapperOrBigDecimal(java.lang.Object obj) {
java.lang.Class clazz = obj.getClass();
return ((((clazz.isPrimitive()) || ((java.lang.String.class) == clazz)) || ((java.lang.Character.class) == clazz)) || ((java.lang.Boolean.class) == clazz)) || (clazz.isAssignableFrom(ja... | public static boolean isPrimitiveOrStringOrWrapperOrBigDecimal(java.lang.Object obj) {
java.lang.Class clazz = obj.getClass();
return ((((clazz.isPrimitive()) || ((java.lang.String.class) == clazz)) || ((java.lang.Character.class) == clazz)) || ((java.lang.Boolean.class) == clazz)) || (java.lang.Number.class.is... |
private java.lang.String getListOption(java.lang.String userCmd) {
if (userCmd.contains(DelimiterConstants.TASK_FILTER_ALL)) {
return constants.CmdParameters.PARAM_VALUE_LIST_ALL;
}else
if (userCmd.contains(DelimiterConstants.TASK_FILTER_DONE)) {
return constants.CmdParameters.PARAM_... | private java.lang.String getListOption(java.lang.String userCmd) {
if (userCmd == null) {
return null;
}
if (userCmd.contains(DelimiterConstants.TASK_FILTER_ALL)) {
return constants.CmdParameters.PARAM_VALUE_LIST_ALL;
}else
if (userCmd.contains(DelimiterConstants.TASK_FILTER_DONE... |
public java.lang.String getNiceName() {
java.lang.String name = "sign (";
if (((actionData.lines) != null) && ((actionData.lines.length) > 0)) {
name += com.helion3.prism.libs.elixr.TypeUtils.join(actionData.lines, (((org.bukkit.ChatColor.DARK_AQUA) + ", ") + (org.bukkit.ChatColor.RESET)));
}else {
... | public java.lang.String getNiceName() {
java.lang.String name = "sign (";
if (((actionData.lines) != null) && ((actionData.lines.length) > 0)) {
name += com.helion3.prism.libs.elixr.TypeUtils.join(actionData.lines, ", ");
}else {
name += "no text";
}
name += ")";
return name;
} |
public void removeSprite(com.badlogic.gdx.graphics.g2d.Sprite sprite, int layer) {
java.util.Collection<com.net.isometric.utils.IsometricTiledMapRendererWithDepth.RenderSprite> spr = sprites.get(layer);
java.util.Iterator<com.net.isometric.utils.IsometricTiledMapRendererWithDepth.RenderSprite> it = spr.iterator... | public void removeSprite(com.badlogic.gdx.graphics.g2d.Sprite sprite) {
java.util.Iterator<com.net.isometric.utils.IsometricTiledMapRendererWithDepth.RenderSprite> it = sprites.iterator();
while (it.hasNext()) {
com.net.isometric.utils.IsometricTiledMapRendererWithDepth.RenderSprite rs = it.next();
... |
public void run() {
int clientNumber = 0;
try {
com.musichub.core.CapitalizeServer.server = new com.musichub.core.CapitalizeServer.Capitalizer();
try {
while (true) {
com.musichub.core.CapitalizeServer.log(("Waiting.. next is " + clientNumber));
com.mu... | public void run() {
int clientNumber = 0;
try {
com.musichub.core.CapitalizeServer.server = new com.musichub.core.CapitalizeServer.Capitalizer(threshold);
try {
while (true) {
com.musichub.core.CapitalizeServer.log(("Waiting.. next is " + clientNumber));
... |
public chemia.httpsgithub.comahyoung1.chemia.Element getElementBySymbol(java.lang.String elementSymbol) {
for (int i = 0; i < 18; i++) {
if (listOfElements[i].getChemSymbol().equals(elementSymbol)) {
return listOfElements[i];
}
}
return new chemia.httpsgithub.comahyoung1.chemia.E... | public chemia.httpsgithub.comahyoung1.chemia.Element getElementBySymbol(java.lang.String elementSymbol) {
for (int i = 0; i < 18; i++) {
if (listOfElements[i].getChemSymbol().equals(elementSymbol)) {
return listOfElements[i];
}
}
return new chemia.httpsgithub.comahyoung1.chemia.E... |
public void runGenerator() throws java.io.IOException, java.net.URISyntaxException {
java.io.File spec1 = new java.io.File("src/test/resources", "spec1.yml");
java.io.File spec2 = new java.io.File("src/test/resources", "spec2.yml");
java.io.File spec3 = new java.io.File("src/test/resources", "spec3.yml");
... | public void runGenerator() throws java.io.IOException, java.net.URISyntaxException {
java.io.File spec1 = new java.io.File("src/test/resources", "spec1.yml");
java.io.File spec2 = new java.io.File("src/test/resources", "spec2.yml");
java.io.File spec3 = new java.io.File("src/test/resources", "spec3.yml");
... |
private entity.Success redoCommand() {
entity.Success status = engine.redoTask();
entity.Success retrievalStatus = null;
if ((status.isSuccess()) == true) {
retrievalStatus = parseCommand(lastRetrieve);
if ((retrievalStatus.isSuccess()) == true) {
status.setObj(retrievalStatus.ge... | private entity.Success redoCommand() {
entity.Success status = engine.redoTask();
entity.Success retrievalStatus = null;
if (((status.isSuccess()) == true) && ((lastRetrieve) != null)) {
retrievalStatus = parseCommand(lastRetrieve);
if ((retrievalStatus.isSuccess()) == true) {
st... |
public static boolean antiCheese(int id, java.util.ArrayList<java.lang.Integer> list) {
for (int i = 0; i < (list.size()); i++) {
if (id == (list.get(i))) {
return false;
}
}
return true;
} | public static boolean antiCheese(int id, java.util.List<java.lang.Integer> list) {
for (int i = 0; i < (list.size()); i++) {
if (id == (list.get(i))) {
return false;
}
}
return true;
} |
public void onViewCreated(android.view.View view, @android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mViewPager = ((android.support.v4.view.ViewPager) (view.findViewById(R.id.vp_TicketsActivity)));
mServiceRequests = getArguments().get... | public void onViewCreated(android.view.View view, @android.support.annotation.Nullable
android.os.Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mViewPager = ((android.support.v4.view.ViewPager) (view.findViewById(R.id.vp_TicketsActivity)));
mServiceRequests = getArguments().get... |
public void remove(int toRemove) {
if (contains(toRemove)) {
int index = 0;
for (int i = 0; i < (listOfIntegers.size()); i++)
if ((listOfIntegers.indexOf(i)) == toRemove) {
index = listOfIntegers.get(i);
java.lang.System.out.println("HEJ!");
}
... | public void remove(int toRemove) {
if (contains(toRemove)) {
int index = 0;
for (int i = 0; i < (listOfIntegers.size()); i++)
if ((listOfIntegers.indexOf(i)) == toRemove) {
index = listOfIntegers.get(i);
java.lang.System.out.println("HEJ!");
}
... |
public void ircRun() throws java.io.IOException, java.lang.InterruptedException, org.jibble.pircbot.IrcException {
if ((java.lang.System.currentTimeMillis()) < (kickWaitTime)) {
java.lang.Thread.sleep(15000);
}
setVersion(getAdvertString());
connect("irc.freenode.net");
joinChannel("#electru... | public void ircRun() throws java.io.IOException, java.lang.InterruptedException, org.jibble.pircbot.IrcException {
while ((java.lang.System.currentTimeMillis()) < (kickWaitTime)) {
java.lang.Thread.sleep(15000);
}
setVersion(getAdvertString());
connect("irc.freenode.net");
joinChannel("#ele... |
public void run() {
addDepartureHandler(this.teleportationEngine);
prepareSim();
this.listenerManager.fireQueueSimulationInitializedEvent();
for (org.matsim.core.mobsim.framework.MobsimAgent agent : new java.util.ArrayList(this.agents.values())) {
arrangeNextAgentAction(agent);
}
boolean... | public void run() {
try {
addDepartureHandler(this.teleportationEngine);
prepareSim();
this.listenerManager.fireQueueSimulationInitializedEvent();
for (org.matsim.core.mobsim.framework.MobsimAgent agent : new java.util.ArrayList(this.agents.values())) {
arrangeNextAgentAc... |
public static void elementy() {
java.lang.Boolean w = JSONParser.wartosc();
JSONParser.getNextToken();
if (w && (JSONParser.currentToken.name.equals(TokenEnum.KONIEC_TABLICY))) {
return ;
}else
if (w && (JSONParser.currentToken.name.equals(TokenEnum.SEPARATOR_REKORDOW))) {
JS... | public static void elementy() {
java.lang.Boolean w = JSONParser.wartosc();
JSONParser.getNextToken();
if (w && (JSONParser.currentToken.name.equals(TokenEnum.KONIEC_TABLICY))) {
return ;
}else
if (w && (JSONParser.currentToken.name.equals(TokenEnum.SEPARATOR_REKORDOW))) {
JS... |
public void onClick(android.view.View view) {
if ((mLocation) != null) {
android.content.Intent sharingIntent = new android.content.Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(Intent.EXTRA_TEXT, mLocation);
startActivity(and... | public void onClick(android.view.View view) {
if ((mLocation) != null) {
android.content.Intent sharingIntent = new android.content.Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(Intent.EXTRA_TEXT, mLocation);
startActivity(and... |
public com.google.common.base.Optional<java.lang.Double> percentile(double p) {
com.google.common.base.Preconditions.checkArgument(((p >= 0.0) && (p < 1.0)), "Percentiles must be in [0.0, 1.0)");
if ((data.length) == 0) {
return com.google.common.base.Optional.absent();
}
return com.google.commo... | public com.google.common.base.Optional<java.lang.Double> percentile(double p) {
com.google.common.base.Preconditions.checkArgument(((p >= 0.0) && (p < 1.0)), "Percentiles must be in [0.0, 1.0)");
if ((data.length) == 0) {
return com.google.common.base.Optional.absent();
}
return com.google.commo... |
public double getIntersection(RayTracing.Ray ray) {
double vd = RayTracing.VectorOperations.dotProduct(normal, ray.getV());
if (vd == 0) {
return -1;
}
double v0 = (-1) * (RayTracing.VectorOperations.dotProduct(normal, RayTracing.VectorOperations.add(ray.getP0(), new RayTracing.Vector(offset, of... | public double getIntersection(RayTracing.Ray ray) {
double vd = RayTracing.VectorOperations.dotProduct(normal, ray.getV());
if (vd == 0) {
return -1;
}
double v0 = RayTracing.VectorOperations.dotProduct(normal, ray.getP0());
double t = (((-1) * v0) + (offset)) / vd;
if (t < 0) {
... |
private boolean debugOptionChange(java.lang.String source) {
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("/\\*\\s*\\d+\\s*\\*/");
java.util.regex.Matcher matcher = pattern.matcher(source);
boolean isDebugSource = (matcher.find()) || ((source.indexOf(DecompilerOutputUtil.NO_LINE_NUMBER)... | private boolean debugOptionChange(java.lang.String source) {
if (source == null)
return false;
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("/\\*\\s*\\d+\\s*\\*/");
java.util.regex.Matcher matcher = pattern.matcher(source);
boolean isDebugSource = (matcher.find()) || ((... |
public void onStatusUpdated() {
timber.log.Timber.d("VideoDetailsFragment : onProgressChanged() : onStatusUpdated()");
if (isRemoteVideoPlaying()) {
playbackState = com.etiennelawlor.loop.fragments.VideoDetailsFragment.PlaybackState.PLAYING;
resumeLocalVideo();
castInfoTextView.setText(j... | public void onStatusUpdated() {
if (isResumed()) {
timber.log.Timber.d("VideoDetailsFragment : onProgressChanged() : onStatusUpdated()");
if (isRemoteVideoPlaying()) {
playbackState = com.etiennelawlor.loop.fragments.VideoDetailsFragment.PlaybackState.PLAYING;
resumeLocalVide... |
public static void remove(java.lang.String sharedConnectionName) {
java.lang.ThreadLocal<java.sql.Connection> tl = de.cimt.talendcomp.connectionpool.ThreadLocalConnectionCache.connectionMap.get(sharedConnectionName);
if (tl != null) {
java.sql.Connection conn = tl.get();
try {
if ((c... | public static void remove(java.lang.String sharedConnectionName) {
java.lang.ThreadLocal<java.sql.Connection> tl = de.cimt.talendcomp.connectionpool.ThreadLocalConnectionCache.connectionMap.get(sharedConnectionName);
if (tl != null) {
java.sql.Connection conn = tl.get();
try {
if ((c... |
public int compareTo(wslf.geometry.Point p) {
if (equals(p)) {
return 0;
}
if (((x) < (p.x)) || (((java.lang.Math.abs(((x) - (p.x)))) < (EPS)) && ((y) < (p.x)))) {
return -1;
}
return 1;
} | public int compareTo(wslf.geometry.Point p) {
if (equals(p)) {
return 0;
}
if (((x) < (p.x)) || (((java.lang.Math.abs(((x) - (p.x)))) < (EPS)) && ((y) < (p.y)))) {
return -1;
}
return 1;
} |
private void responseOnNext(final rx.Subscriber<? super io.netty.handler.codec.redis.RedisMessage> subscriber, final io.netty.handler.codec.redis.RedisMessage respmsg) {
if (unholdRespSubscriber(subscriber)) {
try {
subscriber.onNext(respmsg);
} finally {
removeRespHandler();... | private void responseOnNext(final rx.Subscriber<? super io.netty.handler.codec.redis.RedisMessage> subscriber, final io.netty.handler.codec.redis.RedisMessage respmsg) {
if (unholdRespSubscriber(subscriber)) {
removeRespHandler();
clearTransacting();
try {
subscriber.onNext(respm... |
private void onPositionChanged(int position) {
mCurrentPosition = position;
int count = mChapter.getPageCount();
int page = position + 1;
java.lang.String title = getString(R.string.chapter_title, page, count);
setTitle(title);
if (!(mToolbarHelper.isVisible())) {
showCrouton(title);
... | private void onPositionChanged(int position) {
mCurrentPosition = position;
int count = mChapter.getPageCount();
int page = position + 1;
java.lang.String title = getString(R.string.chapter_title, page, count);
setTitle(title);
if (!(mToolbarHelper.isVisible())) {
showCrouton(title);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.