id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
11,201
} @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_memo); <BUG>ChinaPhoneHelper.setStatusBar(this,true); </BUG> topicId = getIntent().getLongExtra("topicId", -1); if (topicId == -1) { finish();
ChinaPhoneHelper.setStatusBar(this, true);
11,202
MemoEntry.COLUMN_REF_TOPIC__ID + " = ?" , new String[]{String.valueOf(topicId)}); } public Cursor selectMemo(long topicId) { Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null, <BUG>MemoEntry._ID + " DESC", null); </BUG> if (c != null) { c.moveToFirst(); }
MemoEntry.COLUMN_ORDER + " ASC", null);
11,203
MemoEntry._ID + " = ?", new String[]{String.valueOf(memoId)}); } public long updateMemoContent(long memoId, String memoContent) { ContentValues values = new ContentValues(); <BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent); return db.update(</BUG> MemoEntry.TABLE_NAME, values, MemoEntry._ID + " = ?",
return db.update(
11,204
import android.widget.RelativeLayout; import android.widget.TextView; import com.kiminonawa.mydiary.R; import com.kiminonawa.mydiary.db.DBManager; import com.kiminonawa.mydiary.shared.EditMode; <BUG>import com.kiminonawa.mydiary.shared.ThemeManager; import java.util.List; public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode { </BUG> private List<MemoEntity> memoList;
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
11,205
private DBManager dbManager; private boolean isEditMode = false; private EditMemoDialogFragment.MemoCallback callback; private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; <BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) { this.mActivity = activity;</BUG> this.topicId = topicId; this.memoList = memoList;
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
11,206
this.memoList = memoList; this.dbManager = dbManager; this.callback = callback; } @Override <BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { </BUG> View view; if (isEditMode) { if (viewType == TYPE_HEADER) {
public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
11,207
editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment"); } }); } } <BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private View rootView; private TextView TV_memo_item_content;</BUG> private ImageView IV_memo_item_delete;
protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener { private ImageView IV_memo_item_dot; private TextView TV_memo_item_content;
11,208
package com.google.census; <BUG>import static com.google.common.truth.Truth.assertThat; import org.junit.Test;</BUG> import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class)
import com.google.common.testing.EqualsTester; import org.junit.Test;
11,209
package com.alorma.github.ui.activity.repo; import android.content.Context; <BUG>import android.content.Intent; import android.os.Bundle; import android.support.annotation.DrawableRes;</BUG> import android.support.annotation.NonNull; import android.support.annotation.StringRes;
import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.support.annotation.DrawableRes;
11,210
requestRepoInfo.name = name; requestRepoInfo.owner = owner; } } if (requestRepoInfo != null) { <BUG>setTitle(requestRepoInfo.name); listFragments();</BUG> setupTabs(); } else { finish();
showNewRepoScreenDialog(); listFragments();
11,211
public static final String KEY_VERSION = "KEY_VERSION"; public static final String KEY_DOWNLOAD_FILE_TYPE = "KEY_DOWNLOAD_FILE_TYPE"; private static final String KEY_SHOW_ENTERPRISE = "KEY_SHOW_ENTERPRISE"; private static final String GCM_TOKEN = "GCM_TOKEN"; private static final String NOTIFICATIONS = "NOTIFICATIONS"; <BUG>private static final String FULL_README = "FULL_README"; public GitskariosSettings(Context context) {</BUG> super(context); } public void saveRepoSort(String value) {
private static final String REPO_DEFAUL_TAB = "REPO_DEFAUL_TAB"; public GitskariosSettings(Context context) {
11,212
public static final String GITSKARIOS = "gitskarios"; public static final String CHANGELOG = "changelog"; public static final String PREF_THEME = "pref_theme"; private static final String PREF_INTERCEPT = "pref_intercept"; private static final String PREF_MARK_AS_READ = "pref_mark_as_read"; <BUG>private static final String REPOSITORY_FULL_README = "repository_full_readme"; @Override</BUG> public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.main_prefs);
private static final String REPOSITORY_DEFAULT_TAB = "repository_default_tab"; private MaterialListPreference repositoryDefaultTab; @Override
11,213
Preference changelog = findPreference(CHANGELOG); changelog.setOnPreferenceClickListener(this); Preference theme = findPreference("pref_theme"); theme.setOnPreferenceChangeListener(this); CheckBoxPreference fullReadme = (CheckBoxPreference) findPreference(REPOSITORY_FULL_README); <BUG>fullReadme.setOnPreferenceChangeListener(this); }</BUG> @Override public boolean onPreferenceClick(Preference preference) { if (preference.getKey().equals(GITSKARIOS)) {
repositoryDefaultTab = (MaterialListPreference) findPreference(REPOSITORY_DEFAULT_TAB); repositoryDefaultTab.setOnPreferenceChangeListener(this); repositoryDefaultTab.setSummary(settings.getRepoDefaulTab()); }
11,214
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
11,215
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_();
sink.lineBreak(); sink.section1_();
11,216
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
11,217
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
11,218
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_();
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
11,219
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
11,220
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
11,221
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
11,222
} @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("/bin/sh", "-c", "\"echo " + i + "\""))); }
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
11,223
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, sum, fib)); }
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
11,224
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<String> task2 = Task.ofType(String.class).named("Baz", 40) .in(() -> task1)</BUG> .ins(() -> singletonList(task1))
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
11,225
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 + " causes an outer reference");</BUG> serialize(task); } @Test
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
11,226
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.evaluate(des).consume(val);
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
11,227
} @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);
11,228
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);
11,229
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);
11,230
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(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
11,231
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
11,232
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());
11,233
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.format("Unable to delete %s", file)); }</BUG> }
if (deleteImage) { Utils.deleteMedia(context, imageUri);
11,234
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, String.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
11,235
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.format("Unable to delete %s", file)); }</BUG> }
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
11,236
import org.mariotaku.twidere.receiver.NotificationReceiver; import org.mariotaku.twidere.service.LengthyOperationsService; import org.mariotaku.twidere.util.ActivityTracker; import org.mariotaku.twidere.util.AsyncTwitterWrapper; import org.mariotaku.twidere.util.DataStoreFunctionsKt; <BUG>import org.mariotaku.twidere.util.DataStoreUtils; import org.mariotaku.twidere.util.ImagePreloader;</BUG> import org.mariotaku.twidere.util.InternalTwitterContentUtils; import org.mariotaku.twidere.util.JsonSerializer; import org.mariotaku.twidere.util.NotificationManagerWrapper;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.ImagePreloader;
11,237
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);
11,238
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);
11,239
import android.content.Context; import android.content.SharedPreferences; import android.location.Location; import android.os.AsyncTask; import android.support.annotation.NonNull; <BUG>import android.util.Log; import org.mariotaku.twidere.BuildConfig; import org.mariotaku.twidere.Constants; import org.mariotaku.twidere.util.JsonSerializer;</BUG> import org.mariotaku.twidere.util.Utils;
import org.mariotaku.twidere.util.DebugLog; import org.mariotaku.twidere.util.JsonSerializer;
11,240
} public static LatLng getCachedLatLng(@NonNull final Context context) { final Context appContext = context.getApplicationContext(); final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences(); if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null; <BUG>if (BuildConfig.DEBUG) { Log.d(HotMobiLogger.LOGTAG, "getting cached location"); }</BUG> final Location location = Utils.getCachedLocation(appContext);
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
11,241
public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) { final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId); return asyncTaskManager.add(task, true); } public int destroyStatusAsync(final UserKey accountKey, final String statusId) { <BUG>final DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId); </BUG> return asyncTaskManager.add(task, true); } public int destroyUserListAsync(final UserKey accountKey, final String listId) {
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
11,242
@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.getException()); }</BUG> }
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
11,243
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);
11,244
context.setAuthCache(authCache); ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpclient, context); ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build(); client.register(JacksonJaxbJsonProvider.class); client.register(JacksonObjectMapperProvider.class); <BUG>client.register(RequestLogger.class); client.register(ResponseLogger.class); </BUG> ProxyBuilder<T> proxyBuilder = client.target(uri).proxyBuilder(apiClassType);
client.register(RestRequestFilter.class); client.register(RestResponseFilter.class);
11,245
import org.hawkular.alerts.api.model.condition.Condition; import org.hawkular.inventory.api.model.CanonicalPath; import org.hawkular.inventory.api.model.Tenant; import org.hawkular.inventory.json.DetypedPathDeserializer; import org.hawkular.inventory.json.InventoryJacksonConfig; <BUG>import org.hawkular.inventory.json.mixins.CanonicalPathMixin; </BUG> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.core.JsonParseException;
import org.hawkular.inventory.json.mixins.model.CanonicalPathMixin;
11,246
public class UserControllerTest { private static final Logger LOGGER = Logger.getLogger( UserControllerTest.class.getName() ); Properties properties = new Properties(); InputStream input = null; <BUG>private String neo4jServerPort = System.getProperty( "neo4j.server.port" ); private String neo4jRemoteShellPort = System.getProperty( "neo4j.remoteShell.port" ); private String neo4jGraphDb = System.getProperty( "neo4j.graph.db" ); private ServerControls server;</BUG> @Before
private String dbmsConnectorHttpPort = System.getProperty( "dbms.connector.http.port" ); private String dbmsConnectorBoltPort = System.getProperty( "dbms.connector.bolt.port" ); private String dbmsShellPort = System.getProperty( "dbms.shell.port" ); private String dbmsDirectoriesData = System.getProperty( "dbms.directories.data" ); private ServerControls server;
11,247
@Bean public Configuration getConfiguration() { if ( StringUtils.isEmpty( url ) ) { <BUG>url = "http://localhost:" + port; </BUG> } Configuration config = new Configuration(); config.driverConfiguration().setDriverClassName( HttpDriver.class.getName() )
url = "http://localhost:" + dbmsConnectorHttpPort;
11,248
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
11,249
final int lineStride = dst.getScanlineStride(); final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final byte[][] data = dst.getByteDataArrays(); final float[] warpData = new float[2 * dstWidth]; <BUG>int lineOffset = 0; if (ctable == null) { // source does not have IndexColorModel if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset;
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
11,250
pixelOffset += pixelStride; } // COLS LOOP } // ROWS LOOP } } else {// source has IndexColorModel <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
} else if (caseB) { for (int h = 0; h < dstHeight; h++) {
11,251
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
11,252
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final short[][] data = dst.getShortDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
11,253
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
11,254
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final short[][] data = dst.getShortDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
11,255
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
11,256
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final int[][] data = dst.getIntDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
11,257
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
11,258
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final float[][] data = dst.getFloatDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
11,259
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
11,260
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final double[][] data = dst.getDoubleDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
11,261
template.add(customer, values); </BUG> Record result = client.get(null, new Key("test", "Person", "dave-002"), "age", "waist"); Assert.assertEquals(1, result.getInt("age")); <BUG>Assert.assertEquals(32, result.getInt("waist")); }</BUG> @Test public void testDelete(){ client.put(null, new Key("test", "Person", "dave-001"), new Bin("firstname", "Dave"), new Bin ("lastname", "Matthews"));
public void testMultipleIncrement(){ Person customer = new Person("dave-002", "Dave", "Matthews"); template.insert(customer); Map<String, Long> values = new HashMap<String, Long>(); values.put("age", 1L); customer = template.add(customer, values); Assert.assertEquals((Integer)result.getInt("age"), customer.getAge()); }
11,262
import org.springframework.util.ClassUtils; import com.aerospike.client.AerospikeClient; import com.aerospike.client.AerospikeException; import com.aerospike.client.Bin; import com.aerospike.client.Info; <BUG>import com.aerospike.client.Key; import com.aerospike.client.Record;</BUG> import com.aerospike.client.ScanCallback; import com.aerospike.client.Value; import com.aerospike.client.cluster.Node;
import com.aerospike.client.Operation; import com.aerospike.client.Record;
11,263
return new EntityIterator<T>(classType, converter, recordSet); } }; return results; } <BUG>protected class EntityIterator<T> implements Iterator<T>, CloseableIterator<T>{ private RecordSet recordSet;</BUG> private Iterator<KeyRecord> recordSetIterator; private MappingAerospikeConverter converter; private Class<T> type;
protected class EntityIterator<T> implements CloseableIterator<T>{ private RecordSet recordSet;
11,264
<T> T findById(Serializable id, Class<T> type); <T> T findById(Serializable id, Class<T> type, Class<T> domainType); <T> T add(T objectToAddTo, Map<String, Long> values); <T> T add(T objectToAddTo, String binName, int value); <T> T append(T objectToAppenTo, Map<String, String> values); <BUG><T> T append(T objectToAppenTo, String binName, String value); <T> Iterable<T> aggregate(Filter filter, Class<?> type, Class<T> outputType, String module, String function, List<?> arguments);</BUG> int count(Query<?> query, Class<?> javaType); <T> T execute(KeyValueCallback<T> action); <T> Iterable<T> findAll(Sort sort, Class<T> type);
<T> T prepend(T objectToAppenTo, Map<String, String> values); <T> T prepend(T objectToAppenTo, String binName, String value); <T> Iterable<T> aggregate(Filter filter, Class<?> type, Class<T> outputType, String module, String function, List<?> arguments);
11,265
isFirstPort = false; } else { out.print(", "); } String contactRef = circuit.getNodeReference(contact); <BUG>String contactFlatName = NamespaceHelper.hierarchicalToFlatName(contactRef); </BUG> out.print(contactFlatName); if (contact.isInput()) { if (!inputPorts.isEmpty()) {
String contactFlatName = NamespaceHelper.flattenReference(contactRef);
11,266
result = Fsm.EPSILON_SERIALISATION; } else { result = fsm.getNodeReference(symbol); } } <BUG>return NamespaceHelper.hierarchicalToFlatName(result); }</BUG> private void writeSignalHeader(PrintWriter out, Fst fst, Type type) { HashSet<String> names = new HashSet<>(); for (Signal signal: fst.getSignals(type)) {
return result;
11,267
Trace circuitTrace = null; if (trace != null) { circuitTrace = new Trace(); for (String ref: trace) { Transition t = getBestTransitionToFire(ref); <BUG>if (t == null) { String flatRef = NamespaceHelper.hierarchicalToFlatName(ref); t = getBestTransitionToFire(flatRef); }</BUG> if (t != null) {
[DELETED]
11,268
"Circuit is not output persistent after the following trace(s):")); } } monitor.progressUpdate(0.80); if ((envStg != null) && checkConformation) { <BUG>Set<String> devOutputNames = devStg.getSignalFlatNames(Type.OUTPUT); </BUG> byte[] placesList = FileUtils.readAllBytes(placesModFile); Set<String> devPlaceNames = parsePlaceNames(placesList, 0); MpsatSettings conformationSettings = MpsatSettings.getConformationSettings(devOutputNames, devPlaceNames);
Set<String> devOutputNames = devStg.getSignalNames(Type.OUTPUT, null);
11,269
</BUG> return false; } } else { <BUG>LogUtils.logErrorLine("Trace transition '" + flatRef + "' cannot be found."); </BUG> return false; } } return true;
if (node instanceof Transition) { Transition transition = (Transition) node; if (stg.isEnabled(transition)) { stg.fire(transition); LogUtils.logErrorLine("Trace transition '" + ref + "' is not enabled."); LogUtils.logErrorLine("Trace transition '" + ref + "' cannot be found.");
11,270
Set<Node> postset = getPostset(node); if (!(preset.size() == 1 && postset.size() == 1)) { throw new RuntimeException("An implicit place must have one transition in its preset and one transition in its postset."); } String predNodeRef = referenceManager.getNodeReference(null, preset.iterator().next()); <BUG>String succNodeRef = referenceManager.getNodeReference(null, postset.iterator().next()); return "<" + NamespaceHelper.hierarchicalToFlatName(predNodeRef) + "," + NamespaceHelper.hierarchicalToFlatName(succNodeRef) + ">";</BUG> } }
return "<" + predNodeRef + "," + succNodeRef + ">";
11,271
public static String convertLegacyFlatnameSeparators(String ref) { return ref.replaceAll(LEGACY_FLATNAME_SEPARATOR_REGEXP, HIERARCHY_SEPARATOR); } public static String getHierarchySeparator() { return HIERARCHY_SEPARATOR; <BUG>} public static String hierarchicalToFlatName(String reference) { return reference;</BUG> } public static String flattenReference(String reference) {
[DELETED]
11,272
private HashMap<String, VisualSignal> createSignals(LinkedList<Pair<String, Color>> signals) { HashMap<String, VisualSignal> result = new HashMap<>(); for (Pair<String, Color> signalData: signals) { String ref = signalData.getFirst(); Color color = signalData.getSecond(); <BUG>String flatName = NamespaceHelper.hierarchicalToFlatName(ref); </BUG> VisualSignal signal = dtd.createVisualSignal(flatName); signal.setPosition(new Point2D.Double(0.0, SIGNAL_OFFSET * result.size())); Type type = convertSignalType(stg.getSignalType(ref));
String flatName = NamespaceHelper.flattenReference(ref);
11,273
} else { out.write(" " + NamespaceHelper.hierarchicalToFlatName(succNodeRef)); }</BUG> } else { <BUG>out.write(" " + NamespaceHelper.hierarchicalToFlatName(succNodeRef)); }</BUG> } out.write("\n"); } }
out.write(" " + succNodeRef); out.write(" " + succNodeRef);
11,274
final int tokens = p.getTokens(); final String reference; if (p instanceof StgPlace) { if (((StgPlace) p).isImplicit()) { Node predNode = model.getPreset(p).iterator().next(); <BUG>String predFlatName = NamespaceHelper.hierarchicalToFlatName(model.getNodeReference(predNode)); Node succNode = model.getPostset(p).iterator().next(); String succFlatName = NamespaceHelper.hierarchicalToFlatName(model.getNodeReference(succNode)); reference = "<" + predFlatName + "," + succFlatName + ">"; </BUG> } else {
String predRef = model.getNodeReference(predNode); String succRef = model.getNodeReference(succNode); reference = "<" + predRef + "," + succRef + ">";
11,275
StringBuilder capacity = new StringBuilder(); for (Place p : places) { if (p instanceof StgPlace) { StgPlace stgPlace = (StgPlace) p; if (stgPlace.getCapacity() != 1) { <BUG>String flatName = NamespaceHelper.hierarchicalToFlatName(model.getNodeReference(p)); capacity.append(" " + flatName + "=" + stgPlace.getCapacity()); </BUG> } }
String placeRef = model.getNodeReference(p); capacity.append(" " + placeRef + "=" + stgPlace.getCapacity());
11,276
CHEVRON_RIGHT ("chevron-right", "png", false, false), CHEVRON_LEFT ("chevron-left", "png", false, false), SEARCH ("search", "png", false, false), CONTROL_SLIDER_BALL ("control-sliderball", "png", false, false), CONTROL_CHECK_ON ("control-check-on", "png", false, false), <BUG>CONTROL_CHECK_OFF ("control-check-off", "png", false, false), ALPHA_MAP ("alpha", "png", false, false);</BUG> private static final byte IMG_PNG = 1, IMG_JPG = 2;
USER ("user", "user%d", "png", false, false), ALPHA_MAP ("alpha", "png", false, false);
11,277
GameImage(String filename, String type, boolean beatmapSkinnable, boolean preload) { this.filename = filename; this.type = getType(type); this.beatmapSkinnable = beatmapSkinnable; this.preload = preload; <BUG>} public boolean isBeatmapSkinnable() { return beatmapSkinnable; }</BUG> public boolean isPreload() { return preload; } public Image getImage() { setDefaultImage();
GameImage(String filename, String filenameFormat, String type, boolean beatmapSkinnable, boolean preload) { this(filename, type, beatmapSkinnable, preload); this.filenameFormat = filenameFormat; public boolean isBeatmapSkinnable() { return beatmapSkinnable; }
11,278
g.drawRect(0, yPos, rectWidth, rectHeight); g.setLineWidth(oldLineWidth); data.drawSymbolString(rankString, rectWidth, yPos, 1.0f, alpha * 0.2f, true); white.a = blue.a = alpha * 0.75f; if (playerName != null) <BUG>Fonts.MEDIUMBOLD.drawString(xPaddingLeft, yPos + yPadding, playerName, white); Fonts.DEFAULT.drawString(</BUG> xPaddingLeft, yPos + rectHeight - Fonts.DEFAULT.getLineHeight() - yPadding, scoreString, white ); Fonts.DEFAULT.drawString(
Fonts.MEDIUM.drawString(xPaddingLeft, yPos + yPadding, playerName, white);
11,279
int objectCount = hit300 + hit100 + hit50 + miss; if (objectCount > 0) percent = (hit300 * 300 + hit100 * 100 + hit50 * 50) / (objectCount * 300f) * 100f; return percent; } <BUG>private float getScorePercent() { </BUG> return getScorePercent( hitResultCount[HIT_300], hitResultCount[HIT_100], hitResultCount[HIT_50], hitResultCount[HIT_MISS]
public float getScorePercent() {
11,280
sd.score = slidingScore ? scoreDisplay : score; sd.combo = comboMax; sd.perfect = (comboMax == fullObjectCount); sd.mods = GameMod.getModState(); sd.replayString = (replay == null) ? null : replay.getReplayFilename(); <BUG>sd.playerName = null; // TODO return sd;</BUG> } public Replay getReplay(ReplayFrame[] frames, Beatmap beatmap) { if (replay != null && frames == null)
sd.playerName = GameMod.AUTO.isActive() ? UserList.AUTO_USER_NAME : UserList.get().getCurrentUser().getName(); return sd;
11,281
return null; replay = new Replay(); replay.mode = Beatmap.MODE_OSU; replay.version = Updater.get().getBuildDate(); replay.beatmapHash = (beatmap == null) ? "" : beatmap.md5Hash; <BUG>replay.playerName = ""; // TODO replay.replayHash = Long.toString(System.currentTimeMillis()); // TODO</BUG> replay.hit300 = (short) hitResultCount[HIT_300]; replay.hit100 = (short) hitResultCount[HIT_100]; replay.hit50 = (short) hitResultCount[HIT_50];
replay.playerName = UserList.get().getCurrentUser().getName(); replay.replayHash = Long.toString(System.currentTimeMillis()); // TODO
11,282
import itdelatrisu.opsu.downloads.Download; import itdelatrisu.opsu.downloads.DownloadNode; import itdelatrisu.opsu.replay.PlaybackSpeed; import itdelatrisu.opsu.ui.Colors; import itdelatrisu.opsu.ui.Fonts; <BUG>import itdelatrisu.opsu.ui.UI; import java.awt.image.BufferedImage;</BUG> import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.File;
import itdelatrisu.opsu.user.UserButton; import itdelatrisu.opsu.user.UserList; import java.awt.image.BufferedImage;
11,283
public static boolean debugMode = false; @ModConfigProperty(category = "Debug", name = "debugModeGOTG", comment = "Enable/Disable Debug Mode for the Gift Of The Gods") public static boolean debugModeGOTG = false; @ModConfigProperty(category = "Debug", name = "debugModeEnchantments", comment = "Enable/Disable Debug Mode for the Enchantments") public static boolean debugModeEnchantments = false; <BUG>@ModConfigProperty(category = "Weapons", name = "enableSwordsRecipes", comment = "Enable/Disable The ArmorPlus Sword's Recipes") public static boolean enableSwordsRecipes = true; @ModConfigProperty(category = "Weapons", name = "enableBattleAxesRecipes", comment = "Enable/Disable The ArmorPlus Battle Axes's Recipes") public static boolean enableBattleAxesRecipes = true; @ModConfigProperty(category = "Weapons", name = "enableBowsRecipes", comment = "Enable/Disable The ArmorPlus Bows's Recipes") public static boolean enableBowsRecipes = true; @ModConfigProperty(category = "Armors.SuperStarArmor.Effects", name = "enableSuperStarHRegen", comment = "Enable/Disable The Super Star Helmet Regeneration") </BUG> public static boolean enableSuperStarHRegen = true;
@ModConfigProperty(category = "Weapons", name = "enableSwordsRecipes", comment = "Enable/Disable ArmorPlus Sword's Recipes") @ModConfigProperty(category = "Weapons", name = "enableBattleAxesRecipes", comment = "Enable/Disable ArmorPlus Battle Axes's Recipes") @ModConfigProperty(category = "Weapons", name = "enableBowsRecipes", comment = "Enable/Disable ArmorPlus Bows's Recipes")
11,284
private static final String DATASET_CAPACITY_TABLE = "dataset_capacity"; private static final String DATASET_TAG_TABLE = "dataset_tag"; private static final String DATASET_CASE_SENSITIVE_TABLE = "dataset_case_sensitivity"; private static final String DATASET_REFERENCE_TABLE = "dataset_reference"; private static final String DATASET_PARTITION_TABLE = "dataset_partition"; <BUG>private static final String DATASET_SECURITY_TABLE = "dataset_security"; </BUG> private static final String DATASET_OWNER_TABLE = "dataset_owner"; private static final String DATASET_OWNER_UNMATCHED_TABLE = "stg_dataset_owner_unmatched"; private static final String DATASET_CONSTRAINT_TABLE = "dataset_constraint";
private static final String DATASET_SECURITY_TABLE = "dataset_security_info";
11,285
throw new IllegalArgumentException( "Dataset deployment info update fail, " + "Json missing necessary fields: " + root.toString()); </BUG> } <BUG>final Object[] idUrn = findIdAndUrn(idNode, urnNode); final Integer datasetId = (Integer) idUrn[0];</BUG> final String urn = (String) idUrn[1]; ObjectMapper om = new ObjectMapper(); for (final JsonNode deploymentInfo : deployment) { DatasetDeploymentRecord record = om.convertValue(deploymentInfo, DatasetDeploymentRecord.class);
"Dataset deployment info update error, missing necessary fields: " + root.toString()); final Object[] idUrn = findDataset(root); if (idUrn[0] == null || idUrn[1] == null) { throw new IllegalArgumentException("Cannot identify dataset from id/uri/urn: " + root.toString()); final Integer datasetId = (Integer) idUrn[0];
11,286
rec.setModifiedTime(System.currentTimeMillis() / 1000); if (datasetId == 0) { DatasetRecord record = new DatasetRecord(); record.setUrn(urn); record.setSourceCreatedTime("" + rec.getCreateTime() / 1000); <BUG>record.setSchema(rec.getOriginalSchema()); record.setSchemaType(rec.getFormat()); </BUG> record.setFields((String) StringUtil.objectToJsonString(rec.getFieldSchema()));
record.setSchema(rec.getOriginalSchema().getText()); record.setSchemaType(rec.getOriginalSchema().getFormat());
11,287
datasetId = Integer.valueOf(DatasetDao.getDatasetByUrn(urn).get("id").toString()); rec.setDatasetId(datasetId); } else { DICT_DATASET_WRITER.execute(UPDATE_DICT_DATASET_WITH_SCHEMA_CHANGE, <BUG>new Object[]{rec.getOriginalSchema(), rec.getFormat(), StringUtil.objectToJsonString(rec.getFieldSchema()), "API", System.currentTimeMillis() / 1000, datasetId}); }</BUG> List<Map<String, Object>> oldInfo; try {
new Object[]{rec.getOriginalSchema().getText(), rec.getOriginalSchema().getFormat(), StringUtil.objectToJsonString(rec.getFieldSchema()), "API", System.currentTimeMillis() / 1000, datasetId});
11,288
case "deploymentInfo": try { DatasetInfoDao.updateDatasetDeployment(rootNode); } catch (Exception ex) { Logger.debug("Metadata change exception: deployment ", ex); <BUG>} break; case "caseSensitivity": try { DatasetInfoDao.updateDatasetCaseSensitivity(rootNode); } catch (Exception ex) { Logger.debug("Metadata change exception: case sensitivity ", ex);</BUG> }
[DELETED]
11,289
package org.glowroot.agent.config; import com.google.common.collect.ImmutableList; <BUG>import org.immutables.value.Value; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;</BUG> @Value.Immutable public abstract class UiConfig { @Value.Default
import org.glowroot.common.config.ConfigDefaults; import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
11,290
class RepoAdminImpl implements RepoAdmin { private final DataSource dataSource; private final List<CappedDatabase> rollupCappedDatabases; private final CappedDatabase traceCappedDatabase; private final ConfigRepository configRepository; <BUG>private final AgentDao agentDao; </BUG> private final GaugeValueDao gaugeValueDao; private final GaugeNameDao gaugeNameDao; private final TransactionTypeDao transactionTypeDao;
private final EnvironmentDao agentDao;
11,291
private final TransactionTypeDao transactionTypeDao; private final FullQueryTextDao fullQueryTextDao; private final TraceAttributeNameDao traceAttributeNameDao; RepoAdminImpl(DataSource dataSource, List<CappedDatabase> rollupCappedDatabases, CappedDatabase traceCappedDatabase, ConfigRepository configRepository, <BUG>AgentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao, </BUG> TransactionTypeDao transactionTypeDao, FullQueryTextDao fullQueryTextDao, TraceAttributeNameDao traceAttributeNameDao) { this.dataSource = dataSource;
EnvironmentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
11,292
this.fullQueryTextDao = fullQueryTextDao; this.traceAttributeNameDao = traceAttributeNameDao; } @Override public void deleteAllData() throws Exception { <BUG>Environment environment = agentDao.readEnvironment(""); dataSource.deleteAll();</BUG> agentDao.reinitAfterDeletingDatabase(); gaugeValueDao.reinitAfterDeletingDatabase(); gaugeNameDao.invalidateCache();
Environment environment = agentDao.read(""); dataSource.deleteAll();
11,293
public class SimpleRepoModule { private static final long SNAPSHOT_REAPER_PERIOD_MINUTES = 5; private final DataSource dataSource; private final ImmutableList<CappedDatabase> rollupCappedDatabases; private final CappedDatabase traceCappedDatabase; <BUG>private final AgentDao agentDao; private final TransactionTypeDao transactionTypeDao;</BUG> private final AggregateDao aggregateDao; private final TraceAttributeNameDao traceAttributeNameDao; private final TraceDao traceDao;
private final EnvironmentDao environmentDao; private final TransactionTypeDao transactionTypeDao;
11,294
rollupCappedDatabases.add(new CappedDatabase(file, sizeKb, ticker)); } this.rollupCappedDatabases = ImmutableList.copyOf(rollupCappedDatabases); traceCappedDatabase = new CappedDatabase(new File(dataDir, "trace-detail.capped.db"), storageConfig.traceCappedDatabaseSizeMb() * 1024, ticker); <BUG>agentDao = new AgentDao(dataSource); </BUG> transactionTypeDao = new TransactionTypeDao(dataSource); rollupLevelService = new RollupLevelService(configRepository, clock); FullQueryTextDao fullQueryTextDao = new FullQueryTextDao(dataSource);
environmentDao = new EnvironmentDao(dataSource);
11,295
traceDao = new TraceDao(dataSource, traceCappedDatabase, transactionTypeDao, fullQueryTextDao, traceAttributeNameDao); GaugeNameDao gaugeNameDao = new GaugeNameDao(dataSource); gaugeValueDao = new GaugeValueDao(dataSource, gaugeNameDao, clock); repoAdmin = new RepoAdminImpl(dataSource, rollupCappedDatabases, traceCappedDatabase, <BUG>configRepository, agentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao, </BUG> fullQueryTextDao, traceAttributeNameDao); if (backgroundExecutor == null) { reaperRunnable = null;
configRepository, environmentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
11,296
new TraceCappedDatabaseStats(traceCappedDatabase), "org.glowroot:type=TraceCappedDatabase"); platformMBeanServerLifecycle.lazyRegisterMBean(new H2DatabaseStats(dataSource), "org.glowroot:type=H2Database"); } <BUG>public AgentDao getAgentDao() { return agentDao; </BUG> } public TransactionTypeRepository getTransactionTypeRepository() {
public EnvironmentDao getEnvironmentDao() { return environmentDao;
11,297
package org.glowroot.agent.embedded.init; import java.io.Closeable; import java.io.File; <BUG>import java.lang.instrument.Instrumentation; import java.util.Map;</BUG> import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService;
import java.util.List; import java.util.Map;
11,298
import java.util.concurrent.ScheduledExecutorService; import javax.annotation.Nullable; import com.google.common.base.MoreObjects; import com.google.common.base.Stopwatch; import com.google.common.base.Supplier; <BUG>import com.google.common.base.Ticker; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;</BUG> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.glowroot.agent.collector.Collector.AgentConfigUpdater;
import com.google.common.collect.ImmutableList; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
11,299
import org.glowroot.agent.init.EnvironmentCreator; import org.glowroot.agent.init.GlowrootThinAgentInit; import org.glowroot.agent.init.JRebelWorkaround; import org.glowroot.agent.util.LazyPlatformMBeanServer; import org.glowroot.common.live.LiveAggregateRepository.LiveAggregateRepositoryNop; <BUG>import org.glowroot.common.live.LiveTraceRepository.LiveTraceRepositoryNop; import org.glowroot.common.repo.ConfigRepository; import org.glowroot.common.util.Clock;</BUG> import org.glowroot.common.util.OnlyUsedByTests; import org.glowroot.ui.CreateUiModuleBuilder;
import org.glowroot.common.repo.AgentRepository; import org.glowroot.common.repo.ImmutableAgentRollup; import org.glowroot.common.util.Clock;
11,300
SimpleRepoModule simpleRepoModule = new SimpleRepoModule(dataSource, dataDir, clock, ticker, configRepository, backgroundExecutor); simpleRepoModule.registerMBeans(new PlatformMBeanServerLifecycleImpl( agentModule.getLazyPlatformMBeanServer())); CollectorImpl collectorImpl = new CollectorImpl( <BUG>simpleRepoModule.getAgentDao(), simpleRepoModule.getAggregateDao(), simpleRepoModule.getTraceDao(),</BUG> simpleRepoModule.getGaugeValueDao()); collectorProxy.setInstance(collectorImpl); collectorImpl.init(baseDir, EnvironmentCreator.create(glowrootVersion),
simpleRepoModule.getEnvironmentDao(), simpleRepoModule.getTraceDao(),