buggy_function stringlengths 1 391k | fixed_function stringlengths 0 392k |
|---|---|
public void onComplete(@android.support.annotation.NonNull
com.google.android.gms.tasks.Task<com.google.firebase.auth.AuthResult> task) {
if (task.isSuccessful()) {
android.widget.Toast.makeText(this, ("Authentication failed: " + (task.getException())), Toast.LENGTH_SHORT).show();
}else {
androi... | public void onComplete(@android.support.annotation.NonNull
com.google.android.gms.tasks.Task<com.google.firebase.auth.AuthResult> task) {
if (task.isSuccessful()) {
startActivity(new android.content.Intent(this, com.newproject.jordi.hackupc17.MainActivity.class));
}else {
android.widget.Toast.ma... |
protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws java.io.IOException, javax.servlet.ServletException {
java.lang.String id_log = req.getParameter("id_log");
com.example.Nesrine.myapplication.backend.Logement logement = new com.example.Nesrine.my... | protected void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws java.io.IOException, javax.servlet.ServletException {
java.lang.String id_log = req.getParameter("id_log");
com.example.Nesrine.myapplication.backend.Logement logement = new com.example.Nesrine.my... |
public void update() {
if ((fog) != null) {
fog.update();
}
for (core.entities.LightSource l : lights) {
l.update();
}
for (core.entities.Backdrop b : background) {
b.update();
}
for (core.entities.Backdrop b : foreground) {
b.update();
}
} | public void update() {
if ((fog) != null) {
fog.update();
}
for (core.entities.Backdrop b : background) {
b.update();
}
for (core.entities.Backdrop b : foreground) {
b.update();
}
} |
public java.lang.String addRace() {
java.lang.String roleID = Handlers.Utility.getRoleIDFromName(args, guild);
if (roleID == null) {
return Constants.ERROR_ROLE_NOT_FOUND;
}else {
return guildConfig.addRole(roleID, guild.getRoleByID(roleID).getName(), true);
}
} | public java.lang.String addRole() {
java.lang.String roleID = Handlers.Utility.getRoleIDFromName(args, guild);
if (roleID == null) {
return Constants.ERROR_ROLE_NOT_FOUND;
}else {
return guildConfig.addRole(roleID, guild.getRoleByID(roleID).getName(), true);
}
} |
public ModelBuildComponents.RawModel loadToVAO(float[] positions, int dimensions) {
int vaoID = createVAO();
this.storeDataAttributeList(0, dimensions, positions);
unbindVAO();
return new ModelBuildComponents.RawModel(vaoID, ((positions.length) / 2));
} | public ModelBuildComponents.RawModel loadToVAO(float[] positions, int dimensions) {
int vaoID = createVAO();
this.storeDataAttributeList(0, dimensions, positions);
unbindVAO();
return new ModelBuildComponents.RawModel(vaoID, ((positions.length) / dimensions));
} |
static <E extends java.lang.Enum<E>> com.google.common.collect.ImmutableSet<E> asImmutable(java.util.EnumSet<E> set) {
switch (set.size()) {
case 0 :
return com.google.common.collect.ImmutableSet.of();
case 1 :
return com.google.common.collect.ImmutableSet.of(com.google.commo... | @java.lang.SuppressWarnings(value = "rawtypes")
static com.google.common.collect.ImmutableSet asImmutable(java.util.EnumSet set) {
switch (set.size()) {
case 0 :
return com.google.common.collect.ImmutableSet.of();
case 1 :
return com.google.common.collect.ImmutableSet.of(com.... |
private void waitForTime(long time) {
long start = java.lang.System.currentTimeMillis();
while (!(stop)) {
try {
java.lang.Thread.sleep(100);
} catch (java.lang.InterruptedException e) {
}
if (((java.lang.System.currentTimeMillis()) - start) >= time) {
bre... | private void waitForTime(long time) {
if (time == 0) {
return ;
}
long start = java.lang.System.currentTimeMillis();
while (!(stop)) {
try {
java.lang.Thread.sleep(100);
} catch (java.lang.InterruptedException e) {
}
if (((java.lang.System.currentTimeM... |
protected dna.updates.generators.BatchGenerator getNext() {
int sum = 0;
for (dna.updates.generators.util.BatchRepetition.BatchRepetitionWrapper bg : this.bgs) {
sum += bg.getCount();
if (sum >= (this.index)) {
return bg.getBg();
}
}
return null;
} | protected dna.updates.generators.BatchGenerator getNext() {
int sum = 0;
for (dna.updates.generators.util.BatchRepetition.BatchRepetitionWrapper bg : this.bgs) {
sum += bg.getCount();
if (sum > (this.index)) {
return bg.getBg();
}
}
return null;
} |
public void perform(final java.lang.String tagName) throws java.io.IOException {
if (getBuild().hasPermission(Permission.UPDATE)) {
getBuild().keepLog(true);
}
hudson.scm.CvsRevisionState state = getBuild().getAction(hudson.scm.CvsRevisionState.class);
if (state == null) {
return ;
}... | public void perform(final java.lang.String tagName) throws java.io.IOException {
if (getBuild().hasPermission(Permission.UPDATE)) {
getBuild().keepLog(true);
}
hudson.scm.CvsRevisionState state = getBuild().getAction(hudson.scm.CvsRevisionState.class);
if (state == null) {
return ;
}... |
public void onInput(org.bukkit.entity.Player player, java.lang.String input) {
com.Ben12345rocks.AdvancedCore.Objects.Reward reward = com.Ben12345rocks.AdvancedCore.Configs.ConfigRewards.getInstance().getReward(((java.lang.String) (com.Ben12345rocks.AdvancedCore.Utils.getInstance().getPlayerMeta(player, "Reward")))... | public void onInput(org.bukkit.entity.Player player, java.lang.String input) {
com.Ben12345rocks.AdvancedCore.Objects.Reward reward = ((com.Ben12345rocks.AdvancedCore.Objects.Reward) (com.Ben12345rocks.AdvancedCore.Utils.getInstance().getPlayerMeta(player, "Reward")));
com.Ben12345rocks.AdvancedCore.Configs.Con... |
public java.lang.Long countByJSONFilters(java.lang.String jsonfilters, java.lang.String query) {
com.dot.gcpbasedot.dao.Parameters parameters = new com.dot.gcpbasedot.dao.Parameters();
if ((jsonfilters != null) && (!(jsonfilters.equals("")))) {
parameters = com.dot.gcpbasedot.util.FilterQueryJSON.proces... | public java.lang.Long countByJSONFilters(java.lang.String jsonfilters, java.lang.String query) {
com.dot.gcpbasedot.dao.Parameters parameters = new com.dot.gcpbasedot.dao.Parameters();
if ((jsonfilters != null) && (!(jsonfilters.equals("")))) {
parameters = com.dot.gcpbasedot.util.FilterQueryJSON.proces... |
protected java.util.List<com.facebook.react.ReactPackage> getPackages() {
return java.util.Arrays.<com.facebook.react.ReactPackage>asList(new com.facebook.react.shell.MainReactPackage(), new com.airbnb.android.react.maps.MapsPackage(), new com.microsoft.azure.mobile.react.crashes.RNCrashesPackage(this, getResources... | protected java.util.List<com.facebook.react.ReactPackage> getPackages() {
return java.util.Arrays.<com.facebook.react.ReactPackage>asList(new com.facebook.react.shell.MainReactPackage(), new com.airbnb.android.react.maps.MapsPackage(), new com.microsoft.azure.mobile.react.crashes.RNCrashesPackage(this, getResources... |
public void testBatchDelete() {
com.google.gcloud.datastore.Key taskKey1 = keyFactory.newKey(1);
com.google.gcloud.datastore.Key taskKey2 = keyFactory.newKey(2);
setUpBatchTests(taskKey1, taskKey2);
com.google.gcloud.datastore.Batch batch = datastore.newBatch();
batch.delete(taskKey1, taskKey2);
... | public void testBatchDelete() {
com.google.gcloud.datastore.Key taskKey1 = keyFactory.newKey(1);
com.google.gcloud.datastore.Key taskKey2 = keyFactory.newKey(2);
setUpBatchTests(taskKey1, taskKey2);
datastore.delete(taskKey1, taskKey2);
org.junit.Assert.assertNull(datastore.get(taskKey1));
org.j... |
public int getNextAssetAttachmentDisplayOrder() {
int i = 1;
for (dk.i2m.converge.core.content.NewsItemMediaAttachment attachment : getMediaAttachments()) {
if (attachment != null) {
if ((attachment.getDisplayOrder()) >= i) {
i = (attachment.getDisplayOrder()) + 1;
... | public int getNextAssetAttachmentDisplayOrder() {
int i = 1;
for (dk.i2m.converge.core.content.NewsItemMediaAttachment attachment : getMediaAttachments()) {
if ((attachment != null) && ((attachment.getDisplayOrder()) >= i)) {
i = (attachment.getDisplayOrder()) + 1;
}
}
return... |
private static final org.jooq.impl.ParserImpl.Sign parseSign(org.jooq.impl.ParserImpl.ParserContext ctx) {
org.jooq.impl.ParserImpl.Sign sign = org.jooq.impl.ParserImpl.Sign.NONE;
for (; ;)
if (org.jooq.impl.ParserImpl.parseIf(ctx, '+'))
sign = (sign == null) ? org.jooq.impl.ParserImpl.Sign.... | private static final org.jooq.impl.ParserImpl.Sign parseSign(org.jooq.impl.ParserImpl.ParserContext ctx) {
org.jooq.impl.ParserImpl.Sign sign = org.jooq.impl.ParserImpl.Sign.NONE;
for (; ;)
if (org.jooq.impl.ParserImpl.parseIf(ctx, '+'))
sign = (sign == (org.jooq.impl.ParserImpl.Sign.NONE)) ... |
public int compare(no.imr.nmdapi.generic.nmdechosounder.domain.luf20.AcocatType o1, no.imr.nmdapi.generic.nmdechosounder.domain.luf20.AcocatType o2) {
if ((o1.getAcocat().intValue()) > (o2.getAcocat().intValue())) {
return 1;
}else
if ((o1.getAcocat().intValue()) > (o2.getAcocat().intValue())) {... | public int compare(no.imr.nmdapi.generic.nmdechosounder.domain.luf20.AcocatType o1, no.imr.nmdapi.generic.nmdechosounder.domain.luf20.AcocatType o2) {
if ((o1.getAcocat().intValue()) > (o2.getAcocat().intValue())) {
return 1;
}else
if ((o1.getAcocat().intValue()) < (o2.getAcocat().intValue())) {... |
private boolean addValueToActualList(int value) {
if (!(this.testFilter(value))) {
if (!(this.contains(value))) {
this.actualList.add(value);
return true;
}
}else {
this.actualList.add(value);
return true;
}
return false;
} | private boolean addValueToActualList(int value) {
if (this.testFilter(value)) {
if (!(this.contains(value))) {
this.actualList.add(value);
return true;
}
}else {
this.actualList.add(value);
return true;
}
return false;
} |
public io.seldon.clustering.recommender.ClustersCounts retrieve() throws java.lang.Exception {
io.seldon.clustering.recommender.CountRecommender.logger.debug(((("Trying to get top counts for tag and dimension from db : testMode is for client " + (client)) + " dimension:") + dimension));
java.util.Map<java.lang.... | public io.seldon.clustering.recommender.ClustersCounts retrieve() throws java.lang.Exception {
io.seldon.clustering.recommender.CountRecommender.logger.info(((("Trying to get top counts for tag and dimension from db : testMode is for client " + (client)) + " dimension:") + dimension));
java.util.Map<java.lang.L... |
public java.lang.String[] generateMultiplePasswords(java.lang.String specialCharInput, int min, int max, int numberOfPasswords) {
java.lang.String[] passwordStringArray = new java.lang.String[numberOfPasswords];
for (int i = 0; i < numberOfPasswords; i++) {
passwordStringArray[i] = generatePassword(spec... | public java.lang.String[] generateMultiplePasswords(int numberOfPasswords) {
java.lang.String[] passwordStringArray = new java.lang.String[numberOfPasswords];
for (int i = 0; i < numberOfPasswords; i++) {
passwordStringArray[i] = generatePassword();
}
return passwordStringArray;
} |
private void populateContextFromTokenId(java.lang.String tokenId) {
try {
com.iplanet.sso.SSOToken token = com.iplanet.sso.SSOTokenManager.getInstance().createSSOToken(tokenId);
org.forgerock.openam.audit.context.AuditRequestContext.putProperty(org.forgerock.openam.core.rest.authn.USER_ID, org.forge... | private void populateContextFromTokenId(java.lang.String tokenId) {
try {
com.iplanet.sso.SSOToken token = com.iplanet.sso.SSOTokenManager.getInstance().createSSOToken(tokenId);
org.forgerock.openam.audit.context.AuditRequestContext.putProperty(org.forgerock.openam.core.rest.authn.USER_ID, org.forge... |
public org.sanelib.eboss.core.commands.ProcessCommand convert(org.sanelib.eboss.api.dto.user.UserDTO userDTO, org.sanelib.eboss.core.exceptions.ProcessError processError) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException {
org.sanelib.eboss.core.commands.user.AddUser addUser = ((org.sanelib.eb... | public org.sanelib.eboss.core.commands.ProcessCommand convert(org.sanelib.eboss.api.dto.user.UserDTO userDTO, org.sanelib.eboss.core.exceptions.ProcessError processError) throws java.lang.IllegalAccessException, java.lang.NoSuchFieldException {
org.sanelib.eboss.core.commands.user.AddUser addUser = ((org.sanelib.eb... |
private static java.util.Optional<java.util.Properties> getCertConfig(java.nio.file.Path certFile) {
java.util.Optional<java.nio.file.Path> configFile = de.chkpnt.gradle.plugin.truststorebuilder.TrustStoreBuilderPlugin.getConfigFileForCertificate(certFile);
if (!(configFile.isPresent())) {
return java.u... | private static java.util.Optional<java.util.Properties> getCertConfig(java.nio.file.Path certFile) {
java.util.Optional<java.nio.file.Path> configFile = de.chkpnt.gradle.plugin.truststorebuilder.TrustStoreBuilderPlugin.getConfigFileForCertificate(certFile);
if (!(configFile.isPresent())) {
return java.u... |
public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
java.lang.String receiverFCMToken = dataSnapshot.getValue(java.lang.String.class);
if (!(receiverFCMToken.equals(""))) {
com.example.rajk.leasingmanagers.model.Notif newNotif = new com.example.rajk.leasingmanagers.model.N... | public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
java.lang.String receiverFCMToken = dataSnapshot.getValue(java.lang.String.class);
if ((receiverFCMToken != null) && (receiverFCMToken.equals(""))) {
com.example.rajk.leasingmanagers.model.Notif newNotif = new com.example... |
public java.util.Map<java.lang.String, java.lang.Object> toMap() {
java.util.HashMap<java.lang.String, java.lang.Object> result = new java.util.HashMap<>();
result.put("uID", uID);
result.put("first name", firstName);
result.put("last name", lastName);
result.put("currency", currency);
return re... | public java.util.Map<java.lang.String, java.lang.Object> toMap() {
java.util.HashMap<java.lang.String, java.lang.Object> result = new java.util.HashMap<>();
result.put("uID", uID);
result.put("first name", firstName);
result.put("last name", lastName);
return result;
} |
public static boolean isIntentChromeOrFirstParty(android.content.Intent intent, android.content.Context context) {
if (intent == null)
return false;
android.app.PendingIntent token = org.chromium.chrome.browser.IntentHandler.fetchAuthenticationTokenFromIntent(intent);
if (token == null)
... | public static boolean isIntentChromeOrFirstParty(android.content.Intent intent, android.content.Context context) {
if (intent == null)
return false;
android.app.PendingIntent token = org.chromium.chrome.browser.IntentHandler.fetchAuthenticationTokenFromIntent(intent);
if (token == null)
... |
public static void main(java.lang.String[] args) {
com.c0ldcat.HackWLBServer s;
if ((args.length) != 2) {
s = new com.c0ldcat.HackWLBServer("0.0.0.0", 1234);
}else {
s = new com.c0ldcat.HackWLBServer(args[0], java.lang.Integer.parseInt(args[1]));
}
fi.iki.elonen.util.ServerRunner.exe... | public static void main(java.lang.String[] args) throws java.lang.Exception {
com.c0ldcat.HackWLBServer s;
if ((args.length) != 2) {
s = new com.c0ldcat.HackWLBServer("0.0.0.0", 1234);
}else {
s = new com.c0ldcat.HackWLBServer(args[0], java.lang.Integer.parseInt(args[1]));
}
s.start(... |
public void testGetVisibleByVertexNum1() {
java.lang.System.out.println("testGetVisibleByVertexNum");
wslf.algo.World world = wslf.algo.VisibilityTest.getWorld2Polygons1();
wslf.algo.Visibility instance = new wslf.algo.Visibility(world);
java.util.LinkedList<java.lang.Integer> expResult = new java.util.... | public void testGetVisibleByVertexNum1() {
java.lang.System.out.println("testGetVisibleByVertexNum");
wslf.algo.World world = wslf.algo.VisibilityTest.getWorld2Polygons1();
wslf.algo.Visibility instance = new wslf.algo.Visibility(world);
java.util.LinkedList<java.lang.Integer> expResult = new java.util.... |
public int[] getPhases() {
int[] phases = new int[update.getPlayer().length];
for (int i = 0; i < (phases.length); i++) {
phases[i] = update.getPlayer()[i].getPhase();
}
return phases;
} | public int[] getPhase() {
int[] phases = new int[update.getPlayer().length];
for (int i = 0; i < (phases.length); i++) {
phases[i] = update.getPlayer()[i].getPhase();
}
return phases;
} |
public void onItemClick(android.widget.AdapterView<?> parent, android.view.View view, int position, long id) {
if (((player) != null) && (player.isPlaying())) {
player.stop();
player.release();
currentState = com.trojx.fangyan.fragment.StoryFragment.STATUS_IDLE;
}
android.content.Int... | public void onItemClick(android.widget.AdapterView<?> parent, android.view.View view, int position, long id) {
if ((player) != null) {
player.release();
currentState = com.trojx.fangyan.fragment.StoryFragment.STATUS_IDLE;
}
android.content.Intent intent = new android.content.Intent(getActivi... |
public static com.google.common.collect.ImmutableList<net.minecraftforge.common.BiomeManager.BiomeEntry> getBiomes(net.minecraftforge.common.BiomeManager.BiomeType type) {
int idx = type.ordinal();
java.util.List<net.minecraftforge.common.BiomeManager.BiomeEntry> list = (idx > (net.minecraftforge.common.BiomeMa... | public static com.google.common.collect.ImmutableList<net.minecraftforge.common.BiomeManager.BiomeEntry> getBiomes(net.minecraftforge.common.BiomeManager.BiomeType type) {
int idx = type.ordinal();
java.util.List<net.minecraftforge.common.BiomeManager.BiomeEntry> list = (idx >= (net.minecraftforge.common.BiomeM... |
public void start(java.lang.String filepath, trips.CarActionsFilter... filter) {
java.util.Set<trips.CarActionsFilter> filters = new java.util.HashSet(java.util.Arrays.asList(filter));
streamer = new trips.DataStreamSimulator(filepath, filters);
streamer.addStreamListener(this::newAction);
streamer.star... | public void start(java.lang.String filepath, trips.CarActionsFilter... filter) {
java.util.Set<trips.CarActionsFilter> filters = new java.util.HashSet(java.util.Arrays.asList(filter));
streamer = new trips.DataStreamSimulator(filepath, filters);
streamer.addStreamListener(this);
streamer.startStreaming(... |
public void getUserFriendsValueEventListener() {
com.google.firebase.database.DatabaseReference mRefFriends = database.getReference("users").child(profile).child("friends");
mRefFriends.addValueEventListener(new com.google.firebase.database.ValueEventListener() {
@java.lang.Override
public void ... | public void getUserFriendsValueEventListener() {
mRefFriends.addValueEventListener(new com.google.firebase.database.ValueEventListener() {
@java.lang.Override
public void onDataChange(com.google.firebase.database.DataSnapshot dataSnapshot) {
for (com.google.firebase.database.DataSnapshot... |
public void onClick(android.view.View view) {
inputMethodManager.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
if (mOptionsVisible) {
animateOptionsOffScreen();
mOptionsVisible = !(mOptionsVisible);
}
android.location.Location mockLocation = new android.location.Location(LOC... | public void onClick(android.view.View view) {
inputMethodManager.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0);
if (mOptionsVisible) {
animateOptionsOffScreen();
mOptionsVisible = false;
}
android.location.Location mockLocation = new android.location.Location(LOCATION_SERVICE... |
public static com.tk_squared.varmint.tkkDataMod getInstance(android.app.Activity activity) {
if ((com.tk_squared.varmint.tkkDataMod.instance) == null) {
com.tk_squared.varmint.tkkDataMod.instance = new com.tk_squared.varmint.tkkDataMod();
com.tk_squared.varmint.tkkDataMod.instance.stations = new jav... | public static com.tk_squared.varmint.tkkDataMod getInstance(android.app.Activity activity) {
if ((com.tk_squared.varmint.tkkDataMod.instance) == null) {
com.tk_squared.varmint.tkkDataMod.instance = new com.tk_squared.varmint.tkkDataMod();
com.tk_squared.varmint.tkkDataMod.instance.stations = new jav... |
public void onLoadFinished(android.content.Loader<java.util.List<java.io.File>> loader, java.util.List<java.io.File> data) {
listViewAdapter = new kaist.cs550_2016.poche.PlaylistActivity.PlaylistAdapter(this, R.layout.activity_playlist_list_item, data);
playlistListView.setAdapter(listViewAdapter);
playlist... | public void onLoadFinished(android.content.Loader<java.util.List<java.io.File>> loader, java.util.List<java.io.File> data) {
listViewAdapter = new kaist.cs550_2016.poche.PlaylistActivity.PlaylistAdapter(this, R.layout.activity_playlist_list_item, data);
playlistListView.setAdapter(listViewAdapter);
if ((pla... |
public boolean equals(java.lang.Object o) {
boolean result = true;
if ((o != null) && (o instanceof de.aw.gv.CashUmsatz)) {
de.aw.gv.CashUmsatz cu = ((de.aw.gv.CashUmsatz) (o));
if ((mSplitBuchung) == null) {
result &= (cu.mSplitBuchung) == null;
}else {
result &=... | public boolean equals(java.lang.Object o) {
boolean result = false;
if ((o != null) && (o instanceof de.aw.gv.CashUmsatz)) {
de.aw.gv.CashUmsatz cu = ((de.aw.gv.CashUmsatz) (o));
if ((mSplitBuchung) == null) {
result = (cu.mSplitBuchung) == null;
}else {
result = ... |
private <T extends org.smof.element.Element> void createIndexes(java.lang.Class<T> elClass) {
final org.smof.parsers.TypeParser<T> typeMetadata = parser.getTypeParser(elClass);
final org.smof.collection.SmofCollection<T> collection = collections.getCollection(elClass);
for (org.smof.index.InternalIndex inde... | private <T extends org.smof.element.Element> void createIndexes(java.lang.Class<T> elClass) {
final org.smof.collection.SmofCollection<T> collection = collections.getCollection(elClass);
for (org.smof.index.InternalIndex index : parser.getIndexes(elClass)) {
collection.getMongoCollection().createIndex(i... |
public void testGetSegmentByValidId() throws gppmds.wikilegis.exception.SegmentException, org.json.JSONException {
gppmds.wikilegis.controller.SegmentController segmentController = gppmds.wikilegis.controller.SegmentController.getInstance(context);
segmentController.initControllerSegments();
gppmds.wikilegi... | public void testGetSegmentByValidId() throws gppmds.wikilegis.exception.SegmentException, org.json.JSONException {
gppmds.wikilegis.controller.SegmentController segmentController = gppmds.wikilegis.controller.SegmentController.getInstance(context);
segmentController.initControllerSegments();
gppmds.wikilegi... |
private void addLabelToLoop(boolean isWaitStmt) {
if (!isWaitStmt) {
increaseLoopCounter();
if (this.loopsLabels.get(this.currenLoop.getLast())) {
this.sb.append((("loop" + (this.loopCounter)) + ":"));
nlIndent();
}
}
} | private void addLabelToLoop() {
increaseLoopCounter();
if (this.loopsLabels.get(this.currenLoop.getLast())) {
this.sb.append((("loop" + (this.currenLoop.getLast())) + ":"));
nlIndent();
}
} |
public boolean getAnswerByQuestion(java.lang.String questionID) {
for (int i = 0; i < (ruleMap.size()); i++) {
if (ruleMap.get(ruleMap.keySet().toArray()[i]).contains(quastionID));
{
return answerCollection[i];
}
}
} | public boolean getAnswerByQuestion(java.lang.String questionID) {
for (int i = 0; i < (ruleMap.size()); i++) {
if (ruleMap.get(ruleMap.keySet().toArray()[i]).contains(questionID));
{
return ((boolean) (answerCollection.toArray()[i]));
}
}
} |
public void onBranchChoosen(com.hammwerk.wizardpager.core.BranchPage branchPage) {
com.hammwerk.wizardpager.core.Branch choosenBranch = branchPage.getSelectedBranch();
for (com.hammwerk.wizardpager.core.Page i : choosenBranch.getPages()) {
i.setPageListener(pageListener);
}
com.hammwerk.wizardpa... | public void onBranchChoosen(com.hammwerk.wizardpager.core.BranchPage branchPage) {
com.hammwerk.wizardpager.core.Branch choosenBranch = branchPage.getSelectedBranch();
for (com.hammwerk.wizardpager.core.Page i : choosenBranch.getPages()) {
i.setPageListener(pageListener);
}
com.hammwerk.wizardpa... |
public static void assertDataSourceContent(com.google.android.exoplayer2.upstream.DataSource dataSource, com.google.android.exoplayer2.upstream.DataSpec dataSpec, byte[] expectedData) throws java.io.IOException {
try {
long length = dataSource.open(dataSpec);
junit.framework.Assert.assertEquals(leng... | public static void assertDataSourceContent(com.google.android.exoplayer2.upstream.DataSource dataSource, com.google.android.exoplayer2.upstream.DataSpec dataSpec, byte[] expectedData) throws java.io.IOException {
try {
long length = dataSource.open(dataSpec);
junit.framework.Assert.assertEquals(expe... |
public T getById(int id) {
org.hibernate.Session session = hospital.repositories.DbSessionFactory.get();
try {
session.beginTransaction();
T entity = session.load(type, id);
org.hibernate.Hibernate.initialize(entity);
return entity;
} catch (java.lang.Exception e) {
j... | public T getById(int id) {
try {
session.beginTransaction();
T entity = session.load(type, id);
org.hibernate.Hibernate.initialize(entity);
return entity;
} catch (java.lang.Exception e) {
java.lang.System.out.println(e);
}
return null;
} |
public static play.mvc.Result getProjectList() throws org.ats.component.usersmgt.UserManagementException {
java.lang.String type = request().getQueryString("type");
java.lang.String group_id = request().getQueryString("group");
java.lang.String userText = request().getQueryString("user");
return ok(cont... | public static play.mvc.Result getProjectList() throws org.ats.component.usersmgt.UserManagementException {
java.lang.String type = request().getQueryString("type");
java.lang.String group_id = request().getQueryString("group");
java.lang.String userText = request().getQueryString("user");
return ok(cont... |
public boolean move(Board.Tile t) {
int tempX = t.getX();
int tempY = t.getY();
if (checkRoute(tempX, tempY)) {
this.x = t.getX();
this.y = t.getY();
return true;
}
return false;
} | public boolean move(Board.Tile t) {
int tempX = t.getX();
int tempY = t.getY();
if ((t.getType()) != 1)
return false;
if (checkRoute(tempX, tempY)) {
this.x = t.getX();
this.y = t.getY();
return true;
}
return false;
} |
public void testGetBalanceIsZeroAfterDeposit500ThenClose() {
double cash = 500;
model.Account instance = new model.Account();
instance.deposit(cash);
double expResult = 500.0;
double result = instance.getBalance();
assertEquals(expResult, result, 0.0);
expResult = 0.0;
instance.close();
... | public void testGetBalanceIsZeroAfterDeposit500ThenClose() {
double cash = 500;
model.Account instance = new model.Account();
instance.deposit(cash);
double expResult = 500.0;
double result = instance.getBalance();
assertEquals(expResult, result, 0.0);
expResult = 0.0;
instance.close();
... |
public void onBackPressed() {
if (com.jchingdev.squares.singleplayer.Chartboost.onBackPressed()) {
return ;
}else {
timer.cancel();
android.content.Intent intent = new android.content.Intent(this, com.jchingdev.squares.GameModeMenu.class);
finish();
startActivity(intent);... | public void onBackPressed() {
if (com.jchingdev.squares.singleplayer.Chartboost.onBackPressed()) {
return ;
}else {
if ((timer) != null)
timer.cancel();
android.content.Intent intent = new android.content.Intent(this, com.jchingdev.squares.GameModeMenu.class);
... |
private void goRoom(Command command) {
if (!(command.hasSecondWord())) {
java.lang.System.out.println("Go where?");
return ;
}
java.lang.String direction = command.getSecondWord();
Room nextRoom = currentRoom.getExit(direction);
if (nextRoom == null) {
java.lang.System.out.pr... | private void goRoom(Command command) {
if (!(command.hasSecondWord())) {
java.lang.System.out.println("Go where?");
return ;
}
java.lang.String direction = command.getSecondWord();
Room nextRoom = currentRoom.getExit(direction);
if (nextRoom == null) {
java.lang.System.out.pr... |
public void loadSettings(ccre.holders.TuningContext context) {
this.nudge = context.getFloat("Auto Mode Three Totes Nudge +A", 1.0F);
this.toteDistance = context.getFloat("Auto Mode Three Totes Tote Distance +A", 7.0F);
this.autoZoneDistance = context.getFloat("Auto Mode Three Totes Auto Zone Distance +A", ... | public void loadSettings(ccre.holders.TuningContext context) {
this.nudge = context.getFloat("Auto Mode Three Totes Nudge +A", 1.0F);
this.toteDistance = context.getFloat("Auto Mode Three Totes Tote Distance +A", 7.0F);
this.autoZoneDistance = context.getFloat("Auto Mode Three Totes Auto Zone Distance +A", ... |
public boolean onOptionsItemSelected(android.view.MenuItem item) {
switch (item.getItemId()) {
case R.id.profile :
android.content.Intent intent = new android.content.Intent(this, me.leops.hashtalk.activity.ProfileActivity.class);
intent.putExtra("account", mAccount);
int... | public boolean onOptionsItemSelected(android.view.MenuItem item) {
switch (item.getItemId()) {
case R.id.profile :
if ((mAccount) != null) {
android.content.Intent intent = new android.content.Intent(this, me.leops.hashtalk.activity.ProfileActivity.class);
intent.... |
public java.lang.Boolean validXY(int x, int y) {
return (((x >= 0) && (x < (board.length))) && ((y >= 0) && (y < (board.length)))) && ((board[x][y]) == 0);
} | public java.lang.Boolean validXY(int x, int y) {
return (((x >= 0) && (x < (board.length))) && ((y >= 0) && (y < (board[0].length)))) && ((board[x][y]) == 0);
} |
private org.joda.time.DateTime parseDate(int day, java.lang.Integer month, java.lang.Integer year, boolean end) {
return new org.joda.time.DateTime((year == null ? java.util.Calendar.getInstance().get(java.util.Calendar.YEAR) : year), (month == null ? (java.util.Calendar.getInstance().get(java.util.Calendar.MONTH))... | private org.joda.time.DateTime parseDate(int day, java.lang.Integer month, java.lang.Integer year, boolean end) {
return new org.joda.time.DateTime((year == null ? java.util.Calendar.getInstance().get(java.util.Calendar.YEAR) : year), (month == null ? java.util.Calendar.getInstance().get(java.util.Calendar.MONTH) :... |
public void skip_missingRepositoryUrl() throws java.io.IOException {
hudson.model.FreeStyleProject testProject = com.dabsquared.gitlabjenkins.webhook.build.PushBuildActionTest.jenkins.createFreeStyleProject();
testProject.addTrigger(trigger);
new com.dabsquared.gitlabjenkins.webhook.build.PushBuildAction(te... | public void skip_missingRepositoryUrl() throws java.io.IOException {
hudson.model.FreeStyleProject testProject = com.dabsquared.gitlabjenkins.webhook.build.PushBuildActionTest.jenkins.createFreeStyleProject();
testProject.addTrigger(trigger);
new com.dabsquared.gitlabjenkins.webhook.build.PushBuildAction(te... |
public static final com.sun.codemodel.JExpression getAnnotationMemberExpression(com.sun.codemodel.JAnnotationUse annotation, java.lang.String annotationMember) {
com.sun.codemodel.JAnnotationValue annotationValue = annotation.getAnnotationMembers().get(annotationMember);
if (annotationValue == null) {
r... | public static final com.sun.codemodel.JExpression getAnnotationMemberExpression(com.sun.codemodel.JAnnotationUse annotation, java.lang.String annotationMember) {
if (annotation == null) {
return null;
}
com.sun.codemodel.JAnnotationValue annotationValue = annotation.getAnnotationMembers().get(annota... |
public java.util.Set<org.openqa.selenium.WebDriver> closeAllDrivers() {
java.util.Collection<org.openqa.selenium.WebDriver> openDrivers = driverMap.values();
java.util.Set<org.openqa.selenium.WebDriver> closedDrivers = new java.util.HashSet<org.openqa.selenium.WebDriver>(openDrivers);
for (org.openqa.seleni... | public java.util.Set<org.openqa.selenium.WebDriver> closeAllDrivers() {
java.util.Collection<org.openqa.selenium.WebDriver> openDrivers = driverMap.values();
java.util.Set<org.openqa.selenium.WebDriver> closedDrivers = new java.util.HashSet(openDrivers);
for (org.openqa.selenium.WebDriver driver : openDrive... |
public void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
inflater.inflate(R.menu.menu, menu);
android.view.MenuItem searchItem = menu.findItem(R.id.search);
android.app.SearchManager searchManager = ((android.app.SearchManager) (getActivity().getSystemService(Context.SEA... | public void onCreateOptionsMenu(android.view.Menu menu, android.view.MenuInflater inflater) {
inflater.inflate(R.menu.menu, menu);
android.view.MenuItem searchItem = menu.findItem(R.id.search);
android.app.SearchManager searchManager = ((android.app.SearchManager) (getActivity().getSystemService(Context.SEA... |
public final void setTitleAt(int index, java.lang.String title) {
java.lang.String extra = getExtraTitleAt(index);
if (extra != null) {
if ((title == null) || ((title.length()) == 0)) {
title = extra;
}else {
title += " " + extra;
}
}
super.setTitleAt(inde... | public final void setTitleAt(int index, @org.jetbrains.annotations.Nullable
java.lang.String title) {
java.lang.String extra = getExtraTitleAt(index);
if (extra != null) {
if ((title == null) || (title.isEmpty())) {
title = extra;
}else {
title += " " + extra;
}
... |
public void testGetMapList_String() {
java.lang.System.out.println("getMapList");
java.lang.String sql = "select * from Servers";
org.jplus.hyb.database.crud.Hyberbin instance = new org.jplus.hyb.database.crud.Hyberbin();
java.util.List<java.util.Map> result = null;
try {
result = instance.g... | public void testGetMapList_String() {
java.lang.System.out.println("getMapList");
java.lang.String sql = "select * from Servers";
org.jplus.hyb.database.crud.Hyberbin instance = new org.jplus.hyb.database.crud.Hyberbin();
java.util.List<java.util.Map> result = null;
try {
result = instance.g... |
private java.util.Properties hibernateProperties() {
java.util.Properties props = new java.util.Properties();
props.setProperty("hibernate.dialect", environment.getRequiredProperty("nextrtc.db.dialect"));
props.setProperty("hibernate.hbm2ddl.auto", environment.getProperty("nextrtc.db.hbm2ddl", "validate"));... | private java.util.Properties hibernateProperties() {
java.util.Properties props = new java.util.Properties();
props.setProperty("hibernate.dialect", environment.getRequiredProperty("nextrtc.db.dialect"));
props.setProperty("hibernate.hbm2ddl.auto", environment.getProperty("nextrtc.db.hbm2ddl", "validate"));... |
private void removeNodeImpl(nodebox.client.Node node) {
com.google.common.base.Preconditions.checkNotNull(node, "Node to remove cannot be null.");
com.google.common.base.Preconditions.checkArgument(getActiveNetwork().hasChild(node), "Node to remove is not in active network.");
controller.removeNode(activeNe... | private void removeNodeImpl(nodebox.client.Node node) {
com.google.common.base.Preconditions.checkNotNull(node, "Node to remove cannot be null.");
com.google.common.base.Preconditions.checkArgument(getActiveNetwork().hasChild(node), "Node to remove is not in active network.");
if (node == (getActiveNode()))... |
public java.util.Set<org.sbolstandard.core2.TopLevel> getMembers() {
java.util.Set<org.sbolstandard.core2.TopLevel> result = new java.util.HashSet<>();
for (java.net.URI memberURI : members) {
org.sbolstandard.core2.TopLevel member = this.getDocument().getTopLevel(memberURI);
result.add(member);... | public java.util.Set<org.sbolstandard.core2.TopLevel> getMembers() {
java.util.Set<org.sbolstandard.core2.TopLevel> result = new java.util.HashSet<>();
for (java.net.URI memberURI : members) {
org.sbolstandard.core2.TopLevel member = this.getDocument().getTopLevel(memberURI);
if (member != null)... |
public static java.lang.String shortName(java.lang.String longName) {
final java.lang.String temp = longName.replace("$", ".");
if (temp.contains(".")) {
return temp.substring(((com.speedment.common.codegen.util.Formatting.stripGenerics(temp).lastIndexOf(".")) + 1));
}else {
return temp;
... | public static java.lang.String shortName(java.lang.String longName) {
final java.lang.String temp = com.speedment.common.codegen.util.Formatting.stripGenerics(longName.replace("$", "."));
if (temp.contains(".")) {
return temp.substring(((temp.lastIndexOf(".")) + 1));
}else {
return temp;
... |
private void parseBindingConfig(java.lang.String pvBindingConfig) throws org.openhab.model.item.binding.BindingConfigParseException {
java.lang.String[] lvConfigParts = pvBindingConfig.trim().split(";");
for (java.lang.String lvConfigPart : lvConfigParts) {
parseMaxWarning(lvConfigPart);
parseMi... | private void parseBindingConfig(java.lang.String pvBindingConfig) throws org.openhab.model.item.binding.BindingConfigParseException {
java.lang.String[] lvConfigParts = pvBindingConfig.trim().split(";");
for (java.lang.String lvConfigPart : lvConfigParts) {
parseMaxWarning(lvConfigPart);
parseMi... |
public int convertExif2Degress(int degreesConvert) {
int returnValue = 0;
if (degreesConvert == 90) {
returnValue = 90;
}else
if (degreesConvert == 180) {
returnValue = 180;
}else
if (degreesConvert == 270) {
returnValue = 270;
}els... | public int convertExif2Degress(int degreesConvert) {
int returnValue;
if (degreesConvert == 90) {
returnValue = 90;
}else
if (degreesConvert == 180) {
returnValue = 180;
}else
if (degreesConvert == 270) {
returnValue = 270;
}else {
... |
public long sumOfAllMultiples(int maximum, int factor1, int factor2) {
long sum = 0;
while (maximum > 0) {
if (utils.MathUtil.isMultiple(maximum, factor1)) {
sum += maximum;
}else
if (utils.MathUtil.isMultiple(maximum, factor2)) {
sum += maximum;
... | private long sumOfAllMultiples(int maximum, int factor1, int factor2) {
long sum = 0;
while (maximum > 0) {
if (utils.MathUtil.isMultiple(maximum, factor1)) {
sum += maximum;
}else
if (utils.MathUtil.isMultiple(maximum, factor2)) {
sum += maximum;
... |
protected void onSuccess(com.blango.cuber.fragment.grid.Palette palette) {
mPalette = new com.blango.cuber.fragment.grid.MaterialPalette(palette, getResources());
if (((getPosition()) > (-1)) && ((getPosition()) < (com.blango.cuber.fragment.grid.F2LFragment.cubes.size()))) {
com.blango.cuber.fragment.gr... | protected void onSuccess(com.blango.cuber.fragment.grid.Palette palette) {
mPalette = new com.blango.cuber.fragment.grid.MaterialPalette(palette, getResources());
com.blango.cuber.fragment.grid.F2LFragment.cubes.get(mSectionedAdapter.sectionedPositionToPosition(getPosition())).setPalette(mPalette);
bg.setBa... |
public com.supersuperstar.android.shopapi.ProductAdapter.ViewHolder onCreateViewHolder(android.view.ViewGroup parent, int viewType) {
mContext = parent.getContext();
android.widget.RelativeLayout v = ((android.widget.RelativeLayout) (android.view.LayoutInflater.from(mContext).inflate(R.layout.product_item, pare... | public com.supersuperstar.android.shopapi.ProductAdapter.ViewHolder onCreateViewHolder(android.view.ViewGroup parent, int viewType) {
mContext = parent.getContext();
android.widget.RelativeLayout v = ((android.widget.RelativeLayout) (android.view.LayoutInflater.from(mContext).inflate(R.layout.product_item, pare... |
public void create() {
no.tobkje.aagame.AAGame.GAME_WIDTH = 520;
no.tobkje.aagame.AAGame.SCREEN_WIDTH = Gdx.graphics.getWidth();
no.tobkje.aagame.AAGame.SCREEN_HEIGHT = Gdx.graphics.getHeight();
no.tobkje.aagame.AAGame.GAME_HEIGHT = (no.tobkje.aagame.AAGame.SCREEN_HEIGHT) / ((no.tobkje.aagame.AAGame.SCR... | public void create() {
no.tobkje.aagame.AAGame.GAME_WIDTH = 520;
no.tobkje.aagame.AAGame.SCREEN_WIDTH = Gdx.graphics.getWidth();
no.tobkje.aagame.AAGame.SCREEN_HEIGHT = Gdx.graphics.getHeight();
no.tobkje.aagame.AAGame.GAME_HEIGHT = (no.tobkje.aagame.AAGame.SCREEN_HEIGHT) / ((no.tobkje.aagame.AAGame.SCR... |
public org.bukkit.block.BlockFace getLeaveDirection(org.bukkit.block.Block trackBlock, org.bukkit.block.BlockFace enterDirection) {
int minAngle = 1000;
org.bukkit.block.BlockFace result = enterDirection;
for (org.bukkit.block.BlockFace possible : this.getPossibleDirections(trackBlock)) {
int angle ... | public org.bukkit.block.BlockFace getLeaveDirection(org.bukkit.block.Block trackBlock, org.bukkit.block.BlockFace enterDirection) {
int minAngle = 1000;
org.bukkit.block.BlockFace result = enterDirection;
for (org.bukkit.block.BlockFace possible : this.getPossibleDirections(trackBlock)) {
int angle ... |
public java.lang.String readString() throws javax.jms.JMSException {
this.throwIfWriteOnlyModeBody();
this.throwIfEOF();
try {
java.lang.Object obj = this.body.get(this.current_index);
return java.lang.String.valueOf(obj);
} finally {
(this.current_index)++;
}
} | public java.lang.String readString() throws javax.jms.JMSException {
this.throwIfWriteOnlyModeBody();
this.throwIfEOF();
java.lang.Object obj = this.body.get(this.current_index);
(this.current_index)++;
return java.lang.String.valueOf(obj);
} |
public void spielerHinzufuegen(classes.Spieler spieler) {
if (!(spielHatBegonnen)) {
if (spieler == null)
throw new java.lang.RuntimeException("Spieler existiert nicht!");
for (int i = 0; i < (this.spieler.size()); i++) {
if ((this.spieler.get(i).getFarbe()) == (spie... | public void spielerHinzufuegen(classes.Spieler spieler) {
if (!(spielHatBegonnen)) {
if (spieler == null)
throw new java.lang.RuntimeException("Spieler existiert nicht!");
for (int i = 0; i < (this.spieler.size()); i++) {
if ((this.spieler.get(i).getFarbe()) == (spie... |
public void onCreate() {
super.onCreate();
io.fabric.sdk.android.Fabric.with(this, new com.crashlytics.android.Crashlytics());
acr.browser.lightning.app.BrowserApp.mAppComponent = acr.browser.lightning.app.DaggerAppComponent.builder().appModule(new acr.browser.lightning.app.AppModule(this)).build();
acr... | public void onCreate() {
super.onCreate();
io.fabric.sdk.android.Fabric.with(this, new com.crashlytics.android.Crashlytics());
acr.browser.lightning.app.BrowserApp.mAppComponent = acr.browser.lightning.app.DaggerAppComponent.builder().appModule(new acr.browser.lightning.app.AppModule(this)).build();
acr... |
public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
inflateView(inflater, container);
if ((savedInstanceState != null) && (savedInstanceState.con... | public android.view.View onCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState) {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
inflateView(inflater, container);
disableScreenRotation();
initDisplay();
initWeekDay... |
private static void printMenu() {
java.lang.StringBuffer buf = new java.lang.StringBuffer();
buf.append("Welcome to Employee Salary System, please choose from the following:");
buf.append(honkot.java.foundation.training.Chapter10_2.LF);
buf.append(" 1. Create an employee.");
buf.append(java.lang.Sys... | private static void printMenu() {
java.lang.StringBuffer buf = new java.lang.StringBuffer();
buf.append("Welcome to Employee Salary System, please choose from the following:");
buf.append(honkot.java.foundation.training.Chapter10_2.LF);
buf.append(" 1. Create an employee.");
buf.append(honkot.java.f... |
public java.lang.String getCommonExtension() {
java.util.Map.Entry<java.lang.String, java.lang.Integer> largest = null;
for (java.util.Map.Entry<java.lang.String, java.lang.Integer> entry : extensionCount.entrySet()) {
if ((largest == null) || ((largest.getValue()) < (entry.getValue()))) {
l... | public java.lang.String getCommonExtension() {
java.util.Map.Entry<java.lang.String, java.lang.Integer> largest = null;
for (java.util.Map.Entry<java.lang.String, java.lang.Integer> entry : extensionCount.entrySet()) {
if ((largest == null) || ((largest.getValue()) < (entry.getValue()))) {
l... |
public static java.lang.String[] decodePathSegments(java.lang.String path) {
java.lang.String[] result = path.split("/");
for (int i = 0; i < (result.length); i++) {
result[i] = rosa.iiif.image.core.UriUtil.decodePathSegment(result[i]);
}
return result;
} | public static java.lang.String[] decodePathSegments(java.lang.String path) {
java.lang.String[] result = path.substring(1).split("/");
for (int i = 0; i < (result.length); i++) {
result[i] = rosa.iiif.image.core.UriUtil.decodePathSegment(result[i]);
}
return result;
} |
public void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == (com.freshmen.wtgf.App.DetailActivity.RECOVERY_DIALOG_REQUEST)) {
getYouTubePlayerProvider().initialize(Config.DEVELOPER_KEY, this);
... | public void onActivityResult(int requestCode, int resultCode, android.content.Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == (com.freshmen.wtgf.App.DetailActivity.RECOVERY_DIALOG_REQUEST)) {
getYouTubePlayerProvider().initialize(Config.DEVELOPER_KEY, this);
... |
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {
try {
java.lang.Integer.parseInt(ID.getText());
java.lang.Integer.parseInt(PhoneNumber.getText());
java.lang.Double.parseDouble(Salary.getText());
java.lang.Double.parseDouble(SSK.getText());
doClose(accou... | private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {
try {
java.lang.Integer.parseInt(ID.getText());
java.lang.Double.parseDouble(Salary.getText());
java.lang.Double.parseDouble(SSK.getText());
doClose(accounting.software.GUIStaffs.AddPersonnelDialog.RET_OK);
} ... |
public java.util.Map<java.lang.String, java.lang.Double> getLabelDistribution(FV featureVector) {
if ((labelDistributionMap) == null) {
java.lang.System.err.println("WekaClassifierWrapper: no model created yet");
return null;
}
if ((labelDistributionMap.get(featureVector)) == null) {
... | public java.util.Map<java.lang.String, java.lang.Double> getLabelDistribution(FV featureVector) {
if ((labelDistributionMap) == null) {
java.lang.System.err.println("WekaClassifierWrapper: no model created yet");
return null;
}
if ((labelDistributionMap.get(featureVector)) == null) {
... |
public boolean equals(com.gpteam.shopmanager.Time.Date otherDate) {
return (((getYear()) == (otherDate.getYear())) && ((getMonth()) == (otherDate.getMonth()))) && ((getDay()) == (otherDate.getDay()));
} | public boolean equals(com.gpteam.shopmanager.Time.Date otherDate) {
return (((getYear()) == (otherDate.getYear())) && ((getMonth()) == ((otherDate.getMonth()) + 1))) && ((getDay()) == (otherDate.getDay()));
} |
public double getmeanwaitingtime() {
double totalwaitingtime = 0;
for (int i = 0; i < ((waitingtimes.size()) - 1); i++) {
totalwaitingtime += waitingtimes.get(i);
}
return totalwaitingtime / (q.gettraitedClientsNumber());
} | public double getmeanwaitingtime() {
double totalwaitingtime = 0;
for (int i = 0; i < ((waitingtimes.size()) - 1); i++) {
totalwaitingtime += waitingtimes.get(i);
}
return totalwaitingtime / (waitingtimes.size());
} |
public static void deleteGig(int id) {
org.hibernate.Session session = com.rh.gigs.GigDao.sessionFactory.openSession();
com.rh.gigs.Gig gig = session.get(com.rh.gigs.Gig.class, id);
session.beginTransaction();
session.delete(gig);
session.getTransaction().commit();
session.close();
} | public static void deleteGig(int id) {
org.hibernate.Session session = com.rh.gigs.GigDao.sessionFactory.openSession();
com.rh.gigs.Gig gig = session.get(com.rh.gigs.Gig.class, id);
if (gig != null) {
session.beginTransaction();
session.delete(gig);
session.getTransaction().commit();... |
public void testValidNullFatherName() {
java.lang.String validFatherName = null;
try {
student = new model.Student("Jacó Mario Souza", cpf, rg, date, email, address, phone1, phone2, "Milene Souza Medeiros", validFatherName);
assertEquals("", student.getFatherName());
} catch (exception.Stude... | public void testValidNullFatherName() {
java.lang.String validFatherName = null;
try {
student = new model.Student("Jacó Mario Souza", cpf, rg, date, email, address, phone1, phone2, "Milene Souza Medeiros", validFatherName, 1);
assertEquals("", student.getFatherName());
} catch (exception.St... |
public void run() {
this.conectionHandler = this.server.getConnectionHandlerFactory().create(this);
this.conectionHandler.handleConnection(this.socket, this.getServerSocket());
closeConnection();
this.serverThread.sessionEnded(this);
} | public void run() {
this.conectionHandler = this.server.getConnectionHandlerFactory().create(this);
this.conectionHandler.handleConnection(this.socket, this.getServerSocket());
this.closeConnection();
this.serverThread.sessionEnded(this);
} |
public java.util.List<Client> getClients() {
try (Connection con = DB.sql2o.open()) {
java.lang.String sql = "SELECT * FROM clients WHERE stylistid = :id;";
java.util.List<Client> clients = con.createQuery(sql).addParameter("id", this.id).executeAndFetch(Client.class);
return clients;
}
... | public java.util.List<Client> getClients() {
try (Connection con = DB.sql2o.open()) {
java.lang.String sql = "SELECT * FROM clients WHERE stylistid = :id;";
java.util.List<Client> clients = con.createQuery(sql).addParameter("id", id).executeAndFetch(Client.class);
return clients;
}
} |
public static void trackRankingTerm(android.content.Context context, java.util.Date start, java.util.Date end) {
android.os.Bundle payload = new android.os.Bundle();
payload.putString(FirebaseAnalytics.Param.START_DATE, start.toString());
payload.putString(FirebaseAnalytics.Param.END_DATE, end.toString());
... | public static void trackRankingTerm(android.content.Context context, java.util.Date start, java.util.Date end) {
android.os.Bundle payload = new android.os.Bundle();
if (start != null) {
payload.putString(FirebaseAnalytics.Param.START_DATE, start.toString());
}
if (end != null) {
payload... |
public void stopGeofenceMonitoring() {
com.backendless.GeoFenceMonitoring geoFenceMonitoring = ((com.backendless.GeoFenceMonitoring) (com.backendless.LocationTracker.getInstance().getListener(GeoFenceMonitoring.NAME)));
if (geoFenceMonitoring == null) {
return ;
}
geoFenceMonitoring.removeGeoFen... | public void stopGeofenceMonitoring() {
if ((com.backendless.LocationTracker.getInstance()) == null)
return ;
com.backendless.GeoFenceMonitoring geoFenceMonitoring = ((com.backendless.GeoFenceMonitoring) (com.backendless.LocationTracker.getInstance().getListener(GeoFenceMonitoring.NAME)));
if (g... |
public boolean evaluate(ch.qos.logback.classic.spi.ILoggingEvent event) throws ch.qos.logback.core.boolex.EvaluationException, java.lang.NullPointerException {
java.util.Date now = new java.util.Date();
double timeElapsed = ((now.getTime()) - (lastSync.getTime())) / 1000.0;
if (timeElapsed > (logSendingInte... | public boolean evaluate(ch.qos.logback.classic.spi.ILoggingEvent event) throws ch.qos.logback.core.boolex.EvaluationException, java.lang.NullPointerException {
java.util.Date now = new java.util.Date();
double timeElapsed = ((now.getTime()) - (lastSync.getTime())) / 1000.0;
if ((timeElapsed > (logSendingInt... |
public void onScroll(android.widget.AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
org.androidfromfrankfurt.archnews.NewsActivity newsActivity = org.androidfromfrankfurt.archnews.NewsActivity.getThis();
android.app.ActionBar actionBar = newsActivity.getActionBar();
if ((... | public void onScroll(android.widget.AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
android.app.ActionBar actionBar = org.androidfromfrankfurt.archnews.NewsActivity.getThis().getActionBar();
if (((mLastFirstVisibleItem) < firstVisibleItem) && (actionBar.isShowing())) {
... |
public void endMove(jumpingalien.model.Direction direction) {
assert (direction == (Direction.LEFT)) || (direction == (Direction.RIGHT));
assert isMoving(direction);
assert !(isMoving(oppositeDirection(direction)));
setHorVelocity(0);
setHorDirection(Direction.NULL);
setHorAcceleration(0);
g... | public void endMove(jumpingalien.model.Direction direction) {
assert (direction == (Direction.LEFT)) || (direction == (Direction.RIGHT));
assert !(isMoving(oppositeDirection(direction)));
setHorVelocity(0);
setHorDirection(Direction.NULL);
setHorAcceleration(0);
getSpritesTimer().reset();
} |
public void test_should_call_onViewReady_with_pops_out_on_home_page_on_back_navigation() throws java.lang.Throwable {
navigationManager.navigate(this).to(com.shipdream.lib.android.mvc.view.viewpager.SubFragment.class.getSimpleName());
waitTest(1200);
lifeCycleValidator.reset();
navigationManager.navigat... | public void test_should_call_onViewReady_with_pops_out_on_home_page_on_back_navigation() throws java.lang.Throwable {
navigationManager.navigate(this).to(com.shipdream.lib.android.mvc.view.viewpager.SubFragment.class.getSimpleName());
waitTest(1200);
lifeCycleValidator.reset();
navigationManager.navigat... |
public void testFetchNoContent() throws com.fasterxml.jackson.core.JsonProcessingException, net.nuagenetworks.bambou.RestException {
startSession(restOperations, "object/childobject", HttpMethod.GET, HttpStatus.OK, null, null);
net.nuagenetworks.bambou.testobj.TestObject object = new net.nuagenetworks.bambou.te... | public void testFetchNoContent() throws com.fasterxml.jackson.core.JsonProcessingException, net.nuagenetworks.bambou.RestException {
startSession(restOperations, "object/childobject", HttpMethod.GET, HttpStatus.OK, null, null);
net.nuagenetworks.bambou.testobj.TestObject object = new net.nuagenetworks.bambou.te... |
private void populate() {
label.setText(((java.lang.String) (fileStruct.getValue("name"))));
switch (fileStruct.getType()) {
case FILE :
image.setImage(edu.wright.cs.jfiles.gui.common.FileIconViewController.fileImage);
break;
case DIRECTORY :
image.setImage(ed... | private void populate() {
label.setText(((java.lang.String) (fileStruct.getValue("name"))));
switch (fileStruct.getType()) {
case FILE :
break;
case DIRECTORY :
image.setImage(edu.wright.cs.jfiles.gui.common.FileIconViewController.directoryImage);
break;
... |
public void processData(fx.networking.nio.NIOServer server, java.nio.channels.SocketChannel socket, byte[] data, int count) {
byte[] dataCopy = new byte[count];
java.lang.System.arraycopy(data, 0, dataCopy, 0, count);
queue.add(new fx.networking.nio.ServerDataEvent(server, socket, data));
} | public void processData(fx.networking.nio.NIOServer server, java.nio.channels.SocketChannel socket, byte[] data, int count) {
byte[] dataCopy = new byte[count];
java.lang.System.arraycopy(data, 0, dataCopy, 0, count);
queue.add(new fx.networking.nio.ServerDataEvent(server, socket, dataCopy));
} |
public void testCase4() {
me.chiwang.leetcode.ListNode l1 = me.chiwang.leetcode.ListNodes.getListNodes(1, 2, 3, 4, 5);
solution.reverseKGroup(l1, 4);
me.chiwang.leetcode.ListNode l2 = me.chiwang.leetcode.ListNodes.getListNodes(4, 3, 2, 1, 5);
assertListNodeEquals(l2, l1);
} | public void testCase4() {
me.chiwang.leetcode.ListNode l1 = me.chiwang.leetcode.ListNodes.getListNodes(1, 2, 3, 4, 5);
l1 = solution.reverseKGroup(l1, 4);
me.chiwang.leetcode.ListNode l2 = me.chiwang.leetcode.ListNodes.getListNodes(4, 3, 2, 1, 5);
assertListNodeEquals(l2, l1);
} |
protected void resizeAxis() {
int minSize = ((labelMaxWidth) + (fr.inria.soctrace.tools.ocelotl.visualizations.temporal.proportion.views.ProportionAxisView.TextPositionOffset)) + ((areaWidth) - (mainLineXPosition));
if (minSize > (areaWidth)) {
ocelotlView.getMainViewTopSashform().setWeights(new int[]{ ... | protected void resizeAxis() {
int minSize = ((labelMaxWidth) + (fr.inria.soctrace.tools.ocelotl.visualizations.temporal.proportion.views.ProportionAxisView.TextPositionOffset)) + ((areaWidth) - (mainLineXPosition));
if (((areaWidth) < minSize) && (((ocelotlView.getMainViewTopSashform().getSize().x) - minSize) >... |
public void shouldOpenGraphUsingConfiguration() throws java.lang.InterruptedException {
java.util.Map<java.lang.String, java.lang.Object> map = new java.util.HashMap<java.lang.String, java.lang.Object>();
map.put(org.janusgraph.graphdb.STORAGE_BACKEND.toStringWithoutRoot(), "inmemory");
map.put(org.janusgra... | public void shouldOpenGraphUsingConfiguration() throws java.lang.InterruptedException {
java.util.Map<java.lang.String, java.lang.Object> map = new java.util.HashMap<java.lang.String, java.lang.Object>();
map.put(org.janusgraph.graphdb.STORAGE_BACKEND.toStringWithoutRoot(), "inmemory");
map.put(org.janusgra... |
public java.util.ArrayList<java.util.ArrayList<java.lang.String>> executeUserStatement(java.lang.String statement) throws de.tu_bs.cs.ifis.sqlgame.exception.MySQLAlchemistException {
if ((this.tmpDbConn) == null) {
java.lang.System.out.println("jafiuhiebn");
}
java.util.ArrayList<java.util.ArrayList... | public java.util.ArrayList<java.util.ArrayList<java.lang.String>> executeUserStatement(java.lang.String statement) throws de.tu_bs.cs.ifis.sqlgame.exception.MySQLAlchemistException {
java.util.ArrayList<java.util.ArrayList<java.lang.String>> result = this.tmpDbConn.executeSQLSelectStatement(this.conf.getString("aut... |
static net.time4j.format.expert.AttributeSet createDefaults(net.time4j.engine.Chronology<?> chronology, java.util.Locale locale) {
net.time4j.format.Attributes.Builder builder = new net.time4j.format.Attributes.Builder(chronology);
builder.set(Attributes.LENIENCY, Leniency.SMART);
builder.set(Attributes.TEX... | static net.time4j.format.expert.AttributeSet createDefaults(net.time4j.engine.Chronology<?> chronology, java.util.Locale locale) {
net.time4j.format.Attributes.Builder builder = new net.time4j.format.Attributes.Builder(chronology);
builder.set(Attributes.LENIENCY, Leniency.SMART);
builder.set(Attributes.TEX... |
public com.atlas.entity.User getUserByEmail(java.lang.String email) {
org.hibernate.Query query = sessionFactory.getCurrentSession().createQuery("from User u where str(u.email) = :searchTerm");
@java.lang.SuppressWarnings(value = "unchecked")
java.util.List<com.atlas.entity.User> user = query.setParameter("... | public com.atlas.entity.User getUserByEmail(java.lang.String email) {
org.hibernate.Query query = sessionFactory.getCurrentSession().createQuery("from User u where str(u.email) = :searchTerm");
@java.lang.SuppressWarnings(value = "unchecked")
java.util.List<com.atlas.entity.User> user = query.setParameter("... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.