id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
24,801 | import opennlp.tools.ml.model.Event;
import opennlp.tools.ml.model.MutableContext;
import opennlp.tools.ml.model.OnePassDataIndexer;
import opennlp.tools.ml.model.Prior;
import opennlp.tools.ml.model.UniformPrior;
<BUG>import opennlp.tools.util.ObjectStream;
class GISTrainer {</BUG>
private static final double LLThresh... | import opennlp.tools.util.TrainingParameters;
class GISTrainer {
|
24,802 | private String[] predLabels;
private MutableContext[] observedExpects;
private MutableContext[] params;
private MutableContext[][] modelExpects;
private Prior prior;
<BUG>private EvalParameters evalParams;
GISTrainer() {</BUG>
printMessages = false;
}
GISTrainer(boolean printMessages) {
| private Map<String, String> reportMap = new HashMap<>();
GISTrainer() {
|
24,803 | return true;
}
public AbstractModel doTrain(DataIndexer indexer) throws IOException {
int iterations = getIterations();
AbstractModel model;
<BUG>boolean printMessages = parameters.getBooleanParam(VERBOSE_PARAM, VERBOSE_DEFAULT);
boolean smoothing = parameters.getBooleanParam(SMOOTHING_PARAM, SMOOTHING_DEFAULT);
int ... | boolean printMessages = trainingParameters.getBooleanParameter(VERBOSE_PARAM, VERBOSE_DEFAULT);
boolean smoothing = trainingParameters.getBooleanParameter(SMOOTHING_PARAM, SMOOTHING_DEFAULT);
int threads = trainingParameters.getIntParameter(TrainingParameters.THREADS_PARAM, 1);
|
24,804 | public abstract class MUDObject {
public static MUDServer parent;
private int dbref = 0; // database reference number
protected String name = ""; // object name
protected String desc = ""; ... | protected TypeFlag type = TypeFlag.OBJECT; // object type
|
24,805 | effect = this.effects.get(e);
if (effect.getName().equals(tEffect)) {
this.effects.remove(effect);
}
}
<BUG>}
public void removeEffects()</BUG>
{
this.effects.clear();
}
| public void removeEffect(Effect effect) {
public void removeEffects()
|
24,806 | for (int i = 0; i < dimX; i++)
{
for (int j = 0; j < dimY; j++)
{
int id = 0;
<BUG>Room room = new Room(id, instance_name + " Room (" + i + ", " + j + ")", EnumSet.of(ObjectFlag.ROOM, ObjectFlag.DARK), "You see nothing.", 0);
roomIds[counter] = room.getDBRef();</BUG>
counter = counter + 1;
dRooms[i][j] = room;
}
| Room room = new Room(id, instance_name + " Room (" + i + ", " + j + ")", EnumSet.of(ObjectFlag.DARK), "You see nothing.", 0);
roomIds[counter] = room.getDBRef();
|
24,807 | for (int i = 0; i < dimX; i++)
{
for (int j = 0; j < dimY; j++)
{
int id = 0;
<BUG>Room room = new Room(id, instance_name + " Room (" + i + ", " + j + ")", EnumSet.of(ObjectFlag.ROOM, ObjectFlag.DARK), "You see nothing.", 0);
roomIds[counter] = room.getDBRef();</BUG>
counter = counter + 1;
dRooms[i][j] = room;
}
| Room room = new Room(id, instance_name + " Room (" + i + ", " + j + ")", EnumSet.of(ObjectFlag.DARK), "You see nothing.", 0);
roomIds[counter] = room.getDBRef();
|
24,808 | public void onFailure(TransactionResponse response, String reason) {
SdkUIFlowUtil.hideProgressDialog();
MandiriECashActivity.this.errorMessage = getString(R.string.message_payment_failed);
MandiriECashActivity.this.transactionResponse = response;
if (response != null && response.equals(getString(R.string.failed_code_4... | initPaymentStatus(transactionResponse, errorMessage, Constants.PAYMENT_METHOD_MANDIRI_ECASH, false);
|
24,809 | currentFragmentName = STATUS_FRAGMENT;
mToolbar.setNavigationIcon(closeIcon);
setSupportActionBar(mToolbar);
transactionResponseFromMerchant = new TransactionResponse("200", "Transaction Success", UUID.randomUUID().toString(),
mMidtransSDK.getTransactionRequest().getOrderId(), String.valueOf(mMidtransSDK.getTransaction... | initPaymentStatus(transactionResponse, errorMessage, Constants.PAYMENT_METHOD_MANDIRI_ECASH, false);
|
24,810 | buttonConfirmPayment.setVisibility(View.GONE);
} else if (resultCode == RESULT_CANCELED) {
currentFragmentName = STATUS_FRAGMENT;
mToolbar.setNavigationIcon(closeIcon);
setSupportActionBar(mToolbar);
<BUG>initPaymentStatus(transactionResponse, errorMessage, false);
</BUG>
buttonConfirmPayment.setVisibility(View.GONE);
... | initPaymentStatus(transactionResponse, errorMessage, Constants.PAYMENT_METHOD_MANDIRI_ECASH, false);
|
24,811 | if (!mMidtransSDK.getUIKitCustomSetting().isShowPaymentStatus()) {
setResultCode(RESULT_OK);
setResultAndFinish();
return;
}
<BUG>FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();</BUG>
currentFragment = STATUS_FRAGMENT;
mButtonC... | [DELETED] |
24,812 | currentFragment = STATUS_FRAGMENT;
mButtonConfirmPayment.setText(R.string.done);
Drawable closeIcon = getResources().getDrawable(R.drawable.ic_close);
closeIcon.setColorFilter(getResources().getColor(R.color.dark_gray), PorterDuff.Mode.MULTIPLY);
mButtonBack.setIconResource(closeIcon);
<BUG>setSupportActionBar(mToolbar... | initPaymentStatus(transactionResponse, errorMessage, position, false);
|
24,813 | public static final int SCAN_REQUEST_CODE = 101;
private static final int PAYMENT_WEB_INTENT = 100;
private static final String KEY_SCAN_SUCCESS_EVENT = "Scan Card Success";
private static final String KEY_SCAN_FAILED_EVENT = "Scan Card Failed";
private static final String KEY_SCAN_CANCELLED_EVENT = "Scan Card Cancelle... | private static final int MAX_ATTEMPT = 3;
private int attempt = 0;
private Toolbar toolbar;
|
24,814 | titleHeaderTextView = (TextView) findViewById(R.id.text_title);
logo = (ImageView) findViewById(R.id.merchant_logo);
textTotalAmount = (DefaultTextView) findViewById(R.id.text_amount);
buttonback = (FancyButton) findViewById(R.id.btn_back);
imageSavedCardDelete = (ImageView) findViewById(R.id.image_saved_card_delete);
... | mainlayout = (RelativeLayout) findViewById(R.id.main_layout);
|
24,815 | payUsingCard();
}
}
public void payUsingCard() {
SdkUIFlowUtil.showProgressDialog(this, getString(R.string.processing_payment), false);
<BUG>processingLayout.setVisibility(View.VISIBLE);
titleHeaderTextView.setText(getString(R.string.processing_payment));</BUG>
CreditCardPaymentModel paymentModel;
if (midtransSDK.getTr... | [DELETED] |
24,816 | public void run() {
processingLayout.setVisibility(View.GONE);
}
}, 200);
CreditDebitCardFlowActivity.this.transactionResponse = transactionResponse;
<BUG>CreditDebitCardFlowActivity.this.errorMessage = getString(R.string.message_payment_failed);
SdkUIFlowUtil.hideProgressDialog();
initPaymentStatus(transactionResponse... | initPaymentStatus(transactionResponse, errorMessage, Constants.PAYMENT_METHOD_CREDIT_OR_DEBIT, true);
|
24,817 | creditCards.add(saveCardRequest);
}
}
}
SdkUIFlowUtil.hideProgressDialog();
<BUG>initPaymentStatus(transactionResponse, null, true);
}</BUG>
public MidtransSDK getMidtransSDK() {
return midtransSDK;
}
| initPaymentStatus(transactionResponse, null, Constants.PAYMENT_METHOD_CREDIT_OR_DEBIT, true);
|
24,818 | if (resultCode == RESULT_OK) {
if (requestCode == PAYMENT_WEB_INTENT) {
payUsingCard();
} else if (requestCode == SCAN_REQUEST_CODE) {
if (data != null && data.hasExtra(ExternalScanner.EXTRA_SCAN_DATA)) {
<BUG>midtransSDK.getmMixpanelAnalyticsManager().trackMixpanel(KEY_SCAN_SUCCESS_EVENT, PAYMENT_CREDIT_CARD, null);
<... | midtransSDK.getmMixpanelAnalyticsManager().trackMixpanel(MidtransSDK.getInstance().readAuthenticationToken(), KEY_SCAN_SUCCESS_EVENT, PAYMENT_CREDIT_CARD, null);
|
24,819 | </BUG>
ScannerModel scanData = (ScannerModel) data.getSerializableExtra(ExternalScanner.EXTRA_SCAN_DATA);
Logger.i(String.format("Card Number: %s, Card Expire: %s/%d", scanData.getCardNumber(), scanData.getExpiredMonth() < 10 ? String.format("0%d", scanData.getExpiredMonth()) : String.format("%d", scanData.getExpiredMo... | if (resultCode == RESULT_OK) {
if (requestCode == PAYMENT_WEB_INTENT) {
payUsingCard();
} else if (requestCode == SCAN_REQUEST_CODE) {
if (data != null && data.hasExtra(ExternalScanner.EXTRA_SCAN_DATA)) {
midtransSDK.getmMixpanelAnalyticsManager().trackMixpanel(MidtransSDK.getInstance().readAuthenticationToken(), KEY_S... |
24,820 | if (values.isNew()) {
values.putLong(0, rank = 0);
} else {
rank = values.getLong(0) + 1;
values.putLong(0, rank);
<BUG>}
DirectMap.KeyWriter kw2 = map.keyWriter();
kw2.putLong(row);
map.getOrCreateValues(kw2).putLong(0, rank);
}</BUG>
@Override
| map.locate(row);
map.getOrCreateValues().putLong(0, rank);
|
24,821 | package com.questdb.ql.impl.analytic.denserank;
import com.questdb.ql.Record;
<BUG>import com.questdb.ql.impl.map.DirectMap;
import com.questdb.ql.impl.map.DirectMapValues;</BUG>
public class DenseRankOrderedAnalyticFunction extends AbstractRankOrderedAnalyticFunction {
public DenseRankOrderedAnalyticFunction(int pageS... | [DELETED] |
24,822 | public class DenseRankOrderedAnalyticFunction extends AbstractRankOrderedAnalyticFunction {
public DenseRankOrderedAnalyticFunction(int pageSize, String name) {
super(pageSize, name);
}
@Override
<BUG>public void add(Record record) {
DirectMap.KeyWriter kw = map.keyWriter();
kw.putLong(record.getRowId());
DirectMapValu... | [DELETED] |
24,823 | for (Record r : slaveCursor) {
cancellationHandler.check();
final DirectMap.KeyWriter key = recordMap.claimKey();
slaveCopier.copy(r, key);
if (byRowId) {
<BUG>recordMap.add(key, fakeRecord.of(r.getRowId()));
} else {
recordMap.add(key, r);
}</BUG>
}
| recordMap.add(fakeRecord.of(r.getRowId()));
recordMap.add(r);
|
24,824 | private boolean hasNext0() {
while (masterCursor.hasNext()) {
Record r = masterCursor.next();
DirectMap.KeyWriter kw = recordMap.claimKey();
masterCopier.copy(r, kw);
<BUG>hashTableCursor = recordMap.get(kw);
if (hashTableCursor.hasNext()) {</BUG>
advanceSlaveCursor();
return true;
} else if (outer) {
| hashTableCursor = recordMap.get();
if (hashTableCursor.hasNext()) {
|
24,825 | package com.questdb.ql.impl.map;
import com.questdb.ex.JournalRuntimeException;
import com.questdb.misc.Hash;
import com.questdb.misc.Numbers;
<BUG>import com.questdb.misc.Unsafe;
import com.questdb.std.*;</BUG>
import com.questdb.store.ColumnType;
import com.questdb.store.VariableColumn;
public class DirectMap extends... | import com.questdb.ql.Record;
import com.questdb.std.*;
|
24,826 | return values.of(kStart + offset, false);
} else {
return probe0(keyWriter, index);
}
}
<BUG>public DirectMapValues getValues(KeyWriter keyWriter) {
keyWriter.commit();</BUG>
kPos = keyWriter.startAddr;
int index = Hash.hashMem(keyWriter.startAddr + keyDataOffset, keyWriter.len - keyDataOffset) & mask;
long offset = of... | public DirectMapValues getValues() {
keyWriter.commit();
|
24,827 | private final RecordList records;
public MultiRecordMap(ColumnTypeResolver keyResolver, RecordMetadata valueMetadata, int keyPageSize, int valuePageSize) {
map = new DirectMap(keyPageSize, keyResolver, VALUE_RESOLVER);
records = new RecordList(valueMetadata, valuePageSize);
}
<BUG>public void add(DirectMap.KeyWriter ke... | public void add(Record record) {
DirectMapValues values = map.getOrCreateValues();
if (values.isNew()) {
|
24,828 | @Override
public void close() throws IOException {
map.close();
records.close();
}
<BUG>public RecordCursor get(DirectMap.KeyWriter key) {
DirectMapValues values = map.getValues(key);
records.of(values == null ? -1 : values.getLong(0));</BUG>
return records;
}
| public RecordCursor get() {
DirectMapValues values = map.getValues();
records.of(values == null ? -1 : values.getLong(0));
|
24,829 | @Override
public void add(Record record) {
long row = record.getRowId();
DirectMapValues prevValues = MapUtils.getMapValues(prevMap, record, partitionBy);
if (!prevValues.isNew()) {
<BUG>DirectMap.KeyWriter kw2 = map.keyWriter();
kw2.putLong(prevValues.getLong(0));
DirectMapValues values = map.getOrCreateValues(kw2);
... | map.locate(prevValues.getLong(0));
map.getOrCreateValues().putLong(0, row);
|
24,830 | break;
}
DirectMap.KeyWriter kw = map.keyWriter();
kw.putLong(sample);
copier.copy(rec, kw);
<BUG>DirectMapValues values = map.getOrCreateValues(kw);
for (int i = 0; i < sz; i++) {</BUG>
aggregators.getQuick(i).calculate(rec, values);
}
}
| DirectMapValues values = map.getOrCreateValues();
for (int i = 0; i < sz; i++) {
|
24,831 | this.record = cursor.newRecord();
this.cursor = cursor;
valueColumn.prepare(cursor.getStorageFacade());
}
@Override
<BUG>public void prepareFor(Record record) {
DirectMap.KeyWriter kw = map.keyWriter();
kw.putLong(record.getRowId());
DirectMapValues values = map.getValues(kw);
long row;</BUG>
if (values == null || (row... | map.locate(record.getRowId());
DirectMapValues values = map.getValues();
long row;
|
24,832 | package com.questdb.ql.impl.analytic.next;
import com.questdb.ql.Record;
import com.questdb.ql.impl.analytic.AbstractOrderedAnalyticFunction;
<BUG>import com.questdb.ql.impl.map.DirectMap;
import com.questdb.ql.impl.map.DirectMapValues;</BUG>
import com.questdb.ql.ops.VirtualColumn;
public class NextOrderedAnalyticFunc... | [DELETED] |
24,833 | super(pageSize, valueColumn);
}
@Override
public void add(Record record) {
long row = record.getRowId();
<BUG>if (prevRow != -1) {
DirectMap.KeyWriter kw = map.keyWriter();
kw.putLong(prevRow);
DirectMapValues values = map.getOrCreateValues(kw);
values.putLong(0, row);</BUG>
}
| map.locate(prevRow);
map.getOrCreateValues().putLong(0, row);
|
24,834 | private int journalPoolSize = 128;
private int httpQueueDepth = 1024;
private int httpSoRcvSmall = 8 * 1024;
private int httpSoRcvLarge = 4 * 1024 * 1024;
private int httpSoRetries = 1024;
<BUG>private int httpSoConsecutiveBadReadLimit = 10;
</BUG>
private boolean httpAbortBrokenUploads = true;
private String httpIndex... | private int httpSoConsecutiveBadReadLimit = 1000;
|
24,835 | if (prevValues.isNew()) {
prevRow = -1;
} else {
prevRow = prevValues.getLong(0);
}
<BUG>prevValues.putLong(0, row);
DirectMap.KeyWriter kw2 = map.keyWriter();
kw2.putLong(row);
map.getOrCreateValues(kw2).putLong(0, prevRow);
}</BUG>
@Override
| map.locate(row);
map.getOrCreateValues().putLong(0, prevRow);
|
24,836 | import board.items.BrdItem;
import board.items.BrdTracep;
import board.varie.BrdKeepPoint;
import freert.planar.PlaDirection;
import freert.planar.PlaLimits;
<BUG>import freert.planar.PlaLineInt;
import freert.planar.PlaPoint;</BUG>
import freert.planar.PlaPointFloat;
import freert.planar.PlaPointInt;
import freert.pla... | import freert.planar.PlaLineIntAlist;
import freert.planar.PlaPoint;
|
24,837 |
for (int index = 1; index < line_arr.length - 2; ++index)
</BUG>
{
<BUG>PlaDirection d1 = line_arr[index].direction();
PlaDirection d2 = line_arr[index + 1].direction();
</BUG>
if (d1.is_multiple_of_45_degree() && d2.is_multiple_of_45_degree() && d1.projection(d2) != Signum.POSITIVE)
{
| boolean polyline_changed = true;
while (polyline_changed)
if (p_polyline.plaline_len() < 4) return p_polyline;
polyline_changed = false;
PlaLineIntAlist line_arr = p_polyline.alist_copy(0);
for (int index = 1; index < line_arr.size() - 2; ++index)
PlaDirection d1 = line_arr.get(index).direction();
PlaDirection d2 = lin... |
24,838 | if (!(prev_line.is_diagonal() && next_line.is_diagonal()))
{
return null;
}
PlaPointFloat curr_corner = prev_line.intersection_approx(next_line);
<BUG>PlaPointFloat prev_corner = prev_line.intersection_approx(p_line_arr[p_no - 1]);
PlaPointFloat next_corner = next_line.intersection_approx(p_line_arr[p_no + 2]);
</BUG>... | PlaPointFloat prev_corner = prev_line.intersection_approx(p_line_arr.get(p_no - 1));
PlaPointFloat next_corner = next_line.intersection_approx(p_line_arr.get(p_no + 2));
|
24,839 | if (translate_line.side_of(next_corner) == PlaSide.ON_THE_LEFT)
{
max_translate_dist = -max_translate_dist;
}
PlaLineInt[] check_lines = new PlaLineInt[3];
<BUG>check_lines[0] = p_line_arr[p_no];
check_lines[2] = p_line_arr[p_no + 1];
</BUG>
double translate_dist = max_translate_dist;
| check_lines[0] = p_line_arr.get(p_no);
check_lines[2] = p_line_arr.get(p_no + 1);
|
24,840 | double delta_dist = max_translate_dist;
PlaSide side_of_nearest_point = translate_line.side_of(nearest_point);
int sign = Signum.as_int(max_translate_dist);
PlaLineInt new_line = null;
PlaLineInt[] check_lines = new PlaLineInt[3];
<BUG>check_lines[0] = p_line_arr[p_no - 1];
check_lines[2] = p_line_arr[p_no + 1];
</BUG... | check_lines[0] = p_line_arr.get(p_no - 1);
check_lines[2] = p_line_arr.get(p_no + 1);
|
24,841 | return new_line;
}
private Polyline reposition_lines(Polyline p_polyline)
{
if (p_polyline.plaline_len() < 5) return p_polyline;
<BUG>PlaLineInt[] line_arr = p_polyline.alist_to_array();
</BUG>
for (int index = 2; index < p_polyline.plaline_len(-2); ++index)
{
PlaLineInt new_line = reposition_line(line_arr, index);
| PlaLineIntAlist line_arr = p_polyline.alist_copy(0);
|
24,842 | </BUG>
for (int index = 2; index < p_polyline.plaline_len(-2); ++index)
{
PlaLineInt new_line = reposition_line(line_arr, index);
if (new_line == null) continue;
<BUG>line_arr[index] = new_line;
</BUG>
Polyline result = new Polyline(line_arr);
return skip_segments_of_length_0(result);
}
| return new_line;
private Polyline reposition_lines(Polyline p_polyline)
if (p_polyline.plaline_len() < 5) return p_polyline;
PlaLineIntAlist line_arr = p_polyline.alist_copy(0);
line_arr.set(index, new_line);
|
24,843 | return new Polyline(new_lines);
}
}
else if (bend)
{
<BUG>PlaLineInt[] check_line_arr = new PlaLineInt[trace_polyline.plaline_len(+1)];
for (int index = 0; index < trace_polyline.plaline_len(-1); ++index)
{
check_line_arr[index] = trace_polyline.plaline(index);
}
check_line_arr[check_line_arr.length - 2] = other_trace... | PlaLineIntAlist check_line_arr = new PlaLineIntAlist(trace_polyline.plaline_len(+1));
trace_polyline.alist_append_to(check_line_arr, 0,trace_polyline.plaline_len(-1));
check_line_arr.add( other_trace_line);
check_line_arr.add( other_prev_trace_line);
|
24,844 | @Description("Whether this instance should only participate as slave in cluster. If set to true, it will never be elected as master.")
public static final Setting<Boolean> slave_only = setting( "ha.slave_only", BOOLEAN, Settings.FALSE );
@Description( "Policy for how to handle branched data." )
public static final Sett... | [DELETED] |
24,845 | customTokens.put("%%mlFinalForestsPerHost%%", hubConfig.finalForestsPerHost.toString());
customTokens.put("%%mlTraceAppserverName%%", hubConfig.traceHttpName);
customTokens.put("%%mlTracePort%%", hubConfig.tracePort.toString());
customTokens.put("%%mlTraceDbName%%", hubConfig.traceDbName);
customTokens.put("%%mlTraceFo... | customTokens.put("%%mlTriggersDbName%%", hubConfig.triggersDbName);
customTokens.put("%%mlSchemasDbName%%", hubConfig.schemasDbName);
}
|
24,846 | this.renderer = new XWikiVelocityRenderer();
this.mockXWiki = mock(XWiki.class);
this.mockXWiki.stubs().method("getSkin").will(returnValue("default"));
this.mockXWiki.stubs().method("getSkinFile").will(returnValue(null));
this.mockXWiki.stubs().method("getResourceContent").will(returnValue(null));
<BUG>this.mockXWiki.s... | this.mockXWiki.stubs().method("getStore").will(returnValue(null));
getContext().setWiki((XWiki) this.mockXWiki.proxy());
|
24,847 | return skinDocument != null ? skinDocument.getXObject(SKINCLASS_REFERENCE) : null;
}
private TemplateContent getTemplateContentFromSkin(String template, String skin)
{
TemplateContent content;
<BUG>XWikiDocument skinDocument = getSkinDocument(skin);
if (skinDocument != null) {</BUG>
content = getTemplateContentFromDocu... | XWikiDocument skinDocument = template.equals("macros.vm") ? null : getSkinDocument(skin);
if (skinDocument != null) {
|
24,848 | IOUtils.closeQuietly(inputStream);
}
}
return null;
}
<BUG>private String getResourcePath(String suffixPath, String template)
</BUG>
{
String templatePath = suffixPath + template;
String normalizedTemplate = URI.create(templatePath).normalize().toString();
| private String getResourcePath(String suffixPath, String template, boolean testExist)
|
24,849 | String path;
XWikiDocument skinDocument = template.equals("macros.vm") ? null : getSkinDocument(skin);
if (skinDocument != null) {
path = getPathFromDocumentSkin(template, skinDocument);
} else {
<BUG>path = getResourcePath("/skins/" + skin + '/', template);
</BUG>
}
return path;
}
| path = getResourcePath("/skins/" + skin + '/', template, true);
|
24,850 | if (baseSkin != null) {
path = getPathFromSkin(template, baseSkin);
}
}
if (path == null) {
<BUG>path = getResourcePath("/templates/", template);
</BUG>
}
return path;
}
| path = getResourcePath("/templates/", template, true);
|
24,851 | Map<String, ?> sharedState, Map<String, ?> options) {
this.subject = subject;
}
@Override
public boolean login() throws LoginException {
<BUG>if (LOG.isDebugEnabled()) {
LOG.debug("hadoop login");
}</BUG>
return true;
}
| [DELETED] |
24,852 | }</BUG>
return true;
}
@Override
public boolean logout() throws LoginException {
<BUG>if (LOG.isDebugEnabled()) {
LOG.debug("hadoop logout");
}</BUG>
return true;
}
| Map<String, ?> sharedState, Map<String, ?> options) {
this.subject = subject;
public boolean login() throws LoginException {
|
24,853 | HADOOP_SECURITY_AUTHENTICATION +
" of " + value);
}
if (!(groups instanceof TestingGroups)) {
groups = Groups.getUserToGroupsMappingService(conf);
<BUG>}
try {</BUG>
KerberosName.setConfiguration(conf);
} catch (IOException ioe) {
throw new RuntimeException("Problem with Kerberos auth_to_local name " +
| javax.security.auth.login.Configuration.setConfiguration
(new HadoopConfiguration());
try {
|
24,854 | return KEYTAB_KERBEROS_CONF;
}
return null;
}
}
<BUG>private static LoginContext
newLoginContext(String appName, Subject subject) throws LoginException {
return new LoginContext(appName, subject, null, new HadoopConfiguration());
}</BUG>
private LoginContext getLogin() {
| [DELETED] |
24,855 | this.isKrbTkt = !subject.getPrivateCredentials(KerberosTicket.class).isEmpty();
}
public boolean hasKerberosCredentials() {
return isKeytab || isKrbTkt;
}
<BUG>public synchronized
static UserGroupInformation getCurrentUser() throws IOException {
</BUG>
AccessControlContext context = AccessController.getContext();
Subje... | public static UserGroupInformation getCurrentUser() throws IOException {
|
24,856 | renewerThread = null;
LOG.info("Asked the TGT renewer thread to terminate");
}
try {
login =
<BUG>newLoginContext(HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, subject);
</BUG>
start = System.currentTimeMillis();
login.login();
metrics.addLoginSuccess(System.currentTimeMillis() - start);
| new LoginContext(HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, subject);
|
24,857 | oldKeytabPrincipal = keytabPrincipal;
keytabFile = path;
keytabPrincipal = user;
Subject subject = new Subject();
LoginContext login =
<BUG>newLoginContext(HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, subject);
</BUG>
start = System.currentTimeMillis();
login.login();
metrics.addLoginSuccess(System.currentTimeMilli... | new LoginContext(HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, subject);
|
24,858 | } else if (cause instanceof InterruptedException) {
throw (InterruptedException) cause;
} else {
throw new UndeclaredThrowableException(pae,"Unknown exception in doAs");
}
<BUG>}
}
private void logPriviledgedAction(Subject subject, Object action) {
if (LOG.isDebugEnabled()) {
String where = new Throwable().getStackTrac... | [DELETED] |
24,859 | import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
import org.eclipse.xtext.xbase.lib.Exceptions;
@SuppressWarnings("all")
public class ObjectChannel {
<BUG>public final static int BUFFER_SIZE = 32768;
</BUG>
private ByteBuffer inputBuffer = ByteBuffer.allocate(ObjectChannel.BUF... | public final static int BUFFER_SIZE = 65536;
|
24,860 | int _remaining = this.outputBuffer.remaining();
int _length_1 = bytes.length;
int _minus = (_length_1 - offset);
int numBytes = Math.min(_remaining, _minus);
this.outputBuffer.put(bytes, offset, numBytes);
<BUG>this.outputBuffer.flip();
this.outputChannel.write(this.outputBuffer);
this.outputBuffer.clear();</BUG>
int _... | while (this.outputBuffer.hasRemaining()) {
}
this.outputBuffer.clear();
|
24,861 | import com.google.inject.Inject;
import com.google.inject.Injector;
import java.io.Serializable;
import java.net.InetAddress;
import java.net.InetSocketAddress;
<BUG>import java.net.ServerSocket;
import java.nio.channels.SelectionKey;</BUG>
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketCh... | import java.net.Socket;
import java.nio.channels.SelectionKey;
|
24,862 | import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.net.ConnectException;
import java.net.InetAddress;
<BUG>import java.net.InetSocketAddress;
import java.net.URL;</BUG>
import java.net.URLClassLoader;
import java.nio.channels.SocketChannel;
... | import java.net.Socket;
import java.net.URL;
|
24,863 | import java.util.LinkedHashSet;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.eclipse.xtext.builder.standalone.incremental.FilesAndURIs;
<BUG>import org.eclipse.xtext.idea.build.daemon.XtextBuildDaemon;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;</BUG>
impo... | import org.eclipse.xtext.idea.build.net.ObjectChannel;
import org.eclipse.xtext.xbase.lib.CollectionLiterals;
|
24,864 | FileReader _fileReader = new FileReader(portFile);
BufferedReader _bufferedReader = new BufferedReader(_fileReader);
final String line = _bufferedReader.readLine();
String _trim = line.trim();
final int port = Integer.parseInt(_trim);
<BUG>SocketChannel socketChannel = SocketChannel.open();
socketChannel.configureBloc... | SocketChannel socketChannel = this.connectClientSocketChannel(port);
|
24,865 | ProcessBuilder _processBuilder = new ProcessBuilder();
ProcessBuilder _command = _processBuilder.command(command);
final Process daemonProcess = _command.start();
IntegerRange _upTo_1 = new IntegerRange(0, 200);
for (final Integer i : _upTo_1) {
<BUG>try {
SocketChannel socketChannel = SocketChannel.open();
socketChann... | SocketChannel socketChannel = this.connectClientSocketChannel((port).intValue());
|
24,866 | public ReportElement getBase() {
return base;
}
@Override
public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException {
<BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pag... | PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
|
24,867 | public PdfTextStyle(String config) {
Assert.hasText(config);
String[] split = config.split(",");
Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");
fontSize = Integer.parseInt(split[0]);
<BUG>font = resolveStandard14Name(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1),... | font = getFont(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));
|
24,868 | package cc.catalysts.boot.report.pdf.elements;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pdf.utils.ReportAlignType;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
<BUG>import org.apache.pdfbox.pdmodel.font.PDFont;
import org.slf4j.Logger;</BUG>
import org.slf4j.Logg... | import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.util.Matrix;
import org.slf4j.Logger;
|
24,869 | addTextSimple(stream, textConfig, textX, nextLineY, "");
return nextLineY;
}
try {
<BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText);
</BUG>
float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]);
if (!underline) {
addTextSimple(stream, ... | String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
|
24,870 | public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
try {
stream.setFont(textConfig.getFont(), textConfig.getFontSize());
stream.setNonStrokingColor(textConfig.getColor());
stream.beginText();
<BUG>stream.newLineAtOffset(textX, textY);
stream.sh... | stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));
stream.showText(text);
|
24,871 | public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
addTextSimple(stream, textConfig, textX, textY, text);
try {
float lineOffset = textConfig.getFontSize() / 8F;
stream.setStrokingColor(textConfig.getColor());
<BUG>stream.setLineWidth... | stream.moveTo(textX, textY - lineOffset);
stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
|
24,872 | list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
... | List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
|
24,873 | package cc.catalysts.boot.report.pdf.elements;
import org.apache.pdfbox.pdmodel.PDDocument;
<BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import java.io.IOException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
| import org.apache.pdfbox.pdmodel.PDPageContentStream;
import java.io.IOException;
|
24,874 | package mage.sets.iceage;
<BUG>import java.util.UUID;
import mage.abilities.effects.common.continuous.BoostTargetEffect;</BUG>
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
| import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
24,875 | import mage.target.common.TargetCreaturePermanent;
public class FanaticalFever extends CardImpl {
public FanaticalFever(UUID ownerId) {
super(ownerId, 122, "Fanatical Fever", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{G}{G}");
this.expansionSetCode = "ICE";
<BUG>this.getSpellAbility().addEffect(new BoostTa... | Effect effect = new BoostTargetEffect(3, 0, Duration.EndOfTurn);
effect.setText("Target creature gets +3/+0");
this.getSpellAbility().addEffect(effect);
effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
effect.setText("and gains trample until end of turn");
this.getSpellAbility().a... |
24,876 | package mage.sets.iceage;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
<BUG>import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DamageControllerEffect;</BUG>
import mage.abilities.effects.common.DamageT... | import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageControllerEffect;
|
24,877 | this.subtype.add("Orc");
this.subtype.add("Warrior");
this.power = new MageInt(1);
this.toughness = new MageInt(3);
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); abil... | Effect effect = new DamageControllerEffect(3);
effect.setText("and 3 damage to you");
ability.addEffect(effect);
this.addAbility(ability);
|
24,878 | import mage.filter.common.FilterArtifactPermanent;
public class Shatterstorm extends CardImpl {
public Shatterstorm(UUID ownerId) {
super(ownerId, 266, "Shatterstorm", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{R}{R}");
this.expansionSetCode = "5ED";
<BUG>this.getSpellAbility().addEffect(new DestroyAllEffe... | this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent("artifacts"), true));
|
24,879 | import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
<BUG>import mage.abilities.dynamicvalue.common.... | import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageEverythingEffect;
|
24,880 | public class TimeBomb extends CardImpl {
public TimeBomb(UUID ownerId) {
super(ownerId, 223, "Time Bomb", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetCode = "ME2";
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(), true), Tar... | Effect effect = new DamageEverythingEffect(new CountersCount(CounterType.TIME), new FilterCreaturePermanent());
effect.setText("{this} deals damage equal to the number of time counters on it to each creature and each player");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(1)... |
24,881 | Effect effect = new ReturnToHandSourceEffect(true);
effect.setText("Return Snow Hound");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}"));
ability.addCost(new TapSourceCost());
effect = new ReturnToHandTargetEffect();
<BUG>effect.setText("and green or blue creature you co... | effect.setText("and target green or blue creature you control to their owners' hands");
|
24,882 | if (!(sender instanceof Player)) {
sender.sendMessage(plugin.getCore().getMessage("no-console"));
return true;
}
if (plugin.isBungeeCord()) {
<BUG>plugin.sendBungeeActivateMessage(sender, sender.getName(), false);
String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(m... | plugin.getCore().sendLocaleMessage("wait-on-proxy", sender);
|
24,883 | profile.setUuid(null);
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
plugin.getCore().getStorage().save(profile);
});
} else {
<BUG>sender.sendMessage(plugin.getCore().getMessage("not-premium"));
}</BUG>
}
return true;
} else {
| plugin.getCore().sendLocaleMessage("not-premium", sender);
|
24,884 | if (profile == null) {
sender.sendMessage("Error occured");
return;
}
if (profile.getUserId() != -1 && !profile.isPremium()) {
<BUG>sender.sendMessage(plugin.getCore().getMessage("not-premium-other"));
} else {
sender.sendMessage(plugin.getCore().getMessage("remove-premium"));
profile.setPremium(false);</BUG>
Bukkit.ge... | plugin.getCore().sendLocaleMessage("not-premium-other", sender);
plugin.getCore().sendLocaleMessage("remove-premium", sender);
profile.setPremium(false);
|
24,885 | import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
import com.github.games647.fastlogin.core.PlayerProfile;
import com.github.games647.fastlogin.core.shared.JoinManagement;
import java.util.Random;
<BUG>import java.util.logging.Level;
import org.... | import org.bukkit.command.CommandSender;
public class NameCheckTask extends JoinManagement<Player, CommandSender, ProtocolLibLoginSource>
private final FastLoginBukkit plugin;
|
24,886 | BukkitLoginSession session = plugin.getSessions().get(fromPlayer.getAddress().toString());
if (session == null) {
disconnect(plugin.getCore().getMessage("invalid-requst"), true
, "Player {0} tried to send encryption response at invalid state", fromPlayer.getAddress());
} else {
<BUG>String ip = fromPlayer.getAddress().... | [DELETED] |
24,887 | if (core != null) {
core.close();
}
getServer().getOnlinePlayers().forEach(player -> player.removeMetadata(getName(), this));
}
<BUG>public BukkitCore getCore() {
return core;</BUG>
}
public void sendBungeeActivateMessage(CommandSender sender, String target, boolean activate) {
if (sender instanceof Player) {
| public FastLoginCore<Player, CommandSender, FastLoginBukkit> getCore() {
return core;
|
24,888 | String id = '/' + address.getAddress().getHostAddress() + ':' + address.getPort();
if ("AUTO_LOGIN".equalsIgnoreCase(subchannel)) {
BukkitLoginSession playerSession = new BukkitLoginSession(playerName, true);
playerSession.setVerified(true);
plugin.getSessions().put(id, playerSession);
<BUG>Bukkit.getScheduler().runTas... | Bukkit.getScheduler().runTaskAsynchronously(plugin, new ForceLoginTask(plugin.getCore(), player));
|
24,889 | try {
if (authPlugin == null || !authPlugin.isRegistered(playerName)) {
BukkitLoginSession playerSession = new BukkitLoginSession(playerName, false);
playerSession.setVerified(true);
plugin.getSessions().put(id, playerSession);
<BUG>new ForceLoginTask(plugin, player).run();
</BUG>
}
} catch (Exception ex) {
plugin.getL... | new ForceLoginTask(plugin.getCore(), player).run();
|
24,890 | import org.gedcomx.common.ResourceReference;
import org.gedcomx.common.URI;</BUG>
import org.gedcomx.conclusion.Relationship;
import org.gedcomx.conversion.GedcomxConversionResult;
<BUG>import org.gedcomx.contributor.Address;
import org.gedcomx.contributor.Agent;</BUG>
import org.gedcomx.source.CitationField;
import or... | import org.gedcomx.common.TextValue;
import org.gedcomx.common.URI;
|
24,891 | try {
boolean sourceDescriptionHasData = false;
boolean sourceReferenceHasData = false;
SourceDescription gedxSourceDescription = new SourceDescription();
org.gedcomx.source.SourceCitation citation = new org.gedcomx.source.SourceCitation();
<BUG>citation.setCitationTemplate(new ResourceReference(URI.create("http://gedc... | citation.setCitationTemplate(new ResourceReference(URI.create("gedcom5:citation-template")));
|
24,892 | citation.setFields(new ArrayList<CitationField>());
citation.setValue("");
if (dqSource.getRef() != null) {
gedxSourceDescription.setId(dqSource.getRef() + "-" + Long.toHexString(SequentialIdentifierGenerator.getNextId()));
SourceReference componentOf = new SourceReference();
<BUG>componentOf.setSourceDescriptionURI(UR... | componentOf.setDescriptionRef(URI.create(CommonMapper.getSourceDescriptionReference(dqSource.getRef())));
|
24,893 | citation.getFields().add(field);
citation.setValue(citation.getValue() + (citation.getValue().length() > 0 ? ", " + dqSource.getDate() : dqSource.getDate()));
}
if (dqSource.getPage() != null) {
CitationField field = new CitationField();
<BUG>field.setName(URI.create("http://gedcomx.org/gedcom5-conversion-v1-SOUR-mappi... | field.setName(URI.create("gedcom5:citation-template/page"));
field.setValue(dqSource.getPage());
|
24,894 | if (dqSource.getText() != null) {
logger.warn(ConversionContext.getContext(), "GEDCOM X does not currently support text extracted from a source.");
}
ConfidenceLevel gedxConfidenceLevel = toConfidenceLevel(dqSource.getQuality());
if (gedxConfidenceLevel != null) {
<BUG>Attribution attribution = new Attribution();
attri... | [DELETED] |
24,895 | int cntMedia = dqSource.getMedia().size() + dqSource.getMediaRefs().size();
if (cntMedia > 0) {
logger.warn(ConversionContext.getContext(), "Did not process {} media items or references to media items.", cntMedia);
}
if (sourceDescriptionHasData) {
<BUG>gedxSourceDescription.setCitation(citation);
result.addSourceDesc... | gedxSourceDescription.setCitations(Arrays.asList(citation));
result.addSourceDescription(gedxSourceDescription);
sourceReferenceHasData = true;
|
24,896 | relationship.setPerson2(toReference(personId2));
return relationship;
}
public static ResourceReference toReference(String gedxPersonId) {
ResourceReference reference = new ResourceReference();
<BUG>reference.setResource( new URI(getPersonEntryName(gedxPersonId)));
</BUG>
return reference;
}
public static boolean inCan... | reference.setResource( new URI(getPersonReference(gedxPersonId)));
|
24,897 | final Pattern pattern = Pattern.compile("^\\+[\\d \\.\\(\\)\\-/]+");
return pattern.matcher(telephoneNumber).matches();
}
public static void populateAgent(Agent agent, String id, String name, org.folg.gedcom.model.Address address, String phone, String fax, String email, String www) {
agent.setId(id);
<BUG>agent.setName... | agent.setNames(Arrays.asList(new TextValue(name)));
if(address != null) {
|
24,898 | package com.teamwizardry.wizardry.common.world;
import com.teamwizardry.wizardry.init.ModBlocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EnumCreatureType;
<BUG>import net.minecraft.init.Biomes;
</BUG>
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import... | import com.teamwizardry.wizardry.common.entity.EntityFairy;
import net.minecraft.init.Blocks;
|
24,899 | ChunkPrimer chunkprimer = new ChunkPrimer();
generate(x, z, chunkprimer);
Chunk chunk = new Chunk(world, chunkprimer, x, z);
byte[] biomeArray = chunk.getBiomeArray();
for (int i = 0; i < biomeArray.length; ++i) {
<BUG>biomeArray[i] = (byte) Biome.getIdForBiome(Biomes.PLAINS);
}</BUG>
chunk.generateSkylightMap();
retur... | biomeArray[i] = (byte) 42;
|
24,900 | return false;
}
@NotNull
@Override
public List<Biome.SpawnListEntry> getPossibleCreatures(@NotNull EnumCreatureType creatureType, @NotNull BlockPos pos) {
<BUG>return Collections.emptyList();
}</BUG>
@Nullable
@Override
public BlockPos getStrongholdGen(@NotNull World worldIn, @NotNull String structureName, @NotNull Blo... | ArrayList<Biome.SpawnListEntry> list = new ArrayList<>();
list.add(new Biome.SpawnListEntry(EntityFairy.class, 1, 1, 3));
return list;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.