id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
44,201 | package com.android.sample.test_webview;
<BUG>import android.content.Intent;
import android.os.Environment;</BUG>
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
| import android.os.Bundle;
import android.os.Environment;
|
44,202 | WebFragment webFragment = new WebFragment();
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.add(R.id.fl_webfragment, webFragment);
ft.commit();
<BUG>webFragment.loadUrl("https://www.baidu.com");
}</BUG>
@Override
public void onClick(View v) {
Intent intent = new Intent(this, WebActivity.class);
| Bundle bundle = new Bundle();
bundle.putString(WebFragment.EXTRA_URL, "https://www.baidu.com");
webFragment.setArguments(bundle);
}
|
44,203 | url = data.getString(EXTRA_URL);
if (url != null)
webView.loadUrl(url);
}
public void loadUrl(String url){
<BUG>this.url = url;
}</BUG>
public boolean canGoBack(){
return webView.canGoBack();
}
| [DELETED] |
44,204 | import org.w3c.dom.Node;
import org.apache.cxf.common.util.PropertyUtils;
public final class MessageUtils {
private MessageUtils() {
}
<BUG>public static boolean isOutbound(Message message) {
return message != null
&& message.getExchange() != null
&& (message == message.getExchange().getOutMessage()
|| message == message.getExchange().getOutFaultMessage());</BUG>
}
| if (message == null) {
return false;
Exchange exchange = message.getExchange();
return exchange != null
&& (message == exchange.getOutMessage() || message == exchange.getOutFaultMessage());
|
44,205 | import io.parsingdata.metal.data.ParseResult;
import io.parsingdata.metal.data.ParseValue;
import io.parsingdata.metal.data.ParseValueList;
import io.parsingdata.metal.data.callback.Callback;
import io.parsingdata.metal.data.callback.Callbacks;
<BUG>import io.parsingdata.metal.data.callback.TokenCallback;
import io.parsingdata.metal.data.callback.TokenCallbackList;</BUG>
import io.parsingdata.metal.encoding.ByteOrder;
import io.parsingdata.metal.encoding.Encoding;
import io.parsingdata.metal.encoding.Sign;
| [DELETED] |
44,206 | import static io.parsingdata.metal.Shorthand.cho;
import static io.parsingdata.metal.Shorthand.con;
import static io.parsingdata.metal.Shorthand.def;
import static io.parsingdata.metal.Shorthand.eq;
import static io.parsingdata.metal.Shorthand.rep;
<BUG>import static io.parsingdata.metal.Shorthand.seq;
import static io.parsingdata.metal.data.selection.ByName.getValue;</BUG>
import static io.parsingdata.metal.data.selection.ByToken.getAllRoots;
import static io.parsingdata.metal.util.EncodingFactory.enc;
import static io.parsingdata.metal.util.TokenDefinitions.any;
| import static io.parsingdata.metal.data.callback.Callbacks.NONE;
import static io.parsingdata.metal.data.selection.ByName.getValue;
|
44,207 | @Test
public void testHandleCallback() throws IOException {
final CountingCallback countingCallback = new CountingCallback();
final Token cho = cho("cho", ONE, TWO);
final Token sequence = seq("seq", cho, ONE);
<BUG>final TokenCallbackList callbacks = TokenCallbackList
.create(new TokenCallback(ONE, countingCallback))
.add(new TokenCallback(TWO, countingCallback))
.add(new TokenCallback(cho, countingCallback))
.add(new TokenCallback(sequence, countingCallback));
final Environment environment = new Environment(new InMemoryByteStream(new byte[] { 2, 1 }), new Callbacks(callbacks));
assertTrue(sequence.parse(environment, enc()).succeeded);</BUG>
countingCallback.assertCounts(4, 1);
| final Callbacks callbacks =
NONE.add(ONE, countingCallback)
.add(TWO, countingCallback)
.add(cho, countingCallback)
.add(sequence, countingCallback);
final Environment environment = new Environment(new InMemoryByteStream(new byte[] { 2, 1 }), callbacks);
assertTrue(sequence.parse(environment, enc()).succeeded);
|
44,208 | assertEquals(2, getValue(seqRoots.head.asGraph(), "a").getOffset());
assertEquals(0, getValue(seqRoots.tail.head.asGraph(), "a").getOffset());
}
@Override
protected void handleFailure(Token token, Environment environment) {}
<BUG>}));
final Environment environment = new Environment(new InMemoryByteStream(new byte[] { 1, 2, 3, 4 }), new Callbacks(callbacks));
assertTrue(repeatingSeq.parse(environment, enc()).succeeded);</BUG>
}
@Test
| });
final Environment environment = new Environment(new InMemoryByteStream(new byte[] { 1, 2, 3, 4 }), callbacks);
assertTrue(repeatingSeq.parse(environment, enc()).succeeded);
|
44,209 | protected void handleSuccess(Token token, Environment environment) {
linkedListCount++;
}
@Override
protected void handleFailure(Token token, Environment environment) {}
<BUG>}));
final Environment environment = new Environment(new InMemoryByteStream(new byte[] { 0, 3, 1, 0, 0, 1 }), new Callbacks(callbacks));
assertTrue(SubStructTest.LINKED_LIST.parse(environment, enc()).succeeded);</BUG>
assertEquals(2, linkedListCount);
}
| final ParseItemList repRoots = getAllRoots(environment.order, token);
assertEquals(1, repRoots.size);
final ParseItemList seqRoots = getAllRoots(environment.order, SIMPLE_SEQ);
assertEquals(2, seqRoots.size);
assertEquals(2, getValue(seqRoots.head.asGraph(), "a").getOffset());
assertEquals(0, getValue(seqRoots.tail.head.asGraph(), "a").getOffset());
});
final Environment environment = new Environment(new InMemoryByteStream(new byte[] { 1, 2, 3, 4 }), callbacks);
assertTrue(repeatingSeq.parse(environment, enc()).succeeded);
|
44,210 | public void genericCallback() throws IOException {
final Deque<Token> expectedSuccessDefinitions = new ArrayDeque<>(Arrays.asList(ONE, TWO, ONE, TWO, FOUR, SEQ124, CHOICE));
final Deque<Long> expectedSuccessOffsets = new ArrayDeque<>(Arrays.asList(1L, 2L, 1L, 2L, 3L, 3L, 3L));
final Deque<Token> expectedFailureDefinitions = new ArrayDeque<>(Arrays.asList(THREE, SEQ123));
final Deque<Long> expectedFailureOffsets = new ArrayDeque<>(Arrays.asList(2L, 0L));
<BUG>final Callback genericCallback = new OffsetDefinitionCallback(
</BUG>
expectedSuccessOffsets,
expectedSuccessDefinitions,
expectedFailureOffsets,
| final Callbacks callbacks = NONE.add(new OffsetDefinitionCallback(
|
44,211 | </BUG>
expectedSuccessOffsets,
expectedSuccessDefinitions,
expectedFailureOffsets,
expectedFailureDefinitions
<BUG>);
final Environment environment = new Environment(new InMemoryByteStream(new byte[] { 1, 2, 4 }), new Callbacks(genericCallback));
</BUG>
final ParseResult parse = CHOICE.parse(environment, enc());
| public void genericCallback() throws IOException {
final Deque<Token> expectedSuccessDefinitions = new ArrayDeque<>(Arrays.asList(ONE, TWO, ONE, TWO, FOUR, SEQ124, CHOICE));
final Deque<Long> expectedSuccessOffsets = new ArrayDeque<>(Arrays.asList(1L, 2L, 1L, 2L, 3L, 3L, 3L));
final Deque<Token> expectedFailureDefinitions = new ArrayDeque<>(Arrays.asList(THREE, SEQ123));
final Deque<Long> expectedFailureOffsets = new ArrayDeque<>(Arrays.asList(2L, 0L));
final Callbacks callbacks = NONE.add(new OffsetDefinitionCallback(
final Environment environment = new Environment(new InMemoryByteStream(new byte[] { 1, 2, 4 }), callbacks);
|
44,212 | package com.givekesh.baboon.fcm;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
<BUG>import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;</BUG>
import android.text.Html;
| import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.v4.app.NotificationCompat;
|
44,213 | import com.givekesh.baboon.Utils.Utils;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
public class MessagingService extends FirebaseMessagingService {
@Override
<BUG>public void onMessageReceived(RemoteMessage remoteMessage) {
if (remoteMessage.getData().containsKey("new_version"))
sendNotification(new Utils(this).getBazaarIntent(),</BUG>
String.format(getString(R.string.new_version_content), remoteMessage.getData().get("new_version")),
| SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
if (remoteMessage.getData().containsKey("new_version")) {
if (pref.getBoolean("notifications_new_version", true))
sendNotification(new Utils(this).getBazaarIntent(),
|
44,214 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
44,215 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
44,216 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
44,217 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
44,218 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
44,219 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
44,220 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
44,221 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
44,222 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\"")));
}
| return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
44,223 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, sum, fib));
}
| return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
44,224 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task<String> task2 = Task.ofType(String.class).named("Baz", 40)
.in(() -> task1)</BUG>
.ins(() -> singletonList(task1))
| Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
44,225 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField + " causes an outer reference");</BUG>
serialize(task);
}
@Test
| Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
44,226 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.evaluate(des).consume(val);
| Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
44,227 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
44,228 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
44,229 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
44,230 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() -> n);
| TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
44,231 | public ListRequest withVisibleToAll(boolean visible) {
visibleToAll = visible;
return this;
}
public ListRequest withUser(String user) {
<BUG>this.user = user;
return this;</BUG>
}
public ListRequest withLimit(int limit) {
this.limit = limit;
| public ListRequest withOwned(boolean owned) {
this.owned = owned;
|
44,232 | import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashMap;</BUG>
import java.util.List;
import java.util.Map;
<BUG>import java.util.SortedMap;
public class GroupApiRestClient implements GroupApi {
</BUG>
private static final String BASE_URL = "/groups";
private final GroupsParser groupsParser;
| import java.util.Collections;
public class GroupApiRestClient extends GroupApi.NotImplemented implements GroupApi {
|
44,233 | public void description(String description) throws RestApiException {
String restPath = getRequestPath() + "/description";
gerritRestClient.putRequest(restPath, description);
}
@Override
<BUG>public GroupOptionsInfo options() throws RestApiException {
throw new NotImplementedException();
}
@Override
public void options(GroupOptionsInfo options) throws RestApiException {
throw new NotImplementedException();
}
@Override</BUG>
public List<AccountInfo> members() throws RestApiException {
| [DELETED] |
44,234 | public List<AccountInfo> members() throws RestApiException {
return members(false);
}
@Override
public List<AccountInfo> members(boolean recursive) throws RestApiException {
<BUG>String restPath = null;
if (recursive) {
restPath = getRequestPath() + "/members/?recursive";
} else {
restPath = getRequestPath() + "/members";</BUG>
}
| String restPath = getRequestPath() + "/members";
restPath += "?recursive";
|
44,235 | return groupsParser.parseGroupInfos(result);
}
@Override
public void addGroups(String... groups) throws RestApiException {
String restPath = getRequestPath() + "/groups";
<BUG>Map<String, List<String>> groupMap = new HashMap<String, List<String>>();
groupMap.put("groups", Arrays.asList(groups));
</BUG>
String json = gerritRestClient.getGson().toJson(groupMap);
gerritRestClient.postRequest(restPath, json);
| Map<String, List<String>> groupMap =
Collections.singletonMap("groups", Arrays.asList(groups));
|
44,236 | out.writeObject(cacheWriterFactory);
out.writeObject(expiryPolicyFactory);
out.writeBoolean(isReadThrough);
out.writeBoolean(isWriteThrough);
out.writeBoolean(isStoreByValue);
<BUG>out.writeBoolean(isManagementEnabled);
final boolean listNotEmpty = listenerConfigurations != null && !listenerConfigurations.isEmpty();</BUG>
out.writeBoolean(listNotEmpty);
if (listNotEmpty) {
out.writeInt(listenerConfigurations.size());
| out.writeBoolean(isStatisticsEnabled);
final boolean listNotEmpty = listenerConfigurations != null && !listenerConfigurations.isEmpty();
|
44,237 | cacheWriterFactory = in.readObject();
expiryPolicyFactory = in.readObject();
isReadThrough = in.readBoolean();
isWriteThrough = in.readBoolean();
isStoreByValue = in.readBoolean();
<BUG>isManagementEnabled = in.readBoolean();
final boolean listNotEmpty = in.readBoolean();</BUG>
if (listNotEmpty) {
final int size = in.readInt();
listenerConfigurations = new HashSet<CacheEntryListenerConfiguration<K, V>>(size);
| isStatisticsEnabled = in.readBoolean();
final boolean listNotEmpty = in.readBoolean();
|
44,238 | @Override
public void clientCallback(ClientResponse clientResponse) throws Exception {
byte status = clientResponse.getStatus();
if (status == ClientResponse.GRACEFUL_FAILURE ||
status == ClientResponse.USER_ABORT) {
<BUG>log.error("BigTableLoader gracefully failed to insert into table " + tableName + " and this shoudn't happen. Exiting.");
log.error(((ClientResponseImpl) clientResponse).toJSONString());
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| hardStop("BigTableLoader gracefully failed to insert into table " + tableName + " and this shoudn't happen. Exiting.");
|
44,239 | @Override
public void clientCallback(ClientResponse clientResponse) throws Exception {
byte status = clientResponse.getStatus();
if (status == ClientResponse.GRACEFUL_FAILURE ||
status == ClientResponse.USER_ABORT) {
<BUG>log.error("TruncateTableLoader gracefully failed to insert into table " + tableName + " and this shoudn't happen. Exiting.");
log.error(((ClientResponseImpl) clientResponse).toJSONString());
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| hardStop("TruncateTableLoader gracefully failed to insert into table " + tableName + " and this shoudn't happen. Exiting.", clientResponse);
|
44,240 | while (m_shouldContinue.get()) {
r.nextBytes(data);
try {
currentRowCount = TxnId2Utils.getRowCount(client, tableName);
} catch (Exception e) {
<BUG>log.error("getrowcount exception", e);
System.exit(-1);</BUG>
}
try {
| hardStop("getrowcount exception", e);
|
44,241 | latch.await(10, TimeUnit.SECONDS);
long nextRowCount = -1;
try {
nextRowCount = TxnId2Utils.getRowCount(client, tableName);
} catch (Exception e) {
<BUG>log.error("getrowcount exception", e);
System.exit(-1);</BUG>
}
if (nextRowCount == currentRowCount) {
| hardStop("getrowcount exception", e);
|
44,242 | try { Thread.sleep(3000); } catch (Exception e2) {}
}
try {
currentRowCount = TxnId2Utils.getRowCount(client, tableName);
} catch (Exception e) {
<BUG>log.error("getrowcount exception", e);
System.exit(-1);</BUG>
}
try {
| hardStop("getrowcount exception", e);
|
44,243 | tp += r.nextInt(100) < mpRatio * 100. ? "MP" : "SP";
ClientResponse clientResponse = client.callProcedure(tableName.toUpperCase() + tp, p, shouldRollback);
byte status = clientResponse.getStatus();
if (status == ClientResponse.GRACEFUL_FAILURE ||
(shouldRollback == 0 && status == ClientResponse.USER_ABORT)) {
<BUG>log.error("TruncateTableLoader gracefully failed to truncate table " + tableName + " and this shoudn't happen. Exiting.");
log.error(((ClientResponseImpl) clientResponse).toJSONString());
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| hardStop("TruncateTableLoader gracefully failed to truncate table " + tableName + " and this shoudn't happen. Exiting.", clientResponse);
|
44,244 | catch (ProcCallException e) {
ClientResponseImpl cri = (ClientResponseImpl) e.getClientResponse();
if (shouldRollback == 0) {
if ((cri.getStatus() == ClientResponse.GRACEFUL_FAILURE) ||
(cri.getStatus() == ClientResponse.USER_ABORT)) {
<BUG>log.error("TruncateTableLoader failed a TruncateTable ProcCallException call for table '" + tableName + "' " + e.getMessage());
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| hardStop("TruncateTableLoader failed a TruncateTable ProcCallException call for table '" + tableName + "' " + e.getMessage());
|
44,245 | sp += r.nextInt(100) < mpRatio * 100. ? "MP" : "SP";
ClientResponse clientResponse = client.callProcedure(tableName.toUpperCase() + sp, p, shouldRollback);
byte status = clientResponse.getStatus();
if (status == ClientResponse.GRACEFUL_FAILURE ||
(shouldRollback == 0 && status == ClientResponse.USER_ABORT)) {
<BUG>log.error("TruncateTableLoader gracefully failed to scan-agg table " + tableName + " and this shoudn't happen. Exiting.");
log.error(((ClientResponseImpl) clientResponse).toJSONString());
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| hardStop("TruncateTableLoader gracefully failed to scan-agg table " + tableName + " and this shoudn't happen. Exiting.", clientResponse);
|
44,246 | catch (ProcCallException e) {
ClientResponseImpl cri = (ClientResponseImpl) e.getClientResponse();
if (shouldRollback == 0) {
if ((cri.getStatus() == ClientResponse.GRACEFUL_FAILURE) ||
(cri.getStatus() == ClientResponse.USER_ABORT)) {
<BUG>log.error("TruncateTableLoader failed a ScanAgg ProcCallException call for table '" + tableName + "' " + e.getMessage());
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| hardStop("TruncateTableLoader failed a ScanAgg ProcCallException call for table '" + tableName + "' " + e.getMessage());
|
44,247 | }
catch (Exception e) {
</BUG>
log.error("TruncateTableLoader failed a non-proc call exception for table '" + tableName + "' " + e.getMessage());
<BUG>try { Thread.sleep(3000); } catch (Exception e2) {}
}</BUG>
}
log.info("TruncateTableLoader normal exit for table " + tableName + " rows sent: " + insertsTried + " inserted: " + rowsLoaded + " truncates: " + nTruncates);
}
}
| if (status != ClientResponse.SUCCESS) {
log.error("TruncateTableLoader ungracefully failed to scan-agg table " + tableName);
log.error(((ClientResponseImpl) clientResponse).toJSONString());
|
44,248 | try {
VoltTable data = clientResponse.getResults()[0];
UpdateBaseProc.validateCIDData(data, ReadThread.class.getName());
}
catch (Exception e) {
<BUG>log.error("ReadThread got a bad response", e);
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| [DELETED] |
44,249 | catch (NoConnectionsException e) {
log.error("ReadThread got NoConnectionsException on proc call. Will sleep.");
m_needsBlock.set(true);
}
catch (Exception e) {
<BUG>log.error("ReadThread failed to run a procedure. Will exit.", e);
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| [DELETED] |
44,250 | int errcnt = 0;
while (m_shouldContinue.get()) {
log.info (createOrDrop[count]);
try {
ClientResponse cr = TxnId2Utils.doAdHoc(client, createOrDrop[count]);
<BUG>if (cr.getStatus() != ClientResponse.SUCCESS) {
log.error("Catalog update failed: " + cr.getStatusString());
throw new RuntimeException("stop the world");</BUG>
} else {
log.info("Catalog update success #" + Long.toString(progressInd.get()) + " : " + createOrDrop[count]);
| hardStop("DDL failed: " + cr.getStatusString());
|
44,251 | } else
errcnt++;
}
}
catch (Exception e) {
<BUG>log.error("DdlThread threw an error:", e);
throw new RuntimeException(e);</BUG>
}
count = ++count & 1;
| hardStop("DdlThread threw an error:", e);
|
44,252 | ClientResponse cr = client.callProcedure("@AdHoc", query);
if (cr.getStatus() == ClientResponse.SUCCESS) {
Benchmark.txnCount.incrementAndGet();
return cr;
} else {
<BUG>log.debug(cr.getStatusString());
Benchmark.printJStack();
System.exit(-1);</BUG>
}
} catch (NoConnectionsException e) {
| Benchmark.hardStop("unexpected response", cr);
|
44,253 | throw new UserProcCallException(response);
}
VoltTable[] results = response.getResults();
m_txnsRun.incrementAndGet();
if (results.length != expectedTables) {
<BUG>log.error(String.format(
"Client cid %d procedure %s returned %d results instead of %d",
m_cid, procName, results.length, expectedTables));
log.error(((ClientResponseImpl) response).toJSONString());
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| hardStop(String.format(
m_cid, procName, results.length, expectedTables), response);
|
44,254 | cri.getStatusString().contains("EXPECTED ROLLBACK")) {
return;
}
if ((cri.getStatus() == ClientResponse.GRACEFUL_FAILURE) ||
(cri.getStatus() == ClientResponse.USER_ABORT)) {
<BUG>log.error("ClientThread had a proc-call exception that indicated bad data", e);
log.error(cri.toJSONString(), e);
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| hardStop("ClientThread had a proc-call exception that indicated bad data", cri);
|
44,255 | catch (NoConnectionsException e) {
log.error("InvokeDroppedProcedureThread got NoConnectionsException on proc call. Will sleep.");
m_needsBlock.set(true);
}
catch (Exception e) {
<BUG>log.error("InvokeDroppedProcedureThread failed to run client. Will exit.", e);
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| [DELETED] |
44,256 | @Override
public void clientCallback(ClientResponse clientResponse) throws Exception {
latch.countDown();
byte status = clientResponse.getStatus();
if (status == ClientResponse.GRACEFUL_FAILURE || status == ClientResponse.UNEXPECTED_FAILURE) {
<BUG>log.error("LoadTableLoader failed to insert into table " + m_tableName + " and this shoudn't happen. Exiting.");
log.error(((ClientResponseImpl) clientResponse).toJSONString());
System.exit(-1);</BUG>
}
| hardStop("LoadTableLoader failed to insert into table " + m_tableName + " and this shoudn't happen. Exiting.", clientResponse);
|
44,257 | public void clientCallback(ClientResponse clientResponse) throws Exception {
currentRowCount.incrementAndGet();
latch.countDown();
byte status = clientResponse.getStatus();
if (status == ClientResponse.GRACEFUL_FAILURE) {
<BUG>log.error("LoadTableLoader gracefully failed to copy from table " + m_tableName + " and this shoudn't happen. Exiting.");
log.error(((ClientResponseImpl) clientResponse).toJSONString());
System.exit(-1);</BUG>
}
| if (status == ClientResponse.GRACEFUL_FAILURE || status == ClientResponse.UNEXPECTED_FAILURE) {
hardStop("LoadTableLoader failed to insert into table " + m_tableName + " and this shoudn't happen. Exiting.", clientResponse);
|
44,258 | @Override
public void clientCallback(ClientResponse clientResponse) throws Exception {
latch.countDown();
byte status = clientResponse.getStatus();
if (status == ClientResponse.GRACEFUL_FAILURE) {
<BUG>log.error("LoadTableLoader gracefully failed to delete from table " + m_tableName + " and this shoudn't happen. Exiting.");
log.error(((ClientResponseImpl) clientResponse).toJSONString());
System.exit(-1);</BUG>
}
| if (status == ClientResponse.GRACEFUL_FAILURE || status == ClientResponse.UNEXPECTED_FAILURE) {
hardStop("LoadTableLoader failed to insert into table " + m_tableName + " and this shoudn't happen. Exiting.", clientResponse);
|
44,259 | latch.await();
cpDelQueue.addAll(lcpDelQueue);
long nextRowCount = 0;
try { nextRowCount = TxnId2Utils.getRowCount(client, m_tableName);
} catch (Exception e) {
<BUG>log.error("getrowcount exception", e);
System.exit(-1);</BUG>
}
if (nextRowCount == currentRowCount.get()) {
| hardStop("getrowcount exception", e);
|
44,260 | catch (NoConnectionsException e) {
log.error("AdHocMayhemThread got NoConnectionsException on proc call. Will sleep.");
m_needsBlock.set(true);
}
catch (Exception e) {
<BUG>log.error("AdHocMayhemThread failed to run an AdHoc statement. Will exit.", e);
Benchmark.printJStack();
System.exit(-1);</BUG>
}
| [DELETED] |
44,261 | import java.util.stream.Collectors;
import java.util.stream.Stream;
public class ClassifierRspUpdateProcessor {
private ClassifierInterface classifierInterface;
private static final Logger LOG = LoggerFactory.getLogger(ClassifierRspUpdateProcessor.class);
<BUG>private ClassifierHandler classifierHandler;
</BUG>
private ClassifierRspUpdateProcessor() {classifierHandler = new ClassifierHandler();}
public ClassifierRspUpdateProcessor(LogicallyAttachedClassifier theClassifierInterface) {
this();
| private final ClassifierHandler classifierHandler;
|
44,262 | package org.opendaylight.sfc.scfofrenderer.utils;
import org.opendaylight.sfc.util.openflow.transactional_writer.FlowDetails;
<BUG>import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.scf.rev140701.attachment.point.attachment.point.type.Interface;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.scf.rev140701.service.function.classifiers.service.function.classifier.SclServiceFunctionForwarder;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.sff.rev140701.service.function.forwarders.ServiceFunctionForwarder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;</BUG>
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
| import org.opendaylight.sfc.provider.api.SfcProviderAclAPI;
import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.sfc.scf.rev140701.service.function.classifiers.ServiceFunctionClassifier;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
|
44,263 | import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import java.util.Optional;
public class ClassifierHandler {
<BUG>public String buildFlowKeyName(String scfName, String aclName, String aceName, String type) {
return new StringBuffer()
.append(scfName)
.append(aclName)
.append(aceName)
.append(type)
.toString();</BUG>
}
| return scfName + aclName + aceName + type;
|
44,264 | .filter(acl -> acl.getAccessListEntries() != null)
.filter(acl -> acl.getAccessListEntries().getAce()
.stream()
.map(Ace::getActions)
.map(actions -> actions.getAugmentation(Actions1.class))
<BUG>.map(Actions1 -> (AclRenderedServicePath) Actions1.getSfcAction())
</BUG>
.anyMatch(sfcAction -> sfcAction.getRenderedServicePath().equals(theRspName.getValue())))
.collect(Collectors.toList());
}
| .map(actions1 -> (AclRenderedServicePath) actions1.getSfcAction())
|
44,265 | import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LogicallyAttachedClassifier implements ClassifierInterface {
private final LogicalClassifierDataGetter logicalSffDataGetter;
<BUG>private ClassifierHandler classifierHandler;
</BUG>
private static final Logger LOG = LoggerFactory.getLogger(LogicallyAttachedClassifier.class);
private static final short GENIUS_DISPATCHER_TABLE = 0x11;
private static final short TUN_GPE_NP_NSH = 0x4;
| private final ClassifierHandler classifierHandler;
|
44,266 | String theFlowKey) {
Optional<FlowDetails> relayFlow;
String flowKey = theFlowKey.replaceFirst(".in", ".relay");
if (addClassifier) {
Ip ip = SfcOvsUtil.getSffVxlanDataLocator(theSff);
<BUG>Optional<SfcNshHeader> theNshHeader = Optional.of(reverseNsh)
.map(theReverseNsh -> theReverseNsh.setVxlanIpDst(ip.getIp().getIpv4Address()))
.map(theReverseNsh -> theReverseNsh.setVxlanUdpPort(ip.getPort()));
relayFlow = theNshHeader
.map(theReverseNshHeader -></BUG>
classifierInterface.createClassifierRelayFlow(flowKey, theReverseNshHeader, nodeName));
| if (ip == null || ip.getIp() == null || ip.getPort() == null) {
return Optional.empty();
}
relayFlow = Optional.of(reverseNsh)
.map(theReverseNsh -> theReverseNsh
.setVxlanIpDst(ip.getIp().getIpv4Address())
.setVxlanUdpPort(ip.getPort()))
.map(theReverseNshHeader ->
|
44,267 | import java.util.Optional;
public class ClassifierRspsUpdateListener extends AbstractDataTreeChangeListener<RenderedServicePath> {
private static final Logger LOG = LoggerFactory.getLogger(ClassifierRspsUpdateListener.class);
private final DataBroker dataBroker;
private ListenerRegistration<AbstractDataTreeChangeListener> listenerRegistration;
<BUG>private ClassifierRspUpdateProcessor classifierProcessor;
private SfcOfFlowWriterInterface openflowWriter;
private ClassifierRspUpdateDataGetter updateDataGetter;
private LogicalClassifierDataGetter dataGetter;
</BUG>
public ClassifierRspsUpdateListener(DataBroker theDataBroker,
| private final ClassifierRspUpdateProcessor classifierProcessor;
private final SfcOfFlowWriterInterface openflowWriter;
private final ClassifierRspUpdateDataGetter updateDataGetter;
private final LogicalClassifierDataGetter dataGetter;
|
44,268 | import java.util.Collections;
import java.util.List;
import java.util.Optional;
public class BareClassifier implements ClassifierInterface {
private ServiceFunctionForwarder sff;
<BUG>private ClassifierHandler classifierHandler;
</BUG>
public BareClassifier() {classifierHandler = new ClassifierHandler();}
public BareClassifier(ServiceFunctionForwarder theSff) {
this();
| private final ClassifierHandler classifierHandler;
|
44,269 | return theFlows;
}
@Override
public Optional<String> getNodeName(String theInterfaceName) {
return Optional.ofNullable(sff)
<BUG>.filter(sff -> sff.getAugmentation(SffOvsBridgeAugmentation.class) != null)
</BUG>
.map(SfcOvsUtil::getOpenFlowNodeIdForSff);
}
@Override
| .filter(theSff -> theSff.getAugmentation(SffOvsBridgeAugmentation.class) != null)
|
44,270 | package org.opendaylight.sfc.scfofrenderer.processors;
import java.util.Collections;
import java.util.List;
<BUG>import java.util.Optional;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.sfc.provider.api.SfcProviderAclAPI;
import org.opendaylight.sfc.util.openflow.transactional_writer.FlowDetails;</BUG>
import org.opendaylight.sfc.util.openflow.transactional_writer.SfcOfFlowWriterInterface;
| import org.opendaylight.sfc.scfofrenderer.utils.ClassifierHandler;
|
44,271 | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SfcScfOfProcessor {
private static final Logger LOG = LoggerFactory.getLogger(SfcScfOfProcessor.class);
private SfcOfFlowWriterInterface openflowWriter;
<BUG>private OpenflowClassifierProcessor classifierProcessor;
private DataBroker dataBroker;
public SfcScfOfProcessor(DataBroker theDataBroker,
SfcOfFlowWriterInterface theOpenflowWriter,
</BUG>
OpenflowClassifierProcessor theClassifierProcessor) {
| private ClassifierHandler classifierHandler;
public SfcScfOfProcessor(SfcOfFlowWriterInterface theOpenflowWriter,
|
44,272 | new ClassifierRspUpdateProcessor(logicalClassifier),
openflowWriter,
new ClassifierRspUpdateDataGetter(),
dataGetter);
sfcScfDataListener = new SfcScfOfDataListener(dataBroker,
<BUG>new SfcScfOfProcessor(dataBroker, openflowWriter, logicalClassifierHandler));
LOG.info("SfcScfOfRenderer successfully started the SfcScfOfRenderer plugin");</BUG>
}
@Override
public void close() throws ExecutionException, InterruptedException {
| new SfcScfOfProcessor(openflowWriter, logicalClassifierHandler));
LOG.info("SfcScfOfRenderer successfully started the SfcScfOfRenderer plugin");
|
44,273 | package hudson.plugins.accurev;
<BUG>import hudson.model.AbstractBuild;
</BUG>
import hudson.scm.ChangeLogSet;
import java.util.Collection;
import java.util.Collections;
| import hudson.model.Run;
|
44,274 | import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;
@ExportedBean(defaultVisibility=999)
public final class AccurevChangeLogSet extends ChangeLogSet<AccurevTransaction> {
private final List<AccurevTransaction> transactions;
<BUG>AccurevChangeLogSet(AbstractBuild build, List<AccurevTransaction> transactions) {
super(build);
</BUG>
if (transactions == null) {
| AccurevChangeLogSet(Run build, List<AccurevTransaction> transactions) {
super(build, null);
|
44,275 | import net.minecraftforge.fml.common.FMLCommonHandler;
public class Teleport
{
public static boolean teleportEntity(Entity entity, int destinationDimension, ITeleporter teleporter, BlockPos dest)
{
<BUG>return teleportEntity(entity, destinationDimension, teleporter, dest.getX(), dest.getY(), dest.getZ());
</BUG>
}
public static boolean teleportEntity(Entity entity, int destinationDimension, ITeleporter teleporter)
{
| return teleportEntity(entity, destinationDimension, teleporter, dest.getX() + 0.5, dest.getY(), dest.getZ() + 0.5);
|
44,276 | public static boolean teleportEntity(Entity entity, int destinationDimension, ITeleporter teleporter)
{
return teleportEntity(entity, destinationDimension, teleporter, entity.posX, entity.posY, entity.posZ);
}
public static boolean teleportEntity(Entity entity, int destinationDimension, ITeleporter teleporter, double x, double y, double z)
<BUG>{
if(!ForgeHooks.onTravelToDimension(entity, destinationDimension))</BUG>
return false;
MinecraftServer mcServer = entity.getServer();
int prevDimension = entity.dimension;
| if(destinationDimension == entity.dimension)
return localTeleport(entity, teleporter, x, y, z);
if(entity.worldObj.isRemote)
throw new IllegalArgumentException("Shouldn't do teleporting with a clientside entity.");
if(!ForgeHooks.onTravelToDimension(entity, destinationDimension))
|
44,277 | player.setWorld(worldDest);
playerList.preparePlayer(player, worldFrom);
player.connection.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
player.interactionManager.setWorld(worldDest);
player.connection.sendPacket(new SPacketPlayerAbilities(player.capabilities));
<BUG>mcServer.getPlayerList().updateTimeAndWeatherForPlayer(player, worldDest);
mcServer.getPlayerList().syncPlayerInventory(player);
</BUG>
Iterator<?> iterator = player.getActivePotionEffects().iterator();
| playerList.updateTimeAndWeatherForPlayer(player, worldDest);
playerList.syncPlayerInventory(player);
|
44,278 | player.connection.sendPacket(new SPacketEntityEffect(player.getEntityId(), potioneffect));
}
FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, prevDimension, destinationDimension);
return true;
}
<BUG>else if (!entity.worldObj.isRemote && !entity.isDead)
{</BUG>
Entity newEntity = EntityList.createEntityByName(EntityList.getEntityString(entity), worldDest);
if(newEntity == null)
return false;
| else if (!entity.isDead)
{
|
44,279 | import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
<BUG>import java.util.Map;
import com.orientechnologies.common.collection.OMultiValue;</BUG>
import com.orientechnologies.common.log.OLogManager;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.record.ORecord;
| import java.util.zip.GZIPOutputStream;
import com.orientechnologies.common.collection.OMultiValue;
|
44,280 | public String[] additionalHeaders;
public String characterSet;
public String contentType;
public String serverInfo;
public String sessionId;
<BUG>public String callbackFunction;
public boolean sendStarted = false;</BUG>
public OHttpResponse(final OutputStream iOutStream, final String iHttpVersion, final String[] iAdditionalHeaders,
final String iResponseCharSet, final String iServerInfo, final String iSessionId, final String iCallbackFunction) {
out = iOutStream;
| public String contentEncoding;
public boolean sendStarted = false;
|
44,281 | if (headers != null)
writeLine(headers);
writeLine("Date: " + new Date());
writeLine("Content-Type: " + iContentType + "; charset=" + characterSet);
writeLine("Server: " + serverInfo);
<BUG>writeLine("Connection: " + (iKeepAlive ? "Keep-Alive" : "close"));
if (additionalHeaders != null)</BUG>
for (String h : additionalHeaders)
writeLine(h);
}
| if(contentEncoding != null && contentEncoding.length() > 0) {
writeLine("Content-Encoding: " + contentEncoding);
if (additionalHeaders != null)
|
44,282 | package melnorme.lang.ide.core.operations;
import melnorme.lang.ide.core.utils.process.AbstractRunProcessTask.ProcessStartHelper;
<BUG>import melnorme.utilbox.status.StatusLevel;
public interface ILangOperationsListener_Default {
default void notifyMessage(StatusLevel statusLevel, String title, String message) {
notifyMessage(null, statusLevel, title, message);
}
void notifyMessage(String msgId, StatusLevel statusLevel, String title, String message);</BUG>
public enum ProcessStartKind {
| public interface ILangOperationsListener_Default extends IStatusMessageHandler {
BUILD,
CHECK_BUILD,
ENGINE_SERVER,
ENGINE_TOOLS
|
44,283 | boolean clearConsole = false;
IToolOperationMonitor opMonitor =
buildMgr.getToolManager().startNewOperation(ProcessStartKind.CHECK_BUILD, clearConsole, false);
try {
NullOperationMonitor om = new NullOperationMonitor(cm);
<BUG>buildMgr.newProjectBuildOperation(om, opMonitor, project, true, true).execute();
</BUG>
} catch(CommonException e) {
opMonitor.writeInfoMessage("Error during auto-check:\n" + e.getSingleLineRender() + "\n");
} catch(OperationCancellation e) {
| buildMgr.requestProjectBuildOperation(opMonitor, project, true, true).execute(om);
|
44,284 | import melnorme.utilbox.misc.MiscUtil;
import melnorme.utilbox.misc.PathUtil;
import melnorme.utilbox.process.ExternalProcessHelper.ExternalProcessResult;
import melnorme.utilbox.status.StatusException;
import melnorme.utilbox.status.StatusLevel;
<BUG>public abstract class ToolManager extends EventSource<ILangOperationsListener> {
protected final CoreSettings settings;</BUG>
public ToolManager(CoreSettings settings) {
this.settings = assertNotNull(settings);
}
| public abstract class ToolManager extends EventSource<ILangOperationsListener>
implements IStatusMessageHandler
protected final CoreSettings settings;
|
44,285 | logAndNotifyError(title, title, ce);
}
public void logAndNotifyError(String msgId, String title, StatusException ce) {
LangCore.logError(title, ce);
notifyMessage(msgId, ce.getSeverity().toStatusLevel(), title, ce.getMessage());
<BUG>}
public void notifyMessage(StatusLevel statusLevel, String title, String message) {
notifyMessage(null, statusLevel, title, message);
}</BUG>
public void notifyMessage(String msgId, StatusLevel statusLevel, String title, String message) {
| @Override
|
44,286 | import java.io.ByteArrayOutputStream;
import java.io.File;
public class Main {
public static void main(String[] args) {
GradleConnector connector = GradleConnector.newConnector();
<BUG>String gradleUserHomeDir = System.getProperty("gradle.user.home");
if (gradleUserHomeDir != null && gradleUserHomeDir.length() > 0) {
connector.useGradleUserHomeDir(new File(gradleUserHomeDir));
}</BUG>
connector.forProjectDirectory(new File("."));
| if (args.length > 0) {
connector.useInstallation(new File(args[0]));
if (args.length > 1) {
connector.useGradleUserHomeDir(new File(args[1]));
}
}
|
44,287 | import java.lang.Object;
public class Main {
public static void main(String[] args) {
GradleConnector connector = GradleConnector.newConnector();
connector.forProjectDirectory(new File("."));
<BUG>String gradleUserHomeDir = System.getProperty("gradle.user.home");
if (gradleUserHomeDir != null && gradleUserHomeDir.length() > 0) {
connector.useGradleUserHomeDir(new File(gradleUserHomeDir));
}</BUG>
if (args.length > 0) {
| [DELETED] |
44,288 | import java.lang.System;
public class Main {
public static void main(String[] args) {
GradleConnector connector = GradleConnector.newConnector();
connector.forProjectDirectory(new File("."));
<BUG>String gradleUserHomeDir = System.getProperty("gradle.user.home");
if (gradleUserHomeDir != null && gradleUserHomeDir.length() > 0) {
connector.useGradleUserHomeDir(new File(gradleUserHomeDir));
}</BUG>
if (args.length > 0) {
| [DELETED] |
44,289 | package com.intellij.execution.console;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
<BUG>import com.intellij.openapi.options.SearchableConfigurable;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.Splitter;
import com.intellij.ui.AddEditDeleteListPanel;</BUG>
import org.jetbrains.annotations.Nls;
| import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.ui.InputValidator;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.AddEditDeleteListPanel;
|
44,290 | private final ConsoleFoldingSettings mySettings = ConsoleFoldingSettings.getSettings();
public JComponent createComponent() {
if (myMainComponent == null) {
myMainComponent = new JPanel(new BorderLayout());
Splitter splitter = new Splitter(true);
<BUG>myMainComponent.add(splitter);
myPositivePanel = new MyAddDeleteListPanel("Fold console lines that contain", "Enter a substring of a console line you'd like to see folded:");
myNegativePanel = new MyAddDeleteListPanel("Exceptions", "Enter a substring of a console line you don't want to fold:");</BUG>
splitter.setFirstComponent(myPositivePanel);
splitter.setSecondComponent(myNegativePanel);
| myPositivePanel =
myNegativePanel = new MyAddDeleteListPanel("Exceptions", "Enter a substring of a console line you don't want to fold:");
|
44,291 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;</BUG>
import com.google.atap.tangoservice.TangoOutOfDateException;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;
| import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
44,292 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
44,293 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
44,294 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
44,295 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
44,296 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
| import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
44,297 | package com.skin.ayada.runtime;
<BUG>import java.io.IOException;
import java.text.MessageFormat;</BUG>
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
| import java.io.Writer;
import java.text.MessageFormat;
|
44,298 | package com.skin.ayada.jstl.core;
import com.skin.ayada.tagext.Tag;
import com.skin.ayada.tagext.TagSupport;
<BUG>public class BreakTag extends TagSupport
</BUG>
{
@Override
public int doStartTag()
| import com.skin.ayada.tagext.BreakTagSupport;
public class BreakTag extends TagSupport implements BreakTagSupport
|
44,299 | package com.skin.ayada.demo;
<BUG>import java.io.StringWriter;
import com.skin.ayada.runtime.PageContext;</BUG>
import com.skin.ayada.source.ClassPathSourceFactory;
import com.skin.ayada.source.SourceFactory;
import com.skin.ayada.template.DefaultTemplateContext;
| import com.skin.ayada.runtime.DefaultExpressionFactory;
import com.skin.ayada.runtime.ExpressionFactory;
import com.skin.ayada.runtime.PageContext;
|
44,300 | System.out.println(TemplateUtil.toString(template));
System.out.println("-------------- System.out.print --------------");
</BUG>
template.execute(pageContext);
<BUG>System.out.println("-------------- run result --------------");
System.out.println(writer.toString());</BUG>
}
catch(Exception e)
{
e.printStackTrace();
| System.out.println("-------------- System.out.println --------------");
System.out.println("-------------- result --------------");
System.out.println(writer.toString());
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.