id
int64 1
49k
| buggy
stringlengths 34
37.5k
| fixed
stringlengths 2
37k
|
---|---|---|
48,001 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
48,002 | EditorCell_Collection result = jetbrains.mps.nodeEditor.cells.EditorCell_Collection.createIndent2(editorContext, node);
result.setBig(true);
result.getStyle().putAll(StyleRegistry.getInstance().getStyle("LINE_COMMENT"), 1);
result.addEditorCell(createCommentConstantCell(editorContext, node, true));
result.addEditorCell(mainCell);
<BUG>result.addEditorCell(createCommentConstantCell(editorContext, node, false));
return result;</BUG>
}
private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) {
EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false);
| result.setCellId("main_comment_collection");
return result;
|
48,003 | }
private EditorCell_Constant createCommentConstantCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node, boolean left) {
EditorCell_Constant cell = new EditorCell_Constant(editorContext, node, left ? "/*" : "*/", false);
StyleImpl style = new StyleImpl();
style.set(left ? StyleAttributes.PUNCTUATION_RIGHT : StyleAttributes.PUNCTUATION_LEFT, 0, true);
<BUG>cell.getStyle().putAll(style, 0);
return cell;</BUG>
}
@Override
public EditorCell createInspectedCell(jetbrains.mps.openapi.editor.EditorContext editorContext, SNode node) {
| cell.setCellId(left ? "left_comment_constant" : "right_comment_constant");
return cell;
|
48,004 | import org.jetbrains.annotations.NotNull;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import jetbrains.mps.openapi.editor.EditorContext;
import jetbrains.mps.openapi.editor.selection.Selection;
import jetbrains.mps.openapi.editor.selection.SingularSelection;
<BUG>import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG>
import org.jetbrains.mps.util.Condition;
import jetbrains.mps.editor.runtime.selection.SelectionUtil;
import jetbrains.mps.openapi.editor.selection.SelectionManager;
| import jetbrains.mps.openapi.editor.cells.EditorCell_Label;
import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
|
48,005 | import jetbrains.mps.editor.runtime.cells.AbstractCellAction;
import org.jetbrains.mps.openapi.model.SNode;
import org.jetbrains.annotations.NotNull;
import jetbrains.mps.openapi.editor.EditorContext;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
<BUG>import jetbrains.mps.openapi.editor.cells.EditorCell;
import jetbrains.mps.nodeEditor.cells.CellFinderUtil;</BUG>
import org.jetbrains.mps.util.Condition;
import jetbrains.mps.editor.runtime.selection.SelectionUtil;
import jetbrains.mps.openapi.editor.selection.SelectionManager;
| import jetbrains.mps.openapi.editor.cells.EditorCell_Label;
import jetbrains.mps.nodeEditor.cells.CellFinderUtil;
|
48,006 | return (ClientApi) proxyInterface.get();
}
@When("I create an empty ZAP session")
public void startSession() throws ClientApiException {
final ClientApi clientApi = getClientApi();
<BUG>final String url = Optional.ofNullable(State.getFeatureStateForThread().getUrlDetails())
.map(UrlMapping::getDefaultUrl)</BUG>
.orElse(null);
checkState(url != null, "You have not supplied a URL");
clientApi.httpSessions.createEmptySession(Constants.ZAP_API_KEY, url, "session");
| final String url = State.getFeatureStateForThread().getUrlDetails()
.map(UrlMapping::getDefaultUrl)
|
48,007 | clientApi.httpSessions.createEmptySession(Constants.ZAP_API_KEY, url, "session");
}
@When("I set the active ZAP session")
public void activeSession() throws ClientApiException {
final ClientApi clientApi = getClientApi();
<BUG>final String url = Optional.ofNullable(State.getFeatureStateForThread().getUrlDetails())
.map(UrlMapping::getDefaultUrl)</BUG>
.orElse(null);
checkState(StringUtils.isNotBlank(url), "You have not defined a default url");
clientApi.httpSessions.addSessionToken(Constants.ZAP_API_KEY, url, "session");
| final String url = State.getFeatureStateForThread().getUrlDetails()
.map(UrlMapping::getDefaultUrl)
|
48,008 | + "named applications. "
+ "Alternatively, make sure the configuration file defines the named application.");
LOGGER.info("WEBAPPTESTER-INFO-0001: Opened the url {}", url);
webDriver.get(url);
} else {
<BUG>final String url = Optional.ofNullable(State.getFeatureStateForThread().getUrlDetails())
.map(UrlMapping::getDefaultUrl)</BUG>
.orElse(null);
checkState(StringUtils.isNotBlank(url), "You have not defined a default URL");
LOGGER.info("WEBAPPTESTER-INFO-0001: Opened the url {}", url);
| final String url = State.getFeatureStateForThread().getUrlDetails()
.map(UrlMapping::getDefaultUrl)
|
48,009 | package org.fedorahosted.flies.rest.service;
<BUG>import java.net.URI;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;</BUG>
import javax.ws.rs.Path;
| import java.security.MessageDigest;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.PUT;
|
48,010 | import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;</BUG>
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
<BUG>import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;</BUG>
import org.fedorahosted.flies.core.dao.AccountDAO;
| import javax.ws.rs.HeaderParam;
import javax.ws.rs.PUT;
import javax.ws.rs.core.EntityTag;
import javax.ws.rs.core.Response.ResponseBuilder;
import javax.ws.rs.core.Response.Status;
|
48,011 | import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.log.Log;
<BUG>import org.jboss.seam.security.Identity;
@Name("projectService")</BUG>
@Path("/projects/p/{projectSlug}")
public class ProjectService {
@PathParam("projectSlug")
| import org.jboss.seam.util.Hex;
@Name("projectService")
|
48,012 | package board.algo;
<BUG>import java.util.Collection;
import board.RoutingBoard;</BUG>
import board.items.BrdItem;
import board.items.BrdTracep;
import board.varie.BrdKeepPoint;
| import java.util.TreeSet;
import board.RoutingBoard;
|
48,013 | {
other_trace_corner_approx = curr_other_trace_corner_approx;
other_trace_line = curr_other_trace_line;
prev_corner_side = curr_prev_corner_side;
other_prev_trace_line = curr_other_prev_trace_line;
<BUG>}
}
}
else
{
return null;</BUG>
}
| if (trace_polyline.corner_count() < 3) return null;
curr_prev_end_corner = trace_polyline.corner(trace_polyline.corner_count() - 3);
--end_line_no;
|
48,014 | if (p_trace.is_shove_fixed()) return false;
Set<BrdAbitPin> saved_contact_pins = contact_pins;
contact_pins = null;
boolean result = false;
boolean connection_to_trace_improved = true;
<BUG>BrdTracep curr_trace = p_trace;
while (connection_to_trace_improved)
</BUG>
{
connection_to_trace_improved = false;
| int loop_counter=0;
while (connection_to_trace_improved && loop_counter++ < 100)
|
48,015 | }
@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)
|
48,016 | 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))
|
48,017 | 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)
|
48,018 | 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");
|
48,019 | 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");
|
48,020 | }
@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);
|
48,021 | 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);
|
48,022 | 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);
|
48,023 | 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);
|
48,024 | import java.util.UUID;
public class ViewModelHelper<T extends IView, R extends AbstractViewModel<T>> {
private String mScreenId;
private R mViewModel;
public void onCreate(Bundle savedInstanceState, Class<? extends AbstractViewModel<T>> viewModelClass) {
<BUG>if (mViewModel == null) {
return;</BUG>
}
if (savedInstanceState == null) {
| if (viewModelClass == null) {
mViewModel = null;
return;
|
48,025 | import org.zankio.ccudata.ecourse.source.remote.HomeworkSource;
import org.zankio.ccudata.ecourse.source.remote.RollCallSource;
import org.zankio.ccudata.ecourse.source.remote.ScoreSource;
import rx.Observable;
public class Course {
<BUG>private final static int TASK_ANNOUNCE = 0;
private final static int TASK_CLASSMATE = 2;
private final static int TASK_FILE = 3;
private final static int TASK_SCORE = 4;
private final static int TASK_HOMEWORK = 5;
private final static int TASK_ROLLCALL = 6;
public String courseid;</BUG>
public String id;
| public Observable<Response<ScoreGroup[], CourseData>> loadingScore;
public Observable<Response<RollCall[] , CourseData>> loadingRollCall;
public Observable<Response<Homework[] , CourseData>> loadingHomework;
public Observable<Response<FileGroup[] , CourseData>> loadingFiles;
public Observable<Response<Classmate[] , CourseData>> loadingClassmate;
public Observable<Response<Announce[] , CourseData>> loadingAnnounces;
public String courseid;
|
48,026 | } else {
incomingEndpoint = endpoint;</BUG>
}
}
}
<BUG>if (outgoingEndpoint == null || incomingEndpoint == null) {
throw new IllegalArgumentException("Not all endpoints found.");
}
usbRequestPool = new UsbRequestPool(usbDeviceConnection);
usbRequestPool.addEndpoint(outgoingEndpoint, null);
usbRequestPool.start();
outputStream = new AcmOutputStream(usbRequestPool, outgoingEndpoint);
inputStream = new AcmInputStream(usbDeviceConnection, incomingEndpoint);</BUG>
}
| return new AcmUsbEndpoints(incomingEndpoint, outgoingEndpoint);
|
48,027 | package org.ros.android.android_acm_serial;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import android.app.PendingIntent;
<BUG>import android.content.BroadcastReceiver;
import android.content.Intent;</BUG>
import android.content.IntentFilter;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
| import android.content.Context;
import android.content.Intent;
|
48,028 | private LocalBroadcastManager mLocalBroadcastManager;
private String mActiveDownloadUrlString;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
<BUG>setContentView(R.layout.activity_app_details2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</BUG>
toolbar.setTitle(""); // Nice and clean toolbar
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
| setContentView(R.layout.app_details2);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
48,029 | .inflate(R.layout.app_details2_screenshots, parent, false);
return new ScreenShotsViewHolder(view);
} else if (viewType == VIEWTYPE_WHATS_NEW) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_whatsnew, parent, false);
<BUG>return new WhatsNewViewHolder(view);
} else if (viewType == VIEWTYPE_LINKS) {</BUG>
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.app_details2_links, parent, false);
return new ExpandableLinearLayoutViewHolder(view);
| } else if (viewType == VIEWTYPE_DONATE) {
.inflate(R.layout.app_details2_donate, parent, false);
return new DonateViewHolder(view);
} else if (viewType == VIEWTYPE_LINKS) {
|
48,030 | @Path("jobs/{jobName}")
@GET
public long jobName(final @PathParam("jobName") String jobName,
final @Context UriInfo uriInfo) throws Exception {
final Properties jobParams = new Properties();
<BUG>jobParams.setProperty("param1 key", "param1 value");
final ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
producerTemplate.setDefaultEndpointUri(getJBeretComponentUri(uriInfo, null));
final Long jobExecutionId = producerTemplate.requestBody(jobParams, long.class);
producerTemplate.stop();
return jobExecutionId;</BUG>
}
| return requestBody(getJBeretComponentUri(uriInfo, null), jobParams, long.class);
|
48,031 | return jobExecutionId;</BUG>
}
@Path("jobs/{jobName}/start")
@GET
public long jobNameStart(final @PathParam("jobName") String jobName,
<BUG>final @Context UriInfo uriInfo) throws Exception {
final ProducerTemplate producerTemplate = camelContext.createProducerTemplate();
producerTemplate.setDefaultEndpointUri(getJBeretComponentUri(uriInfo, null));
final Long jobExecutionId = producerTemplate.requestBody((Properties) null, long.class);
producerTemplate.stop();
return jobExecutionId;</BUG>
}
| @Path("jobs/{jobName}")
public long jobName(final @PathParam("jobName") String jobName,
final Properties jobParams = new Properties();
jobParams.setProperty("param1 key", "param1 value");
return requestBody(getJBeretComponentUri(uriInfo, null), jobParams, long.class);
return requestBody(getJBeretComponentUri(uriInfo, null), null, long.class);
|
48,032 | package org.camunda.bpm.engine.impl.migration;
import java.util.ArrayList;
import java.util.Collection;
<BUG>import java.util.List;
import org.camunda.bpm.engine.impl.migration.validation.activity.MigrationActivityValidator;</BUG>
import org.camunda.bpm.engine.impl.migration.validation.instruction.CannotAddMultiInstanceInnerActivityValidator;
import org.camunda.bpm.engine.impl.migration.validation.instruction.CannotRemoveMultiInstanceInnerActivityValidator;
import org.camunda.bpm.engine.impl.migration.validation.instruction.MigrationInstructionValidator;
| import org.camunda.bpm.engine.impl.bpmn.behavior.ConditionalEventBehavior;
import org.camunda.bpm.engine.impl.migration.validation.activity.MigrationActivityValidator;
|
48,033 | for (ActivityImpl sourceActivity : sourceActivities) {
if (!existingInstructions.containsInstructionForSourceScope(sourceActivity)) {
for (ActivityImpl targetActivity : targetActivities) {
if (isValidActivity(sourceActivity)
&& isValidActivity(targetActivity)
<BUG>&& migrationActivityMatcher.matchActivities(sourceActivity, targetActivity)) {
boolean updateEventTriggersForInstruction = updateEventTriggers && UpdateEventTriggersValidator.definesPersistentEventTrigger(sourceActivity);
ValidatingMigrationInstruction generatedInstruction = new ValidatingMigrationInstructionImpl(sourceActivity, targetActivity, updateEventTriggersForInstruction);</BUG>
generatedInstructions.add(generatedInstruction);
}
| boolean updateEventTriggersForInstruction = sourceActivity.getActivityBehavior() instanceof ConditionalEventBehavior ||
ValidatingMigrationInstruction generatedInstruction = new ValidatingMigrationInstructionImpl(sourceActivity, targetActivity, updateEventTriggersForInstruction);
|
48,034 | SUPPORTED_ACTIVITY_BEHAVIORS.add(EventSubProcessActivityBehavior.class);
SUPPORTED_ACTIVITY_BEHAVIORS.add(EventSubProcessStartEventActivityBehavior.class);
SUPPORTED_ACTIVITY_BEHAVIORS.add(ExternalTaskActivityBehavior.class);
SUPPORTED_ACTIVITY_BEHAVIORS.add(ParallelGatewayActivityBehavior.class);
SUPPORTED_ACTIVITY_BEHAVIORS.add(InclusiveGatewayActivityBehavior.class);;
<BUG>SUPPORTED_ACTIVITY_BEHAVIORS.add(IntermediateConditionalEventBehavior.class);
}</BUG>
public boolean valid(ActivityImpl activity) {
return activity != null && (isSupportedActivity(activity) || isAsync(activity));
}
| SUPPORTED_ACTIVITY_BEHAVIORS.add(BoundaryConditionalEventActivityBehavior.class);
SUPPORTED_ACTIVITY_BEHAVIORS.add(EventSubProcessStartConditionalEventActivityBehavior.class);
|
48,035 | migrationInstructionValidators.add(new CannotAddMultiInstanceInnerActivityValidator());
migrationInstructionValidators.add(new CannotRemoveMultiInstanceInnerActivityValidator());
migrationInstructionValidators.add(new GatewayMappingValidator());
migrationInstructionValidators.add(new SameEventScopeInstructionValidator());
migrationInstructionValidators.add(new UpdateEventTriggersValidator());
<BUG>migrationInstructionValidators.add(new AdditionalFlowScopeInstructionValidator());
return migrationInstructionValidators;</BUG>
}
public void setMigratingActivityInstanceValidators(List<MigratingActivityInstanceValidator> migratingActivityInstanceValidators) {
this.migratingActivityInstanceValidators = migratingActivityInstanceValidators;
| migrationInstructionValidators.add(new ConditionalEventUpdateEventTriggerValidator());
return migrationInstructionValidators;
|
48,036 | import org.camunda.bpm.engine.migration.MigrationPlan;
import org.camunda.bpm.engine.repository.ProcessDefinition;</BUG>
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.engine.test.ProcessEngineRule;
<BUG>import org.camunda.bpm.engine.test.api.runtime.migration.models.EventSubProcessModels;
import org.camunda.bpm.engine.test.util.ProvidedProcessEngineRule;</BUG>
import org.camunda.bpm.model.bpmn.BpmnModelInstance;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
| import org.camunda.bpm.engine.migration.MigrationPlanBuilder;
import org.camunda.bpm.engine.repository.ProcessDefinition;
import org.camunda.bpm.engine.test.util.BpmnEventTrigger;
import org.camunda.bpm.engine.test.util.ProcessEngineTestRule;
import org.camunda.bpm.engine.test.util.ProvidedProcessEngineRule;
|
48,037 | @Override
public String getEventName() {
return null;
}
@Override
<BUG>public void assertMigration(MigrationTestRule testHelper) {
testHelper.assertJobMigrated(EventSubProcessModels.EVENT_SUB_PROCESS_START_ID,
EventSubProcessModels.EVENT_SUB_PROCESS_START_ID,
TimerStartEventSubprocessJobHandler.TYPE);</BUG>
}
| public BpmnEventTrigger addBoundaryEvent(BpmnModelInstance modelInstance, String parentId) {
|
48,038 | protected ProcessEngineRule rule = new ProvidedProcessEngineRule();
protected MigrationTestRule testHelper = new MigrationTestRule(rule);
@Rule
public RuleChain ruleChain = RuleChain.outerRule(rule).around(testHelper);
@Test
<BUG>public void testMigrateEventSubprocessSignalTrigger() {
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(configuration.getBpmnModel());
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(configuration.getBpmnModel());
</BUG>
ProcessInstance processInstance = rule.getRuntimeService().startProcessInstanceById(sourceProcessDefinition.getId());
| BpmnEventTrigger bpmnEventTrigger = configuration.addEventSubProcess(null, null);
ProcessDefinition sourceProcessDefinition = testHelper.deployAndGetDefinition(bpmnEventTrigger.getProcessModel());
ProcessDefinition targetProcessDefinition = testHelper.deployAndGetDefinition(bpmnEventTrigger.getProcessModel());
|
48,039 | notifyDataSetChanged();
}
static class ViewHolder {
ViewGroup listItemRoot;
ImageView profileIcon;
<BUG>UnderlinedTextView profileName;
ImageView profileIndicator;</BUG>
int position;
}
public View getView(int position, View convertView, ViewGroup parent)
| ImageView profileIndicator;
|
48,040 | if (PPApplication.applicationActivatorPrefIndicator)
vi = inflater.inflate(R.layout.activate_profile_list_item, parent, false);
else
vi = inflater.inflate(R.layout.activate_profile_list_item_no_indicator, parent, false);
holder.listItemRoot = (RelativeLayout)vi.findViewById(R.id.act_prof_list_item_root);
<BUG>holder.profileName = (UnderlinedTextView) vi.findViewById(R.id.act_prof_list_item_profile_name);
holder.profileIcon = (ImageView)vi.findViewById(R.id.act_prof_list_item_profile_icon);</BUG>
if (PPApplication.applicationActivatorPrefIndicator)
holder.profileIndicator = (ImageView)vi.findViewById(R.id.act_prof_list_profile_pref_indicator);
}
| holder.profileName = (TextView) vi.findViewById(R.id.act_prof_list_item_profile_name);
holder.profileIcon = (ImageView)vi.findViewById(R.id.act_prof_list_item_profile_icon);
|
48,041 | }
else
{
vi = inflater.inflate(R.layout.activate_profile_grid_item, parent, false);
holder.listItemRoot = (LinearLayout)vi.findViewById(R.id.act_prof_list_item_root);
<BUG>holder.profileName = (UnderlinedTextView) vi.findViewById(R.id.act_prof_list_item_profile_name);
holder.profileIcon = (ImageView)vi.findViewById(R.id.act_prof_list_item_profile_icon);</BUG>
}
vi.setTag(holder);
}
| holder.profileName = (TextView) vi.findViewById(R.id.act_prof_list_item_profile_name);
holder.profileIcon = (ImageView)vi.findViewById(R.id.act_prof_list_item_profile_icon);
|
48,042 | if (profile != null)
{
if (profile._checked && (!PPApplication.applicationEditorHeader))
{
holder.profileName.setTypeface(null, Typeface.BOLD);
<BUG>holder.profileName.setUnderLineColor(GlobalGUIRoutines.getThemeAccentColor(fragment.getActivity()));
</BUG>
}
else
{
| holder.profileName.setTextColor(GlobalGUIRoutines.getThemeAccentColor(fragment.getActivity()));
|
48,043 | @Override
public IResource getResource()
{
return new PackageResource(getScope(), getName(), getLocale(), getStyle(), getVariation());
}
<BUG>private UrlAttributes testResource(IResourceStreamLocator locator, Locale locale, String style,
String variation)
{</BUG>
String absolutePath = Packages.absolutePath(getScope(), getName());
| private UrlAttributes testResource(final IResourceStreamLocator locator, final Locale locale,
final String style, final String variation)
|
48,044 | else
{
return null;
}
}
<BUG>private UrlAttributes getUrlAttributes(Locale locale, String style, String variation)
{
IResourceStreamLocator locator = Application.get()
</BUG>
.getResourceSettings()
| private UrlAttributes getUrlAttributes(final Locale locale, final String style,
final String variation)
IResourceStreamLocator locator = ThreadContext.getApplication()
|
48,045 | package org.apache.wicket.request.resource;
import java.util.Locale;
import javax.servlet.http.HttpServletResponse;
<BUG>import org.apache.wicket.Application;
</BUG>
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.markup.html.IPackageResourceGuard;
import org.apache.wicket.request.cycle.RequestCycle;
| import org.apache.wicket.ThreadContext;
|
48,046 | public KeepAliveController(PubSubManager pubSubManager) {
this.pubSubManager = pubSubManager;
}
@Timed
@GET
<BUG>public Response getKeepAlive(@Auth(required = false) Account account,
@WebSocketSession WebSocketSessionContext context)</BUG>
{
if (account != null) {
WebsocketAddress address = new WebsocketAddress(account.getNumber(),
| public Response getKeepAlive(@Auth Account account,
@WebSocketSession WebSocketSessionContext context)
|
48,047 | import com.codahale.metrics.Meter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.SharedMetricRegistries;
import com.google.common.base.Optional;
import org.slf4j.Logger;
<BUG>import org.slf4j.LoggerFactory;
import org.whispersystems.textsecuregcm.configuration.FederationConfiguration;</BUG>
import org.whispersystems.textsecuregcm.federation.FederatedPeer;
import org.whispersystems.textsecuregcm.util.Constants;
import java.util.List;
| import org.whispersystems.dropwizard.simpleauth.Authenticator;
import org.whispersystems.textsecuregcm.configuration.FederationConfiguration;
|
48,048 | import com.codahale.metrics.Meter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.SharedMetricRegistries;
import com.google.common.base.Optional;
import org.slf4j.Logger;
<BUG>import org.slf4j.LoggerFactory;
import org.whispersystems.textsecuregcm.storage.Account;</BUG>
import org.whispersystems.textsecuregcm.storage.AccountsManager;
import org.whispersystems.textsecuregcm.storage.Device;
import org.whispersystems.textsecuregcm.util.Constants;
| import org.whispersystems.dropwizard.simpleauth.Authenticator;
import org.whispersystems.textsecuregcm.storage.Account;
|
48,049 | import org.elasticsearch.common.netty.bootstrap.ServerBootstrap;
import org.elasticsearch.common.netty.buffer.ChannelBuffer;
import org.elasticsearch.common.netty.buffer.ChannelBuffers;
import org.elasticsearch.common.netty.channel.*;
import org.elasticsearch.common.netty.channel.socket.nio.NioClientSocketChannelFactory;
<BUG>import org.elasticsearch.common.netty.channel.socket.nio.NioServerSocketChannelFactory;
import org.elasticsearch.common.netty.logging.InternalLogger;</BUG>
import org.elasticsearch.common.netty.logging.InternalLoggerFactory;
import org.elasticsearch.common.network.NetworkService;
import org.elasticsearch.common.network.NetworkUtils;
| import org.elasticsearch.common.netty.channel.socket.oio.OioClientSocketChannelFactory;
import org.elasticsearch.common.netty.channel.socket.oio.OioServerSocketChannelFactory;
import org.elasticsearch.common.netty.logging.InternalLogger;
|
48,050 | return super.newInstance(name.replace("org.elasticsearch.common.netty.", "netty.").replace("org.jboss.netty.", "netty."));
}
});
}
private final NetworkService networkService;
<BUG>final int workerCount;
final String port;</BUG>
final String bindHost;
final String publishHost;
final TimeValue connectTimeout;
| final boolean blockingServer;
final boolean blockingClient;
final String port;
|
48,051 | final int NUMBER_OF_CLIENTS = 1;
final int NUMBER_OF_ITERATIONS = 100000;
final byte[] payload = new byte[(int) payloadSize.bytes()];
final AtomicLong idGenerator = new AtomicLong();
Settings settings = ImmutableSettings.settingsBuilder()
<BUG>.put("network.server", false)
.build();</BUG>
final ThreadPool threadPool = new CachedThreadPool(settings);
final TimerService timerService = new TimerService(settings, threadPool);
final TransportService transportService = new TransportService(new NettyTransport(settings, threadPool), threadPool, timerService).start();
| .put("network.tcp.blocking", false)
.build();
|
48,052 | package org.elasticsearch.memcached.netty;
import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
<BUG>import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.netty.bootstrap.ServerBootstrap;</BUG>
import org.elasticsearch.common.netty.channel.Channel;
import org.elasticsearch.common.netty.channel.ChannelPipeline;
import org.elasticsearch.common.netty.channel.ChannelPipelineFactory;
| import org.elasticsearch.common.netty.OpenChannelsHandler;
import org.elasticsearch.common.netty.bootstrap.ServerBootstrap;
|
48,053 | import static org.elasticsearch.common.network.NetworkService.TcpSettings.*;
import static org.elasticsearch.common.util.concurrent.Executors.*;
public class NettyMemcachedServerTransport extends AbstractLifecycleComponent<MemcachedServerTransport> implements MemcachedServerTransport {
private final RestController restController;
private final NetworkService networkService;
<BUG>private final int workerCount;
private final String port;</BUG>
private final String bindHost;
private final String publishHost;
private final Boolean tcpNoDelay;
| private final boolean blockingServer;
private final String port;
|
48,054 | private volatile OpenChannelsHandler serverOpenChannels;
@Inject public NettyMemcachedServerTransport(Settings settings, RestController restController, NetworkService networkService) {
super(settings);
this.restController = restController;
this.networkService = networkService;
<BUG>this.workerCount = componentSettings.getAsInt("worker_count", Runtime.getRuntime().availableProcessors());
this.port = componentSettings.get("port", settings.get("memcached.port", "11211-11311"));</BUG>
this.bindHost = componentSettings.get("bind_host");
this.publishHost = componentSettings.get("publish_host");
this.tcpNoDelay = componentSettings.getAsBoolean("tcp_no_delay", settings.getAsBoolean(TCP_NO_DELAY, true));
| this.blockingServer = componentSettings.getAsBoolean("memcached.blocking_server", componentSettings.getAsBoolean(TCP_BLOCKING_SERVER, componentSettings.getAsBoolean(TCP_BLOCKING, false)));
this.port = componentSettings.get("port", settings.get("memcached.port", "11211-11311"));
|
48,055 | public static final class TcpSettings {
public static final String TCP_NO_DELAY = "network.tcp.no_delay";
public static final String TCP_KEEP_ALIVE = "network.tcp.keep_alive";
public static final String TCP_REUSE_ADDRESS = "network.tcp.reuse_address";
public static final String TCP_SEND_BUFFER_SIZE = "network.tcp.send_buffer_size";
<BUG>public static final String TCP_RECEIVE_BUFFER_SIZE = "network.tcp.receive_buffer_size";
}</BUG>
public static interface CustomNameResolver {
InetAddress resolve();
}
| public static final String TCP_BLOCKING = "network.tcp.blocking";
public static final String TCP_BLOCKING_SERVER = "network.tcp.blocking_server";
public static final String TCP_BLOCKING_CLIENT = "network.tcp.blocking_client";
|
48,056 | final int NUMBER_OF_ITERATIONS = 100000;
final byte[] payload = new byte[(int) payloadSize.bytes()];
final AtomicLong idGenerator = new AtomicLong();
final BenchmarkTransportResponseHandler responseHandler = new BenchmarkTransportResponseHandler();
Settings settings = ImmutableSettings.settingsBuilder()
<BUG>.put("network.server", false)
.build();</BUG>
final ThreadPool threadPool = new CachedThreadPool(settings);
final TimerService timerService = new TimerService(settings, threadPool);
final TransportService transportService = new TransportService(new NettyTransport(settings, threadPool), threadPool, timerService).start();
| .put("network.tcp.blocking", false)
.build();
|
48,057 | import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.netty.OpenChannelsHandler;
import org.elasticsearch.common.netty.bootstrap.ServerBootstrap;
import org.elasticsearch.common.netty.channel.*;
<BUG>import org.elasticsearch.common.netty.channel.socket.nio.NioServerSocketChannelFactory;
import org.elasticsearch.common.netty.handler.codec.http.HttpChunkAggregator;</BUG>
import org.elasticsearch.common.netty.handler.codec.http.HttpRequestDecoder;
import org.elasticsearch.common.netty.handler.codec.http.HttpResponseEncoder;
import org.elasticsearch.common.netty.handler.timeout.ReadTimeoutException;
| import org.elasticsearch.common.netty.channel.socket.oio.OioServerSocketChannelFactory;
import org.elasticsearch.common.netty.handler.codec.http.HttpChunkAggregator;
|
48,058 | }
});
}
private final NetworkService networkService;
private final ByteSizeValue maxContentLength;
<BUG>private final int workerCount;
private final String port;</BUG>
private final String bindHost;
private final String publishHost;
private final Boolean tcpNoDelay;
| private final boolean blockingServer;
private final String port;
|
48,059 | private volatile HttpServerAdapter httpServerAdapter;
@Inject public NettyHttpServerTransport(Settings settings, NetworkService networkService) {
super(settings);
this.networkService = networkService;
ByteSizeValue maxContentLength = componentSettings.getAsBytesSize("max_content_length", settings.getAsBytesSize("http.max_content_length", new ByteSizeValue(100, ByteSizeUnit.MB)));
<BUG>this.workerCount = componentSettings.getAsInt("worker_count", Runtime.getRuntime().availableProcessors());
this.port = componentSettings.get("port", settings.get("http.port", "9200-9300"));</BUG>
this.bindHost = componentSettings.get("bind_host");
this.publishHost = componentSettings.get("publish_host");
this.tcpNoDelay = componentSettings.getAsBoolean("tcp_no_delay", settings.getAsBoolean(TCP_NO_DELAY, true));
| this.blockingServer = componentSettings.getAsBoolean("http.blocking_server", componentSettings.getAsBoolean(TCP_BLOCKING_SERVER, componentSettings.getAsBoolean(TCP_BLOCKING, false)));
this.port = componentSettings.get("port", settings.get("http.port", "9200-9300"));
|
48,060 | import org.elasticsearch.transport.netty.NettyTransport;
public class BenchmarkNettyServer {
public static void main(String[] args) {
final boolean spawn = true;
Settings settings = ImmutableSettings.settingsBuilder()
<BUG>.put("transport.netty.port", 9999)
.build();</BUG>
final ThreadPool threadPool = new CachedThreadPool(settings);
final TimerService timerService = new TimerService(settings, threadPool);
final TransportService transportService = new TransportService(new NettyTransport(settings, threadPool), threadPool, timerService).start();
| .put("network.tcp.blocking", false)
.build();
|
48,061 | ASTNode program = null;
try {
Token token = nextToken();
ProgramParser programParser = new ProgramParser(this);
program = programParser.parse(token);
<BUG>float elapsedTime = (System.currentTimeMillis() - startTime) / 1000.0f;
getEventDispatcher().sendNow( new ParserSummaryEvent(this, token.getLineNumber(),getErrorCount(), elapsedTime) );</BUG>
}
catch (java.io.IOException ex) {
this.getExceptionHandler().onException(ex);
| [DELETED] |
48,062 | public ProgramParser(LeolaParser parser) {
super(parser);
}
@Override
public ASTNode parse(Token token) throws Exception {
<BUG>ProgramStmt program = new ProgramStmt();
while (!(token instanceof EofToken)) {
StmtParser stmtParser = new StmtParser(this);</BUG>
ASTNode node = stmtParser.parse(token);
program.addChild(node);
| StmtParser stmtParser = new StmtParser(this);
|
48,063 | timeWarp = new OwnLabel(getFormattedTimeWrap(), skin, "warp");
timeWarp.setName("time warp");
Container wrapWrapper = new Container(timeWarp);
wrapWrapper.width(60f * GlobalConf.SCALE_FACTOR);
wrapWrapper.align(Align.center);
<BUG>VerticalGroup timeGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
</BUG>
HorizontalGroup dateGroup = new HorizontalGroup();
dateGroup.space(4 * GlobalConf.SCALE_FACTOR);
dateGroup.addActor(date);
| VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
|
48,064 | focusListScrollPane.setFadeScrollBars(false);
focusListScrollPane.setScrollingDisabled(true, false);
focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR);
focusListScrollPane.setWidth(160);
}
<BUG>VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
</BUG>
objectsGroup.addActor(searchBox);
if (focusListScrollPane != null) {
objectsGroup.addActor(focusListScrollPane);
| VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
|
48,065 | headerGroup.addActor(expandIcon);
headerGroup.addActor(detachIcon);
addActor(headerGroup);
expandIcon.setChecked(expanded);
}
<BUG>public void expand() {
</BUG>
if (!expandIcon.isChecked()) {
expandIcon.setChecked(true);
}
| public void expandPane() {
|
48,066 | </BUG>
if (!expandIcon.isChecked()) {
expandIcon.setChecked(true);
}
}
<BUG>public void collapse() {
</BUG>
if (expandIcon.isChecked()) {
expandIcon.setChecked(false);
}
| headerGroup.addActor(expandIcon);
headerGroup.addActor(detachIcon);
addActor(headerGroup);
expandIcon.setChecked(expanded);
public void expandPane() {
public void collapsePane() {
|
48,067 | });
playstop.addListener(new TextTooltip(txt("gui.tooltip.playstop"), skin));
TimeComponent timeComponent = new TimeComponent(skin, ui);
timeComponent.initialize();
CollapsiblePane time = new CollapsiblePane(ui, txt("gui.time"), timeComponent.getActor(), skin, true, playstop);
<BUG>time.align(Align.left);
mainActors.add(time);</BUG>
panes.put(timeComponent.getClass().getSimpleName(), time);
if (Constants.desktop) {
recCamera = new OwnImageButton(skin, "rec");
| time.align(Align.left).columnAlign(Align.left);
mainActors.add(time);
|
48,068 | panes.put(visualEffectsComponent.getClass().getSimpleName(), visualEffects);
ObjectsComponent objectsComponent = new ObjectsComponent(skin, ui);
objectsComponent.setSceneGraph(sg);
objectsComponent.initialize();
CollapsiblePane objects = new CollapsiblePane(ui, txt("gui.objects"), objectsComponent.getActor(), skin, false);
<BUG>objects.align(Align.left);
mainActors.add(objects);</BUG>
panes.put(objectsComponent.getClass().getSimpleName(), objects);
GaiaComponent gaiaComponent = new GaiaComponent(skin, ui);
gaiaComponent.initialize();
| objects.align(Align.left).columnAlign(Align.left);
mainActors.add(objects);
|
48,069 | if (Constants.desktop) {
MusicComponent musicComponent = new MusicComponent(skin, ui);
musicComponent.initialize();
Actor[] musicActors = MusicActorsManager.getMusicActors() != null ? MusicActorsManager.getMusicActors().getActors(skin) : null;
CollapsiblePane music = new CollapsiblePane(ui, txt("gui.music"), musicComponent.getActor(), skin, true, musicActors);
<BUG>music.align(Align.left);
mainActors.add(music);</BUG>
panes.put(musicComponent.getClass().getSimpleName(), music);
}
Button switchWebgl = new OwnTextButton(txt("gui.webgl.back"), skin, "link");
| music.align(Align.left).columnAlign(Align.left);
mainActors.add(music);
|
48,070 | package com.example.appnotificationmanagerdemo1;
import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.ActionBar.Tab;
<BUG>import android.app.Activity;
import android.app.AlertDialog;</BUG>
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.Fragment;
| import android.app.AlarmManager;
import android.app.AlertDialog;
|
48,071 | NotificationManager mNotificationManager;
String one,two,three;
Notification.Builder mNotificationBuilder;
int mLightOn= 1000;
int mLightOff= 1000;
<BUG>int mColor = Color.BLUE;
public jNotificationManager(Controls _ctrls, long _Self) { //Add more others news "_xxx" params if needed!</BUG>
context = _ctrls.activity;
pascalObj = _Self;
controls = _ctrls;
| int mColor;
int mId;
public jNotificationManager(Controls _ctrls, long _Self) { //Add more others news "_xxx" params if needed!
|
48,072 | catch (Exception e) {
Log.e("jNotificationManager", "Failure to get drawable id.", e);
return 0;
}
}
<BUG>public void Notify(int _id, String _title, String _subject, String _body, String _iconIdentifier){
</BUG>
int icon;
if (_iconIdentifier.equals(""))
icon = android.R.drawable.ic_dialog_info;
| public void Notify(int _id, String _title, String _subject, String _body, String _iconIdentifier, int _color){
|
48,073 | mNotificationBuilder = new Notification.Builder(controls.activity); //need API >= 11 !!
mNotificationBuilder.setContentTitle(_title);
mNotificationBuilder.setContentText(_subject);
mNotificationBuilder.setContentInfo(_body);
mNotificationBuilder.setSmallIcon(icon);
<BUG>mNotificationBuilder.setLights(mColor, mLightOn, mLightOff); //thanks to freris
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {</BUG>
mNotificationManager.notify(_id, mNotificationBuilder.build());
}
| mNotificationBuilder.setLights(_color, mLightOn, mLightOff); //thanks to freris
mColor = _color;
mId = _id;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
48,074 | }
public void SetLeftTopRightBottomWidthHeight(int _left, int _top, int _right, int _bottom, int _w, int _h) {
marginLeft = _left;
marginTop = _top;
marginRight = _right;
<BUG>marginBottom = _bottom;
</BUG>
| else {
mNotificationManager.notify(mId, mNotificationBuilder.getNotification());
|
48,075 | package com.example.dummyapp;
import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.ActionBar.Tab;
<BUG>import android.app.Activity;
import android.app.AlertDialog;</BUG>
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.Fragment;
| import android.app.AlarmManager;
import android.app.AlertDialog;
|
48,076 | NotificationManager mNotificationManager;
String one,two,three;
Notification.Builder mNotificationBuilder;
int mLightOn= 1000;
int mLightOff= 1000;
<BUG>int mColor = Color.BLUE;
public jNotificationManager(Controls _ctrls, long _Self) { //Add more others news "_xxx" params if needed!</BUG>
context = _ctrls.activity;
pascalObj = _Self;
controls = _ctrls;
| int mColor;
int mId;
public jNotificationManager(Controls _ctrls, long _Self) { //Add more others news "_xxx" params if needed!
|
48,077 | catch (Exception e) {
Log.e("jNotificationManager", "Failure to get drawable id.", e);
return 0;
}
}
<BUG>public void Notify(int _id, String _title, String _subject, String _body, String _iconIdentifier){
</BUG>
int icon;
if (_iconIdentifier.equals(""))
icon = android.R.drawable.ic_dialog_info;
| public void Notify(int _id, String _title, String _subject, String _body, String _iconIdentifier, int _color){
|
48,078 | mNotificationBuilder = new Notification.Builder(controls.activity); //need API >= 11 !!
mNotificationBuilder.setContentTitle(_title);
mNotificationBuilder.setContentText(_subject);
mNotificationBuilder.setContentInfo(_body);
mNotificationBuilder.setSmallIcon(icon);
<BUG>mNotificationBuilder.setLights(mColor, mLightOn, mLightOff); //thanks to freris
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {</BUG>
mNotificationManager.notify(_id, mNotificationBuilder.build());
}
| mNotificationBuilder.setLights(_color, mLightOn, mLightOff); //thanks to freris
mColor = _color;
mId = _id;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
|
48,079 | import org.joda.time.format.DateTimeFormat;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.BeanUtils;
<BUG>import org.springframework.beans.BeanWrapper;
</BUG>
import org.springframework.beans.PropertyAccessorFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.beans.factory.support.RootBeanDefinition;
| import org.springframework.beans.ConfigurablePropertyAccessor;
|
48,080 | LocalDate date = formattingService.convert("10/31/09", LocalDate.class);
assertEquals(new LocalDate(2009, 10, 31), date);
}
@Test
public void testFormatFieldForAnnotation() throws Exception {
<BUG>formattingService.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory());
doTestFormatFieldForAnnotation(Model.class);
</BUG>
}
@Test
| doTestFormatFieldForAnnotation(Model.class, false);
public void testFormatFieldForAnnotationWithDirectFieldAccess() throws Exception {
doTestFormatFieldForAnnotation(Model.class, true);
|
48,081 | ppc.setProperties(props);
context.getBeanFactory().registerSingleton("ppc", ppc);
context.refresh();
context.getBeanFactory().initializeBean(formattingService, "formattingService");
formattingService.addFormatterForFieldAnnotation(new JodaDateTimeFormatAnnotationFormatterFactory());
<BUG>doTestFormatFieldForAnnotation(ModelWithPlaceholders.class);
</BUG>
}
@Test
public void testFormatFieldForAnnotationWithPlaceholdersAndFactoryBean() throws Exception {
| doTestFormatFieldForAnnotation(ModelWithPlaceholders.class, false);
|
48,082 | dates = (List<Date>) formattingService.convert("10-31-09,11-1-09,11-2-09",
TypeDescriptor.valueOf(String.class), new TypeDescriptor(modelClass.getField("dates")));
assertEquals(new LocalDate(2009, 10, 31), new LocalDate(dates.get(0)));
assertEquals(new LocalDate(2009, 11, 1), new LocalDate(dates.get(1)));
assertEquals(new LocalDate(2009, 11, 2), new LocalDate(dates.get(2)));
<BUG>Object model = BeanUtils.instantiate(modelClass);
BeanWrapper accessor = PropertyAccessorFactory.forBeanPropertyAccess(model);
accessor.setConversionService(formattingService);</BUG>
accessor.setPropertyValue("dates", "10-31-09,11-1-09,11-2-09");
dates = (List<Date>) accessor.getPropertyValue("dates");
| ConfigurablePropertyAccessor accessor = directFieldAccess ? PropertyAccessorFactory.forDirectFieldAccess(model) :
accessor.setConversionService(formattingService);
|
48,083 | accessor.setPropertyValue("dates[2]", "10-2-09");
dates = (List<Date>) accessor.getPropertyValue("dates");
assertEquals(new LocalDate(2009, 10, 30), new LocalDate(dates.get(0)));
assertEquals(new LocalDate(2009, 10, 1), new LocalDate(dates.get(1)));
assertEquals(new LocalDate(2009, 10, 2), new LocalDate(dates.get(2)));
<BUG>}
@Test</BUG>
public void testPrintNull() throws ParseException {
formattingService.addFormatterForFieldType(Number.class, new NumberFormatter());
assertEquals("", formattingService.convert(null, TypeDescriptor.valueOf(Integer.class), TypeDescriptor.valueOf(String.class)));
| @Test
|
48,084 | assertNull(formattingService.convert(null, TypeDescriptor.valueOf(String.class), TypeDescriptor.valueOf(Integer.class)));
}
@Test
public void testParseEmptyString() throws ParseException {
formattingService.addFormatterForFieldType(Number.class, new NumberFormatter());
<BUG>assertNull(formattingService.convert("", TypeDescriptor.valueOf(Integer.class)));
</BUG>
}
@Test
public void testPrintNullDefault() throws ParseException {
| assertNull(formattingService.convert("", TypeDescriptor.valueOf(String.class), TypeDescriptor.valueOf(Integer.class)));
|
48,085 | public void testParseNullDefault() throws ParseException {
assertNull(formattingService.convert(null, TypeDescriptor.valueOf(String.class), TypeDescriptor.valueOf(Integer.class)));
}
@Test
public void testParseEmptyStringDefault() throws ParseException {
<BUG>assertNull(formattingService.convert("", TypeDescriptor.valueOf(Integer.class)));
</BUG>
}
public static class Model {
@SuppressWarnings("unused")
| assertNull(formattingService.convert("", TypeDescriptor.valueOf(String.class), TypeDescriptor.valueOf(Integer.class)));
|
48,086 | }
@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)
|
48,087 | 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))
|
48,088 | 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)
|
48,089 | 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");
|
48,090 | 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");
|
48,091 | }
@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);
|
48,092 | 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);
|
48,093 | 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);
|
48,094 | 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);
|
48,095 | 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;
|
48,096 | 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();
|
48,097 | 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: " +
|
48,098 | 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;
|
48,099 | 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]);
|
48,100 | 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;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.