buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void NextLevelFunction(android.view.View view) {
int nextLevelPosition = getIntent().getIntExtra("nextLevelPosition", (-1));
if (nextLevelPosition < (MainActivity.gameCellArray.size())) {
android.content.Intent intent = new android.content.Intent(this, marash.com.rebuspuzzle.selected_image.Select... | public void NextLevelFunction(android.view.View view) {
int nextLevelPosition = getIntent().getIntExtra("nextLevelPosition", (-1));
if (nextLevelPosition <= (MainActivity.gameCellArray.size())) {
android.content.Intent intent = new android.content.Intent(this, marash.com.rebuspuzzle.selected_image.Selec... |
public void onBlockPlacedBy(net.minecraft.world.World world, int x, int y, int z, net.minecraft.entity.EntityLivingBase entityLiving, net.minecraft.item.ItemStack is) {
if (!(world.isRemote)) {
java.lang.System.out.println("Block placed.");
steamcraft.common.tiles.energy.TileCopperWire tile = ((stea... | public void onBlockPlacedBy(net.minecraft.world.World world, int x, int y, int z, net.minecraft.entity.EntityLivingBase entityLiving, net.minecraft.item.ItemStack is) {
if (!(world.isRemote)) {
steamcraft.common.tiles.energy.TileCopperWire tile = ((steamcraft.common.tiles.energy.TileCopperWire) (world.getTi... |
public void onRequestNextPage() {
final int FIRST_POST = 0;
if ((com.sonicmax.etiapp.fragments.MessageListFragment.nextPageUrl) != null) {
mMessageListAdapter.clearMessages();
loadMessageList(buildArgsForLoader(com.sonicmax.etiapp.fragments.MessageListFragment.nextPageUrl, false), LOAD_MESSAGE);... | public void onRequestNextPage() {
final int FIRST_POST = 0;
if ((com.sonicmax.etiapp.fragments.MessageListFragment.nextPageUrl) != null) {
mMessageListAdapter.clearMessages();
loadMessageList(buildArgsForLoader(com.sonicmax.etiapp.fragments.MessageListFragment.nextPageUrl, false), LOAD_MESSAGE);... |
public static mcgill.ca.fragilitysurvey.quiz.questions.Question getQuestionById(int id, final android.content.res.Resources res) {
java.util.List<mcgill.ca.fragilitysurvey.quiz.questions.Question> questions = mcgill.ca.fragilitysurvey.quiz.questions.Questions.completeSurveyQuestions(res);
questions.addAll(mcgil... | public static mcgill.ca.fragilitysurvey.quiz.questions.Question getQuestionById(int id, final android.content.res.Resources res) {
java.util.List<mcgill.ca.fragilitysurvey.quiz.questions.Question> questions = new java.util.ArrayList<>();
questions.addAll(mcgill.ca.fragilitysurvey.quiz.questions.Questions.comple... |
private java.lang.Object[] sendNewText(java.lang.String text) throws java.io.IOException {
locked = true;
if ((pl.asie.computronics.Computronics.tts) != null) {
Computronics.tts.say(text, worldObj.provider.dimensionId, xCoord, yCoord, zCoord);
}else {
return new java.lang.Object[]{ false , "... | private java.lang.Object[] sendNewText(java.lang.String text) throws java.io.IOException {
if ((pl.asie.computronics.Computronics.tts) != null) {
locked = true;
Computronics.tts.say(text, worldObj.provider.dimensionId, xCoord, yCoord, zCoord);
}else {
return new java.lang.Object[]{ false... |
public void enqueue(Item item) {
if (item == null) {
throw new java.lang.NullPointerException("Can not enqueue a null item");
}
if ((n) == (items.length)) {
resize(((items.length) * 2));
}
items[n] = item;
(n)++;
} | public void enqueue(Item item) {
if (item == null) {
throw new java.lang.NullPointerException("Can not enqueue a null item");
}
if ((n) == (items.length)) {
resize(((items.length) * 2));
}
items[((n)++)] = item;
} |
public void installUI(javax.swing.JComponent c) {
super.installUI(c);
javax.swing.LookAndFeel.installProperty(c, "opaque", java.lang.Boolean.FALSE);
contentShape = new java.awt.geom.RoundRectangle2D.Float(0, 0, 0, 0, 8, 8);
borderShape = new java.awt.geom.RoundRectangle2D.Float(0, 0, 0, 0, 8, 8);
ha... | public void installUI(javax.swing.JComponent c) {
super.installUI(c);
borderShape = new java.awt.geom.RoundRectangle2D.Float(0, 0, 0, 0, 8, 8);
handle = createFocusHandle();
c.addMouseListener(handle);
c.addFocusListener(handle);
} |
public static boolean hasFolder(long groupId, long parentFolderId, java.lang.String name) {
boolean result = false;
com.liferay.portlet.documentlibrary.model.DLFolder dlFolder = null;
try {
dlFolder = com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil.getFolder(groupId, parentFolde... | public static boolean hasFolder(long groupId, long parentFolderId, java.lang.String name) {
boolean result = false;
com.liferay.portlet.documentlibrary.model.DLFolder dlFolder = null;
try {
dlFolder = com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil.getFolder(groupId, parentFolde... |
private net.minecraft.client.entity.EntityOtherPlayerMP getClosestPlayer(net.minecraft.client.Minecraft mc) {
for (net.minecraft.entity.Entity o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof net.minecraft.client.entity.EntityOtherPlayerMP) {
net.minecraft.client.entity.EntityOtherPlaye... | private net.minecraft.client.entity.EntityOtherPlayerMP getClosestPlayer(net.minecraft.client.Minecraft mc) {
for (net.minecraft.entity.Entity o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof net.minecraft.client.entity.EntityOtherPlayerMP) {
net.minecraft.client.entity.EntityOtherPlaye... |
public static java.awt.image.BufferedImage writeImageDetails(java.awt.image.BufferedImage bi, java.lang.String details) {
java.awt.image.BufferedImage image = com.comandante.eyeballs.common.ImageFormatting.createLargerImage(bi);
java.awt.Graphics g = image.getGraphics();
g.setFont(g.getFont().deriveFont(18.... | private static java.awt.image.BufferedImage writeImageDetails(java.awt.image.BufferedImage image, java.lang.String details) {
java.awt.Graphics g = image.getGraphics();
g.setFont(g.getFont().deriveFont(18.0F));
g.setColor(java.awt.Color.GRAY);
g.drawString(details, 5, ((image.getHeight()) - 5));
g.d... |
private void readDatabase(java.lang.String databasePath) throws java.io.IOException {
java.io.BufferedReader fileReader = new java.io.BufferedReader(new java.io.FileReader(databasePath));
try {
java.lang.String line = fileReader.readLine();
while (line != null) {
line = fileReader.re... | private void readDatabase(java.lang.String databasePath) throws java.io.IOException {
java.io.BufferedReader fileReader = new java.io.BufferedReader(new java.io.FileReader(databasePath));
try {
java.lang.String line = fileReader.readLine();
while (true) {
line = fileReader.readLine()... |
public java.util.List<java.lang.Integer> getSelectedItems() {
java.util.List<java.lang.Integer> items = new java.util.ArrayList<java.lang.Integer>(selectedItems.size());
for (int i = 0; i < (selectedItems.size()); i++) {
items.add(selectedItems.keyAt(i));
}
return items;
} | public java.util.ArrayList<java.lang.Integer> getSelectedItems() {
java.util.ArrayList<java.lang.Integer> items = new java.util.ArrayList<java.lang.Integer>(selectedItems.size());
for (int i = 0; i < (selectedItems.size()); i++) {
items.add(selectedItems.keyAt(i));
}
return items;
} |
public java.util.List<org.openmrs.module.muzimabiometrics.model.PatientFingerPrintModel> addFingerprint(@org.openmrs.module.muzimabiometrics.web.controller.RequestBody
java.lang.String patientWithFingerprint) throws java.lang.Exception {
org.openmrs.module.muzimabiometrics.api.MuzimaFingerprintService service = org... | public java.util.List<org.openmrs.module.muzimabiometrics.model.PatientFingerPrintModel> addFingerprint(@org.openmrs.module.muzimabiometrics.web.controller.RequestBody
java.lang.String patientWithFingerprint) throws java.lang.Exception {
org.openmrs.module.muzimabiometrics.api.MuzimaFingerprintService service = org... |
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) {
final android.view.View rootView = inflater.inflate(R.layout.fragment_controls, null);
b... | 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) {
final android.view.View rootView = inflater.inflate(R.layout.fragment_controls, null);
b... |
public int onStartCommand(android.content.Intent intent, int flags, int startId) {
if (((intent.getAction()) != null) && (intent.getAction().equals(com.antest1.kcanotify.KcaViewButtonService.RETURN_FAIRY_ACTION))) {
mView.setVisibility(View.VISIBLE);
}
notificationManager.cancel(com.antest1.kcanotif... | public int onStartCommand(android.content.Intent intent, int flags, int startId) {
if (((intent != null) && ((intent.getAction()) != null)) && (intent.getAction().equals(com.antest1.kcanotify.KcaViewButtonService.RETURN_FAIRY_ACTION))) {
mView.setVisibility(View.VISIBLE);
}
notificationManager.cance... |
public void run() {
org.apache.jena.util.iterator.ClosableIterator<org.apache.jena.rdf.model.Model> modelIter = source.modelIterator();
try {
while (modelIter.hasNext()) {
if (sink.insert(modelIter.next(), cfg.getString(org.xenei.galway2020.processor.Processor.GRAPH_NAME))) {
... | public void run() {
org.apache.jena.util.iterator.ClosableIterator<org.apache.jena.rdf.model.Model> modelIter = source.modelIterator();
try {
while (modelIter.hasNext()) {
if (!(sink.insert(modelIter.next(), cfg.getString(org.xenei.galway2020.processor.Processor.GRAPH_NAME)))) {
... |
public static void printCard(int card) {
if (card < 11) {
java.lang.System.out.println((" " + (a)));
}else
if (card == 11) {
java.lang.System.out.println(" Jack");
}else
if (card == 12) {
java.lang.System.out.println(" Queen");
}else
... | public static void printCard(int card) {
if (card < 11) {
java.lang.System.out.println((" " + card));
}else
if (card == 11) {
java.lang.System.out.println(" Jack");
}else
if (card == 12) {
java.lang.System.out.println(" Queen");
}else
... |
public void onClickNumber(android.view.View v) {
if ((result) != "") {
clear();
updateScreen();
}
android.widget.Button b = ((android.widget.Button) (v));
display += b.getText();
updateScreen();
} | public void onClickNumber(android.view.View v) {
if (!(result.isEmpty())) {
clear();
updateScreen();
}
android.widget.Button b = ((android.widget.Button) (v));
display += b.getText();
updateScreen();
} |
void updateData(int[][] x) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
array2[i][j] = x[j][(7 - i)];
}
}
this.invalidate();
} | void updateData(int[][] x) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
array2[i][j] = x[(7 - j)][i];
}
}
this.invalidate();
} |
public void contextsChanged(clojure.lang.IPersistentMap addedcontexts, java.lang.Boolean clear) {
if (clear) {
edu.buffalo.cse.sneps3.gui.business.Context.clearContexts();
for (edu.buffalo.cse.sneps3.gui.business.IView i : views) {
i.ctUpdate(new java.util.ArrayList<edu.buffalo.cse.sneps... | public void contextsChanged(clojure.lang.IPersistentMap addedcontexts, java.lang.Boolean clear) {
if (clear) {
edu.buffalo.cse.sneps3.gui.business.Context.clearContexts();
}
java.util.ArrayList<edu.buffalo.cse.sneps3.gui.business.Context> newcts = edu.buffalo.cse.sneps3.gui.business.Context.createCo... |
public static int getRandomIntegerFromExponentialDistribution(java.util.Random rand, int min, int max, double lambda) {
double randomDoubleFromUniformeDistrubtion = rand.nextDouble();
double doubleResult = (-(java.lang.Math.log((1 - ((1 - (java.lang.Math.exp((-lambda)))) * randomDoubleFromUniformeDistrubtion)))... | public static int getRandomIntegerFromExponentialDistribution(java.util.Random rand, int min, int max, double lambda) {
double doubleResult = (java.lang.Math.log((1 - (rand.nextDouble())))) / (-lambda);
return nl.tudelft.contextproject.util.RandomUtil.ensureInterval(((int) (java.lang.Math.round(doubleResult))),... |
public int handleHorizontalCollisionResponse(entities.Entity obj) {
int result = 0;
if (isColliding(obj)) {
boolean left = (x) < (obj.x);
if (left) {
result = -1;
x = (obj.x) - (width);
}else {
result = 1;
x = (obj.x) + (obj.width);
... | public int handleHorizontalCollisionResponse(entities.Entity obj) {
int result = 0;
if (isColliding(obj)) {
boolean left = (x) <= (obj.x);
if (left) {
result = -1;
x = (obj.x) - (width);
}else {
result = 1;
x = (obj.x) + (obj.width);
... |
public void createRandomFences() {
for (int i = 0; i < 12; i++) {
while (true) {
int x = hivolts.Square.random2();
int y = hivolts.Square.random2();
if ((field[x][y]) == null) {
field[x][y] = new hivolts.Fence(x, y);
java.lang.System.out.pr... | public void createRandomFences() {
for (int i = 0; i < 12; i++) {
while (true) {
int x = hivolts.Square.random2();
int y = hivolts.Square.random2();
if ((field[x][y]) == null) {
field[x][y] = new hivolts.Fence(x, y);
break;
}
... |
public void enterNumber(java.lang.String s) {
if (firstNumFlag) {
firstNum = "";
firstNum += s;
secondNum = "";
function = "";
firstNumFlag = false;
tfAnswer.setText(firstNum);
}else {
if (function.equals("")) {
firstNum += s;
tfAns... | private void enterNumber(java.lang.String s) {
if (firstNumFlag) {
firstNum = "";
firstNum += s;
secondNum = "";
function = "";
firstNumFlag = false;
tfAnswer.setText(firstNum);
}else {
if (function.equals("")) {
firstNum += s;
tfAn... |
private void addIcon(com.google.maps.android.ui.IconGenerator iconFactory, java.lang.CharSequence text, com.google.android.gms.maps.model.LatLng position) {
com.google.android.gms.maps.model.MarkerOptions markerOptions = new com.google.android.gms.maps.model.MarkerOptions().icon(com.google.android.gms.maps.model.Bi... | private void addIcon(com.google.maps.android.ui.IconGenerator iconFactory, java.lang.CharSequence text, com.google.android.gms.maps.model.LatLng position) {
com.google.android.gms.maps.model.MarkerOptions markerOptions = new com.google.android.gms.maps.model.MarkerOptions().icon(com.google.android.gms.maps.model.Bi... |
private java.util.Collection<com.ilscipio.scipio.setup.SetupWorker.StepState> getStepStatesInternal(boolean lazyResolve) {
java.util.Map<java.lang.String, com.ilscipio.scipio.setup.SetupWorker.StepState> stepStateMap = getStepStateMapLoaded(lazyResolve);
java.util.List<com.ilscipio.scipio.setup.SetupWorker.Step... | private java.util.Collection<com.ilscipio.scipio.setup.SetupWorker.StepState> getStepStatesInternal() {
java.util.Map<java.lang.String, com.ilscipio.scipio.setup.SetupWorker.StepState> stepStateMap = getStepStateMapLoaded();
java.util.List<com.ilscipio.scipio.setup.SetupWorker.StepState> values = new java.util.... |
private void startTracking() {
java.lang.String requiredPermission = Manifest.permission.ACCESS_FINE_LOCATION;
int permissionState = android.support.v4.content.ContextCompat.checkSelfPermission(this, requiredPermission);
if (permissionState == (android.content.pm.PackageManager.PERMISSION_GRANTED)) {
... | private void startTracking() {
java.lang.String requiredPermission = Manifest.permission.ACCESS_FINE_LOCATION;
int permissionState = android.support.v4.content.ContextCompat.checkSelfPermission(this, requiredPermission);
if (permissionState != (android.content.pm.PackageManager.PERMISSION_GRANTED)) {
... |
public void onClick(android.view.View view) {
if ((up_Arrow.getVisibility()) == (android.view.View.VISIBLE)) {
java.lang.String click_id = ((java.lang.String) (view.getTag()));
location_database.submit_vote(view_page.get_location(), click_id, (+1));
team11.crowded.CustomAdapter.changeVoteInP... | public void onClick(android.view.View view) {
if ((up_Arrow.getVisibility()) == (android.view.View.VISIBLE)) {
java.lang.String click_id = ((java.lang.String) (view.getTag()));
location_database.submit_vote(view_page.get_location(), click_id, (+1));
team11.crowded.CustomAdapter.changeVoteInP... |
private Points.Point pointFromColumn(com.rackspacecloud.blueflood.io.Column<java.lang.Long> column, com.rackspacecloud.blueflood.rollup.Granularity gran, com.netflix.astyanax.serializers.AbstractSerializer serializer) {
if (serializer instanceof com.rackspacecloud.blueflood.io.serializers.NumericSerializer.RawSeria... | private Points.Point pointFromColumn(com.rackspacecloud.blueflood.io.Column<java.lang.Long> column, com.netflix.astyanax.serializers.AbstractSerializer serializer) {
if (serializer instanceof com.rackspacecloud.blueflood.io.serializers.NumericSerializer.RawSerializer)
return new com.rackspacecloud.blueflood... |
public void refreshRiders(com.lasergiraffe.rideshare.Note note) {
android.os.Bundle extra = getIntent().getExtras();
note.getCurrNumRiders();
int noteCurrNumRiders = note.getCurrNumRiders();
android.widget.TextView numSeatsText = ((android.widget.TextView) (findViewById(R.id.numSeats_id)));
int note... | public void refreshRiders(com.lasergiraffe.rideshare.Note note) {
android.os.Bundle extra = getIntent().getExtras();
int noteCurrNumRiders = note.getCurrNumRiders();
android.widget.TextView numSeatsText = ((android.widget.TextView) (findViewById(R.id.numSeats_id)));
int noteCapacity = extra.getInt(getSt... |
public static void applyOverrides() {
CCubesCore.logger.info("Applying Non-Replaceable Block overrides");
for (chanceCubes.util.NonReplaceableBlockOverride override : chanceCubes.config.CCubesSettings.nonReplaceableBlockOverrides) {
if (override.overrideType) {
CCubesSettings.nonReplaceableB... | public static void applyOverrides() {
CCubesCore.logger.info("Applying Non-Replaceable Block overrides");
for (chanceCubes.util.NonReplaceableBlockOverride override : chanceCubes.config.CCubesSettings.nonReplaceableBlockOverrides) {
if (override.overrideType) {
if (!(CCubesSettings.nonReplac... |
public void onClick(android.view.View v) {
new com.xllllh.android.takeaway.OrderListRecyclerViewAdapter.ChangeOrderStateTask().execute(orderId, Order.STATE_CANCEL);
try {
holder.mItem.remove("state");
holder.mItem.put("state", Order.STATE_CANCEL);
} catch (java.lang.Exception e) {
e.... | public void onClick(android.view.View v) {
new com.xllllh.android.takeaway.OrderListRecyclerViewAdapter.ChangeOrderStateTask().execute(orderId, Order.STATE_CANCEL);
try {
holder.mItem.remove("state");
holder.mItem.put("state", Order.STATE_CANCEL);
} catch (java.lang.Exception e) {
e.... |
private void addSystems() {
dclib.geometry.UnitConverter unitConverter = new dclib.geometry.UnitConverter(dc.slideracer.level.LevelController.PIXELS_PER_UNIT, camera);
entitySystemManager.add(new dc.slideracer.epf.systems.CollisionSystem());
entitySystemManager.add(new dc.slideracer.epf.systems.WaypointsSys... | private void addSystems() {
dclib.geometry.UnitConverter unitConverter = new dclib.geometry.UnitConverter(dc.slideracer.level.LevelController.PIXELS_PER_UNIT, camera);
entitySystemManager.add(moveWithCameraSystem);
entitySystemManager.add(new dc.slideracer.epf.systems.CollisionSystem());
entitySystemMan... |
public void done(java.util.List<com.parse.ParseUser> user, materialtest.theartistandtheengineer.co.materialtest.ParseException e) {
if (e == null) {
android.content.Intent intent = new android.content.Intent(getApplicationContext(), materialtest.theartistandtheengineer.co.materialtest.MessagingActivity.clas... | public void done(java.util.List<com.parse.ParseUser> user, materialtest.theartistandtheengineer.co.materialtest.ParseException e) {
if (e == null) {
android.content.Intent intent = new android.content.Intent(context, materialtest.theartistandtheengineer.co.materialtest.MessagingActivity.class);
inte... |
public static com.stratio.crossdata.common.logicalplan.Filter createFilter(java.lang.String catalogName, java.lang.String tableName, java.lang.String columnName, com.stratio.crossdata.common.statements.structures.Operator operator, java.lang.Integer data, boolean indexed) {
com.stratio.crossdata.common.statements.s... | public static com.stratio.crossdata.common.logicalplan.Filter createFilter(java.lang.String catalogName, java.lang.String tableName, java.lang.String columnName, com.stratio.crossdata.common.statements.structures.Operator operator, java.lang.Integer data, boolean indexed) {
com.stratio.crossdata.common.statements.s... |
private void saveBid(net.powermatcher.core.bidcache.AggregatedBid aggregatedBid, net.powermatcher.api.messages.BidUpdate sentBidUpdate) {
net.powermatcher.core.concentrator.SentBidInformation info = new net.powermatcher.core.concentrator.SentBidInformation(aggregatedBid, sentBidUpdate);
synchronized(sentBids) {... | void saveBid(final net.powermatcher.core.bidcache.AggregatedBid aggregatedBid, final net.powermatcher.api.messages.BidUpdate sentBidUpdate) {
net.powermatcher.core.concentrator.SentBidInformation info = new net.powermatcher.core.concentrator.SentBidInformation(aggregatedBid, sentBidUpdate);
synchronized(sentBid... |
public org.springframework.boot.web.servlet.ServletRegistrationBean cxfDispatcherServlet() {
org.apache.cxf.transport.servlet.CXFServlet cxfServlet = new org.apache.cxf.transport.servlet.CXFServlet();
org.springframework.boot.web.servlet.ServletRegistrationBean servletRegistrationBean = new org.springframework.... | public org.springframework.boot.web.servlet.ServletRegistrationBean cxfDispatcherServlet() {
org.springframework.boot.web.servlet.ServletRegistrationBean servletRegistrationBean = new org.springframework.boot.web.servlet.ServletRegistrationBean(new org.apache.cxf.transport.servlet.CXFServlet(), ((baseUrl) + "/*"));... |
private java.lang.String readServerFilename(byte[] listBuf, java.io.BufferedReader in) throws java.io.IOException {
if ((args.length) != 1) {
java.lang.System.out.println(new java.lang.String(listBuf));
java.lang.System.out.println("Type file name on server: ");
return in.readLine();
}el... | private java.lang.String readServerFilename(byte[] listBuf, java.io.BufferedReader in) throws java.io.IOException {
if ((args.length) == 1) {
java.lang.System.out.println(new java.lang.String(listBuf));
java.lang.System.out.println("Type file name on server: ");
return in.readLine();
}el... |
public org.springframework.web.servlet.view.ContentNegotiatingViewResolver contentViewResolver() throws java.lang.Exception {
org.springframework.web.servlet.view.json.MappingJackson2JsonView jsonView = new org.springframework.web.servlet.view.json.MappingJackson2JsonView();
jsonView.setContentType("application... | public org.springframework.web.servlet.view.ContentNegotiatingViewResolver contentViewResolver() throws java.lang.Exception {
org.springframework.web.servlet.view.json.MappingJackson2JsonView jsonView = new org.springframework.web.servlet.view.json.MappingJackson2JsonView();
jsonView.setContentType("application... |
public static void showSoftKeyboard(android.app.Activity activity, android.view.View view) {
if (view.requestFocus()) {
android.view.inputmethod.InputMethodManager imm = ((android.view.inputmethod.InputMethodManager) (activity.getSystemService(Context.INPUT_METHOD_SERVICE)));
boolean isShowing = imm... | public static void showSoftKeyboard(android.app.Activity activity, android.view.View view) {
if ((activity != null) && (view.requestFocus())) {
android.view.inputmethod.InputMethodManager imm = ((android.view.inputmethod.InputMethodManager) (activity.getSystemService(Context.INPUT_METHOD_SERVICE)));
... |
public void onClick(android.content.DialogInterface dialog, int which) {
preCheckedItemsLast = new boolean[]{ false , false , false , false , false , false , false , false , false , false , false };
tv.setText(android.text.Html.fromHtml((("<B>" + (getActivity().getResources().getString(R.string.noFilter))) + "<... | public void onClick(android.content.DialogInterface dialog, int which) {
preCheckedItemsLast = new boolean[]{ false , false , false , false , false , false , false , false , false , false , false , false };
tv.setText(android.text.Html.fromHtml((("<B>" + (getActivity().getResources().getString(R.string.noFilter... |
public void shouldTrackDeposits() {
account.deposit(124);
account.deposit(212);
account.deposit(2);
account.deposit(1663);
validatePrint("Date | Amount | Balance", ((today()) + " | 124 | 124"), ((today()) + " | 212 | 336"), ((today()) + " | 2 | 338"), ((today()) + " | 1663 | 2001"... | public void shouldTrackDeposits() {
account.deposit(124);
account.deposit(212);
account.deposit(2);
account.deposit(1663);
validatePrint("Date | Amount | Balance", ((today()) + " | 1663 | 2001"), ((today()) + " | 2 | 338"), ((today()) + " | 212 | 336"), ((today()) + " | 124 | 124"... |
public void onClick(android.view.View v) {
final java.lang.String message = mEdtStatus.getText().toString();
com.soomla.blueprint.rewards.Reward gameReward = new com.soomla.blueprint.rewards.VirtualItemReward("blabla", "Update Status for VG", mItemAmount, mItemId);
try {
com.soomla.profile.SoomlaPro... | public void onClick(android.view.View v) {
final java.lang.String message = mEdtStatus.getText().toString();
try {
com.soomla.profile.SoomlaProfile.getInstance().updateStatus(this, mProvider, message, gameReward);
} catch (com.soomla.profile.exceptions.ProviderNotFoundException e) {
e.printS... |
public synchronized java.lang.String join(severalClientProject.MiniServer player) {
int slot = getNextEmptySlot();
if (slot >= 0) {
java.lang.String errorMsg = checkIfPlayerBanned(player.getClientName());
if (errorMsg.equals("")) {
players[slot] = player;
(this.numPlayers... | public synchronized java.lang.String join(severalClientProject.MiniServer player) {
int slot = getNextEmptySlot();
if (slot >= 0) {
java.lang.String errorMsg = checkIfPlayerBanned(player.getClientName());
if (errorMsg.equals("")) {
players[slot] = player;
(this.numPlayers... |
protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewPager = ((android.support.v4.view.ViewPager) (findViewById(R.id.viewPager)));
viewPager.setOnPageChangeListener(new android.support.v4.view.ViewPager.SimpleOnPa... | protected void onCreate(android.os.Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
parser = new brickhack.jive.Parser(this);
server = new brickhack.jive.ServerAPI(this);
server.refreshEvents();
viewPager = ((android.support.v4.view.ViewPag... |
private java.lang.Runnable createJobFileScan(final stroom.util.zip.StroomZipRepository stroomZipRepository, final java.io.File file) {
return () -> {
if (!(monitor.isTerminated())) {
fileScan(stroomZipRepository, file);
}else {
LOGGER.info("run() - Quit File Scan %s", file);
... | private java.lang.Runnable createJobFileScan(final stroom.util.zip.StroomZipRepository stroomZipRepository, final java.io.File file) {
return () -> {
if (!(monitor.isTerminated())) {
if (file != null) {
fileScan(stroomZipRepository, file);
}
}else {
... |
public void onPrecaptureRequired() {
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER, CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER_START);
setState(com.google.android.cameraview.Camera2.PictureCaptureCallback.STATE_PRECAPTURE);
try {
mCaptureSession.capture(mPreviewRequestBui... | public void onPrecaptureRequired() {
if ((mPreviewRequestBuilder) != null) {
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER, CaptureRequest.CONTROL_AE_PRECAPTURE_TRIGGER_START);
setState(com.google.android.cameraview.Camera2.PictureCaptureCallback.STATE_PRECAPTURE);
... |
public java.lang.String dialogue() {
java.net.DatagramPacket receiveMessage = new java.net.DatagramPacket(recvBuffer, recvBuffer.length);
try {
socket.receive(receiveMessage);
java.lang.System.out.println(receiveMessage.getAddress());
message = new java.lang.String(recvBuffer, 0, receive... | public java.lang.String dialogue() {
java.net.DatagramPacket receiveMessage = new java.net.DatagramPacket(recvBuffer, recvBuffer.length);
try {
socket.receive(receiveMessage);
message = new java.lang.String(recvBuffer, 0, receiveMessage.getLength());
} catch (java.io.IOException e) {
... |
public void setDefaultTabPosition(int defaultTabPosition) {
if ((mItems) == null) {
mCurrentTabPosition = defaultTabPosition;
return ;
}else
if ((((mItems.length) == 0) || (defaultTabPosition > ((mItems.length) - 1))) || (defaultTabPosition < 0)) {
throw new java.lang.IndexOu... | public void setDefaultTabPosition(int defaultTabPosition) {
if (mIsComingFromRestoredState)
return ;
if ((mItems) == null) {
mCurrentTabPosition = defaultTabPosition;
return ;
}else
if ((((mItems.length) == 0) || (defaultTabPosition > ((mItems.length) - 1))) || (defaultT... |
public static int getIndex(final java.lang.String[] arr, final java.lang.String val) {
for (int i = 0; i < (arr.length); i++) {
if (val.equalsIgnoreCase(arr[i])) {
return i;
}
}
return -1;
} | public static int getIndex(final java.lang.String[] arr, final java.lang.String val) {
if ((arr == null) || (val == null)) {
return -1;
}
for (int i = 0; i < (arr.length); i++) {
if (val.equalsIgnoreCase(arr[i])) {
return i;
}
}
return -1;
} |
public java.lang.Long getMaxPositionByCandidateId(java.lang.Long candidateId) {
java.lang.StringBuilder sql = new java.lang.StringBuilder();
sql.append("SELECT max(position)").append(" FROM chat_message").append(" WHERE chat_message.candidate_id =?0");
javax.persistence.Query query = em.createNativeQuery(sq... | public java.lang.Long getMaxPositionByCandidateId(java.lang.Long candidateId) {
java.lang.StringBuilder sql = new java.lang.StringBuilder();
sql.append("SELECT max(position)").append(" FROM chat_message").append(" WHERE chat_message.candidate_id =?0");
javax.persistence.Query query = em.createNativeQuery(sq... |
private void performUpdateSubViews() {
if ((subViewsMap) != null) {
for (org.openflexo.gina.view.FIBView v : new java.util.ArrayList<org.openflexo.gina.view.FIBView>(subViewsMap.values())) {
if ((!(v.isDeleted())) && (v.isViewVisible())) {
v.update();
}
}
... | private void performUpdateSubViews() {
if ((subViewsMap) != null) {
for (org.openflexo.gina.view.FIBView v : new java.util.ArrayList<org.openflexo.gina.view.FIBView>(subViewsMap.values())) {
if (!(v.isDeleted())) {
v.update();
}
}
}
} |
public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
android.view.View view = convertView;
if (view == null) {
view = lInflater.inflate(R.layout.item, parent, false);
}
com.example.work.colors.Item i = getProduct(position);
((android.... | public android.view.View getView(int position, android.view.View convertView, android.view.ViewGroup parent) {
android.view.View view = convertView;
view = lInflater.inflate(R.layout.item, parent, false);
com.example.work.colors.Item i = getProduct(position);
((android.widget.TextView) (view.findViewByI... |
public void start() {
int sjf = 1;
int rr = 1;
while ((interruptCounter) > 0) {
isTaskArrived();
while (sjf != 0)
sjf = firstLevelSch.runTask();
(MainScheduler.counter)++;
isTaskArrived();
rr = secondLevelSch.runTask();
(MainScheduler.coun... | public void start() {
int sjf = 1;
int rr = 1;
while ((interruptCounter) > 0) {
isTaskArrived();
while (sjf != 0) {
sjf = firstLevelSch.runTask();
(MainScheduler.counter)++;
}
isTaskArrived();
rr = secondLevelSch.runTask();
(MainSchedu... |
private org.springframework.web.servlet.ModelAndView getAdminPage(java.security.Principal principal, java.lang.String actionName) {
org.apache.roller.weblogger.pojos.User user = userManager.getEnabledUserByUserName(principal.getName());
java.util.Map<java.lang.String, java.lang.Object> myMap = new java.util.Has... | private org.springframework.web.servlet.ModelAndView getAdminPage(java.security.Principal principal, java.lang.String actionName) {
org.apache.roller.weblogger.pojos.User user = userManager.getEnabledUserByUserName(principal.getName());
java.util.Map<java.lang.String, java.lang.Object> myMap = new java.util.Has... |
private boolean isNodeNameValid(final java.lang.String nodeName) {
boolean retval = false;
if (nodeName == null) {
return retval;
}
if ((nodeName.length()) == 0) {
return retval;
}
if ((nodeName.charAt(0)) == ' ') {
return retval;
}
if ((nodeName.length()) > 0) {
... | private static boolean isNodeNameValid(final java.lang.String nodeName) {
boolean retval = false;
if (nodeName == null) {
return retval;
}
if ((nodeName.length()) == 0) {
return retval;
}
if ((nodeName.charAt(0)) == ' ') {
return retval;
}
if ((nodeName.length()) ... |
private java.lang.String nattyManipulation(java.lang.String taskDate) {
try {
com.joestelmach.natty.Parser parser = new com.joestelmach.natty.Parser();
java.util.List<com.joestelmach.natty.DateGroup> dateGroupList = parser.parse(taskDate);
java.util.Date parsedDate = dateGroupList.get(0).get... | private java.lang.String nattyManipulation(java.lang.String taskDate) {
try {
com.joestelmach.natty.Parser parser = new com.joestelmach.natty.Parser();
java.util.List<com.joestelmach.natty.DateGroup> dateGroupList = parser.parse(taskDate);
java.util.Date parsedDate = dateGroupList.get(0).get... |
private double myPowRecurse(double x, int n) {
if (n <= 1) {
return x;
}
double halfMyPow = myPowRecurse(x, (n / 2));
if ((n % 2) == 1) {
return (halfMyPow * halfMyPow) * x;
}else {
return halfMyPow * halfMyPow;
}
} | private double myPowRecurse(double x, int n) {
if (n == 0) {
return 1;
}
if (n == 1) {
return x;
}
double halfMyPow = myPowRecurse(x, (n / 2));
if ((n % 2) == 1) {
return (halfMyPow * halfMyPow) * x;
}else {
return halfMyPow * halfMyPow;
}
} |
public org.apache.zeppelin.helium.HeliumPackageSearchResult getEnabledPackageInfo(java.lang.String packageName) {
java.util.Map<java.lang.String, java.util.List<org.apache.zeppelin.helium.HeliumPackageSearchResult>> infos = getAllPackageInfoWithoutRefresh();
java.util.List<org.apache.zeppelin.helium.HeliumPacka... | private org.apache.zeppelin.helium.HeliumPackageSearchResult getEnabledPackageInfo(java.lang.String packageName) {
java.util.Map<java.lang.String, java.util.List<org.apache.zeppelin.helium.HeliumPackageSearchResult>> infos = getAllPackageInfoWithoutRefresh();
java.util.List<org.apache.zeppelin.helium.HeliumPack... |
public void onResume() {
super.onResume();
if (loginController.checkIfLoggedIn()) {
mSimpleFacebook = com.sromku.simple.fb.SimpleFacebook.getInstance(getActivity());
}else {
loginController.logIn();
}
if (nl.project.groep4.hhs.bestofdubsmash.view.FavoritesView.refreshNeeded) {
... | public void onResume() {
super.onResume();
if (loginController.checkIfLoggedIn()) {
mSimpleFacebook = com.sromku.simple.fb.SimpleFacebook.getInstance(getActivity());
}else {
loginController.logIn();
}
if (nl.project.groep4.hhs.bestofdubsmash.view.FavoritesView.refreshNeeded) {
... |
public void setIObject(edu.wpi.cs.lmp.objects.IObject obj) {
if (((!(isResizing)) && (obj == null)) && ((!(isRotating)) && (obj == null))) {
unbindRequest = false;
this.obj = obj;
}else
if (((isResizing) && (obj == null)) || ((isRotating) && (obj == null))) {
unbindRequest = ... | public void setIObject(edu.wpi.cs.lmp.objects.IObject obj) {
if (((isResizing) && (obj == null)) || ((isRotating) && (obj == null))) {
unbindRequest = true;
}else {
unbindRequest = false;
this.obj = obj;
}
} |
public void setUp() throws java.lang.Exception {
be.raildelays.domain.entities.TrainLineTest.DATA_POINT1 = new be.raildelays.domain.entities.TrainLine.Builder(466L).build();
be.raildelays.domain.entities.TrainLineTest.DATA_POINT2 = be.raildelays.domain.entities.TrainLineTest.DATA_POINT1;
be.raildelays.domai... | public void setUp() throws java.lang.Exception {
be.raildelays.domain.entities.TrainLineTest.DATA_POINT1 = new be.raildelays.domain.entities.TrainLine.Builder(466L).build();
be.raildelays.domain.entities.TrainLineTest.DATA_POINT2 = be.raildelays.domain.entities.TrainLineTest.DATA_POINT1;
be.raildelays.domai... |
private void testGetNonPrivateFeedbackSessions() {
______TS("standard success case");
java.util.List<teammates.common.datatransfer.FeedbackSessionAttributes> fsaList = teammates.test.cases.storage.FeedbackSessionsDbTest.fsDb.getNonPrivateFeedbackSessions();
assertEquals(8, fsaList.size());
for (teammate... | private void testGetNonPrivateFeedbackSessions() {
______TS("standard success case");
java.util.List<teammates.common.datatransfer.FeedbackSessionAttributes> fsaList = teammates.test.cases.storage.FeedbackSessionsDbTest.fsDb.getNonPrivateFeedbackSessions();
assertEquals(fsaList.toString(), 8, fsaList.size()... |
private static java.lang.String millisToTimeString(long millis) {
long seconds = millis / 1000;
long s = seconds % 60;
long m = (seconds / 60) % 60;
long h = (seconds / (60 * 60)) % 24;
return java.lang.String.format("%02d:%02d:%02d", h, m, s);
} | private static java.lang.String millisToTimeString(long millis) {
long seconds = millis / 1000;
long s = seconds % 60;
long m = (seconds / 60) % 60;
long h = seconds / (60 * 60);
return java.lang.String.format("%02d:%02d:%02d", h, m, s);
} |
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
java.lang.String selectedObject = m_almRepoCombo.getSelectedObject();
org.eclipse.core.runtime.IStatus connectionStatus = org.eclipse.jubula.client.alm.mylyn.core.utils.ALMAccess.testConnection(selectedObject);
if (connectionStatus.isOK()... | public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
java.lang.String selectedObject = m_almRepoCombo.getSelectedObject();
if (selectedObject != null) {
org.eclipse.core.runtime.IStatus connectionStatus = org.eclipse.jubula.client.alm.mylyn.core.utils.ALMAccess.testConnection(selectedOb... |
public void DBUpdate(java.lang.String item, java.lang.String data) {
try {
db.open("DBUpdate()");
} catch (android.database.SQLException sqle) {
throw sqle;
}
if (item == "title") {
db.updateTitle(1, data);
}else
if (item == "startDate") {
db.updateStartDa... | public void DBUpdate(java.lang.String item, java.lang.String data) {
try {
db.open("DBUpdate()");
} catch (android.database.SQLException sqle) {
throw sqle;
}
if (item == "title") {
db.updateTitle(1, data);
}else
if (item.equals("startDate")) {
db.updateSt... |
private java.lang.String calc(java.lang.String input) {
java.lang.String ret = (("" + (input.charAt(((input.length()) - 1)))) + (input.subString(1, ((input.length()) - 1)))) + (input.charAt(0));
return ret;
} | private java.lang.String calc(java.lang.String input) {
java.lang.String ret = (("" + (input.charAt(((input.length()) - 1)))) + (input.substring(1, ((input.length()) - 1)))) + (input.charAt(0));
return ret;
} |
protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
if (resultCode == (-1)) {
com.faa1192.weatherforecast.Cities.City city = com.faa1192.weatherforecast.Cities.City.fromBundle(data.getExtras());
android.widget.Toast.makeText(this, ((getResources().getStrin... | protected void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
com.faa1192.weatherforecast.Cities.City city = com.faa1192.weatherforecast.Cities.City.fromBundle(data.getExtras());
android.widget.Toast.makeText(this, ((getResources().getString(R.string.added_city)) + (city.name))... |
public void testExpandOnEmbedded() {
java.util.List<com.orientechnologies.orient.core.record.impl.ODocument> qResult = db.command(new com.orientechnologies.orient.core.sql.OCommandSQL("select expand(address) from foo where name = 'a'")).execute();
assertEquals(qResult.size(), 1);
assertEquals(qResult.get(0)... | public void testExpandOnEmbedded() {
java.util.List<com.orientechnologies.orient.core.record.impl.ODocument> qResult = db.command(new com.orientechnologies.orient.core.sql.OCommandSQL("select expand(address) from foo where name = 'a'")).execute();
org.testng.Assert.assertEquals(qResult.size(), 1);
org.testn... |
public void onSpawnStructureEvent(org.terasology.structureTemplates.events.StructureBlocksSpawnedEvent event, org.terasology.entitySystem.entity.EntityRef entity, org.terasology.structureTemplates.components.AddItemsToChestComponent component) {
org.terasology.structureTemplates.util.transform.BlockRegionTransform ... | public void onSpawnStructureEvent(org.terasology.structureTemplates.events.StructureBlocksSpawnedEvent event, org.terasology.entitySystem.entity.EntityRef entity, org.terasology.structureTemplates.components.AddItemsToChestComponent component) {
org.terasology.structureTemplates.util.transform.BlockRegionTransform ... |
public void run() {
linearLayout = ((android.widget.LinearLayout) (getChildAt(0)));
sliderSync = new com.stuin.cleanvisuals.Slide.SliderSync(linearLayout, getChildAt(1));
android.widget.ProgressBar progressBar = ((android.widget.ProgressBar) (linearLayout.getChildAt(1)));
progressBar.setMax(1000);
p... | public void run() {
linearLayout = ((android.widget.LinearLayout) (getChildAt(0)));
sliderSync = new com.stuin.cleanvisuals.Slide.SliderSync(linearLayout, getChildAt(1));
android.widget.ProgressBar progressBar = ((android.widget.ProgressBar) (linearLayout.getChildAt(1)));
progressBar.getLayoutParams().w... |
public static java.lang.Boolean updateTemplate(int id, at.becast.youploader.templates.Template template) throws java.io.IOException, java.sql.SQLException {
java.sql.PreparedStatement prest = null;
com.fasterxml.jackson.databind.ObjectMapper mapper = new com.fasterxml.jackson.databind.ObjectMapper();
java.l... | public static java.lang.Boolean updateTemplate(int id, at.becast.youploader.templates.Template template) throws java.io.IOException, java.sql.SQLException {
java.sql.PreparedStatement prest = null;
com.fasterxml.jackson.databind.ObjectMapper mapper = new com.fasterxml.jackson.databind.ObjectMapper();
java.l... |
private void runSimulation(java.util.List<elements.UserEquipment> ues) {
java.lang.System.out.println("Starting simulation");
java.util.Timer time = new java.util.Timer();
utils.UserEquipmentMover st = new utils.UserEquipmentMover(ues);
time.schedule(st, 0, 1000);
try {
java.lang.Thread.slee... | private void runSimulation(java.util.List<elements.UserEquipment> ues) {
java.util.Timer time = new java.util.Timer();
utils.UserEquipmentMover st = new utils.UserEquipmentMover(ues);
time.schedule(st, 0, 1000);
try {
java.lang.Thread.sleep(runner.main.Simulator.SIMULATION_TIME);
time.ca... |
public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
createItemList.clear();
for (com.google.firebase.database.DataSnapshot tempSnapshot : dataSnapshot.getChildren()) {
pearsistent.knutreasurehunt.Item item = tempSnapshot.getValue(pearsistent.knutreasurehunt.Item.class);
... | public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
createItemList.clear();
if ((getContext()) != null) {
for (com.google.firebase.database.DataSnapshot tempSnapshot : dataSnapshot.getChildren()) {
pearsistent.knutreasurehunt.Item item = tempSnapshot.getValue(p... |
public void onClick(android.view.View v) {
int pos = ((java.lang.Integer) (v.getTag()));
selPosition = pos;
java.lang.String subCate = viewHolder.tvSubCateName.getText().toString();
selSubCategory = subCate;
selCategory = selCat;
if (viewHolder.tvSubCateName.getText().toString().equalsIgnoreCase... | public void onClick(android.view.View v) {
int pos = ((java.lang.Integer) (v.getTag()));
selPosition = pos;
java.lang.String subCate = viewHolder.tvSubCateName.getText().toString();
selSubCategory = subCate;
selCategory = selCat;
if (viewHolder.tvSubCateName.getText().toString().equalsIgnoreCase... |
public org.osmdroid.util.GeoPoint getLocationFromAddress(java.lang.String address) {
android.location.Geocoder geocoder = new android.location.Geocoder(MyApp.mAppContext);
try {
java.util.List<android.location.Address> addresses = geocoder.getFromLocationName(address, 1);
android.location.Addres... | public org.osmdroid.util.GeoPoint getLocationFromAddress(java.lang.String address) {
android.location.Geocoder geocoder = new android.location.Geocoder(MyApp.mAppContext);
try {
java.util.List<android.location.Address> addresses = geocoder.getFromLocationName(address, 1);
if ((addresses.size()) ... |
public java.lang.String home(java.util.Locale locale, org.springframework.ui.Model model, java.security.Principal principal) {
com.barun.springsecurity.controller.HomeController.logger.info("Welcome home! The client locale is {}.", locale);
java.util.Date date = new java.util.Date();
java.text.DateFormat da... | public java.lang.String home(java.util.Locale locale, org.springframework.ui.Model model, java.security.Principal principal) {
com.barun.springsecurity.controller.HomeController.logger.info("Welcome home! The client locale is {}.", locale);
java.util.Date date = new java.util.Date();
java.text.DateFormat da... |
public common.messages.KVMessage get(java.lang.String key) throws java.lang.Exception {
common.messages.MessageType request = new common.messages.MessageType("get", "", key, "");
if ((request.error) != null) {
throw new java.lang.Exception(request.error);
}
boolean success = connectToResponsible... | public common.messages.KVMessage get(java.lang.String key) throws java.lang.Exception {
common.messages.MessageType request = new common.messages.MessageType("get", "", key, "");
if ((request.error) != null) {
throw new java.lang.Exception(request.error);
}
if (!(connectToResponsible(key))) {
... |
public void invoke(final java.io.OutputStream outputStream) {
try {
byte[] buffer = new byte[com.github.jishida.gradle.commons.util.NetUtils.BUFFER_SIZE];
while (true) {
final int count = inputStream.read(buffer);
if (count == (-1))
break;
... | public void invoke(final java.io.OutputStream outputStream) {
try {
byte[] buffer = new byte[com.github.jishida.gradle.commons.util.NetUtils.BUFFER_SIZE];
while (true) {
final int size = inputStream.read(buffer, 0, com.github.jishida.gradle.commons.util.NetUtils.BUFFER_SIZE);
... |
private double getWalkingSpeed(double target_z) {
if (((this.getLocation().get(2)) - target_z) == (-1)) {
return 0.5 * (this.getBaseSpeed());
}else
if (((this.getLocation().get(2)) - target_z) == 1) {
return 1.2 * (this.getBaseSpeed());
}else {
return this.getBase... | private double getWalkingSpeed(double target_z) {
java.lang.System.out.println(target_z);
if (((this.getLocation().get(2)) - target_z) < 0) {
return 0.5 * (this.getBaseSpeed());
}else
if (((this.getLocation().get(2)) - target_z) > 0) {
return 1.2 * (this.getBaseSpeed());
... |
private java.lang.String formatDate(java.lang.String dateString) {
java.util.Date date = new java.util.Date();
java.text.SimpleDateFormat formatedDate = new java.text.SimpleDateFormat("EEEE, LLL dd");
java.text.SimpleDateFormat originalDate = new java.text.SimpleDateFormat("yyyy-MM-dd");
try {
d... | private java.lang.String formatDate(java.lang.String dateString) {
java.util.Date date = new java.util.Date();
java.text.SimpleDateFormat formatedDate = new java.text.SimpleDateFormat("EEEE, LLL dd");
java.text.SimpleDateFormat originalDate = new java.text.SimpleDateFormat("yyyy-MM-dd");
try {
d... |
private org.mrgeo.data.vector.geowave.TemporalConstraints getTemporalConstraints(org.mrgeo.data.vector.geowave.Date startTime, org.mrgeo.data.vector.geowave.Date endTime) {
org.mrgeo.data.vector.geowave.TemporalRange tr = new org.mrgeo.data.vector.geowave.TemporalRange();
if (startTime != null) {
tr.set... | private org.mrgeo.data.vector.geowave.TemporalConstraints getTemporalConstraints(java.util.Date startTime, java.util.Date endTime) {
org.mrgeo.data.vector.geowave.TemporalRange tr = new org.mrgeo.data.vector.geowave.TemporalRange();
if (startTime != null) {
tr.setStartTime(startTime);
}
if (endT... |
public void setDefaultValues() {
unitOfMeasure = 300;
dotsPerInch = 75;
pageSize = 2;
xPosition = yPosition = 100;
xScale = yScale = 0.5;
int[] defaultData = new int[]{ 2 , 3 , 0 , 8 , 8 , 8 };
setDataImage(defaultData);
} | public void setDefaultValues() {
unitOfMeasure = 300;
dotsPerInch = 300;
pageSize = 2;
xPosition = yPosition = 0;
xScale = yScale = 1;
int[] defaultData = new int[]{ 2 , 3 , 0 , 8 , 8 , 8 };
setDataImage(defaultData);
} |
private javax.faces.component.UIComponent getSelectBooleanCheckboxLabelFacetChild(javax.faces.component.UIComponent uiComponent) {
javax.faces.component.UIComponent labelFacet = uiComponent.getFacet("label");
javax.faces.component.UIComponent selectBooleanCheckboxChild = null;
if (labelFacet != null) {
... | private com.liferay.faces.alloy.component.selectbooleancheckbox.SelectBooleanCheckbox getSelectBooleanCheckboxLabelFacetChild(javax.faces.component.UIComponent labelFacet) {
com.liferay.faces.alloy.component.selectbooleancheckbox.SelectBooleanCheckbox selectBooleanCheckboxChild = null;
if (labelFacet instanceof... |
public static java.lang.String toString(java.lang.CharSequence[] list, java.lang.String separator) {
if ((list.length) == 0) {
return "";
}else {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
for (java.lang.CharSequence str : list) {
sb.append((separator + str))... | public static java.lang.String toString(java.lang.CharSequence[] list, java.lang.String separator) {
if ((list == null) || ((list.length) == 0)) {
return null;
}else {
java.lang.StringBuilder sb = new java.lang.StringBuilder();
for (java.lang.CharSequence str : list) {
sb.app... |
public Item removeFirst() {
if (this.isEmpty()) {
throw new java.util.NoSuchElementException("No elements in Deque, cannot remove");
}
Deque<Item>.Node oldFirst = first;
first = oldFirst.next;
first.prev = null;
(numberItems)--;
return oldFirst.item;
} | public Item removeFirst() {
if (this.isEmpty()) {
throw new java.util.NoSuchElementException("No elements in Deque, cannot remove");
}
Deque<Item>.Node oldFirst = first;
first.prev = null;
first = oldFirst.next;
(numberItems)--;
return oldFirst.item;
} |
public void handleData(java.nio.ByteBuffer src, int startPosition, int endPosition) {
final byte[] bytes = new byte[endPosition - startPosition];
for (int i = 0; i < (bytes.length); i++) {
bytes[i] = src.get(i);
}
seenStrings.add(new java.lang.String(bytes, java.nio.charset.StandardCharsets.US_A... | public void handleData(java.nio.ByteBuffer src, int startPosition, int endPosition) {
final byte[] bytes = new byte[endPosition - startPosition];
for (int i = 0; i < (bytes.length); i++) {
bytes[i] = src.get((startPosition + i));
}
seenStrings.add(new java.lang.String(bytes, java.nio.charset.Sta... |
private void getClientSecrets() {
try {
w094j.ctrl8.database.GoogleStorage.logger.info("Getting client secrets...");
this.clientSecrets = com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.load(w094j.ctrl8.database.GoogleStorage.jsonFactory, new java.io.InputStreamReader(w094j.ctrl8.da... | private void getClientSecrets() {
try {
w094j.ctrl8.database.GoogleStorage.logger.info("Getting client secrets...");
this.clientSecrets = com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets.load(w094j.ctrl8.database.GoogleStorage.jsonFactory, new java.io.InputStreamReader(w094j.ctrl8.da... |
public java.lang.Iterable<java.util.Map.Entry<java.lang.String, org.apache.apex.malhar.stream.sample.complete.AutoComplete.CompletionCandidate>> f(org.apache.apex.malhar.stream.sample.complete.AutoComplete.CompletionCandidate input) {
java.util.List<java.util.Map.Entry<java.lang.String, org.apache.apex.malhar.strea... | public java.lang.Iterable<com.datatorrent.lib.util.KeyValPair<java.lang.String, org.apache.apex.malhar.stream.sample.complete.AutoComplete.CompletionCandidate>> f(org.apache.apex.malhar.stream.sample.complete.AutoComplete.CompletionCandidate input) {
java.util.List<com.datatorrent.lib.util.KeyValPair<java.lang.Stri... |
private int max(int[] currentPos) {
int index = 0;
int max = currentPos[index];
for (int i = 1; i < (currentPos.length); i++)
if ((currentPos[i]) > max)
index = i;
return index;
} | private int max(int[] currentPos) {
int index = 0;
int max = currentPos[index];
for (int i = 1; i < (currentPos.length); i++)
if ((currentPos[i]) > max) {
index = i;
max = currentPos[i];
}
return index;
} |
public static void listFilesForFolder(java.io.File folder, java.lang.String spaces) {
DirectoryReader.html += "<ul>";
for (java.io.File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
DirectoryReader.html += ("<li>" + (fileEntry.getName())) + "</li>";
DirectoryRe... | public static void listFilesForFolder(java.io.File folder, java.lang.String spaces) {
DirectoryReader.html += "<ul>";
for (java.io.File fileEntry : folder.listFiles()) {
if (fileEntry.isDirectory()) {
DirectoryReader.html += "<li>" + (fileEntry.getName());
DirectoryReader.listFil... |
public boolean login(java.lang.String id, java.lang.String password) {
if ((this.studentCollection.get(id)) != null) {
if ((this.studentCollection.get(id).getPassword()) == (java.lang.Integer.parseInt(password))) {
return true;
}
}
return false;
} | public boolean login(java.lang.String id, java.lang.String password) {
if ((this.studentCollection.get(id)) != null) {
if ((this.studentCollection.get(id).getPassword()) == (java.lang.Integer.parseInt(password))) {
java.lang.System.out.println(java.lang.Integer.parseInt(password));
r... |
public java.lang.String getAuthorsAsString() {
java.lang.StringBuilder builder = new java.lang.StringBuilder();
if (((mAuthors) == null) && (mAuthors.isEmpty())) {
return "";
}
for (java.lang.String author : mAuthors) {
builder.append(author);
builder.append(", ");
}
buil... | public java.lang.String getAuthorsAsString() {
java.lang.StringBuilder builder = new java.lang.StringBuilder();
if (((mAuthors) == null) || (mAuthors.isEmpty())) {
return "";
}
for (java.lang.String author : mAuthors) {
builder.append(author);
builder.append(", ");
}
buil... |
public org.jbox2d.common.Vec2 __Interpolate(org.jbox2d.common.Vec2 a, org.jbox2d.common.Vec2 b, float t) {
return new org.jbox2d.common.Vec2((((b.x) - (a.x)) * t), (((b.y) - (a.y)) * t));
} | public org.jbox2d.common.Vec2 __Interpolate(org.jbox2d.common.Vec2 a, org.jbox2d.common.Vec2 b, float t) {
return new org.jbox2d.common.Vec2(((a.x) + (((b.x) - (a.x)) * t)), ((a.y) + (((b.y) - (a.y)) * t)));
} |
public void setUp() {
db = mock(com.mongodb.DB.class);
mongoCollection = mock(com.mongodb.DBCollection.class);
resourceDAO = mock(org.fiware.apps.repository.dao.impl.MongoResourceDAO.class);
virtuosoResourceDAO = mock(org.fiware.apps.repository.dao.impl.VirtuosoResourceDAO.class);
dBObject = mock(co... | public void setUp() {
db = mock(com.mongodb.DB.class);
mongoCollection = mock(com.mongodb.DBCollection.class);
resourceDAO = mock(org.fiware.apps.repository.dao.impl.MongoResourceDAO.class);
virtuosoResourceDAO = mock(org.fiware.apps.repository.dao.impl.VirtuosoResourceDAO.class);
dBObject = mock(co... |
private void normalize() {
normStatisticalSeries.clear();
double normedVal;
double size = groupedStatisticalSeries.size();
for (double val : groupedStatisticalSeries) {
normedVal = val / size;
normStatisticalSeries.add(normedVal);
}
java.lang.System.out.println(("-----" + (normSt... | private void normalize() {
normStatisticalSeries.clear();
double normedVal;
double size = groupedStatisticalSeries.size();
for (double val : groupedStatisticalSeries) {
normedVal = val / size;
normStatisticalSeries.add(normedVal);
}
normStatisticalSeries.add(0.0);
java.lang.S... |
public void onBindViewHolder(com.example.app.ourapplication.RVAdapter.PersonViewHolder personViewHolder, int i) {
personViewHolder.senderName.setText(mFeeds.get(i).name);
personViewHolder.senderMessage.setText(mFeeds.get(i).age);
personViewHolder.senderPhoto.setImageResource(mFeeds.get(i).photoId);
pers... | public void onBindViewHolder(com.example.app.ourapplication.RVAdapter.PersonViewHolder personViewHolder, int i) {
personViewHolder.senderName.setText(mFeeds.get(i).name);
personViewHolder.senderMessage.setText(mFeeds.get(i).age);
personViewHolder.senderPhoto.setImageResource(mFeeds.get(i).photoId);
pers... |
protected boolean checkIfWin(jumpingalien.model.Characters mazub) {
jumpingalien.model.Position mazubPosition = new jumpingalien.model.Position(mazub.getIntPositionAt(1), ((mazub.getIntPositionAt(2)) + 1));
mazubPosition = mazubPosition.toScale(Scale.TILE);
if (mazubPosition.equals(getTargetPosition())) {
... | protected boolean checkIfWin(jumpingalien.model.Characters mazub) {
jumpingalien.model.Position mazubPosition = new jumpingalien.model.Position(((mazub.getIntPositionAt(1)) + 2), ((mazub.getIntPositionAt(2)) + 1));
mazubPosition = mazubPosition.toScale(Scale.TILE);
if (mazubPosition.equals(getTargetPosition... |
private void nextChar() {
if ((i) < (source.length())) {
ch = source.charAt(i);
if ((ch) == '\n') {
(line)++;
column = 0;
}
i = (i) + 1;
column = (column) + 1;
}else {
ch = ' ';
}
} | private void nextChar() {
if ((i) < (source.length())) {
ch = source.charAt(i);
if ((ch) == '\n') {
(line)++;
column = 0;
}else {
(column)++;
}
i = (i) + 1;
}else {
ch = ' ';
}
} |
public void generate(final com.spectralogic.ds3autogen.api.models.Ds3ApiSpec spec, final com.spectralogic.ds3autogen.api.FileUtils fileUtils, final java.nio.file.Path destDir) throws java.io.IOException {
this.spec = spec;
this.fileUtils = fileUtils;
try {
generateDs3_H();
generateDs3_C();
... | public void generate(final com.spectralogic.ds3autogen.api.models.Ds3ApiSpec spec, final com.spectralogic.ds3autogen.api.FileUtils fileUtils, final java.nio.file.Path destDir) throws java.io.IOException {
this.spec = spec;
this.fileUtils = fileUtils;
try {
generateDs3_H();
generateDs3_C();
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.