id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
35,701
final TextView text1; public LabelHolder(final View itemView) { super(itemView); text1 = V.get(itemView, android.R.id.text1); } <BUG>} class LabelAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private List<Label> labels; public LabelAdapter() { labels = S.getDb().listAllLabels(); }</BUG> @Override
class LabelAdapter extends MaterialDialogAdapterHelper.Adapter { private List<Label> availableLabels = S.getDb().listAllLabels();
35,702
public LabelAdapter() { labels = S.getDb().listAllLabels(); }</BUG> @Override public int getItemCount() { <BUG>return 1 + labels.size(); </BUG> } @Override public RecyclerView.ViewHolder onCreateViewHolder(final ViewGroup parent, final int viewType) {
final TextView text1; public LabelHolder(final View itemView) { super(itemView); text1 = V.get(itemView, android.R.id.text1); class LabelAdapter extends MaterialDialogAdapterHelper.Adapter { private List<Label> availableLabels = S.getDb().listAllLabels(); return 1 + availableLabels.size();
35,703
public void onBindViewHolder(final RecyclerView.ViewHolder _holder_, final int position) { final int type = getItemViewType(position); final LabelHolder holder = (LabelHolder) _holder_; { if (type == 0) { <BUG>final Label label = labels.get(position - 1); </BUG> holder.text1.setText(label.title); U.applyLabelColor(labe...
final Label label = availableLabels.get(position - 1);
35,704
U.applyLabelColor(label, holder.text1); } else { holder.text1.setText(context.getString(R.string.create_label_titik3)); } } <BUG>holder.itemView.setOnClickListener(v -> { final int which = holder.getAdapterPosition();</BUG> if (which == 0) { // new label LabelEditorDialog.show(context, "", context.getString(R.string.cr...
dismissDialog(); final int which = holder.getAdapterPosition();
35,705
labels.add(newLabel); setLabelsText(); } }); } else { <BUG>final Label label = labels.get(position - 1); </BUG> labels.add(label); setLabelsText(); }
[DELETED]
35,706
defaultColumnWidth.put(c, defaultWidth); } } } this.setConvertedValue(cell, tableCell); <BUG>this.setCellStyle(styleHeader, styleBody, styleFooter, cell, tableCell, wb); </BUG> c++; } r++;
this.setCellStyle(styleHeader, styleBody, styleFooter, cell, tableCell, wb, dataFormat, cellStyle);
35,707
if(tableCell.isBold()){ Font font = wb.createFont(); font.setBoldweight(Font.BOLDWEIGHT_BOLD); style.setFont(font); } <BUG>if (tableCell.getCellType() == CellType.BRL_TYPE) { final DataFormat dataFormat = wb.createDataFormat(); final CellStyle cellStyle = wb.createCellStyle(); cellStyle.cloneStyleFrom(style); cellStyle...
cellStyle = getBrlCellStyle(dataFormat, style, cellStyle);
35,708
if (second >= 60) { fail("timeout"); } try { if (selenium.isVisible( <BUG>"//div[@class='lfr-component lfr-menu-list']/ul/li[6]/a")) { </BUG> break; } }
if (selenium.isVisible("link=Asset Publisher Test Page")) {
35,709
selenium.saveScreenShotAndSource(); selenium.clickAt("link=Asset Publisher Test Page", RuntimeVariables.replace("Asset Publisher Test Page")); selenium.waitForPageToLoad("30000"); selenium.saveScreenShotAndSource(); <BUG>assertEquals(RuntimeVariables.replace("More\u2026"), selenium.getText("//a[@id='_145_addApplication...
assertTrue(selenium.isPartialText("//a[@id='_145_addApplication']", "More")); RuntimeVariables.replace("More")); for (int second = 0;; second++) {
35,710
import jetbrains.mps.project.structure.modules.ModuleReference; import jetbrains.mps.reloading.ClassLoaderManager; import jetbrains.mps.smodel.*; import jetbrains.mps.util.Computable; import jetbrains.mps.util.Condition; <BUG>import jetbrains.mps.util.ConditionalIterable; import jetbrains.mps.workbench.actions.goTo.ind...
import jetbrains.mps.workbench.action.BaseAction; import jetbrains.mps.workbench.actions.goTo.index.MPSChooseSNodeDescriptor;
35,711
import java.awt.Frame; import java.util.ArrayList; import java.util.List; public class ImportHelper { public static void addModelImport(final Project project, final IModule module, final SModelDescriptor model, <BUG>@Nullable ShortcutSet checkboxShortcut) { BaseModelModel goToModelModel = new BaseModelModel(project) {<...
@Nullable BaseAction parentAction) { BaseModelModel goToModelModel = new BaseModelModel(project) {
35,712
@Nullable public String getPromptText() { return "Import model:"; } }; <BUG>ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToModelModel); if (checkboxShortcut != null) { popup.setCheckBoxShortcut(checkboxShortcut); }</BUG> popup.invoke(new ChooseByNamePopupComponent.Callback() {
ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToModelModel, parentAction);
35,713
((NavigationItem) element).navigate(true); } }, ModalityState.current(), true); } public static void addLanguageImport(Project project, final IModule contextModule, final SModelDescriptor model, <BUG>@Nullable ShortcutSet checkboxShortcut) { BaseLanguageModel goToLanguageModel = new BaseLanguageModel(project) {</BUG> p...
@Nullable BaseAction parentAction) { BaseLanguageModel goToLanguageModel = new BaseLanguageModel(project) {
35,714
@Nullable public String getPromptText() { return "Import language:"; } }; <BUG>ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToLanguageModel); if (checkboxShortcut != null) { popup.setCheckBoxShortcut(checkboxShortcut); }</BUG> popup.invoke(new ChooseByNamePopupComponent.Callback() {
ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToLanguageModel, parentAction);
35,715
@Nullable public String getPromptText() { return "Import model that contains root:"; } }; <BUG>ChooseByNamePopup popup = MpsPopupFactory.createNodePopup(project, goToNodeModel, initialText); if (checkboxShortcut != null) { popup.setCheckBoxShortcut(checkboxShortcut); }</BUG> popup.invoke(new ChooseByNamePopupComponent...
return "Import language:"; ChooseByNamePopup popup = MpsPopupFactory.createPackagePopup(project, goToLanguageModel, parentAction);
35,716
import org.exoplatform.calendar.util.Constants; import org.exoplatform.services.jcr.util.IdGenerator; import org.exoplatform.services.organization.OrganizationService; public class Calendar extends AbstractModel { private static final long serialVersionUID = 2638692203625602436L; <BUG>public enum Type implements Calend...
public enum Type { PERSONAL(0),
35,717
private boolean hasChildren = false; public static final String CALENDAR_PREF = "calendar"; public Calendar() { this(CALENDAR_PREF + IdGenerator.generate()); } <BUG>public Calendar(String compositeId) { this(compositeId, null); } public Calendar(String id, CalendarType type) { super(id);</BUG> timeZone = TimeZone.getDe...
super(compositeId);
35,718
} public Calendar(String id, CalendarType type) { super(id);</BUG> timeZone = TimeZone.getDefault().getID(); locale = Locale.getDefault().getISO3Country(); <BUG>if (type != null) { setCalendarType(type); }</BUG> } public String getName() {
public Calendar(String compositeId) { super(compositeId);
35,719
return hasChildren; } public void setHasChildren(boolean children) { this.hasChildren = children; } <BUG>public void setCalendarType(CalendarType type) { this.calendarType = type; } public CalendarType getCalendarType() { return calendarType; }</BUG> public boolean canEdit(String username) {
[DELETED]
35,720
package org.exoplatform.calendar.storage; <BUG>import org.exoplatform.calendar.service.CalendarType;</BUG> public interface Storage { public String getId(); public CalendarDAO getCalendarDAO(); public EventDAO getEventDAO(); }
[DELETED]
35,721
public Calendar remove(String id) { Calendar calendar = getById(id); if (calendar == null) { return null; } <BUG>if (calendar.getCalendarType() == Calendar.Type.PERSONAL) { </BUG> try { dataStorage.removeUserCalendar(calendar.getCalendarOwner(), id); } catch (Exception ex) {
if (calendar.getCalType() == Calendar.Type.PERSONAL.type()) {
35,722
try { dataStorage.removeUserCalendar(calendar.getCalendarOwner(), id); } catch (Exception ex) { LOG.error(ex); } <BUG>} else if (calendar.getCalendarType() == Calendar.Type.GROUP) { </BUG> try { dataStorage.removeGroupCalendar(id); } catch (Exception ex) {
} else if (calendar.getCalType() == Calendar.Type.GROUP.type()) {
35,723
if (type == Calendar.Type.PERSONAL) { </BUG> dataStorage.removeUserEvent(cal.getCalendarOwner(), cal.getId(), id); <BUG>} else if (type == Calendar.Type.GROUP) { </BUG> dataStorage.removePublicEvent(cal.getId(), id); } else { return null; }
Event event = this.getById(id); if (event == null) { Calendar cal = context.getCalendarDAO().getById(event.getCalendarId()); int type = cal.getCalType(); if (type == Calendar.Type.PERSONAL.type()) { } else if (type == Calendar.Type.GROUP.type()) {
35,724
package org.secuso.privacyfriendlytodolist.view; <BUG>import android.content.SharedPreferences; import android.os.Bundle;</BUG> import android.preference.EditTextPreference; import android.preference.ListPreference; import android.preference.Preference;
import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; import android.os.Bundle;
35,725
}); dialog.show(); } else { initActivity(); } <BUG>} void initActivity() { dbHelper = DatabaseHelper.getInstance(this); getTodoLists(true);</BUG> Bundle extras = getIntent().getExtras();
public void setUnlockedState(boolean isUnlocked) { this.isUnlocked = isUnlocked; this.isUnlocked = true; getTodoLists(true);
35,726
setFragment(fragment); } else { TodoListsFragment todoListOverviewFragment = new TodoListsFragment(); setFragment(todoListOverviewFragment); } <BUG>guiSetup(); }</BUG> public void setFragment(Fragment fragment) { if(fragment == null) return;
this.isInitialized = true;
35,727
bundle.putInt(TodoList.UNIQUE_DATABASE_ID, dummyList.getId()); bundle.putBoolean(TodoTasksFragment.SHOW_FLOATING_BUTTON, false); fragment.setArguments(bundle); setFragment(fragment); } else if (id == R.id.nav_about) { <BUG>Intent intent = new Intent(this, AboutActivity.class); startActivity(intent);</BUG> } else if (id...
this.unlockUntil = System.currentTimeMillis() + UnlockPeriod; startActivity(intent);
35,728
} else { super.onBackPressed(); } } public ArrayList<TodoList> getTodoLists(boolean reload) { <BUG>if (reload) todoLists = DBQueryHandler.getAllToDoLists(dbHelper.getReadableDatabase()); return todoLists;</BUG> }
if (reload) { if (dbHelper != null) return todoLists;
35,729
if(worldIn.getTileEntity(pos) != null){ TileEntity te = worldIn.getTileEntity(pos); if(te.hasCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null) && te.getCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null).getTemp() >= -273D + mult){ te.getCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null).addHeat(-mult); } <...
if(te.hasCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null)){ te.getCapability(Capabilities.HEAT_HANDLER_CAPABILITY, null).addHeat(mult);
35,730
public static double betterRound(double numIn, int decPlac){ double opOn = Math.round(numIn * Math.pow(10, decPlac)) / Math.pow(10D, decPlac); return opOn; } public static double centerCeil(double numIn, int tiers){ <BUG>return ((numIn > 0) ? Math.ceil(numIn * tiers) : Math.floor(numIn * tiers)) / tiers; </BUG> } publi...
return ((numIn > 0) ? Math.ceil(numIn * (double) tiers) : Math.floor(numIn * (double) tiers)) / (double) tiers;
35,731
package com.Da_Technomancer.crossroads.API; import com.Da_Technomancer.crossroads.API.DefaultStorageHelper.DefaultStorage; import com.Da_Technomancer.crossroads.API.heat.DefaultHeatHandler; import com.Da_Technomancer.crossroads.API.heat.IHeatHandler; import com.Da_Technomancer.crossroads.API.magic.DefaultMagicHandler; ...
import com.Da_Technomancer.crossroads.API.rotary.DefaultAxleHandler; import com.Da_Technomancer.crossroads.API.rotary.DefaultCogHandler; import com.Da_Technomancer.crossroads.API.rotary.IAxleHandler; import com.Da_Technomancer.crossroads.API.rotary.ICogHandler;
35,732
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; public class Capabilities{ @CapabilityInject(IHeatHandler.class) <BUG>public static Capability<IHeatHandler> HEAT_HANDLER_CAPABILITY ...
@CapabilityInject(IAxleHandler.class) public static Capability<IAxleHandler> AXLE_HANDLER_CAPABILITY = null; @CapabilityInject(ICogHandler.class) public static Capability<ICogHandler> COG_HANDLER_CAPABILITY = null;
35,733
public IEffect getMixEffect(Color col){ if(col == null){ return effect; } int top = Math.max(col.getBlue(), Math.max(col.getRed(), col.getGreen())); <BUG>if(top < rand.nextInt(128) + 128){ return voidEffect;</BUG> } return effect; }
if(top != 255){ return voidEffect;
35,734
public interface UserModel { String TABLE_NAME = "user"; String BALANCE = "balance"; String CREATE_TABLE = "" + "CREATE TABLE user (\n" <BUG>+ " balance BLOB NOT NULL\n" </BUG> + ")"; User.Money balance(); final class Mapper<T extends UserModel> {
+ " balance TEXT NOT NULL\n"
35,735
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG>...
public class ErrorController { @RequestMapping(value = {"/404"})
35,736
import de.vanita5.twittnuker.receiver.NotificationReceiver; import de.vanita5.twittnuker.service.LengthyOperationsService; import de.vanita5.twittnuker.util.ActivityTracker; import de.vanita5.twittnuker.util.AsyncTwitterWrapper; import de.vanita5.twittnuker.util.DataStoreFunctionsKt; <BUG>import de.vanita5.twittnuker.u...
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
35,737
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
35,738
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getExcepti...
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
35,739
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
35,740
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.form...
if (deleteImage) { Utils.deleteMedia(context, imageUri);
35,741
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, S...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
35,742
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.for...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
35,743
import de.vanita5.twittnuker.annotation.CustomTabType; import de.vanita5.twittnuker.library.MicroBlog; import de.vanita5.twittnuker.library.MicroBlogException; import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus; import de.vanita5.twittnuker.library.twitter.model.Status; <BUG>import de.vanita5.twittnuker...
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
35,744
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
35,745
import java.util.List; import java.util.Map.Entry; import javax.inject.Singleton; import okhttp3.Dns; @Singleton <BUG>public class TwidereDns implements Constants, Dns { </BUG> private static final String RESOLVER_LOGTAG = "TwittnukerDns"; private final SharedPreferences mHostMapping; private final SharedPreferencesWra...
public class TwidereDns implements Dns, Constants {
35,746
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
35,747
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args...
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
35,748
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, s...
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
35,749
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task...
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
35,750
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField +...
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
35,751
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.e...
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
35,752
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
35,753
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
35,754
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
35,755
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() ...
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
35,756
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args...
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
35,757
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, s...
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
35,758
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task...
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
35,759
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField +...
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
35,760
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.e...
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
35,761
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
35,762
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
35,763
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
35,764
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() ...
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
35,765
import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPHeader; import org.apache.commons.lang.StringUtils; import com.nortal.jroad.client.enums.XroadObjectType; import com.nortal.jroad.client.service.configuration.BaseXRoadServiceConfiguration; <BUG>import com.nortal.jroad.client.service.configuration.XRoadServ...
import com.nortal.jroad.enums.XRoadProtocolVersion; private XRoadProtocolVersion protocol = XRoadProtocolVersion.V4_0; @Override
35,766
public class XRoadProtocolNamespaceStrategyV4 extends MessageCallbackNamespaceStrategy { @Override</BUG> public void addNamespaces(SOAPEnvelope env) throws SOAPException { env.addNamespaceDeclaration("xsd", "http://www.w3.org/2001/XMLSchema"); env.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instanc...
private XRoadProtocolVersion protocol = XRoadProtocolVersion.V4_0; env.addNamespaceDeclaration(protocol.getNamespacePrefix(), protocol.getNamespaceUri()); env.addNamespaceDeclaration("id", "http://x-road.eu/xsd/identifiers");
35,767
package com.nortal.jroad.client.service.configuration.provider; <BUG>import java.io.IOException; import java.util.Properties; import javax.annotation.PostConstruct; import org.springframework.core.io.ClassPathResource;</BUG> import org.springframework.core.io.Resource;
import java.util.HashMap; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.springframework.core.io.ClassPathResource;
35,768
return clientMemberClass; } public void setClientMemberClass(String clientMemberClass) { this.clientMemberClass = clientMemberClass; } <BUG>public String getClientMemberCode() { return clientMemberCode; } public void setClientMemberCode(String clientMemberCode) { this.clientMemberCode = clientMemberCode; }</BUG> public...
[DELETED]
35,769
package org.apache.felix.gogo.launcher; <BUG>import org.apache.felix.gogo.runtime.osgi.OSGiShell; import org.apache.felix.gogo.runtime.threadio.ThreadIOImpl;</BUG> import org.apache.felix.gogo.console.stdio.Console; import org.osgi.framework.Bundle; import org.osgi.framework.launch.FrameworkFactory;
import org.apache.felix.gogo.runtime.shell.CommandProcessorImpl; import org.apache.felix.gogo.runtime.threadio.ThreadIOImpl;
35,770
Class<?> fw = cl.loadClass(fwkClassName); Constructor<?> c = fw.getConstructor(Map.class, List.class); framework = (Framework) c.newInstance(p); } ThreadIOImpl threadio = new ThreadIOImpl(); <BUG>threadio.start(); OSGiShell shell = new OSGiShell(); shell.setThreadio(threadio); shell.setBundle(framework); shell.start();...
CommandProcessorImpl shell = new CommandProcessorImpl(threadio);
35,771
threadio = new ThreadIOImpl(); threadio.start(); } public Context() { <BUG>setThreadio(threadio); </BUG> } public Object execute(CharSequence source) throws Exception {
super(threadio);
35,772
import java.sql.SQLException; import java.sql.Statement; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; <BUG>import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set;</BUG> import java.util.concurrent.locks.Lock;
import java.util.HashMap; import java.util.Map; import java.util.Set;
35,773
if (msgin != null) { try { msgin.close(); } catch (IOException e) { } <BUG>} } } protected void updateSourceSequence(SourceSequence seq) </BUG> throws SQLException {
releaseResources(stmt, null); protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound) throws IOException, SQLException { storeMessage(connection, sid, msg, outbound); protected void updateSourceSequence(Connection con, SourceSequence seq)
35,774
} catch (SQLException ex) { if (!isTableExistsError(ex)) { throw ex; } else { LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); <BUG>verifyTable(SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS); </BUG> } } finally { stmt.close();
verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
35,775
} catch (SQLException ex) { if (!isTableExistsError(ex)) { throw ex; } else { LOG.fine("Table CXF_RM_DEST_SEQUENCES already exists."); <BUG>verifyTable(DEST_SEQUENCES_TABLE_NAME, DEST_SEQUENCES_TABLE_COLS); </BUG> } } finally { stmt.close();
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
35,776
} } finally { stmt.close(); } for (String tableName : new String[] {OUTBOUND_MSGS_TABLE_NAME, INBOUND_MSGS_TABLE_NAME}) { <BUG>stmt = connection.createStatement(); try {</BUG> stmt.executeUpdate(MessageFormat.format(CREATE_MESSAGES_TABLE_STMT, tableName)); } catch (SQLException ex) { if (!isTableExistsError(ex)) {
stmt = con.createStatement(); try { stmt.executeUpdate(CREATE_DEST_SEQUENCES_TABLE_STMT);
35,777
throw ex; } else { if (LOG.isLoggable(Level.FINE)) { LOG.fine("Table " + tableName + " already exists."); } <BUG>verifyTable(tableName, MESSAGES_TABLE_COLS); </BUG> } } finally { stmt.close();
LOG.fine("Table CXF_RM_SRC_SEQUENCES already exists."); verifyTable(con, SRC_SEQUENCES_TABLE_NAME, SRC_SEQUENCES_TABLE_COLS);
35,778
if (newCols.size() > 0) { if (LOG.isLoggable(Level.FINE)) { LOG.log(Level.FINE, "Table " + tableName + " needs additional columns"); } for (String[] newCol : newCols) { <BUG>Statement st = connection.createStatement(); try {</BUG> st.executeUpdate(MessageFormat.format(ALTER_TABLE_STMT_STR, tableName, newCol[0], newCol[...
Statement st = con.createStatement(); try {
35,779
if (nextReconnectAttempt < System.currentTimeMillis()) { nextReconnectAttempt = System.currentTimeMillis() + reconnectDelay; reconnectDelay = reconnectDelay * useExponentialBackOff; } } <BUG>} public static void deleteDatabaseFiles() {</BUG> deleteDatabaseFiles(DEFAULT_DATABASE_NAME, true); } public static void deleteD...
public static void deleteDatabaseFiles() {
35,780
String dispatcherName = ContainerConfig.getPropertyValue(cfg, "dispatcher-name", "JavaMailDispatcher"); String delegatorName = ContainerConfig.getPropertyValue(cfg, "delegator-name", "default"); this.deleteMail = "true".equals(ContainerConfig.getPropertyValue(cfg, "delete-mail", "false")); this.delegator = DelegatorFac...
this.timerDelay = ContainerConfig.getPropertyValue(cfg, "poll-delay", 300000); this.maxSize = ContainerConfig.getPropertyValue(cfg, "maxSize", 1000000); // maximum size in bytes String runAsUser = ContainerConfig.getPropertyValue(cfg, "run-as-user", "system");
35,781
} else { frequencyLabelText = Settings.REPEAT_FREQUENCIES_PLURAL.get(frequencyComboBox.getValue()); } frequencyLabel.setText(frequencyLabelText); <BUG>refreshSummary(); refreshExceptionDates(); }; private void setFrequencyVisibility(FrequencyType f)</BUG> {
private void setFrequencyVisibility(FrequencyType f)
35,782
intervalSpinner.valueProperty().removeListener(intervalSpinnerListener); dayOfWeekList.removeListener(makeExceptionDatesAndSummaryListener); } private void setInitialValues(VDisplayable<?> vComponent) { <BUG>final int initialInterval; if (rrule.getInterval() == null) { initialInterval = Interval.DEFAULT_INTERVAL; } els...
[DELETED]
35,783
import javafx.scene.input.KeyEvent; import javafx.scene.layout.AnchorPane; import jfxtras.labs.icalendaragenda.internal.scene.control.skin.agenda.base24hour.DeleteChoiceDialog; import jfxtras.labs.icalendaragenda.internal.scene.control.skin.agenda.base24hour.Settings; import jfxtras.labs.icalendaragenda.scene.control.a...
import jfxtras.labs.icalendarfx.components.VComponent; import jfxtras.labs.icalendarfx.components.VDisplayable;
35,784
Temporal startRecurrence, Temporal endRecurrence, List<String> categories ) { <BUG>this.vComponentCopy = vComponentCopy; editDescriptiveVBox.setupData(vComponentCopy, startRecurrence, endRecurrence, categories);</BUG> if (vComponentCopy.getRecurrenceId() != null) { recurrenceRuleTab.setDisable(true);
vo = vComponentOriginal; editDescriptiveVBox.setupData(vComponentCopy, startRecurrence, endRecurrence, categories);
35,785
timeWarp = new OwnLabel(getFormattedTimeWrap(), skin, "warp"); timeWarp.setName("time warp"); Container wrapWrapper = new Container(timeWarp); wrapWrapper.width(60f * GlobalConf.SCALE_FACTOR); wrapWrapper.align(Align.center); <BUG>VerticalGroup timeGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCAL...
VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
35,786
focusListScrollPane.setFadeScrollBars(false); focusListScrollPane.setScrollingDisabled(true, false); focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR); focusListScrollPane.setWidth(160); } <BUG>VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).space(3 *...
VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
35,787
headerGroup.addActor(expandIcon); headerGroup.addActor(detachIcon); addActor(headerGroup); expandIcon.setChecked(expanded); } <BUG>public void expand() { </BUG> if (!expandIcon.isChecked()) { expandIcon.setChecked(true); }
public void expandPane() {
35,788
</BUG> if (!expandIcon.isChecked()) { expandIcon.setChecked(true); } } <BUG>public void collapse() { </BUG> if (expandIcon.isChecked()) { expandIcon.setChecked(false); }
headerGroup.addActor(expandIcon); headerGroup.addActor(detachIcon); addActor(headerGroup); expandIcon.setChecked(expanded); public void expandPane() { public void collapsePane() {
35,789
}); playstop.addListener(new TextTooltip(txt("gui.tooltip.playstop"), skin)); TimeComponent timeComponent = new TimeComponent(skin, ui); timeComponent.initialize(); CollapsiblePane time = new CollapsiblePane(ui, txt("gui.time"), timeComponent.getActor(), skin, true, playstop); <BUG>time.align(Align.left); mainActors.ad...
time.align(Align.left).columnAlign(Align.left); mainActors.add(time);
35,790
panes.put(visualEffectsComponent.getClass().getSimpleName(), visualEffects); ObjectsComponent objectsComponent = new ObjectsComponent(skin, ui); objectsComponent.setSceneGraph(sg); objectsComponent.initialize(); CollapsiblePane objects = new CollapsiblePane(ui, txt("gui.objects"), objectsComponent.getActor(), skin, fal...
objects.align(Align.left).columnAlign(Align.left); mainActors.add(objects);
35,791
if (Constants.desktop) { MusicComponent musicComponent = new MusicComponent(skin, ui); musicComponent.initialize(); Actor[] musicActors = MusicActorsManager.getMusicActors() != null ? MusicActorsManager.getMusicActors().getActors(skin) : null; CollapsiblePane music = new CollapsiblePane(ui, txt("gui.music"), musicCompo...
music.align(Align.left).columnAlign(Align.left); mainActors.add(music);
35,792
private int hsz_; private int isz_; private int osz_; private float loss_; private long nexamples_; <BUG>private float[] t_sigmoid; private float[] t_log; </BUG> private List<Integer> negatives = new ArrayList<>();
private static float[] t_sigmoid; private static float[] t_log;
35,793
private Node[] tree; private static final int NEGATIVE_TABLE_SIZE = 10000000; private static final int SIGMOID_TABLE_SIZE = 512; private static final int MAX_SIGMOID = 8; private static final int LOG_TABLE_SIZE = 512; <BUG>Random random = new Random(); Model(Matrix wi,</BUG> Matrix wo, Args args, int seed) {
Random random; static { initLog(); initSigmoid(); } Model(Matrix wi,
35,794
osz_ = wo.m_; hsz_ = args.dim; negpos = 0; loss_ = 0.0f; nexamples_ = 1; <BUG>initSigmoid(); initLog();</BUG> } float binaryLogistic(int target, boolean label, float lr) { float score = sigmoid(wo_.dotRow(hidden_, target));
[DELETED]
35,795
loss_ += softmax(target, lr); } nexamples_ += 1; if (args_.model == Args.model_name.sup) { grad_.mul(1.0f / input.length); <BUG>} for (int i : input) { wi_.addRow(grad_, i, 1.0f); }</BUG> }
synchronized (this) {
35,796
for (int i = 0; i < SIGMOID_TABLE_SIZE + 1; i++) { float x = i * 2f * MAX_SIGMOID / SIGMOID_TABLE_SIZE - MAX_SIGMOID; t_sigmoid[i] = 1.0f / (1.0f + (float) Math.exp(-x)); } } <BUG>void initLog() { </BUG> t_log = new float[LOG_TABLE_SIZE + 1]; for (int i = 0; i < LOG_TABLE_SIZE + 1; i++) { float x = (i + 1e-5f) / LOG_TA...
static void initLog() {
35,797
private Matrix input_; private Matrix output_; private Model model_; private int tokenCount; private Stopwatch stopwatch; <BUG>void getVector(Vector vec, String word) { int[] ngrams = dict_.getNgrams(word); vec.zero(); //TODO: may not be necessary. for (int i : ngrams) {</BUG> vec.addRow(input_, i);
Vector getVector(String word) { Vector vec = new Vector(args_.dim); for (int i : ngrams) {
35,798
package org.neo4j.server.rest; <BUG>import java.util.Map; import org.junit.After;</BUG> import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass;
import java.util.ArrayList; import org.jruby.compiler.ir.operands.Array; import org.junit.After;
35,799
public class AbstractRestFunctionalTestBase implements GraphHolder { private static ImpermanentGraphDatabase graphdb; protected static final String NODES = "http://localhost:7474/db/data/node/"; public @Rule <BUG>TestData<Map<String, Node>> data = TestData.producedThrough( GraphDescription.createGraphFor( this, true ) ...
TestData<Map<String, Node>> data = TestData.producedThrough( GraphDescription.createGraphFor(
35,800
String uri = (String) map.get( "self" ); assertTrue( uri + " not found", expected.remove( uri ) ); } assertTrue( "Expected not empty:" + expected, expected.isEmpty() ); } <BUG>@Documented @Test public void shouldGetExpectedHitsWhenTraversingWithDescription() throws PropertyValueException { List<Map<String, Object>> rel...
@Graph( {"Root knows Mattias", "Root knows Johan", "Johan knows Emil", "Emil knows Peter", "Emil knows Tobias", "Tobias loves Sara"} ) public void shouldGetExpectedHitsWhenTraversingWithDescription() Node start = getNode( "Root" ); List<Map<String, Object>> rels = new ArrayList<Map<String, Object>>();