id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
13,101 | 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
|
13,102 | 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++) {
|
13,103 | thread.start();
this.xid = null;
this.active = false;
}
public void rollback(Xid xid) throws XAException {
<BUG>Debug.log("ServiceXaWrapper#rollback() : " + xid.toString(), module);
</BUG>
if (this.active) {
Debug.logWarning("rollback() called without end()", module);
}
| if (Debug.verboseOn()) Debug.logVerbose("ServiceXaWrapper#rollback() : " + xid.toString(), module);
|
13,104 | rtn = super.prepare(xid);
} catch (XAException e) {
Debug.logError(e, module);
throw e;
}
<BUG>Debug.log("ServiceXaWrapper#prepare() : " + rtn + " / " + (rtn == XA_OK) , module);
</BUG>
return rtn;
}
protected final void runService(String service, Map context, boolean persist, int mode, int type) throws XAException {
| if (Debug.verboseOn()) Debug.logVerbose("ServiceXaWrapper#prepare() : " + rtn + " / " + (rtn == XA_OK) , module);
|
13,105 | </BUG>
dctx.getDispatcher().runAsync(service, thisContext, persist);
break;
case MODE_SYNC:
<BUG>Debug.log(msgPrefix + "Invoking [" + service + "] via runSyncIgnore", module);
</BUG>
dctx.getDispatcher().runSyncIgnore(service, thisContext);
break;
}
} catch (Throwable t) {
| thisContext = model.makeValid(context, ModelService.IN_PARAM);
thisContext.put("userLogin", ServiceUtil.getUserLogin(dctx, thisContext, runAsUser));
switch (mode) {
case MODE_ASYNC:
if (Debug.infoOn()) Debug.logInfo(msgPrefix + "Invoking [" + service + "] via runAsync", module);
if (Debug.infoOn()) Debug.logInfo(msgPrefix + "Invoking [" + service + "] via runSyncIgnore", module);
|
13,106 | Enumeration en = request.getAttributeNames();
while (en.hasMoreElements()) {
String name = (String) en.nextElement();
Object val = request.getAttribute(name);
if (val instanceof String || val instanceof Number || val instanceof Map || val instanceof List) {
<BUG>Debug.log("Adding attribute to JSON output: " + name, module);
</BUG>
attrMap.put(name, val);
}
}
| if (Debug.verboseOn()) Debug.logVerbose("Adding attribute to JSON output: " + name, module);
|
13,107 | import com.redhat.ceylon.compiler.util.Util;
import com.sun.tools.javac.code.TypeTags;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.JCBinary;
import com.sun.tools.javac.tree.JCTree.JCExpression;
<BUG>import com.sun.tools.javac.tree.JCTree.JCLiteral;
import com.sun.tools.javac.util.List;</BUG>
import com.sun.tools.javac.util.ListBuffer;
public class ExpressionGen extends GenPart {
public ExpressionGen(Gen2 gen) {
| import com.sun.tools.javac.tree.JCTree.JCUnary;
import com.sun.tools.javac.util.List;
|
13,108 | import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.intentions.GroovyIntentionsBundle;
import org.jetbrains.plugins.groovy.intentions.base.Intention;
import org.jetbrains.plugins.groovy.intentions.base.PsiElementPredicate;
<BUG>import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;</BUG>
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariableDeclaration;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
| import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.GrListOrMap;
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifier;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrTupleDeclaration;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrVariable;
|
13,109 | import com.intellij.psi.stubs.EmptyStub;
import com.intellij.psi.stubs.EmptyStubElementType;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
<BUG>import org.jetbrains.plugins.groovy.lang.GrReferenceAdjuster;
import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes;</BUG>
import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor;
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory;
import org.jetbrains.plugins.groovy.lang.psi.api.auxiliary.modifiers.GrModifier;
| import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes;
|
13,110 | }.start();
for (int i = 0; i < k; i++) {
final IMap map = instances[i].getMap(mapName);
new Thread() {
public void run() {
<BUG>for (int j = 0; j < 100000; j++) {
map.put(k + "-" + j, j);</BUG>
}
latch.countDown();
}
| for (int j = 0; j < size; j++) {
map.put(k + "-" + j, j);
|
13,111 | public void testMapRecordIdleEvictionOnMigration() throws InterruptedException {
Config cfg = new Config();</BUG>
final String name = "testMapRecordIdleEvictionOnMigration";
MapConfig mc = cfg.getMapConfig(name);
<BUG>int maxIdleSeconds = 10;
</BUG>
int size = 100;
final int nsize = size / 5;
mc.setMaxIdleSeconds(maxIdleSeconds);
TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(3);
| latch.await(10, TimeUnit.SECONDS);
assertNull(map.get(2));
assertEquals(2, map.get(1));
}
@Test
public void testMapRecordIdleEvictionOnMigration() {
Config cfg = new Config();
int maxIdleSeconds = 30;
|
13,112 | latch.countDown();
}
}, false);
for (int i = 0; i < size; i++) {
map.put(i, i);
<BUG>}
final Thread thread = new Thread(new Runnable() {
public void run() {
while (!Thread.currentThread().isInterrupted()) {
try {</BUG>
for (int i = 0; i < nsize; i++) {
| sleepSeconds(maxIdleSeconds - 5);
|
13,113 | }
});
thread.start();</BUG>
HazelcastInstance instance2 = factory.newHazelcastInstance(cfg);
<BUG>HazelcastInstance instance3 = factory.newHazelcastInstance(cfg);
assertTrue(latch.await(1, TimeUnit.MINUTES));
assertEquals(nsize, map.size());
thread.interrupt();
thread.join(5000);</BUG>
}
| }, false);
for (int i = 0; i < size; i++) {
map.put(i, i);
sleepSeconds(maxIdleSeconds - 5);
for (int i = 0; i < nsize; i++) {
map.get(i);
assertOpenEventually(latch);
assertEquals("not all idle values evicted!",nsize, map.size());
|
13,114 | for (int j = 0; j < putCount; j++) {
final long expectedEvictionTime = ttl + System.currentTimeMillis();
map.put(j + putCount * threadId, expectedEvictionTime, ttl, TimeUnit.MILLISECONDS);
}
}
<BUG>assertTrue(latch.await(1, TimeUnit.MINUTES));
assertFalse("Some evictions took more than 3 seconds! -> " + times, error.get());
</BUG>
}
@Test
| assertOpenEventually(latch);
assertFalse("Some evictions took more than 5 seconds! -> late eviction count:" + times.size(), error.get());
|
13,115 | latch.countDown();
}
}, false);
for (int i = 0; i < size; i++) {
map.put(i, i);
<BUG>}
instance2.shutdown();
instance3.shutdown();
assertTrue("map size:" + map.size(), latch.await(30, TimeUnit.SECONDS));
}</BUG>
@Test
| instances[1].shutdown();
instances[2].shutdown();
assertOpenEventually(latch);
assertEquals("not all values evicted!",0,map.size());
|
13,116 | return new CommentViewHolder(view, fragment.getActivity(), (ICommentableFragment) fragment);
} else if (viewType == GiveawayDetailsCard.VIEW_LAYOUT) {
return new GiveawayCardViewHolder(view, (GiveawayDetailFragment) fragment);
} else if (viewType == DiscussionDetailsCard.VIEW_LAYOUT) {
return new DiscussionCardViewHolder(view, (DiscussionDetailFragment) fragment, fragment.getContext());
<BUG>} else if (viewType == TradeDetailsCard.VIEW_LAYOUT) {
return new TradeCardViewHolder(view, (TradeDetailFragment) fragment, fragment.getContext());</BUG>
} else if (viewType == CommentContextViewHolder.VIEW_LAYOUT) {
return new CommentContextViewHolder(view, fragment.getActivity());
} else if (viewType == Poll.Header.VIEW_LAYOUT) {
| [DELETED] |
13,117 | GiveawayDetailsCard card = (GiveawayDetailsCard) getItem(position);
holder.setFrom(card);
} else if (h instanceof DiscussionCardViewHolder) {
DiscussionCardViewHolder holder = (DiscussionCardViewHolder) h;
DiscussionDetailsCard card = (DiscussionDetailsCard) getItem(position);
<BUG>holder.setFrom(card);
} else if (h instanceof TradeCardViewHolder) {
TradeCardViewHolder holder = (TradeCardViewHolder) h;
TradeDetailsCard card = (TradeDetailsCard) getItem(position);</BUG>
holder.setFrom(card);
| [DELETED] |
13,118 | setContentView(R.layout.activity_one_fragment);
if (savedInstanceState == null)
loadFragment(DiscussionDetailFragment.newInstance((BasicDiscussion) serializable, commentContext));
return;
}
<BUG>serializable = getIntent().getSerializableExtra(TradeDetailFragment.ARG_TRADE);
if (serializable != null) {
setContentView(R.layout.activity_one_fragment);
if (savedInstanceState == null)
loadFragment(TradeDetailFragment.newInstance((BasicTrade) serializable, commentContext));
return;
}</BUG>
String user = getIntent().getStringExtra(UserDetailFragment.ARG_USER);
| [DELETED] |
13,119 | params.width = commentMarker.getLayoutParams().width * Math.min(MAX_VISIBLE_DEPTH, comment.getDepth());
commentIndent.setLayoutParams(params);
Picasso.with(context).load(comment.getAvatar()).placeholder(R.drawable.default_avatar_mask).transform(new RoundedCornersTransformation(20, 0)).into(commentImage);
View.OnClickListener viewProfileListener = comment.isDeleted() ? null : new View.OnClickListener() {
@Override
<BUG>public void onClick(View v) {
fragment.showProfile(comment.getAuthor());</BUG>
}
};
commentImage.setOnClickListener(viewProfileListener);
| if(comment instanceof TradeComment)
fragment.showProfile(((TradeComment) comment).getSteamID64());
else
fragment.showProfile(comment.getAuthor());
|
13,120 | return super.onKeyDown(keyCode, event);
}
@Override
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
<BUG>final CharSequence[] strings = new CharSequence[]{getString(R.string.go_to_giveaway), getString(R.string.go_to_discussion), getString(R.string.go_to_user), getString(R.string.go_to_trade)};
AlertDialog.Builder builder = new AlertDialog.Builder(this);</BUG>
builder.setTitle(R.string.go_to);
builder.setItems(strings, new DialogInterface.OnClickListener() {
@Override
| final CharSequence[] strings = new CharSequence[]{getString(R.string.go_to_giveaway), getString(R.string.go_to_discussion), getString(R.string.go_to_user)};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
13,121 | intent.putExtra(DiscussionDetailFragment.ARG_DISCUSSION, new BasicDiscussion(target));
break;
case 2:
intent.putExtra(UserDetailFragment.ARG_USER, target);
break;
<BUG>case 3:
intent.putExtra(TradeDetailFragment.ARG_TRADE, new BasicTrade(target));
break;</BUG>
}
startActivity(intent);
| [DELETED] |
13,122 | chart.addYAxisLabels(AxisLabelsFactory.newAxisLabels(labels));
chart.addXAxisLabels(AxisLabelsFactory.newNumericRangeAxisLabels(0, max));
chart.setBarWidth(BarChart.AUTO_RESIZE);
chart.setSize(600, 500);
chart.setHorizontal(true);
<BUG>chart.setTitle("Total Evaluations by User");
showChartImg(resp, chart.toURLString());
}</BUG>
private List<Entry<String, Integer>> sortEntries(Collection<Entry<String, Integer>> entries) {
List<Entry<String, Integer>> result = new ArrayList<Entry<String, Integer>>(entries);
| chart.setDataEncoding(DataEncoding.TEXT);
return chart;
}
|
13,123 | checkEvaluationsEqual(eval4, foundissueProto.getEvaluations(0));
checkEvaluationsEqual(eval5, foundissueProto.getEvaluations(1));
}
public void testGetRecentEvaluationsNoneFound() throws Exception {
DbIssue issue = createDbIssue("fad", persistenceHelper);
<BUG>DbEvaluation eval1 = createEvaluation(issue, "someone", 100);
DbEvaluation eval2 = createEvaluation(issue, "someone", 200);
DbEvaluation eval3 = createEvaluation(issue, "someone", 300);
issue.addEvaluations(eval1, eval2, eval3);</BUG>
getPersistenceManager().makePersistent(issue);
| [DELETED] |
13,124 | public int read() throws IOException {
return inputStream.read();
}
});
}
<BUG>}
protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {</BUG>
DbUser user;
Query query = getPersistenceManager().newQuery("select from " + persistenceHelper.getDbUserClass().getName()
+ " where openid == :myopenid");
| @SuppressWarnings({"unchecked"})
protected DbEvaluation createEvaluation(DbIssue issue, String who, long when) {
|
13,125 | eval.setComment("my comment");
eval.setDesignation("MUST_FIX");
eval.setIssue(issue);
eval.setWhen(when);
eval.setWho(user.createKeyObject());
<BUG>eval.setEmail(who);
return eval;</BUG>
}
protected PersistenceManager getPersistenceManager() {
return testHelper.getPersistenceManager();
| issue.addEvaluation(eval);
return eval;
|
13,126 | import com.intrbiz.data.db.compiler.meta.ScriptType;
import com.intrbiz.data.db.compiler.util.SQLScript;
import com.intrbiz.gerald.witchcraft.Witchcraft;
@SQLSchema(
name = "bergamot",
<BUG>version = @SQLVersion({3, 30, 0}),
</BUG>
tables = {
Site.class,
Location.class,
| version = @SQLVersion({3, 31, 0}),
|
13,127 | set_current_alert,
(with) -> {
try (PreparedStatement stmt = with.prepareStatement("SELECT bergamot.set_current_alert(?::UUID, ?::UUID)"))
{
stmt.setObject(1, checkId);
<BUG>stmt.setObject(2, alertId);
try (ResultSet rs = stmt.executeQuery())</BUG>
{
if (rs.next()) return rs.getBoolean(1);
}
| try (ResultSet rs = stmt.executeQuery())
|
13,128 | db.execute(() -> {
db.setComment(ackCom);
alert.setAcknowledged(true);
alert.setAcknowledgedAt(new Timestamp(System.currentTimeMillis()));
alert.setAcknowledgedById(contact.getId());
<BUG>db.setAlert(alert);
});</BUG>
if (! alert.getCheck().getState().isSuppressedOrInDowntime())
{
SendAcknowledge sendAck = alert.createAcknowledgeNotification(Calendar.getInstance(), contact, ackCom);
| db.acknowledgeCheck(alert.getCheckId(), true);
});
|
13,129 | Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.tab_qibla, container, false);
final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass);
qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north),
((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla));
<BUG>sOrientationListener = new SensorListener() {
</BUG>
public void onSensorChanged(int s, float v[]) {
float northDirection = v[SensorManager.DATA_X];
qiblaCompassView.setDirections(northDirection, sQiblaDirection);
| sOrientationListener = new android.hardware.SensorListener() {
|
13,130 | Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.tab_qibla, container, false);
final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass);
qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north),
((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla));
<BUG>sOrientationListener = new SensorListener() {
</BUG>
public void onSensorChanged(int s, float v[]) {
float northDirection = v[SensorManager.DATA_X];
qiblaCompassView.setDirections(northDirection, sQiblaDirection);
| sOrientationListener = new android.hardware.SensorListener() {
|
13,131 | 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;
|
13,132 | 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)
|
13,133 | } 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);
|
13,134 | } 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);
|
13,135 | }
} 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);
|
13,136 | 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);
|
13,137 | 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[1]));
if (LOG.isLoggable(Level.FINE)) {
| Statement st = con.createStatement();
try {
|
13,138 | 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 deleteDatabaseFiles(String dbName, boolean now) {
| public static void deleteDatabaseFiles() {
|
13,139 | String enclosure = transMeta.environmentSubstitute( meta.content.enclosure );
String escapeCharacter = transMeta.environmentSubstitute( meta.content.escapeCharacter );
if ( textFileList.nrOfFiles() > 0 ) {
int clearFields = meta.content.header ? SWT.YES : SWT.NO;
int nrInputFields = meta.inputFiles.inputFields.length;
<BUG>if ( meta.content.header && nrInputFields > 0 ) {
MessageBox mb = new MessageBox( shell, SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION );</BUG>
mb.setMessage( BaseMessages.getString( PKG, "TextFileInputDialog.ClearFieldList.DialogMessage" ) );
mb.setText( BaseMessages.getString( PKG, "TextFileInputDialog.ClearFieldList.DialogTitle" ) );
clearFields = mb.open();
| if ( nrInputFields > 0 ) {
MessageBox mb = new MessageBox( shell, SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION );
|
13,140 | reader = new InputStreamReader( inputStream, meta.getEncoding() );
} else {
reader = new InputStreamReader( inputStream );
}
EncodingType encodingType = EncodingType.guessEncodingType( reader.getEncoding() );
<BUG>if ( clearFields == SWT.YES || !meta.content.header || nrInputFields > 0 ) {
String line;
if ( meta.content.header || meta.inputFiles.inputFields.length == 0 ) {
line = TextFileInputUtils.getLine( log, reader, encodingType, fileFormatType, lineStringBuilder );
</BUG>
if ( line != null ) {
| String line = TextFileInputUtils.getLine( log, reader, encodingType, fileFormatType, lineStringBuilder );
|
13,141 | String[] fields =
TextFileInputUtils.guessStringsFromLine( transMeta, log, line, meta, delimiter, enclosure,
escapeCharacter );
for ( int i = 0; i < fields.length; i++ ) {
String field = fields[i];
<BUG>if ( field == null || field.length() == 0 || ( nrInputFields == 0 && !meta.content.header ) ) {
field = "Field" + ( i + 1 );</BUG>
} else {
field = Const.trim( field );
field = Const.replace( field, " ", "_" );
| if ( field == null || field.length() == 0 || !meta.content.header ) {
field = "Field" + ( i + 1 );
|
13,142 | item.setText( 2, "String" ); // The default type is String...
}
wFields.setRowNums();
wFields.optWidth( true );
getInfo( meta );
<BUG>}
}</BUG>
String shellText = BaseMessages.getString( PKG, "TextFileInputDialog.LinesToSample.DialogTitle" );
String lineText = BaseMessages.getString( PKG, "TextFileInputDialog.LinesToSample.DialogMessage" );
EnterNumberDialog end = new EnterNumberDialog( shell, 100, shellText, lineText );
| [DELETED] |
13,143 | final String dashboardId = dashboardService.save(dashboard);
final ImmutableList.Builder<WidgetPositionRequest> widgetPositions = ImmutableList.builder();
for (DashboardWidget dashboardWidget : dashboardDescription.getDashboardWidgets()) {
final org.graylog2.dashboards.widgets.DashboardWidget widget = createDashboardWidget(dashboardWidget, userName);
dashboardService.addWidget(dashboard, widget);
<BUG>final WidgetPositionRequest positionRequest = new WidgetPositionRequest();
positionRequest.id = widget.getId();
positionRequest.row = dashboardWidget.getRow();
positionRequest.col = dashboardWidget.getCol();
widgetPositions.add(positionRequest);
</BUG>
}
| final WidgetPositionRequest widgetPosition = new WidgetPositionRequest(widget.getId(),
dashboardWidget.getRow(), dashboardWidget.getCol());
widgetPositions.add(widgetPosition);
|
13,144 | 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.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
</BUG>
HorizontalGroup dateGroup = new HorizontalGroup();
dateGroup.space(4 * GlobalConf.SCALE_FACTOR);
dateGroup.addActor(date);
| VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
|
13,145 | 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 * GlobalConf.SCALE_FACTOR);
</BUG>
objectsGroup.addActor(searchBox);
if (focusListScrollPane != null) {
objectsGroup.addActor(focusListScrollPane);
| VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
|
13,146 | 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() {
|
13,147 | </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() {
|
13,148 | });
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.add(time);</BUG>
panes.put(timeComponent.getClass().getSimpleName(), time);
if (Constants.desktop) {
recCamera = new OwnImageButton(skin, "rec");
| time.align(Align.left).columnAlign(Align.left);
mainActors.add(time);
|
13,149 | 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, false);
<BUG>objects.align(Align.left);
mainActors.add(objects);</BUG>
panes.put(objectsComponent.getClass().getSimpleName(), objects);
GaiaComponent gaiaComponent = new GaiaComponent(skin, ui);
gaiaComponent.initialize();
| objects.align(Align.left).columnAlign(Align.left);
mainActors.add(objects);
|
13,150 | 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"), musicComponent.getActor(), skin, true, musicActors);
<BUG>music.align(Align.left);
mainActors.add(music);</BUG>
panes.put(musicComponent.getClass().getSimpleName(), music);
}
Button switchWebgl = new OwnTextButton(txt("gui.webgl.back"), skin, "link");
| music.align(Align.left).columnAlign(Align.left);
mainActors.add(music);
|
13,151 | package org.neo4j.server.rest;
<BUG>import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import org.junit.After;</BUG>
import org.junit.Before;
import org.junit.Test;
| import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import javax.ws.rs.core.MediaType;
import org.junit.After;
|
13,152 | server = null;
}
@Test
public void shouldRespondWithTheWebAdminClientSettings() throws Exception {
String url = functionalTestHelper.mangementUri() + "properties/neo4j-servers";
<BUG>ClientResponse response = Client.create().resource(url).get(ClientResponse.class);
String json = response.getEntity(String.class);</BUG>
assertEquals(200, response.getStatus());
assertThat(json, containsString("\"url\" : \"" + server.baseUri() + "db/data/\""));
| ClientResponse response = Client.create().resource( url ).accept(
MediaType.APPLICATION_JSON_TYPE ).get( ClientResponse.class );
String json = response.getEntity(String.class);
|
13,153 | package org.neo4j.server.rest;
import static org.junit.Assert.assertEquals;
<BUG>import java.io.IOException;
import org.junit.After;</BUG>
import org.junit.Before;
import org.junit.Test;
import org.neo4j.server.NeoServer;
| import javax.ws.rs.core.MediaType;
import org.junit.After;
|
13,154 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.List;
<BUG>import java.util.Optional;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandDelete extends FCCommandBase {
private static final FlagMapper MAPPER = map -> key -> value -> {
map.put(key, value);
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
13,155 | .append(Text.of(TextColors.GREEN, "Usage: "))
.append(getUsage(source))
.build());
return CommandResult.empty();
} else if (isIn(REGIONS_ALIASES, parse.args[0])) {
<BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
IRegion region = FGManager.getInstance().getRegion(parse.args[1]);
</BUG>
boolean isWorldRegion = false;
if (region == null) {
| String regionName = parse.args[1];
IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
|
13,156 | </BUG>
isWorldRegion = true;
}
if (region == null)
<BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!"));
if (region instanceof GlobalWorldRegion) {
</BUG>
throw new CommandException(Text.of("You may not delete the global region!"));
}
| if (world == null)
throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!"));
if (world == null) throw new CommandException(Text.of("Must specify a world!"));
region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null);
throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!"));
if (region instanceof IGlobal) {
|
13,157 | source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region"
);
return CommandResult.success();
} else if (isIn(HANDLERS_ALIASES, parse.args[0])) {
if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!"));
<BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]);
if (handler == null)
throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1);
if (handler instanceof GlobalHandler)</BUG>
throw new CommandException(Text.of("You may not delete the global handler!"));
| Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]);
if (!handlerOpt.isPresent())
IHandler handler = handlerOpt.get();
if (handler instanceof GlobalHandler)
|
13,158 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
13,159 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
13,160 | @Dependency(id = "foxcore")
},
description = "A world protection plugin built for SpongeAPI. Requires FoxCore.",
authors = {"gravityfox"},
url = "https://github.com/FoxDenStudio/FoxGuard")
<BUG>public final class FoxGuardMain {
public final Cause pluginCause = Cause.builder().named("plugin", this).build();
private static FoxGuardMain instanceField;</BUG>
@Inject
private Logger logger;
| private static FoxGuardMain instanceField;
|
13,161 | private UserStorageService userStorage;
private EconomyService economyService = null;
private boolean loaded = false;
private FCCommandDispatcher fgDispatcher;
public static FoxGuardMain instance() {
<BUG>return instanceField;
}</BUG>
@Listener
public void construct(GameConstructionEvent event) {
instanceField = this;
| }
public static Cause getCause() {
return instance().pluginCause;
}
|
13,162 | return configDirectory;
}
public boolean isLoaded() {
return loaded;
}
<BUG>public static Cause getCause() {
return instance().pluginCause;
}</BUG>
public EconomyService getEconomyService() {
return economyService;
| [DELETED] |
13,163 | import org.spongepowered.api.world.Locatable;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import javax.annotation.Nullable;
import java.util.*;
<BUG>import java.util.stream.Collectors;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG>
public class CommandHere extends FCCommandBase {
private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"};
private static final FlagMapper MAPPER = map -> key -> value -> {
| import java.util.stream.Stream;
import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
|
13,164 | .excludeCurrent(true)
.autoCloseQuotes(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "handler").stream()
.filter(new StartsWithPredicate(parse.current.token))</BUG>
.map(args -> parse.current.prefix + args)
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index > 0) {
| return Stream.of("region", "handler")
.filter(new StartsWithPredicate(parse.current.token))
|
13,165 | private static FGStorageManager instance;
private final Logger logger = FoxGuardMain.instance().getLogger();</BUG>
private final Set<LoadEntry> loaded = new HashSet<>();
private final Path directory = getDirectory();
private final Map<String, Path> worldDirectories;
<BUG>private FGStorageManager() {
defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG>
if (k instanceof IFGObject) {
m.put((IFGObject) k, true);
return true;
| public final HashMap<IFGObject, Boolean> defaultModifiedMap;
private final UserStorageService userStorageService;
private final Logger logger = FoxGuardMain.instance().getLogger();
userStorageService = FoxGuardMain.instance().getUserStorage();
defaultModifiedMap = new CacheMap<>((k, m) -> {
|
13,166 | String name = fgObject.getName();
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| UUID owner = fgObject.getOwner();
boolean isOwned = !owner.equals(SERVER_UUID);
Optional<User> userOwner = userStorageService.get(owner);
String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name;
if (fgObject.autoSave()) {
Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
|
13,167 | if (fgObject.autoSave()) {
Path singleDir = dir.resolve(name.toLowerCase());
</BUG>
boolean shouldSave = fgObject.shouldSave();
if (force || shouldSave) {
<BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir);
</BUG>
constructDirectory(singleDir);
try {
fgObject.save(singleDir);
| Path singleDir = serverDir.resolve(name.toLowerCase());
logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
|
13,168 | public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
13,169 | public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
| Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
13,170 | StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
| public enum Type {
REGION, WREGION, HANDLER
|
13,171 | .autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
| return Stream.of("region", "worldregion", "handler", "controller")
|
13,172 | PortletDataContext portletDataContext, DDMStructure structure)
throws Exception {
prepareLanguagesForImport(structure);
long userId = portletDataContext.getUserId(structure.getUserUuid());
if (structure.getParentStructureId() !=
<BUG>DDMStructureConstants.DEFAULT_PARENT_STRUCTURE_ID) {
Element structureElement =
portletDataContext.getReferenceDataElement(
structure, DDMStructure.class,
</BUG>
structure.getParentStructureId());
| Element structureElement = portletDataContext.getExportDataElement(
DDMStructure parentStructure =
DDMStructureLocalServiceUtil.getStructure(
|
13,173 | Map<Long, Long> folderIds =
(Map<Long, Long>)portletDataContext.getNewPrimaryKeysMap(
JournalFolder.class);
if (article.getFolderId() !=
JournalFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
<BUG>Element folderElement = portletDataContext.getReferenceDataElement(
article, JournalFolder.class, article.getFolderId());
StagedModelDataHandlerUtil.importStagedModel(
portletDataContext, folderElement);
}</BUG>
long folderId = MapUtil.getLong(
| StagedModelDataHandlerUtil.importReferenceStagedModel(
portletDataContext, article, JournalFolder.class,
}
|
13,174 | this.filterChains = new SlingFilterChainHelper[FilterChainType.values().length];
this.filterChains[FilterChainType.REQUEST.ordinal()] = new SlingFilterChainHelper();
this.filterChains[FilterChainType.ERROR.ordinal()] = new SlingFilterChainHelper();
this.filterChains[FilterChainType.INCLUDE.ordinal()] = new SlingFilterChainHelper();
this.filterChains[FilterChainType.FORWARD.ordinal()] = new SlingFilterChainHelper();
<BUG>this.filterChains[FilterChainType.COMPONENT.ordinal()] = new SlingFilterChainHelper();
}</BUG>
public SlingFilterChainHelper getFilterChain(final FilterChainType chain) {
return filterChains[chain.ordinal()];
}
| this.compatMode = compatMode;
|
13,175 | public static final String PROP_MAX_CALL_COUNTER = "sling.max.calls";
@Property(intValue=RequestData.DEFAULT_MAX_INCLUSION_COUNTER)
public static final String PROP_MAX_INCLUSION_COUNTER = "sling.max.inclusions";
public static final boolean DEFAULT_ALLOW_TRACE = false;
@Property(boolValue=DEFAULT_ALLOW_TRACE)
<BUG>public static final String PROP_ALLOW_TRACE = "sling.trace.allow";
@Property(intValue = RequestHistoryConsolePlugin.STORED_REQUESTS_COUNT)</BUG>
private static final String PROP_MAX_RECORD_REQUESTS = "sling.max.record.requests";
@Reference
private HttpService httpService;
| public static final boolean DEFAULT_FILTER_COMPAT_MODE = false;
@Property(boolValue=DEFAULT_FILTER_COMPAT_MODE)
public static final String PROP_FILTER_COMPAT_MODE = "sling.filter.compat.mode";
@Property(intValue = RequestHistoryConsolePlugin.STORED_REQUESTS_COUNT)
|
13,176 | } catch (Exception e) {
log.error("Cannot register " + this.getServerInfo(), e);
}
slingServletContext = new SlingServletContext(bundleContext, this);
filterManager = new ServletFilterManager(bundleContext,
<BUG>slingServletContext);
filterManager.open();</BUG>
requestProcessor.setFilterManager(filterManager);
requestListenerManager = new RequestListenerManager( bundleContext, slingServletContext );
| slingServletContext,
OsgiUtil.toBoolean(componentConfig.get(PROP_FILTER_COMPAT_MODE), DEFAULT_FILTER_COMPAT_MODE));
filterManager.open();
|
13,177 | public static final String SLING_CURRENT_SERVLET_NAME = "sling.core.current.servletName";
@Deprecated
public static final String SLING_SERLVET_NAME = "sling.core.servletName";
@Deprecated
public static final String SESSION = "javax.jcr.Session";
<BUG>public static final String FILTER_NAME = "javax.servlet.Filter";
public static final String FILTER_SCOPE = "filter.scope";
public static final String FILTER_SCOPE_COMPONENT = "COMPONENT";</BUG>
public static final String FILTER_SCOPE_ERROR = "ERROR";
public static final String FILTER_SCOPE_INCLUDE = "INCLUDE";
| public static final String SLING_FILTER_SCOPE = "sling.filter.scope";
public static final String FILTER_SCOPE_COMPONENT = "COMPONENT";
|
13,178 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
13,179 | package org.jboss.as.patching.runner;
<BUG>import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.LocalPatchInfo;</BUG>
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
13,180 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
13,181 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
13,182 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
13,183 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
13,184 | 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;
|
13,185 | 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());
|
13,186 | 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);
|
13,187 | 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);
|
13,188 | 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);
|
13,189 | 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;
|
13,190 | 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);
|
13,191 | 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);
|
13,192 | 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;
|
13,193 | }
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);
|
13,194 | 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);
|
13,195 | @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);
|
13,196 | 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);
|
13,197 | import org.jboss.seam.annotations.Transactional;
import org.zanata.common.EntityStatus;
import org.zanata.common.LocaleId;
import org.zanata.common.MergeType;
import org.zanata.dao.DocumentDAO;
<BUG>import org.zanata.dao.ProjectIterationDAO;
import org.zanata.model.HDocument;</BUG>
import org.zanata.model.HProject;
import org.zanata.model.HProjectIteration;
import org.zanata.process.ProcessHandle;
| import org.zanata.lock.LockNotAcquiredException;
import org.zanata.model.HDocument;
|
13,198 | import org.zanata.service.LocaleService;
import org.zanata.service.ProcessManagerService;
import org.zanata.service.TranslationService;
import org.zanata.service.impl.DocumentServiceImpl;
import org.zanata.service.impl.TranslationServiceImpl;
<BUG>import lombok.extern.slf4j.Slf4j;
@Name("asynchronousProcessResourceService")</BUG>
@Path("/async")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
@Transactional
| import static org.zanata.rest.dto.ProcessStatus.ProcessStatusCode;
@Name("asynchronousProcessResourceService")
|
13,199 | private ProjectIterationDAO projectIterationDAO;
@In
private ResourceUtils resourceUtils;
@In
private ZanataIdentity identity;
<BUG>@Context
private HttpServletResponse response;</BUG>
@Override
public ProcessStatus startSourceDocCreation(final @PathParam("id") String idNoSlash,
final @PathParam("projectSlug") String projectSlug,
| [DELETED] |
13,200 | protected void run(ProcessHandle handle) throws Throwable
{
DocumentService documentServiceImpl =
(DocumentService)Component.getInstance(DocumentServiceImpl.class);
documentServiceImpl.saveDocument(
<BUG>projectSlug, iterationSlug, resource, extensions, copytrans);
</BUG>
handle.setCurrentProgress( handle.getMaxProgress() ); // TODO This should update with real progress
}
},
| projectSlug, iterationSlug, resource, extensions, copytrans, true);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.