buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public static void assertParametersSuffice(java.util.Collection<com.onestopconcept.endpoints.config.ParameterName> params, java.lang.String template) throws com.databasesandlife.util.gwtsafe.ConfigurationException {
if (template == null)
return ;
java.util.regex.Matcher m = java.util.regex.Pattern.... | public static void assertParametersSuffice(java.util.Collection<com.onestopconcept.endpoints.config.ParameterName> params, java.lang.String template) throws com.databasesandlife.util.gwtsafe.ConfigurationException {
if (template == null)
return ;
java.util.regex.Matcher m = java.util.regex.Pattern.... |
public void setRoute(int nodeId, int destId, int neighbourId, policies.implementations.gaorexford.GaoRexfordAttribute.Type type, int[] path) {
if (isValidDestination(destId)) {
simulation.RouteTable routeTable = routeTables.get(network.getNode(nodeId));
routeTable.setAttribute(network.getNode(destId... | public void setRoute(int nodeId, int destId, int neighbourId, policies.implementations.gaorexford.GaoRexfordAttribute attribute, int[] path) {
if (isValidDestination(destId)) {
simulation.RouteTable routeTable = routeTables.get(network.getNode(nodeId));
routeTable.setAttribute(network.getNode(destId... |
public void onStart() {
super.onStart();
org.cocos2d.nodes.CCDirector.sharedDirector().attachInView(_glSurfaceView);
org.cocos2d.nodes.CCDirector.sharedDirector().setDisplayFPS(true);
org.cocos2d.nodes.CCDirector.sharedDirector().setAnimationInterval((1.0F / 60.0F));
try {
java.lang.System.o... | public void onStart() {
super.onStart();
org.cocos2d.nodes.CCDirector.sharedDirector().attachInView(_glSurfaceView);
org.cocos2d.nodes.CCDirector.sharedDirector().setAnimationInterval((1.0F / 60.0F));
try {
java.lang.System.out.println("creating MenuLayer...");
org.cocos2d.layers.CCScene... |
protected com.up.sim.model.LogModel request0() {
java.lang.String requestLog = logRequest(request);
try {
java.lang.String responseLog = client.execute(request, new com.up.sim.handler.RespLoggingHandler());
return com.up.sim.model.LogModel.newInstance(model.getBussId(), requestLog, responseLog, ... | protected com.up.sim.model.LogModel request0() {
java.lang.String requestLog = logRequest(request);
try {
java.lang.String responseLog = client.execute(request, new com.up.sim.handler.RespLoggingHandler(request, model));
return com.up.sim.model.LogModel.newInstance(model.getBussId(), requestLog,... |
public void printList() {
IntNode pointer = this;
java.lang.System.out.println("The numbers in the array are: ");
while (true) {
java.lang.System.out.println(pointer.getInt());
pointer = pointer.getNext();
if ((pointer.getNext()) == null) {
java.lang.System.out.println(po... | public void printList() {
IntNode pointer = this;
java.lang.System.out.println("The numbers in the array are: ");
while (true) {
java.lang.System.out.println(pointer.getInt());
if ((pointer.getNext()) != null) {
pointer = pointer.getNext();
if ((pointer.getNext()) == ... |
public void execute(net.zencal.snuffles.domain.dubtrack.payload.DubChatPayload chatPayload) {
net.zencal.snuffles.command.configuration.ResponseConfiguration responseConfiguration = new com.google.gson.Gson().fromJson(configurationJson.toString(), net.zencal.snuffles.command.configuration.ResponseConfiguration.clas... | public void execute(net.zencal.snuffles.domain.dubtrack.payload.DubChatPayload chatPayload) {
net.zencal.snuffles.command.configuration.ResponseConfiguration responseConfiguration = new com.google.gson.Gson().fromJson(configurationJson.toString(), net.zencal.snuffles.command.configuration.ResponseConfiguration.clas... |
public boolean cancelSeats(int no) {
if ((no > (this.booked)) && (no > 0)) {
return false;
}else {
this.booked = -no;
this.availability += no;
this.setChanged();
this.notifyObservers(this.availability);
this.clearChanged();
return true;
}
} | public boolean cancelSeats(int no) {
if ((no > (this.booked)) && (no > 0)) {
return false;
}else {
this.booked -= no;
this.availability += no;
this.setChanged();
this.notifyObservers(this.availability);
this.clearChanged();
return true;
}
} |
public void testInsertPlan() {
edu.fudan.ooad.entity.Plan p = new edu.fudan.ooad.entity.Plan("p1", edu.fudan.ooad.test.PlanTest.type.getId(), 30, "small", "testing");
edu.fudan.ooad.operation.BaseOperation.insert(p);
junit.framework.TestCase.assertNotNull("failure in plan insertion", edu.fudan.ooad.operatio... | public void testInsertPlan() {
edu.fudan.ooad.entity.Plan p = new edu.fudan.ooad.entity.Plan("p1", edu.fudan.ooad.test.PlanTest.type.getId(), 30, "small", "testing");
edu.fudan.ooad.operation.BaseOperation.insert(p);
junit.framework.TestCase.assertNotNull("failure in plan insertion", edu.fudan.ooad.operatio... |
public edu.internet2.middleware.subject.Subject getSubject(edu.internet2.middleware.grouper.pspng.Provisioner provisioner) {
if ((getChangelogEntry()) == null)
return null;
final java.lang.String subjectId = getSubjectId();
final java.lang.String sourceId = getSubjectSourceId();
if ((subjec... | public edu.internet2.middleware.subject.Subject getSubject(edu.internet2.middleware.grouper.pspng.Provisioner provisioner) {
if ((getChangelogEntry()) == null)
return null;
final java.lang.String subjectId = getSubjectId(true);
final java.lang.String sourceId = getSubjectSourceId(true);
if ... |
public void writeToParcel(android.os.Parcel dest, int flags) {
dest.writeInt(mNumber);
dest.writeInt(mImage);
dest.writeString(mName);
dest.writeString(getAlias());
dest.writeString(mType1.name());
dest.writeString(mType2.name());
} | public void writeToParcel(android.os.Parcel dest, int flags) {
dest.writeInt(mNumber);
dest.writeInt(mImage);
dest.writeString(mName);
dest.writeString(getAlias());
dest.writeString(mType1.name());
dest.writeString(((mType2) != null ? mType2.name() : null));
} |
public static void appendBytes(org.apache.hadoop.fs.FileSystem fs, java.lang.String filepath, byte[] bytes, int start, int length) {
try {
core.utils.FSDataOutputStream fout = fs.append(new core.utils.Path(filepath));
fout.write(bytes, start, length);
fout.close();
} catch (java.io.IOExc... | public static void appendBytes(org.apache.hadoop.fs.FileSystem fs, java.lang.String filepath, byte[] bytes, int start, int length) {
try {
core.utils.FSDataOutputStream fout = fs.append(new core.utils.Path(filepath));
fout.write(bytes, start, length);
fout.close();
} catch (java.io.IOExc... |
protected void asyncRedraw() {
spoon.getDisplay().asyncExec(new java.lang.Runnable() {
public void run() {
if (!(isDisposed())) {
redraw();
pushSession.stop();
}
}
});
} | protected void asyncRedraw() {
if (spoon.getDisplay().isDisposed()) {
return ;
}
spoon.getDisplay().asyncExec(new java.lang.Runnable() {
public void run() {
if (!(isDisposed())) {
redraw();
pushSession.stop();
}
}
});
} |
private void incrementCount(org.apache.hadoop.io.MapWritable map, org.apache.hadoop.io.Text key) {
org.apache.hadoop.io.IntWritable count = ((org.apache.hadoop.io.IntWritable) (map.getOrDefault(key, ZERO)));
count.set(((count.get()) + 1));
map.put(key, count);
} | private void incrementCount(org.apache.hadoop.io.MapWritable map, org.apache.hadoop.io.Text key) {
org.apache.hadoop.io.IntWritable count = ((org.apache.hadoop.io.IntWritable) (map.getOrDefault(key, ZERO)));
map.put(key, new org.apache.hadoop.io.IntWritable(((count.get()) + 1)));
} |
public java.util.List<de.mirkosertic.bytecoder.core.BytecodeProgramJumps.Range> endRangesAt(de.mirkosertic.bytecoder.core.BytecodeOpcodeAddress aAddress) {
java.util.List<de.mirkosertic.bytecoder.core.BytecodeProgramJumps.Range> theResult = new java.util.ArrayList<>();
for (de.mirkosertic.bytecoder.core.Bytecod... | public java.util.List<de.mirkosertic.bytecoder.core.BytecodeProgramJumps.Range> endRangesAt(de.mirkosertic.bytecoder.core.BytecodeOpcodeAddress aAddress) {
java.util.List<de.mirkosertic.bytecoder.core.BytecodeProgramJumps.Range> theResult = new java.util.ArrayList<>();
for (de.mirkosertic.bytecoder.core.Bytecod... |
public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
mCompleted = dataSnapshot.child("complete").getChildrenCount();
dbCurrentUser.child("remaining").addListenerForSingleValueEvent(new com.google.firebase.database.ValueEventListener() {
@java.lang.Override
public vo... | public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
mCompleted = dataSnapshot.getChildrenCount();
dbCurrentUser.child("remaining").addListenerForSingleValueEvent(new com.google.firebase.database.ValueEventListener() {
@java.lang.Override
public void onDataChange(co... |
public synchronized void start() {
pool = java.util.concurrent.Executors.newFixedThreadPool(me.ferrybig.javacoding.graphical.decompiler.support.CFRTalker.MAX_TASKS, new java.util.concurrent.ThreadFactory() {
@java.lang.Override
public java.lang.Thread newThread(java.lang.Runnable r) {
ja... | public synchronized void start() {
pool = java.util.concurrent.Executors.newFixedThreadPool(me.ferrybig.javacoding.graphical.decompiler.support.CFRTalker.MAX_TASKS, (java.lang.Runnable r) -> {
java.lang.Thread t = new java.lang.Thread(r);
t.setPriority(((java.lang.Thread.NORM_PRIORITY) - 2));
... |
public static void debugClass(java.lang.Class<?> _class) {
java.lang.Class<?> rootClass = Utils.getRootClass(_class);
DebugUtils.DebugFlags dbgFlags = DebugUtils.dbgClassFlags.get(rootClass);
DebugUtils.dbgClasses.put(_class, rootClass);
DebugUtils.dbgClassFlags.put(_class, (dbgFlags == null ? new Debug... | public static void debugClass(java.lang.Class<?> _class) {
java.lang.Class<?> rootClass = Utils.getRootClass(_class);
DebugUtils.DebugFlags dbgFlags = DebugUtils.dbgClassFlags.get(rootClass);
DebugUtils.dbgClasses.put(_class, rootClass);
DebugUtils.dbgClassFlags.put(rootClass, (dbgFlags == null ? new De... |
public static void registerAllTypes() {
org.jimmutable.core.serialization.reader.ObjectParseTree.registerTypeName(org.jimmutable.core.serialization.FieldName.class);
org.jimmutable.core.serialization.reader.ObjectParseTree.registerTypeName(org.jimmutable.core.serialization.TypeName.class);
org.jimmutable.co... | public static void registerAllTypes() {
org.jimmutable.core.serialization.reader.ObjectParseTree.registerTypeName(org.jimmutable.core.serialization.FieldName.class);
org.jimmutable.core.serialization.reader.ObjectParseTree.registerTypeName(org.jimmutable.core.serialization.TypeName.class);
org.jimmutable.co... |
public void actionPerformed(java.awt.event.ActionEvent e) {
EventDispatcher.instance.dispatchEvent(new org.mhisoft.common.event.MHIEvent(org.mhisoft.common.event.EventType.UserCheckInEvent, "btnAttach", null));
java.lang.String imageFile = org.mhisoft.wallet.view.ViewHelper.chooseFile(null, "png", "gif", "jpg",... | public void actionPerformed(java.awt.event.ActionEvent e) {
EventDispatcher.instance.dispatchEvent(new org.mhisoft.common.event.MHIEvent(org.mhisoft.common.event.EventType.UserCheckInEvent, "btnAttach", null));
java.lang.String imageFile = org.mhisoft.wallet.view.ViewHelper.chooseFile(null, "png", "gif", "jpg",... |
private void runMainLoop() {
int numGuessesLeft = assignment2.Utilities.GameConfiguration.numGuesses;
java.lang.String response;
while (numGuessesLeft > 0) {
showGuessInfo(numGuessesLeft);
response = player1.respond();
if (response.equals("HISTORY")) {
showBoard();
... | private void runMainLoop() {
int numGuessesLeft = assignment2.Utilities.GameConfiguration.numGuesses;
java.lang.String response;
while (numGuessesLeft > 0) {
showGuessInfo(numGuessesLeft);
response = player1.respond();
if (response.equals("HISTORY")) {
showBoard();
... |
public void setCurrentClientServiceName(@com.github.kristofa.brave.internal.Nullable
final java.lang.String serviceName) {
if (serviceName == null) {
registry.add(new ratpack.zipkin.internal.RatpackServerClientLocalSpanState.ClientEndpointValue(registry.get(ratpack.zipkin.internal.RatpackServerClientLocalSp... | public void setCurrentClientServiceName(@com.github.kristofa.brave.internal.Nullable
final java.lang.String serviceName) {
if (serviceName == null) {
registry.get().add(new ratpack.zipkin.internal.RatpackServerClientLocalSpanState.ClientEndpointValue(registry.get().get(ratpack.zipkin.internal.RatpackServerC... |
public void onClientTick(net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent event) {
isServerSide = false;
net.minecraft.entity.player.EntityPlayer entityPlayer = net.minecraftforge.fml.client.FMLClientHandler.instance().getClientPlayerEntity();
if (entityPlayer != null) {
if ((helloT... | public void onClientTick(net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent event) {
net.minecraft.entity.player.EntityPlayer entityPlayer = net.minecraftforge.fml.client.FMLClientHandler.instance().getClientPlayerEntity();
if (entityPlayer != null) {
if ((helloTimeout) > 0) {
... |
public static void joinFiles(javax.swing.JFrame parent, java.io.File[] inputFileArray, java.io.File outputFile, java.lang.Integer startYear, java.lang.Integer endYear, java.lang.Integer minNumberSamples) {
new org.fhaes.tools.FHOperations(parent, inputFileArray, outputFile, startYear, endYear, 1.0, org.fhaes.enums.... | public static void joinFiles(javax.swing.JFrame parent, java.io.File[] inputFileArray, java.io.File outputFile, java.lang.Integer startYear, java.lang.Integer endYear, java.lang.Integer minNumberSamples) {
new org.fhaes.tools.FHOperations(parent, inputFileArray, outputFile, startYear, endYear, 1.0, org.fhaes.enums.... |
public void testRecognizeFileStringRecognizeOptions() {
final java.io.File audio = new java.io.File("src/test/resources/sample1.wav");
final java.lang.String contentType = com.ibm.watson.developer_cloud.http.HttpMediaType.AUDIO_WAV;
final com.ibm.watson.developer_cloud.speech_to_text.v1.RecognizeOptions opt... | public void testRecognizeFileStringRecognizeOptions() {
final java.io.File audio = new java.io.File("src/test/resources/sample1.wav");
final java.lang.String contentType = com.ibm.watson.developer_cloud.http.HttpMediaType.AUDIO_WAV;
final com.ibm.watson.developer_cloud.speech_to_text.v1.RecognizeOptions opt... |
public void createNewTutorial(org.bukkit.entity.Player player, java.lang.String tutorialName) {
this.name = tutorialName;
this.factory = new io.snw.tutorial.ConversationFactory(plugin).withModality(true).withPrefix(new io.snw.tutorial.CreateTutorial.Prefix()).withFirstPrompt(new io.snw.tutorial.CreateTutorial.W... | public void createNewTutorial(org.bukkit.entity.Player player, java.lang.String tutorialName) {
this.name = tutorialName;
this.factory = new io.snw.tutorial.ConversationFactory(plugin).withModality(true).withFirstPrompt(new io.snw.tutorial.CreateTutorial.Welcome()).withEscapeSequence("/quit").withTimeout(10).th... |
public java.util.Set<java.lang.String> getCurrentConfigurationPaths() {
javax.jcr.Session session = null;
java.util.Set<java.lang.String> paths = new java.util.LinkedHashSet<java.lang.String>();
try {
session = repository.loginAdministrative(null);
paths = this.getNewestConfigurationNodes(th... | public java.util.Set<java.lang.String> getCurrentConfigurationPaths() {
javax.jcr.Session session = null;
java.util.Set<java.lang.String> paths = new java.util.LinkedHashSet<java.lang.String>();
try {
session = repository.loginAdministrative(null);
paths = getNewestConfigurationNodes(configu... |
public void save_assignsIdToObject() {
Client myClient = new Client("Client1");
myClient.save();
Client savedClient = Client.all().get(0);
assertEquals(myClient.getClientId(), savedClient.getClientId());
} | public void save_assignsIdToObject() {
Client myClient = new Client("Client1");
myClient.save();
Client savedClient = Client.all().get(0);
assertEquals(myClient.getId(), savedClient.getId());
} |
public void updateTimeGroup(java.lang.String output) {
if ((c.getEventType()) != 0) {
txtRun.setText("");
txtRun.append(output);
}else {
txtRun.setText("");
runTimeGroup.interrupt();
runTimeGroup = null;
}
} | public void updateTimeGroup(java.lang.String output) {
if ((c.getEventType()) != 0) {
txtRun.append(output);
}else {
txtRun.setText("");
runTimeGroup.interrupt();
runTimeGroup = null;
}
} |
public java.util.List<java.lang.String> processJson(java.util.List<edu.usc.cssl.tacit.common.queryprocess.Filter> corpusFilters, java.lang.String jsonFilepath, java.lang.String keyFields) throws com.google.gson.JsonIOException, com.google.gson.JsonSyntaxException, java.io.IOException, org.json.simple.parser.ParseExcept... | public java.util.List<java.lang.String> processJson(java.util.List<edu.usc.cssl.tacit.common.queryprocess.Filter> corpusFilters, java.lang.String jsonFilepath, java.lang.String keyFields) throws com.google.gson.JsonIOException, com.google.gson.JsonSyntaxException, java.io.IOException, org.json.simple.parser.ParseExcept... |
public synchronized de.mickare.xserver.events.XServerEvent callEvent(final de.mickare.xserver.events.XServerEvent event) {
if (event == null) {
throw new java.lang.IllegalArgumentException("event can't be null");
}
long start = java.lang.System.nanoTime();
bus.post(event);
event.postCall();
... | public synchronized de.mickare.xserver.events.XServerEvent callEvent(final de.mickare.xserver.events.XServerEvent event) {
if (event == null) {
throw new java.lang.IllegalArgumentException("event can't be null");
}
long start = java.lang.System.nanoTime();
bus.post(event);
event.postCall();
... |
public void onClick(android.view.View v) {
switch (brann) {
case 0 :
(brann)++;
iv_mill_brann.setAlpha(((float) (1)));
tv_mill_brann.setText("x1");
break;
default :
brann = 0;
iv_mill_brann.setAlpha(((float) (0.5)));
... | public void onClick(android.view.View v) {
switch (brann) {
case 0 :
(brann)++;
iv_mill_brann.setAlpha(((float) (1)));
tv_mill_brann.setText("x1");
break;
default :
brann = 0;
iv_mill_brann.setAlpha(((float) (0.5)));
... |
public void setSprite(java.lang.String name, int height, int width) {
setTexture(manager.get(name, com.badlogic.gdx.graphics.Texture.class));
setBounds(body.getPosition().x, body.getPosition().y, (height / (se.boregrim.gyarb.utils.Constants.PPM)), (width / (se.boregrim.gyarb.utils.Constants.PPM)));
java.lan... | public void setSprite(java.lang.String name, int height, int width) {
setTexture(manager.get(name, com.badlogic.gdx.graphics.Texture.class));
setBounds(body.getPosition().x, body.getPosition().y, (height / (se.boregrim.gyarb.utils.Constants.PPM)), (width / (se.boregrim.gyarb.utils.Constants.PPM)));
java.lan... |
public void close() {
this.running.set(false);
this.udpSocket.close();
this.udpSocket = null;
try {
this.updateThread.join();
} catch (java.lang.InterruptedException ignored) {
} finally {
this.updateThread = null;
}
try {
this.receiveThread.join();
} catch (j... | public void close() {
this.running.set(false);
try {
this.updateThread.join();
} catch (java.lang.InterruptedException ignored) {
} finally {
this.updateThread = null;
}
this.udpSocket.close();
this.udpSocket = null;
try {
this.receiveThread.join();
} catch (j... |
public void onSlide(@android.support.annotation.NonNull
android.view.View bottomSheet, float slideOffset) {
mBottomSheetTextView.setVisibility(View.INVISIBLE);
switch (mBottomSheetNavigationView.getSelectedItemId()) {
case R.id.main_bottom_sheet_navigation_calendar :
me.kholmukhamedov.organi... | public void onSlide(@android.support.annotation.NonNull
android.view.View bottomSheet, float slideOffset) {
mBottomSheetTextView.setVisibility(View.INVISIBLE);
switch (mBottomSheetNavigationView.getSelectedItemId()) {
case R.id.main_bottom_sheet_navigation_calendar :
me.kholmukhamedov.organi... |
private void parseAddedPIT(org.waag.histograph.queue.Task task) throws java.io.IOException {
namePrint("Parsing added PIT...");
java.util.Map<java.lang.String, java.lang.String> params = task.getParams();
java.lang.String hgid = params.get(HistographTokens.General.HGID);
findRejectedRelationsHgid(hgid);... | private void parseAddedPIT(org.waag.histograph.queue.Task task) throws java.io.IOException {
java.util.Map<java.lang.String, java.lang.String> params = task.getParams();
java.lang.String hgid = params.get(HistographTokens.General.HGID);
findRejectedRelationsHgid(hgid);
if (params.containsKey(HistographT... |
public static void printConsole(int[] data) {
if (!(utils.arrays.Output.canPrint(data))) {
return ;
}
java.lang.System.out.println("Array:");
java.lang.System.out.print("[");
for (int i = 0; i < ((data.length) - 1); i++) {
java.lang.System.out.print(((data[i]) + ", "));
}
jav... | public static void printConsole(int[] data) {
if (!(utils.arrays.Output.canPrint(data))) {
return ;
}
java.lang.System.out.print("[");
for (int i = 0; i < ((data.length) - 1); i++) {
java.lang.System.out.print(((data[i]) + ", "));
}
java.lang.System.out.println(((data[((data.leng... |
public void sendBroadCast() {
android.util.Log.i(com.example.sunsai.mymusicplayer.service.MusicService.TAG, "sendBroadCast");
android.content.Intent intent = new android.content.Intent();
intent.setAction(PlayerActivity.BROADCAST_MUSICPLAYER);
intent.putExtra("CurrentPosition", mediaPlayer.getCurrentPos... | public void sendBroadCast() {
android.content.Intent intent = new android.content.Intent();
intent.setAction(PlayerActivity.BROADCAST_MUSICPLAYER);
intent.putExtra("CurrentPosition", mediaPlayer.getCurrentPosition());
intent.putExtra("Duration", mediaPlayer.getDuration());
localBroadcastManager.send... |
public void CalcFreq(java.lang.String[] words) {
for (java.lang.String word : words) {
java.lang.Integer wf = frequency.get(word);
if (wf == null) {
wf = new java.lang.Integer(1);
frequency.put(word, wf);
}else {
frequency.put(word, new java.lang.Integer((... | public void CalcFreq(java.lang.String[] words) {
if (words == null) {
return ;
}
for (java.lang.String word : words) {
java.lang.Integer wf = frequency.get(word);
if (wf == null) {
wf = new java.lang.Integer(1);
frequency.put(word, wf);
}else {
... |
public void takeControllerAction(tollbooth.TollGate.Action act) throws tollbooth.TollboothException {
switch (act) {
case OPEN :
this.controller.open();
(this.openCount)++;
break;
case CLOSE :
this.controller.close();
(this.closeCount)++;
... | public void takeControllerAction(tollbooth.TollGate.Action act) throws tollbooth.TollboothException {
switch (act) {
case OPEN :
controller.open();
(openCount)++;
break;
case CLOSE :
controller.close();
(closeCount)++;
break;
... |
public static double averageConsumption(java.util.ArrayList<com.example.smano.app.Metrhsh> metrhshes) {
double sumMetrhseis = 0;
double averageMerthsh = 0;
if ((metrhshes.size()) == 0) {
return -1;
}
for (int i = 0; i <= (metrhshes.size()); i++) {
sumMetrhseis = metrhshes.get(i).getS... | public static double averageConsumption(java.util.ArrayList<com.example.smano.app.Metrhsh> metrhshes) {
double sumMetrhseis = 0;
double averageMerthsh = 0;
if ((metrhshes.size()) == 0) {
return -1;
}
for (int i = 0; i < (metrhshes.size()); i++) {
sumMetrhseis += metrhshes.get(i).getS... |
public void onGenerated(android.support.v7.graphics.Palette palette) {
android.support.v7.graphics.Palette.Swatch swatch = palette.getDarkVibrantSwatch();
int backgroundColor = android.support.v4.content.ContextCompat.getColor(context, R.color.color_primary);
int subtitleColor = android.graphics.Color.WHITE... | public void onGenerated(android.support.v7.graphics.Palette palette) {
android.support.v7.graphics.Palette.Swatch swatch = palette.getDarkVibrantSwatch();
int backgroundColor = android.support.v4.content.ContextCompat.getColor(context, R.color.color_primary);
if (swatch != null) {
backgroundColor = ... |
private int getDividerBySeekBarId(@android.support.annotation.IdRes
int id) {
switch (id) {
case R.id.givenDomesticHotWaterTempBar :
return 10;
case R.id.heatingCurveBar :
return 100;
case R.id.desiredInsideTempBar :
return 10;
case R.id.threeWayVa... | private int getDividerBySeekBarId(@android.support.annotation.IdRes
int id) {
switch (id) {
case R.id.givenDomesticHotWaterTempBar :
return 1;
case R.id.heatingCurveBar :
return 100;
case R.id.desiredInsideTempBar :
return 10;
case R.id.threeWayVal... |
private java.util.List<com.vaguehope.morrigan.model.media.MediaTagClassification> local_getTagClassifications() throws java.lang.ClassNotFoundException, java.sql.SQLException {
java.util.List<com.vaguehope.morrigan.model.media.MediaTagClassification> ret;
java.sql.Statement stat = com.vaguehope.morrigan.model.m... | private java.util.List<com.vaguehope.morrigan.model.media.MediaTagClassification> local_getTagClassifications() throws java.lang.ClassNotFoundException, java.sql.SQLException {
java.util.List<com.vaguehope.morrigan.model.media.MediaTagClassification> ret;
java.sql.Statement stat = com.vaguehope.morrigan.model.m... |
public void onResponse(org.json.JSONObject jsonObject) {
android.util.Log.i("Like API Listener", ("json : " + jsonObject));
if (jsonObject.optBoolean("match", false)) {
android.util.Log.i("PROFILE MATCHED", this.profile.getId());
tinderAPI.addMatchProfile(profile);
}
} | public void onResponse(org.json.JSONObject jsonObject) {
android.util.Log.i("Like API Listener", ("json : " + jsonObject));
if (jsonObject != null) {
if (jsonObject.optBoolean("match", false)) {
android.util.Log.i("PROFILE MATCHED", this.profile.getId());
tinderAPI.addMatchProfil... |
public void setDrawingRect(float left, float top, float right, float bottom) {
this.drawRect.left = left;
this.drawRect.top = top;
this.drawRect.right = right;
this.drawRect.bottom = bottom;
if ((this.isDebug) == true) {
this.inValidate();
}
} | public void setDrawingRect(float left, float top, float right, float bottom) {
this.drawRect.left = left;
this.drawRect.top = top;
this.drawRect.right = right;
this.drawRect.bottom = bottom;
if (this.isDebug) {
this.inValidate();
}
} |
public void windowClosing(java.awt.event.WindowEvent we) {
java.awt.Window window = we.getWindow();
cct.JamberooMolecularEditor.windows.remove(window);
--(Number_of_open_windows);
window.dispose();
if ((cct.JamberooMolecularEditor.windows.size()) == 0) {
cct.dialogs.JamberooFrame frame = cre... | public void windowClosing(java.awt.event.WindowEvent we) {
java.awt.Window window = we.getWindow();
cct.JamberooMolecularEditor.windows.remove(window);
--(Number_of_open_windows);
window.dispose();
if ((cct.JamberooMolecularEditor.windows.size()) == 0) {
cct.dialogs.JamberooFrame frame = cre... |
public double period(double ab, double ac, double bc) {
ab = this.distance(this.a, this.b);
ac = this.distance(this.a, this.c);
bc = this.distance(this.b, this.c);
return ((ab + ac) + bc) / 2;
} | public double period() {
double ab = this.distance(this.a, this.b);
double ac = this.distance(this.a, this.c);
double bc = this.distance(this.b, this.c);
return ((ab + ac) + bc) / 2;
} |
private static void manageEditArgument(java.lang.String[] args) {
if ((args.length) > 1) {
com.doos.webloc_opener.core.Main.runEditDialog(args[1]);
}else {
javax.swing.JOptionPane.showMessageDialog(new java.awt.Frame(), ("Argument '-edit' should have " + "location path parameter."), "Error", jav... | private static void manageEditArgument(java.lang.String[] args) {
if ((args.length) > 1) {
com.doos.webloc_opener.core.Main.runEditDialog(args[1]);
}else {
javax.swing.JOptionPane.showMessageDialog(null, ("Argument '-edit' should have " + "location path parameter."), "Error", javax.swing.JOption... |
private void receiveRepeat(io.netty.channel.ChannelHandlerContext ctx, java.lang.String s) {
Player pl = Main.I.getPlayer(ctx);
if (pl == null)
ctx.close();
pl.receiveRepeat(Base64Codec.DecodeFromString(new WrapperString(s)));
} | private void receiveRepeat(io.netty.channel.ChannelHandlerContext ctx, java.lang.String s) {
Player pl = Main.I.getPlayer(ctx);
if (pl == null)
ctx.close();
else
pl.receiveRepeat(Base64Codec.DecodeFromString(new WrapperString(s)));
} |
public void run(org.eclipse.jface.action.IAction action) {
if ((((selectedResources) == null) || (selectedResources.isEmpty())) || ((window) == null)) {
return ;
}
run(getRefactoringWizard(selectedResources, window), window.getShell());
} | public void run(org.eclipse.jface.action.IAction action) {
if ((((selectedResources) == null) || (selectedResources.isEmpty())) || ((window) == null)) {
return ;
}
run(getRefactoringWizard(selectedResources, window), window.getShell());
selectedResources = null;
} |
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) {
android.view.View rootView = inflater.inflate(R.layout.path_page, container);
pathScreen = ((com.thoughtworks.mobile.awayday.screen.PathScreen) (rootView.findView... | public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) {
android.view.View rootView = inflater.inflate(R.layout.path_page, container, false);
pathScreen = ((com.thoughtworks.mobile.awayday.screen.PathScreen) (rootView.f... |
private void updateSavedCard(java.util.ArrayList<com.midtrans.sdk.corekit.models.SaveCardRequest> saveCardRequests) {
java.util.List<android.support.v4.app.Fragment> fragments = getSupportFragmentManager().getFragments();
for (android.support.v4.app.Fragment fragment : fragments) {
if (fragment instance... | private void updateSavedCard(java.util.ArrayList<com.midtrans.sdk.corekit.models.SaveCardRequest> saveCardRequests) {
java.util.List<android.support.v4.app.Fragment> fragments = getSupportFragmentManager().getFragments();
for (android.support.v4.app.Fragment fragment : fragments) {
if (fragment instance... |
public synchronized java.util.Set<it.polimi.tower4clouds.manager.Observer> getObservers(java.lang.String metric) throws it.polimi.tower4clouds.manager.NotFoundException {
if (!(ruleIdByObservableMetric.containsKey(metric))) {
throw new it.polimi.tower4clouds.manager.NotFoundException(metric);
}
java... | public synchronized java.util.Set<it.polimi.tower4clouds.manager.Observer> getObservers(java.lang.String metric) throws it.polimi.tower4clouds.manager.NotFoundException {
if (!(ruleIdByObservableMetric.containsKey(metric))) {
throw new it.polimi.tower4clouds.manager.NotFoundException(metric);
}
java... |
public void onSuccess() {
getLocationManager(response);
java.lang.String serviceId = getServiceID(request);
org.deviceconnect.android.event.EventError error = EventManager.INSTANCE.addEvent(request);
if (error == (org.deviceconnect.android.event.EventError.NONE)) {
startGPS(getHighAccuracy(reque... | public void onSuccess() {
getLocationManager(response);
java.lang.String serviceId = getServiceID(request);
org.deviceconnect.android.event.EventError error = EventManager.INSTANCE.addEvent(request);
if (error == (org.deviceconnect.android.event.EventError.NONE)) {
startGPS(getHighAccuracy(reque... |
public void allocate(int index) {
if (index >= (_capacity)) {
if ((_backend) == null) {
_backend = new java.lang.Object[index];
_capacity = index;
}else {
throw new java.lang.RuntimeException("Not implemented yet!!!");
}
}
} | public void allocate(int index) {
if (index >= (_capacity)) {
if ((_backend.length) == 0) {
_backend = new java.lang.Object[index];
_capacity = index;
}else {
throw new java.lang.RuntimeException("Not implemented yet!!!");
}
}
} |
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!hasFocus)
return ;
if (!(com.bifrostentertainment.rainbow.RainbowActivity.kSupportsImmersiveFullScreenMode)) {
if (com.bifrostentertainment.rainbow.RainbowActivity.kSupportsLowProfileSystemUI... | public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (!hasFocus) {
return ;
}
if (!(com.bifrostentertainment.rainbow.RainbowActivity.kSupportsImmersiveFullScreenMode)) {
if (com.bifrostentertainment.rainbow.RainbowActivity.kSupportsLowProfileSyste... |
private void startPlayerService() {
if (!(mBound)) {
android.content.Intent intent = new android.content.Intent(getActivity(), au.com.taaffe.spotifystreamer.service.PlayerService.class);
android.os.Bundle arguments = getArguments();
if (arguments != null)
intent.putExtras(getArgu... | private void startPlayerService(android.os.Bundle arguments) {
if (!(mBound)) {
android.content.Intent intent = new android.content.Intent(getActivity(), au.com.taaffe.spotifystreamer.service.PlayerService.class);
if (arguments != null)
intent.putExtras(getArguments());
... |
public void onClick(android.view.View v) {
com.nrct.application.model.User user = new com.nrct.application.model.User();
user.removeAll();
com.facebook.Session session = com.facebook.Session.getActiveSession();
if (session != null) {
session.closeAndClearTokenInformation();
this.finish()... | public void onClick(android.view.View v) {
com.nrct.application.model.User user = new com.nrct.application.model.User();
user.removeAll();
com.facebook.Session session = com.facebook.Session.getActiveSession();
if (session != null) {
session.closeAndClearTokenInformation();
this.finish()... |
private static void jj_la1_init_1() {
simplejava.jj_la1_1 = new int[]{ 65536 , 0 , 2 , 65536 , 65536 , 0 , 0 , 78848 , 900 , 98304 , 12288 , 0 , 98304 , 65536 , 98304 , 65536 , 32 , 98304 , 67493 , 1 , 98304 , 67493 , 0 , 0 , 1024 , 98304 , 900 , 98304 , 98304 , 98304 , 98304 , 98304 , 98304 , 98304 , 98304 , 98304... | private static void jj_la1_init_1() {
simplejava.jj_la1_1 = new int[]{ 65536 , 65536 , 0 , 2 , 65536 , 65536 , 0 , 0 , 78848 , 900 , 67493 , 98304 , 12288 , 0 , 98304 , 65536 , 2 , 65536 , 32 , 98304 , 67493 , 1 , 98304 , 67493 , 0 , 0 , 1024 , 98304 , 900 , 98304 , 98304 , 98304 , 98304 , 98304 , 98304 , 98304 , 9... |
public void handle(final java.util.LinkedList<java.lang.String> args) {
if (!(supports(args)))
return ;
args.removeFirst();
final java.lang.String commandToRun = args.removeFirst();
final java.lang.String paramString = (org.scijava.console.ConsoleUtils.hasParam(args)) ? "" : args.removeFirs... | public void handle(final java.util.LinkedList<java.lang.String> args) {
if (!(supports(args)))
return ;
args.removeFirst();
final java.lang.String commandToRun = args.removeFirst();
final java.lang.String paramString = (org.scijava.console.ConsoleUtils.hasParam(args)) ? args.removeFirst() :... |
public Item removeLast() {
if ((size()) == 0) {
throw new java.util.NoSuchElementException();
}
Item item = last.item;
last = last.backward;
if ((last) != null) {
last.forward = null;
}
(size)--;
if ((size()) == 0) {
first = null;
}
return item;
} | public Item removeLast() {
if ((size()) == 0) {
throw new java.util.NoSuchElementException();
}
Item value = last.item;
if ((size()) == 1) {
last = null;
first = last;
(size)--;
return value;
}
last = last.backward;
last.forward = null;
(size)--;
... |
public static void assertNoParentChildRelationship(backend.CategoryNode parent, java.lang.String parentName, backend.CategoryNode child, java.lang.String childName) {
assertFalse((((childName + " is ") + parentName) + "'s child"), backend.Helper.isChild(child, parent));
assertNotSame((((parentName + " is ") + c... | public static void assertNoParentChildRelationship(backend.CategoryNode parent, java.lang.String parentName, backend.CategoryNode child, java.lang.String childName) {
assertFalse((((childName + " is ") + parentName) + "'s child"), backend.Helper.isChild(child, parent));
assertNotSame((((parentName + " is ") + c... |
public void saveLanguageTranslation(java.lang.String languageLocale, java.lang.String jsonData) {
try {
org.json.JSONObject data = new org.json.JSONObject(jsonData);
if (data.has("data")) {
org.json.JSONObject jsonTranslation = data.optJSONObject("data");
if (jsonTranslation ... | public void saveLanguageTranslation(java.lang.String languageLocale, java.lang.String jsonData) {
try {
org.json.JSONObject data = new org.json.JSONObject(jsonData);
if (data.has("data")) {
data = data.optJSONObject("data");
}
if (data != null) {
cacheManager.... |
public javax.ws.rs.core.Response updateKontakt(ch.issueman.common.Kontakt t, @javax.ws.rs.core.Context
javax.servlet.http.HttpServletRequest request) {
rbm.get("login").setLogin(((ch.issueman.common.Login) (request.getSession(true).getAttribute("login"))));
return ((ch.issueman.webservice.DAOResponseBuilder) (r... | public javax.ws.rs.core.Response updateKontakt(ch.issueman.common.Kontakt t, @javax.ws.rs.core.Context
javax.servlet.http.HttpServletRequest request) {
rbm.get("kontakt").setLogin(((ch.issueman.common.Login) (request.getSession(true).getAttribute("login"))));
return ((ch.issueman.webservice.DAOResponseBuilder) ... |
public budgetapp.util.money.Money calculateDailyPayment() {
if (!(budgetapp.util.FlagHandler.isFlagSet(flags, budgetapp.util.Installment.INSTALLMENT_POSITIVE))) {
budgetapp.util.money.Money remaining = totalValue.add(amountPaid);
return budgetapp.util.BudgetFunctions.max(remaining, dailyPayment);
... | public budgetapp.util.money.Money calculateDailyPayment() {
budgetapp.util.money.Money remaining = totalValue.subtract(amountPaid);
if (!(budgetapp.util.FlagHandler.isFlagSet(flags, budgetapp.util.Installment.INSTALLMENT_POSITIVE))) {
return budgetapp.util.BudgetFunctions.max(remaining, dailyPayment);
... |
public static java.util.Set<javax.persistence.metamodel.EntityType<?>> getSubClassEntities(javax.persistence.metamodel.EntityType<?> superEntity, java.util.Set<javax.persistence.metamodel.EntityType<?>> entities) {
java.util.Set<javax.persistence.metamodel.EntityType<?>> subEntities = new java.util.HashSet<javax.pe... | public static java.util.Set<javax.persistence.metamodel.EntityType<?>> getSubClassEntities(javax.persistence.metamodel.EntityType<?> superEntity, java.util.Set<javax.persistence.metamodel.EntityType<?>> entities) {
java.util.Set<javax.persistence.metamodel.EntityType<?>> subEntities = new java.util.HashSet<javax.pe... |
public java.util.List<java.lang.Integer> getParents(int index) {
java.util.List<java.lang.Integer> parents = new java.util.ArrayList<java.lang.Integer>();
for (int v = 0; v < (size()); v++) {
if (v == index)
continue;
for (int child : getChildren(v)) {
if (child ... | public java.util.List<java.lang.Integer> getParents(int index) {
java.util.List<java.lang.Integer> parents = new java.util.ArrayList<java.lang.Integer>();
for (int v = 0; v < (size()); v++) {
if (v == index)
continue;
for (int child : getChildren(v)) {
if (child ... |
public void updateGPSProximityBars(double dist) {
int progress = 100 - ((int) (java.lang.Math.round(((dist * 100.0) / 20.0))));
if ((android.os.Build.VERSION.SDK_INT) >= 11) {
android.animation.ObjectAnimator animation = android.animation.ObjectAnimator.ofInt(gpsProgressBar, "progress", progress);
... | public void updateGPSProximityBars(double dist) {
int progress = 100 - ((int) (java.lang.Math.round(((dist * 100.0) / 100.0))));
if ((android.os.Build.VERSION.SDK_INT) >= 11) {
android.animation.ObjectAnimator animation = android.animation.ObjectAnimator.ofInt(gpsProgressBar, "progress", progress);
... |
public void drawNetwork(final uk.ac.uea.cmp.spectre.core.ds.network.draw.ViewerConfig config, uk.ac.uea.cmp.spectre.core.ds.network.Network network, boolean optimiseLayout) {
this.network = network;
this.config = config;
this.setGraph();
this.showTrivial(config.showTrivial());
this.repaintOnResize()... | public void drawNetwork(final uk.ac.uea.cmp.spectre.core.ds.network.draw.ViewerConfig config, uk.ac.uea.cmp.spectre.core.ds.network.Network network, boolean optimiseLayout) {
this.network = network;
this.config = config;
this.setGraph();
this.showTrivial(config.showTrivial());
if (optimiseLayout) {
... |
org.passay.dictionary.AbstractFileWordList.Cache.Entry get(final int index) {
if ((modulus) == 0) {
return new org.passay.dictionary.AbstractFileWordList.Cache.Entry(0, 0);
}
final int i = index / (modulus);
map.position(i);
return new org.passay.dictionary.AbstractFileWordList.Cache.Entry(i... | org.passay.dictionary.AbstractFileWordList.Cache.Entry get(final int index) {
if ((modulus) == 0) {
return new org.passay.dictionary.AbstractFileWordList.Cache.Entry(0, 0);
}
final int i = index / (modulus);
map.position(i);
return new org.passay.dictionary.AbstractFileWordList.Cache.Entry((... |
public void performImageAction() {
queueSelectionMask(mask);
spirite.image_data.DrawEngine.StrokeEngine engine = workspace.getDrawEngine().startStrokeEngine(builtImage);
engine.startStroke(params, points[0]);
for (int i = 1; i < (points.length); ++i) {
engine.updateStroke(points[i]);
eng... | public void performImageAction() {
queueSelectionMask(mask);
startStroke(params, points[0], builtImage);
for (int i = 1; i < (points.length); ++i) {
engine.stepStroke(points[i]);
}
engine.endStroke();
} |
public void representationDiff(final java.util.Set<il.ac.technion.ie.model.Record> source, final java.util.Set<il.ac.technion.ie.model.Record> other, il.ac.technion.ie.canopy.model.DuplicateReductionContext reductionContext) {
java.util.Set<il.ac.technion.ie.model.Record> sourceCopy = new java.util.HashSet(source);... | public void representationDiff(final java.util.Set<il.ac.technion.ie.model.Record> source, final java.util.Set<il.ac.technion.ie.model.Record> other, il.ac.technion.ie.canopy.model.DuplicateReductionContext reductionContext) {
java.util.Set<il.ac.technion.ie.model.Record> sourceCopy = new java.util.HashSet(source);... |
public thredds.client.catalog.builder.Catalog buildFromCatref(thredds.client.catalog.builder.CatalogRef catref) throws java.io.IOException {
java.net.URI catrefURI = catref.getURI();
if (catrefURI == null) {
errlog.format("Catref doesnt have valid UrlPath=%s%n", catref.getUrlPath());
fatalError ... | public thredds.client.catalog.builder.Catalog buildFromCatref(thredds.client.catalog.builder.CatalogRef catref) throws java.io.IOException {
java.net.URI catrefURI = catref.getURI();
if (catrefURI == null) {
errlog.format("Catref doesnt have valid UrlPath=%s%n", catref.getUrlPath());
fatalError ... |
public void enableLink(long linkId, boolean enabled, java.sql.Connection conn) {
java.sql.PreparedStatement enableConn = null;
try {
enableConn = conn.prepareStatement(crudQueries.getStmtEnableLink());
enableConn.setBoolean(1, enabled);
enableConn.setLong(2, linkId);
enableConn.e... | public void enableLink(long linkId, boolean enabled, java.sql.Connection conn) {
try (java.sql.PreparedStatement enableConn = conn.prepareStatement(crudQueries.getStmtEnableLink())) {
enableConn.setBoolean(1, enabled);
enableConn.setLong(2, linkId);
enableConn.executeUpdate();
} catch (j... |
public io.realm.internal.Table createTable(java.lang.Class<? extends io.realm.RealmModel> clazz, io.realm.internal.ImplicitTransaction transaction) {
checkClass(clazz);
if (clazz.equals(com.xstock.models.GetTradeList.class)) {
return io.realm.io.realm.GetTradeListRealmProxy.initTable(transaction);
}... | public io.realm.internal.Table createTable(java.lang.Class<? extends io.realm.RealmModel> clazz, io.realm.internal.ImplicitTransaction transaction) {
checkClass(clazz);
if (clazz.equals(com.xstock.models.UserDetail.class)) {
return io.realm.io.realm.UserDetailRealmProxy.initTable(transaction);
}else... |
public void setPizzaPowerup(boolean pickedUp) {
hasPizzaPowerup = pickedUp;
if (pickedUp) {
timeLeftPizzaPowerup = com.packtpub.libgdx.canyonbunny.util.Constants.ITEM_PIZZA_POWERUP_DURTION;
this.terminalVelocity.set(((originalTerminal.x) * 2), ((originalTerminal.y) * 2));
}else {
thi... | public void setPizzaPowerup(boolean pickedUp) {
hasPizzaPowerup = pickedUp;
if (pickedUp) {
timeLeftPizzaPowerup = com.packtpub.libgdx.canyonbunny.util.Constants.ITEM_PIZZA_POWERUP_DURTION;
this.terminalVelocity.set(((originalTerminal.x) * 2), ((originalTerminal.y) * 2));
}else {
thi... |
public T stringToObject(java.lang.String json, java.lang.Class clazz) {
com.fasterxml.jackson.databind.ObjectMapper objectMapper = new com.fasterxml.jackson.databind.ObjectMapper();
try {
T result = ((T) (objectMapper.readValue(json, clazz)));
return result;
} catch (java.io.IOException ex) ... | public T stringToObject(java.lang.String json, java.lang.Class clazz) {
com.fasterxml.jackson.databind.ObjectMapper objectMapper = new com.fasterxml.jackson.databind.ObjectMapper();
try {
T result = ((T) (objectMapper.readValue(json, clazz)));
return result;
} catch (java.io.IOException ex) ... |
private group2.Blob getBlob(group2.BlobDetection.BlobInProgress bip) {
if (unusedBlobs.isEmpty()) {
return new group2.Blob(bip.width(), bip.height(), bip.left, bip.top, bip.color);
}else {
group2.Blob blob = unusedBlobs.pop();
blob.width = bip.width();
blob.height = bip.height();... | private group2.Blob getBlob(group2.BlobDetection.BlobInProgress bip) {
if (unusedBlobs.isEmpty()) {
return new group2.Blob(bip.width(), bip.height(), bip.left, bip.top, bip.color);
}else {
group2.Blob blob = unusedBlobs.pop();
blob.width = bip.width();
blob.height = bip.height();... |
public static int largestPalindromeProduct(int max) {
int output = 0;
int min = (max / 10) + 1;
for (int i = max; i > min; i--) {
for (int j = i; j > min; j--) {
if ((projectEuler.ProjectHelper.palindromeIntChecker((i * j))) && ((i * j) > output)) {
output = i * j;
... | public static int largestPalindromeProduct(int max) {
int output = 0;
int min = (max / 10) + 1;
for (int i = max; i > min; i--) {
for (int j = i; j > min; j--) {
if ((palindromeIntChecker((i * j))) && ((i * j) > output)) {
output = i * j;
}
}
}
... |
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
org.eclipse.swt.widgets.Shell shell = new org.eclipse.swt.widgets.Shell(getDisplay());
shell.setLocation(200, 100);
int index = list.getSelectionIndex();
Event existEvent = events.get(index);
Workspace workspace = new Workspace(sh... | public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
org.eclipse.swt.widgets.Shell shell = new org.eclipse.swt.widgets.Shell(getDisplay());
shell.setLocation(200, 100);
int index = list.getSelectionIndex();
if (index != (-1)) {
Event existEvent = events.get(index);
Works... |
private static com.worldciv.filesystem.CustomItem createItemFromYAML(org.bukkit.configuration.file.YamlConfiguration yaml) {
com.worldciv.filesystem.CustomItem item = new com.worldciv.filesystem.CustomItem(yaml.getItemStack("Item-Data.ItemStack"), yaml.getString("Item-Data.Name"), yaml.getString("Item-Data.UUID"), ... | private static com.worldciv.filesystem.CustomItem createItemFromYAML(org.bukkit.configuration.file.YamlConfiguration yaml) {
com.worldciv.filesystem.CustomItem item = new com.worldciv.filesystem.CustomItem(yaml.getItemStack("Item-Data.ItemStack"), yaml.getString("Item-Data.Name"), yaml.getString("Item-Data.UUID"), ... |
public void pass(java.awt.Graphics g) {
if ((painted) < (gateDelay)) {
g.setColor(java.awt.Color.green);
g.fillRect((((center.getX()) - 20) + (10 * (painted))), ((center.getY()) - 5), 10, 10);
(painted)++;
}
} | public void pass(java.awt.Graphics g) {
if ((painted) < (gateDelay)) {
g.setColor(java.awt.Color.green);
g.fillRect(((center.getX()) - 20), ((center.getY()) - 5), (10 + (10 * (painted))), 10);
(painted)++;
}
} |
public CreditCard.CardType convertTypeToModel(java.lang.String text) {
project.model.CreditCard.CardType type;
if (typeText.equals("Visa")) {
type = CreditCard.CardType.VISA;
}else
if (typeText.equals("MC")) {
type = CreditCard.CardType.MC;
}else
if (typeText.... | public CreditCard.CardType convertTypeToModel(java.lang.String text) {
project.model.CreditCard.CardType type;
if (text.equals("Visa")) {
type = CreditCard.CardType.VISA;
}else
if (text.equals("MC")) {
type = CreditCard.CardType.MC;
}else
if (text.equals("Amer... |
public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object event) {
if (event instanceof io.netty.handler.timeout.IdleStateEvent) {
io.netty.handler.timeout.IdleStateEvent e = ((io.netty.handler.timeout.IdleStateEvent) (event));
if ((e.state()) == (io.netty.handler.t... | public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object event) {
if (event instanceof io.netty.handler.timeout.IdleStateEvent) {
io.netty.handler.timeout.IdleStateEvent e = ((io.netty.handler.timeout.IdleStateEvent) (event));
if ((e.state()) == (io.netty.handler.t... |
public com.sgoertzen.sonarbreak.qualitygate.Result execute(com.sgoertzen.sonarbreak.qualitygate.Query query) throws com.sgoertzen.sonarbreak.SonarBreakException, java.io.IOException {
java.net.URL queryURL = com.sgoertzen.sonarbreak.QueryExecutor.buildURL(sonarURL, query);
log.debug(("Built a sonar query url of... | public com.sgoertzen.sonarbreak.qualitygate.Result execute(com.sgoertzen.sonarbreak.qualitygate.Query query) throws com.sgoertzen.sonarbreak.SonarBreakException, java.io.IOException {
java.net.URL queryURL = com.sgoertzen.sonarbreak.QueryExecutor.buildURL(sonarURL, query);
log.debug(("Built a sonar query url of... |
private void appendAllLongLat(java.lang.StringBuilder wkt) {
java.util.Iterator<inter2ohdm.OHDMNode> nodeIter = this.getNodeIter();
boolean first = true;
while (nodeIter.hasNext()) {
if (first) {
first = false;
}else {
wkt.append(", ");
}
inter2ohdm.OH... | private void appendAllLongLat(java.lang.StringBuilder wkt) {
java.util.Iterator<inter2ohdm.OHDMNode> nodeIter = this.getNodeIter();
boolean first = true;
while (nodeIter.hasNext()) {
if (first) {
first = false;
}else {
wkt.append(", ");
}
inter2ohdm.OH... |
public static void main(java.lang.String[] args) {
game.Go go = new game.Go();
player.Player p1 = new player.HumanPlayer(go.askName(), Stone.BLACK);
player.Player p2 = new player.HumanPlayer(go.askName(), Stone.WHITE);
game.Game game = new game.Game(p1, p2, go.askBoardSize(), true);
game.start();
} | public static void main(java.lang.String[] args) {
game.Go go = new game.Go();
player.Player p1 = new player.HumanPlayer(go.askName(), Stone.BLACK);
player.Player p2 = new player.HumanPlayer(go.askName(), Stone.WHITE);
game.Game game = new game.Game(p1, p2, go.askBoardSize());
game.start();
} |
public void onReceiveCommand(java.lang.Object message) {
if ((state) == null) {
risakka.raft.log.LogEntry entry = new risakka.raft.log.LogEntry(2, new risakka.raft.log.StateMachineCommand("aa", 1, 1));
state = new risakka.raft.miscellanea.PersistentState(1, getSender(), null, null);
}
if (me... | public void onReceiveCommand(java.lang.Object message) {
if ((state) == null) {
risakka.raft.log.LogEntry entry = new risakka.raft.log.LogEntry(2, new risakka.raft.log.StateMachineCommand("aa", 1, 1));
state = new risakka.raft.miscellanea.PersistentState(1, getSender(), null, null);
}
if (me... |
public void addPredicate(org.exist.xquery.Predicate pred) {
final org.exist.xquery.Expression e = ((org.exist.xquery.Expression) (steps.get(((steps.size()) - 1))));
if (e instanceof org.exist.xquery.Step) {
((org.exist.xquery.Step) (e)).addPredicate(pred);
}
} | public void addPredicate(org.exist.xquery.Predicate pred) {
if (!(steps.isEmpty())) {
final org.exist.xquery.Expression e = ((org.exist.xquery.Expression) (steps.get(((steps.size()) - 1))));
if (e instanceof org.exist.xquery.Step) {
((org.exist.xquery.Step) (e)).addPredicate(pred);
... |
public void onClick(android.view.View v) {
switch (v.getId()) {
case R.id.logout_button :
logout();
break;
case R.id.aboutus_button :
aboutUs();
break;
case R.id.profile_button :
profile();
break;
case R.id.setti... | public void onClick(android.view.View v) {
switch (v.getId()) {
case R.id.logout_button :
logout();
break;
case R.id.aboutus_button :
aboutUs();
break;
case R.id.profile_button :
profile();
break;
case R.id.setti... |
public java.lang.String checkForDuplicateParticipant(@org.springframework.web.bind.annotation.RequestParam
java.lang.Integer id, @org.springframework.web.bind.annotation.RequestParam
java.lang.String firstName, @org.springframework.web.bind.annotation.RequestParam
java.lang.String lastName, @org.springframework.web.bin... | public java.lang.String checkForDuplicateParticipant(@org.springframework.web.bind.annotation.RequestParam
java.lang.Integer id, @org.springframework.web.bind.annotation.RequestParam
java.lang.String firstName, @org.springframework.web.bind.annotation.RequestParam
java.lang.String lastName, @org.springframework.web.bin... |
public void run() {
android.support.v4.app.Fragment fragment = miage.projetindustriel.fragment.MusicPlayerFragment.newInstance(listMusique, positionMusicSelected);
android.support.v4.app.FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAn... | public void run() {
android.support.v4.app.Fragment fragment = miage.projetindustriel.fragment.MusicPlayerFragment.newInstance(listMusique, positionMusicSelected);
android.support.v4.app.FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.setCustomAn... |
public void onClick(android.content.DialogInterface dialog, int which) {
boolean shouldShowShare = (mMoveModel.getHistoryCoordiates().size()) > (com.stdnull.runmap.common.RMConfiguration.MIN_CACHE_DATA);
mMoveModel.saveModelToDatabase(true);
if (!shouldShowShare) {
mMovementTrackActivity.finishActiv... | public void onClick(android.content.DialogInterface dialog, int which) {
boolean shouldShowShare = (mMoveModel.getHistoryCoordiates().size()) > (com.stdnull.runmap.common.RMConfiguration.MIN_CACHE_DATA);
mMoveModel.saveModelToDatabase(true);
if (shouldShowShare) {
isForceExit = true;
mapObje... |
private void playerNotPuttedCard() {
com.axandar.makaoCore.utils.Logger.logConsole(TAG, "Player did not put card");
if ((sessionInfo.getQuantityCardsToTake()) > 0) {
playerGetCards(sessionInfo.getQuantityCardsToTake());
threadPlayer.setWasPuttedCard(false);
}else
if ((sessionInfo.get... | private void playerNotPuttedCard() {
com.axandar.makaoCore.utils.Logger.logConsole(TAG, "Player did not put card");
if ((sessionInfo.getQuantityCardsToTake()) > 0) {
playerGetCards(sessionInfo.getQuantityCardsToTake());
threadPlayer.setWasPuttedCard(false);
}else
if ((sessionInfo.get... |
public java.util.List<org.eyeseetea.malariacare.data.database.model.Tab> getTabs() {
if ((tabs) == null) {
tabs = new com.raizlabs.android.dbflow.sql.language.Select().from(org.eyeseetea.malariacare.data.database.model.Tab.class).where(Tab_Table.id_program.eq(this.getId_program())).orderBy(com.raizlabs.andr... | public java.util.List<org.eyeseetea.malariacare.data.database.model.Tab> getTabs() {
if ((tabs) == null) {
tabs = new com.raizlabs.android.dbflow.sql.language.Select().from(org.eyeseetea.malariacare.data.database.model.Tab.class).where(Tab_Table.id_program.eq(this.getId_program())).orderBy(Tab_Table.order_p... |
public void operationComplete(io.netty.channel.ChannelFuture future) throws java.lang.Exception {
if (future.isSuccess()) {
java.lang.System.out.println(("Connected to instance " + (instance)));
inboundChannel.read();
}else {
java.lang.System.out.println(("Something went wrong trying to ... | public void operationComplete(io.netty.channel.ChannelFuture future) throws java.lang.Exception {
if (future.isSuccess()) {
java.lang.System.out.println(("Connected to instance " + (instance)));
inboundChannel.read();
}else {
instance = null;
inboundChannel.close();
}
} |
public static void clean() {
java.util.Iterator<java.lang.Long> itr = edu.utexas.cs.nn.evolution.ScoreHistory.allScores.keySet().iterator();
while (itr.hasNext()) {
java.lang.Long id = itr.next();
if (!(edu.utexas.cs.nn.evolution.ScoreHistory.accessed.get(id))) {
itr.remove();
... | public static void clean() {
java.util.Iterator<java.lang.Long> itr = edu.utexas.cs.nn.evolution.ScoreHistory.allScores.keySet().iterator();
while (itr.hasNext()) {
java.lang.Long id = itr.next();
if (((edu.utexas.cs.nn.evolution.ScoreHistory.accessed.get(id)) != null) && (!(edu.utexas.cs.nn.evo... |
private void showDate(int year, int month, int day) {
java.lang.String fixedMonth = (month < 10) ? "0" + month : "" + month;
java.lang.String fixedDay = (day < 10) ? "0" + day : "" + day;
dateOfBirthET.setText(new java.lang.StringBuilder().append(year).append("-").append(fixedMonth).append("-").append(fixed... | private void showDate(int year, int month, int day) {
month = month + 1;
java.lang.String fixedMonth = (month < 10) ? "0" + month : "" + month;
java.lang.String fixedDay = (day < 10) ? "0" + day : "" + day;
dateOfBirthET.setText(new java.lang.StringBuilder().append(year).append("-").append(fixedMonth).a... |
public static ScheduleHacks.Task editExistingTask(ScheduleHacks.Task oldTask, java.lang.String editStatement) {
ScheduleHacks.Task newTask = new ScheduleHacks.Task();
if (Parser.CommandParser.requiresDeletingParameters(editStatement)) {
editStatement = Parser.CommandParser.removeFirstWord(editStatement)... | public static ScheduleHacks.Task editExistingTask(ScheduleHacks.Task oldTask, java.lang.String editStatement) {
ScheduleHacks.Task newTask = new ScheduleHacks.Task();
if (Parser.CommandParser.requiresDeletingParameters(editStatement)) {
editStatement = Parser.CommandParser.removeFirstWord(editStatement)... |
public boolean treeCallback(int proxyId) {
int other = proxyMap.get(proxyId);
if (checkCollision(current, other)) {
collisionDataMapper.get(other).callback.collideWith(current);
collisionDataMapper.get(current).callback.collideWith(other);
}else {
return true;
}
return false;... | public boolean treeCallback(int proxyId) {
int other = proxyMap.get(proxyId);
if (((current) != other) && (checkCollision(current, other))) {
collisionDataMapper.get(other).callback.collideWith(current);
collisionDataMapper.get(current).callback.collideWith(other);
}else {
return tru... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.