id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
3,901
} @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)
3,902
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))
3,903
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)
3,904
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");
3,905
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");
3,906
} @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);
3,907
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);
3,908
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);
3,909
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);
3,910
package com.xpn.xwiki.web; import java.io.BufferedReader; import java.io.IOException; import java.io.UnsupportedEncodingException; <BUG>import java.security.Principal; import java.util.Collection; import java.util.Enumeration; import java.util.HashMap; import java.util.Locale;</BUG> import java.util.Map;
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Locale;
3,911
private String host; private String contextPath; private StringBuffer requestURL; private String requestURI; private String serverName; <BUG>private Map<String, String> parameters; </BUG> public XWikiServletRequestStub() { this.host = "";
private Map<String, List<String>> parameters;
3,912
Integer datasetId; String datasetUrn; String capacityName; String capacityType; String capacityUnit; <BUG>String capacityLow; String capacityHigh; </BUG> Long modifiedTime;
Long capacityLow; Long capacityHigh;
3,913
import com.fasterxml.jackson.databind.ObjectMapper; public class DatasetFieldPathRecord { String fieldPath; String role; public DatasetFieldPathRecord() { <BUG>} @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (JsonProcessingException ex) { return null; }</BUG> }
[DELETED]
3,914
new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, DATASET_INVENTORY_TABLE); public static final String GET_DATASET_DEPLOYMENT_BY_DATASET_ID = "SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id = :dataset_id"; public static final String GET_DATASET_DEPLOYMENT_BY_URN = "SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_urn = :dataset_urn"; <BUG>public static final String DELETE_DATASET_DEPLOYMENT_BY_URN = "DELETE FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_urn=?"; </BUG> public static final String GET_DATASET_CAPACITY_BY_DATASET_ID =
public static final String DELETE_DATASET_DEPLOYMENT_BY_DATASET_ID = "DELETE FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id=?";
3,915
</BUG> public static final String GET_DATASET_CAPACITY_BY_DATASET_ID = "SELECT * FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_id = :dataset_id"; public static final String GET_DATASET_CAPACITY_BY_URN = "SELECT * FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_urn = :dataset_urn"; <BUG>public static final String DELETE_DATASET_CAPACITY_BY_URN = "DELETE FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_urn=?"; </BUG> public static final String GET_DATASET_TAG_BY_DATASET_ID =
new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, DATASET_INVENTORY_TABLE); public static final String GET_DATASET_DEPLOYMENT_BY_DATASET_ID = "SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id = :dataset_id"; public static final String GET_DATASET_DEPLOYMENT_BY_URN = "SELECT * FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_urn = :dataset_urn"; public static final String DELETE_DATASET_DEPLOYMENT_BY_DATASET_ID = "DELETE FROM " + DATASET_DEPLOYMENT_TABLE + " WHERE dataset_id=?"; public static final String DELETE_DATASET_CAPACITY_BY_DATASET_ID = "DELETE FROM " + DATASET_CAPACITY_TABLE + " WHERE dataset_id=?";
3,916
"SELECT * FROM " + DATASET_CASE_SENSITIVE_TABLE + " WHERE dataset_urn = :dataset_urn"; public static final String GET_DATASET_REFERENCE_BY_DATASET_ID = "SELECT * FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_id = :dataset_id"; public static final String GET_DATASET_REFERENCE_BY_URN = "SELECT * FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_urn = :dataset_urn"; <BUG>public static final String DELETE_DATASET_REFERENCE_BY_URN = "DELETE FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_urn=?"; </BUG> public static final String GET_DATASET_PARTITION_BY_DATASET_ID =
public static final String DELETE_DATASET_REFERENCE_BY_DATASET_ID = "DELETE FROM " + DATASET_REFERENCE_TABLE + " WHERE dataset_id=?";
3,917
"SELECT * FROM " + DATASET_SECURITY_TABLE + " WHERE dataset_urn = :dataset_urn"; public static final String GET_DATASET_OWNER_BY_DATASET_ID = "SELECT * FROM " + DATASET_OWNER_TABLE + " WHERE dataset_id = :dataset_id ORDER BY sort_id"; public static final String GET_DATASET_OWNER_BY_URN = "SELECT * FROM " + DATASET_OWNER_TABLE + " WHERE dataset_urn = :dataset_urn ORDER BY sort_id"; <BUG>public static final String DELETE_DATASET_OWNER_BY_URN = "DELETE FROM " + DATASET_OWNER_TABLE + " WHERE dataset_urn=?"; </BUG> public static final String GET_USER_BY_USER_ID = "SELECT * FROM " + EXTERNAL_USER_TABLE + " WHERE user_id = :user_id";
public static final String DELETE_DATASET_OWNER_BY_DATASET_ID = "DELETE FROM " + DATASET_OWNER_TABLE + " WHERE dataset_id=?";
3,918
"SELECT app_id FROM " + EXTERNAL_GROUP_TABLE + " WHERE group_id = :group_id GROUP BY group_id"; public static final String GET_DATASET_CONSTRAINT_BY_DATASET_ID = "SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id = :dataset_id"; public static final String GET_DATASET_CONSTRAINT_BY_URN = "SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn = :dataset_urn"; <BUG>public static final String DELETE_DATASET_CONSTRAINT_BY_URN = "DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn=?"; </BUG> public static final String GET_DATASET_INDEX_BY_DATASET_ID =
public static final String DELETE_DATASET_CONSTRAINT_BY_DATASET_ID = "DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id=?";
3,919
</BUG> public static final String GET_DATASET_INDEX_BY_DATASET_ID = "SELECT * FROM " + DATASET_INDEX_TABLE + " WHERE dataset_id = :dataset_id"; public static final String GET_DATASET_INDEX_BY_URN = "SELECT * FROM " + DATASET_INDEX_TABLE + " WHERE dataset_urn = :dataset_urn"; <BUG>public static final String DELETE_DATASET_INDEX_BY_URN = "DELETE FROM " + DATASET_INDEX_TABLE + " WHERE dataset_urn=?"; </BUG> public static final String GET_DATASET_SCHEMA_BY_DATASET_ID =
"SELECT app_id FROM " + EXTERNAL_GROUP_TABLE + " WHERE group_id = :group_id GROUP BY group_id"; public static final String GET_DATASET_CONSTRAINT_BY_DATASET_ID = "SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id = :dataset_id"; public static final String GET_DATASET_CONSTRAINT_BY_URN = "SELECT * FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_urn = :dataset_urn"; public static final String DELETE_DATASET_CONSTRAINT_BY_DATASET_ID = "DELETE FROM " + DATASET_CONSTRAINT_TABLE + " WHERE dataset_id=?"; public static final String DELETE_DATASET_INDEX_BY_DATASET_ID = "DELETE FROM " + DATASET_INDEX_TABLE + " WHERE dataset_id=?";
3,920
DatasetSecurityRecord record = om.convertValue(security, DatasetSecurityRecord.class); record.setDatasetId(datasetId); record.setDatasetUrn(urn); record.setModifiedTime(System.currentTimeMillis() / 1000); try { <BUG>Map<String, Object> result = getDatasetSecurityByDatasetId(datasetId); </BUG> String[] columns = record.getDbColumnNames(); Object[] columnValues = record.getAllValuesToString(); String[] conditions = {"dataset_id"};
DatasetSecurityRecord result = getDatasetSecurityByDatasetId(datasetId);
3,921
"confidential_flags", "is_recursive", "partitioned", "indexed", "namespace", "default_comment_id", "comment_ids"}; } @Override public List<Object> fillAllFields() { return null; <BUG>} public String[] getFieldDetailColumns() {</BUG> return new String[]{"dataset_id", "sort_id", "parent_sort_id", "parent_path", "field_name", "fields_layout_id", "field_label", "data_type", "data_size", "data_precision", "data_fraction", "is_nullable", "is_indexed", "is_partitioned", "is_recursive", "confidential_flags", "default_value", "namespace", "default_comment_id",
@JsonIgnore public String[] getFieldDetailColumns() {
3,922
partitioned != null && partitioned ? "Y" : "N", isRecursive != null && isRecursive ? "Y" : "N", confidentialFlags, defaultValue, namespace, defaultCommentId, commentIds}; } public DatasetFieldSchemaRecord() { } <BUG>@Override public String toString() { try { return new ObjectMapper().writeValueAsString(this.getFieldValueMap()); } catch (Exception ex) { return null; } }</BUG> public Integer getDatasetId() {
[DELETED]
3,923
String fieldPath; String descend; Integer prefixLength; String filter; public DatasetFieldIndexRecord() { <BUG>} @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (JsonProcessingException ex) { return null; }</BUG> }
[DELETED]
3,924
String actorUrn; String type; Long time; String note; public DatasetChangeAuditStamp() { <BUG>} @Override public String toString() { try { return new ObjectMapper().writeValueAsString(this); } catch (JsonProcessingException ex) { return null; }</BUG> }
[DELETED]
3,925
package wherehows.common.schemas; <BUG>import com.fasterxml.jackson.annotation.JsonIgnore; import java.lang.reflect.Field; import java.util.HashMap;</BUG> import java.util.List; import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.util.Date; import java.util.Collection; import java.util.HashMap;
3,926
package com.jetbrains.lang.dart.validation.fixes; import com.intellij.codeInsight.template.Template; import com.intellij.codeInsight.template.TemplateManager; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; <BUG>import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiElement;</BUG> import com.intellij.psi.PsiFile; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.util.CommonRefactoringUtil;
import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement;
3,927
DartBundle.message("dart.cannot.find.place.to.create"), null ); return; } <BUG>final Editor openedEditor = navigate(project, anchor.getTextOffset(), anchor.getContainingFile().getVirtualFile()); if (openedEditor != null) {</BUG> templateManager.startTemplate(openedEditor, template); } }
VirtualFile file = anchor.getContainingFile().getVirtualFile(); final Editor openedEditor = file == null ? null : navigate(project, file, anchor.getTextOffset()); if (openedEditor != null) {
3,928
package com.jetbrains.lang.dart.validation.fixes; import com.intellij.codeInsight.template.Template; import com.intellij.codeInsight.template.TemplateManager; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Editor; <BUG>import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement;</BUG> import com.intellij.psi.PsiFile; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.util.CommonRefactoringUtil;
import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement;
3,929
DartBundle.message("dart.cannot.find.place.to.create"), null ); return; } <BUG>final Editor openedEditor = navigate(project, anchor.getTextOffset(), anchor.getContainingFile().getVirtualFile()); if (openedEditor != null) {</BUG> templateManager.startTemplate(openedEditor, template); } }
VirtualFile file = anchor.getContainingFile().getVirtualFile(); final Editor openedEditor = file == null ? null : navigate(project, file, anchor.getTextOffset()); if (openedEditor != null) {
3,930
import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileEditor.OpenFileDescriptor; import com.intellij.openapi.fileEditor.TextEditor; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; <BUG>import com.intellij.psi.PsiElement; import org.jetbrains.annotations.Nullable;</BUG> public abstract class BaseCreateFix extends FixAndIntentionAction { @Override public boolean startInWriteAction() {
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
3,931
package com.jetbrains.lang.dart.validation.fixes; import com.intellij.codeInsight.template.Template; import com.intellij.codeInsight.template.TemplateManager; import com.intellij.openapi.editor.Editor; <BUG>import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement;</BUG> import com.intellij.psi.util.PsiTreeUtil; import com.jetbrains.lang.dart.DartBundle; import com.jetbrains.lang.dart.psi.DartExecutionScope;
import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement;
3,932
template.addTextSegment("class "); template.addVariable(DartPresentableUtil.getExpression(myClassName), false); template.addTextSegment("{\n"); template.addEndVariable(); template.addTextSegment("\n}\n"); <BUG>final Editor openedEditor = navigate(project, anchor.getTextOffset(), anchor.getContainingFile().getVirtualFile()); if (openedEditor != null) {</BUG> templateManager.startTemplate(openedEditor, template); } }
VirtualFile file = anchor.getContainingFile().getVirtualFile(); final Editor openedEditor = file == null ? null : navigate(project, file, anchor.getTextOffset()); if (openedEditor != null) {
3,933
package org.drools.marshalling; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; <BUG>import java.io.PrintWriter; import java.util.Arrays; import java.util.Collection; </BUG> import java.util.Comparator;
import java.util.ArrayList; import java.util.Collections;
3,934
throw new IllegalArgumentException( "Unknown node instance type: " + nodeInstance ); } } public static void writeWorkItems(MarshallerWriteContext context) throws IOException { ObjectOutputStream stream = context.stream; <BUG>Set<WorkItem> workItems = context.wm.getWorkItemManager().getWorkItems(); for ( WorkItem workItem : workItems ) {</BUG> stream.writeShort( PersisterEnums.WORK_ITEM ); writeWorkItem( context,
List<WorkItem> workItems = new ArrayList<WorkItem>(context.wm.getWorkItemManager().getWorkItems()); Collections.sort(workItems, new Comparator<WorkItem>() { public int compare(WorkItem o1, WorkItem o2) { return (int) (o2.getId() - o1.getId()); }); for ( WorkItem workItem : workItems ) {
3,935
</BUG> } if (property instanceof Boolean) { return (((Boolean) property).booleanValue() ? 1 : 0); <BUG>} if (property instanceof String) { return Integer.parseInt((String) property); } throw new IllegalArgumentException(property != null ? property.toString() : "null");</BUG> }
if (base instanceof ListModel<?>) { // implies base != null return Integer.class; return null; private static final Integer coerce(Object property) { if (property instanceof Number) { return ((Number)property).intValue(); if (property instanceof Character) { return (int)((Character) property).charValue();
3,936
public BindELResolver(XelContext ctx) { super(ctx); _resolver = new CompositeELResolver(); _resolver.add(new PathELResolver()); //must be the first _resolver.add(new FormELResolver()); <BUG>_resolver.add(new ListModelELResolver()); _resolver.add(super.getELResolver());</BUG> } protected ELResolver getELResolver() { return _resolver;
_resolver.add(new TreeModelELResolver()); _resolver.add(super.getELResolver());
3,937
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;
3,938
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();
3,939
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: " +
3,940
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;
3,941
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]);
3,942
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;
3,943
for (ClassInfo classInfo : allClasses) { String className = classInfo.name().toString(); try { resultClasses.add(pu.getClassLoader().loadClass(className)); } catch (ClassNotFoundException e) { <BUG>throw MESSAGES.cannotLoadEntityClass(e, className); }</BUG> } }
JPA_LOGGER.cannotLoadEntityClass(e, className); } catch (NoClassDefFoundError e) { JPA_LOGGER.cannotLoadEntityClass(e, className);
3,944
JPA_LOGGER.tracef("getClassesInJar found class %s with annotation %s", className, annClass.getName()); Class<?> clazz = pu.getClassLoader().loadClass(className); result.add(clazz); classesForAnnotation.add(clazz); } catch (ClassNotFoundException e) { <BUG>throw MESSAGES.cannotLoadEntityClass(e, className); }</BUG> } } cacheClasses(pu, jartoScan, annClass, classesForAnnotation);
JPA_LOGGER.tracef("Could not load entity class '%s' with PersistenceUnitInfo.getClassLoader()", className); } catch (NoClassDefFoundError e) { JPA_LOGGER.tracef("Could not load entity class '%s' with PersistenceUnitInfo.getClassLoader()", className);
3,945
for (ClassInfo classInfo : allClasses) { String className = classInfo.name().toString(); try { resultClasses.add(pu.getNewTempClassLoader().loadClass(className)); } catch (ClassNotFoundException e) { <BUG>throw MESSAGES.cannotLoadEntityClass(e, className); }</BUG> } }
JPA_LOGGER.cannotLoadEntityClass(e, className); } catch (NoClassDefFoundError e) { JPA_LOGGER.cannotLoadEntityClass(e, className);
3,946
JPA_LOGGER.tracef("getClassesInJar found class %s with annotation %s", className, annClass.getName()); Class<?> clazz = pu.getNewTempClassLoader().loadClass(className); result.add(clazz); classesForAnnotation.add(clazz); } catch (ClassNotFoundException e) { <BUG>throw MESSAGES.cannotLoadEntityClass(e, className); }</BUG> } }
JPA_LOGGER.cannotLoadEntityClass(e, className); } catch (NoClassDefFoundError e) { JPA_LOGGER.cannotLoadEntityClass(e, className);
3,947
package com.cronutils.model.time.generator; import java.util.Collections; <BUG>import java.util.List; import org.apache.commons.lang3.Validate;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.expression.FieldExpression; public abstract class FieldValueGenerator {
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
3,948
import java.util.ResourceBundle; import java.util.function.Function;</BUG> class DescriptionStrategyFactory { private DescriptionStrategyFactory() {} public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) { <BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale()); </BUG> NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression); dow.addDescription(fieldExpression -> { if (fieldExpression instanceof On) {
import java.util.function.Function; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
3,949
return dom; } public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) { return new NominalDescriptionStrategy( bundle, <BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()), expression</BUG> ); } public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()), expression
3,950
<BUG>package com.cronutils.model.time.generator; import com.cronutils.mapper.WeekDay;</BUG> import com.cronutils.model.field.CronField; import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
import java.time.LocalDate; import java.util.Collections; import java.util.List; import java.util.Set; import org.apache.commons.lang3.Validate; import com.cronutils.mapper.WeekDay;
3,951
import com.cronutils.model.field.expression.Between; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.parser.CronParserField; import com.google.common.collect.Lists; import com.google.common.collect.Sets; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.Collections; import java.util.List; import java.util.Set;</BUG> class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
[DELETED]
3,952
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On;
import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import org.apache.commons.lang3.Validate; import com.cronutils.model.field.CronField;
3,953
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.CronFieldName; import com.cronutils.model.field.expression.FieldExpression; import com.cronutils.model.field.expression.On; import com.google.common.collect.Lists; <BUG>import org.apache.commons.lang3.Validate; import org.joda.time.DateTime; import java.util.List;</BUG> class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year;
package com.cronutils.model.time.generator; import java.time.DayOfWeek; import java.time.LocalDate; import java.util.List; import com.cronutils.model.field.CronField;
3,954
class OnDayOfMonthValueGenerator extends FieldValueGenerator { private int year; private int month; public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) { super(cronField); <BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month"); this.year = year;</BUG> this.month = month; }
Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" + " month"); this.year = year;
3,955
package com.cronutils.mapper; public class ConstantsMapper { private ConstantsMapper() {} public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false); <BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false); </BUG> public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true); public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){ return source.mapTo(weekday, target);
public static final WeekDay JAVA8 = new WeekDay(1, false);
3,956
return nextMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException { </BUG> List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear()); TimeNode days = null; int lowestMonth = months.getValues().get(0);
ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
3,957
boolean questionMarkSupported = cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK); if(questionMarkSupported){ return new TimeNode( generateDayCandidatesQuestionMarkSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
3,958
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
3,959
} public DateTime lastExecution(DateTime date){ </BUG> Validate.notNull(date); try { <BUG>DateTime previousMatch = previousClosestMatch(date); </BUG> if(previousMatch.equals(date)){ previousMatch = previousClosestMatch(date.minusSeconds(1)); }
public java.time.Duration timeToNextExecution(ZonedDateTime date){ return java.time.Duration.between(date, nextExecution(date)); public ZonedDateTime lastExecution(ZonedDateTime date){ ZonedDateTime previousMatch = previousClosestMatch(date);
3,960
return previousMatch; } catch (NoSuchValueException e) { throw new IllegalArgumentException(e); } } <BUG>public Duration timeFromLastExecution(DateTime date){ return new Interval(lastExecution(date), date).toDuration(); } public boolean isMatch(DateTime date){ </BUG> return nextExecution(lastExecution(date)).equals(date);
[DELETED]
3,961
<BUG>package com.cronutils.model.time.generator; import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting;
import java.time.ZonedDateTime; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cronutils.model.field.CronField;
3,962
import com.cronutils.model.field.CronField;</BUG> import com.cronutils.model.field.expression.Every; import com.cronutils.model.field.expression.FieldExpression; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; <BUG>import org.joda.time.DateTime; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.List;</BUG> class EveryFieldValueGenerator extends FieldValueGenerator {
package com.cronutils.model.time.generator; import java.time.ZonedDateTime; import java.util.List; import com.cronutils.model.field.CronField;
3,963
private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class); public EveryFieldValueGenerator(CronField cronField) { super(cronField); log.trace(String.format( "processing \"%s\" at %s", <BUG>cronField.getExpression().asString(), DateTime.now() </BUG> )); } @Override
cronField.getExpression().asString(), ZonedDateTime.now()
3,964
object instanceof Double || object instanceof Boolean || object instanceof Long || object instanceof Short) { value = object.toString(); } else if (object.getClass().getName().startsWith("java.lang")) { String strValue = object.toString() <BUG>.replace("\r","\\r") .replace("\n","\\n"); </BUG> value = "\"" + strValue + "\"";
.replace("\r","\\u000d") // \r .replace("\r","\\u0022") // \* .replace("\n","\\u000a"); // \n
3,965
public List<Object> call(String sqlText, CallType[] callTypes, Object ... args) throws SQLException { Map<String, Object> paramsMap = TObject.arrayToMap(args); return this.baseCall(sqlText,callTypes, paramsMap); } protected static void closeConnection(ResultSet resultSet) { <BUG>Statement statement = null; Connection connection = null; try { statement = resultSet.getStatement(); connection = statement.getConnection(); } catch (SQLException e) { Logger.error(e.getMessage(),e); }</BUG> try {
if (resultSet != null) { Statement statement = resultSet.getStatement(); resultSet.close(); closeConnection(statement);
3,966
if(value!=null){ if(value instanceof String){ String stringValue = TObject.cast(value); if(stringValue.startsWith("\"") && stringValue.endsWith("\"")){ value = stringValue.substring(1,stringValue.length()-1); <BUG>value = value.toString().replace("\\\\","\\").replace("\\r","\r").replace("\\n","\n"); </BUG> } else if (TString.isInteger(stringValue)){ Long longValue = Long.parseLong((String)value);
value = value.toString().replace("\\u000a","\n").replace("\\u000d","\r").replace("\\u0022","\"");
3,967
final Writer writer = sourceFile.openWriter(); JavaFile.builder(packageElement.getQualifiedName().toString(), classType) </BUG> .build() .writeTo(writer); writer.close(); <BUG>} catch (IOException e) { throw new RuntimeException("Failed writing class file " + qualifiedClassName, e); } }</BUG> private TypeName getObjectBinderGenericTypeName(TypeElement hostElement) {
.addParameter(objectGenericType, "view") .addCode(generateBindMethodBody(lifeCycleAwareInfo)) .build();
3,968
builder.addStatement("$L." + methodName + "(view.$L, bundle)", info.field.getSimpleName(), info.field.getSimpleName()); } } return builder.build(); } <BUG>private CodeBlock generateBindMethod(LifeCycleAwareInfo lifeCycleAwareInfo) { </BUG> CodeBlock.Builder builder = CodeBlock.builder(); for (Element element : lifeCycleAwareInfo.lifeCycleAwareElements) { builder.addStatement("listeners.add(view.$L)", element);
private CodeBlock generateBindMethodBody(LifeCycleAwareInfo lifeCycleAwareInfo) {
3,969
RedisClient debugSegfault(Handler<AsyncResult<String>> handler); @Fluent RedisClient decr(String key, Handler<AsyncResult<Long>> handler); @Fluent RedisClient decrby(String key, long decrement, Handler<AsyncResult<Long>> handler); <BUG>@Fluent RedisClient del(List<String> keys, Handler<AsyncResult<Long>> handler); </BUG> @Fluent RedisClient discard(Handler<AsyncResult<String>> handler);
RedisClient del(String key, Handler<AsyncResult<Long>> handler); RedisClient delMany(List<String> keys, Handler<AsyncResult<Long>> handler);
3,970
@Override public RedisClient decrby(String key, long decrement, Handler<AsyncResult<Long>> handler) { sendLong(DECRBY, toPayload(key, decrement), handler); return this; } <BUG>@Override public RedisClient del(List<String> keys, Handler<AsyncResult<Long>> handler) { </BUG> sendLong(DEL, toPayload(keys), handler); return this;
public RedisClient append(String key, String value, Handler<AsyncResult<Long>> handler) { sendLong(APPEND, toPayload(key, value), handler);
3,971
public RedisClient hmget(String key, List<String> fields, Handler<AsyncResult<JsonArray>> handler) { sendJsonArray(HMGET, toPayload(key, fields), handler); return this; } @Override <BUG>public RedisClient hmset(String key, Map<String, String> values, Handler<AsyncResult<String>> handler) { </BUG> sendString(HMSET, toPayload(key, values), handler); return this; }
[DELETED]
3,972
public RedisClient move(String key, int destdb, Handler<AsyncResult<Long>> handler) { sendLong(MOVE, toPayload(key, destdb), handler); return this; } @Override <BUG>public RedisClient mset(Map<String, String> keyvals, Handler<AsyncResult<String>> handler) { </BUG> sendString(MSET, toPayload(keyvals), handler); return this; }
[DELETED]
3,973
</BUG> sendString(MSET, toPayload(keyvals), handler); return this; } @Override <BUG>public RedisClient msetnx(Map<String, String> keyvals, Handler<AsyncResult<Long>> handler) { </BUG> sendLong(MSETNX, toPayload(keyvals), handler); return this; }
public RedisClient move(String key, int destdb, Handler<AsyncResult<Long>> handler) { sendLong(MOVE, toPayload(key, destdb), handler); public RedisClient mset(JsonObject keyvals, Handler<AsyncResult<String>> handler) {
3,974
private static JsonArray toPayload(Object ... parameters) { JsonArray result = new JsonArray(); for (Object param: parameters) { if (param instanceof JsonArray) { param = ((JsonArray) param).getList(); <BUG>} if (param instanceof Collection) {</BUG> ((Collection) param).stream().filter(el -> el != null).forEach(result::add); } else if (param instanceof Map) { for (Map.Entry<?, ?> pair : ((Map<?, ?>) param).entrySet()) {
if (param instanceof JsonObject) { param = ((JsonObject) param).getMap(); if (param instanceof Collection) {
3,975
</BUG> if (params.length % 2 != 0) { throw new IllegalArgumentException("Last key has no value"); } <BUG>Map<String, String> result = new HashMap<>(); </BUG> String key = null; for (String param : params) { if (key == null) { key = param;
return t != null ? t.getMessage() : ""; private static String makeKey() { return UUID.randomUUID().toString(); private static Map<String, Object> toMap(final String... params) { Map<String, Object> result = new HashMap<>();
3,976
return Arrays.asList(params); } @Test public void testAppend() { final String key = makeKey(); <BUG>redis.del(toList(key), reply0 -> { </BUG> assertTrue(reply0.succeeded()); redis.append(key, "Hello", reply1 -> { assertTrue(reply1.succeeded());
redis.delMany(toList(key), reply0 -> {
3,977
final String key3 = makeKey(); redis.set(key1, "Hello", reply0 -> { assertTrue(reply0.succeeded()); redis.set(key2, "World", reply1 -> { assertTrue(reply1.succeeded()); <BUG>redis.del(toList(key1, key2, key3), reply2 -> { </BUG> assertTrue(reply2.succeeded()); assertEquals(2, reply2.result().longValue()); testComplete();
redis.delMany(toList(key1, key2, key3), reply2 -> {
3,978
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG> public String error404() { return "/error/404"; }
public class ErrorController { @RequestMapping(value = {"/404"})
3,979
System.out.println(change); } } }; @Override <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { return (child) -> {
protected Callback<VChild, Void> copyIntoCallback()
3,980
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
3,981
VEVENT ("VEVENT", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_END, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, PropertyType.EXCEPTION_DATE_TIMES, <BUG>PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,</BUG> PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS, PropertyType.SUMMARY, PropertyType.TIME_TRANSPARENCY, PropertyType.UNIQUE_IDENTIFIER,
PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,
3,982
VTODO ("VTODO", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_COMPLETED, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_DUE, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, <BUG>PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,</BUG> PropertyType.PERCENT_COMPLETE, PropertyType.PRIORITY, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS,
PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,
3,983
throw new RuntimeException("not implemented"); } }, DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, <BUG>PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,</BUG> PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class) {
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
3,984
throw new RuntimeException("not implemented"); } }, VALARM ("VALARM", Arrays.asList(PropertyType.ACTION, PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.DESCRIPTION, <BUG>PropertyType.DURATION, PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.REPEAT_COUNT, PropertyType.SUMMARY, PropertyType.TRIGGER),</BUG> VAlarm.class) { @Override
DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM, PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class)
3,985
private ContentLineStrategy contentLineGenerator; protected void setContentLineGenerator(ContentLineStrategy contentLineGenerator) { this.contentLineGenerator = contentLineGenerator; } <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { throw new RuntimeException("Can't copy children. copyChildCallback isn't overridden in subclass." + this.getClass()); };
protected Callback<VChild, Void> copyIntoCallback()
3,986
import jfxtras.labs.icalendarfx.properties.calendar.Version; import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty; public enum CalendarProperty { CALENDAR_SCALE ("CALSCALE", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), CalendarScale.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), CalendarScale.class)
3,987
CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); } }, METHOD ("METHOD", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Method.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
3,988
} list.add(new NonStandardProperty((NonStandardProperty) child)); } }, PRODUCT_IDENTIFIER ("PRODID", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), ProductIdentifier.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
public void copyChild(VChild child, VCalendar destination) CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); METHOD ("METHOD", Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
3,989
ProductIdentifier productIdentifier = (ProductIdentifier) child; destination.setProductIdentifier(productIdentifier); } }, VERSION ("VERSION", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Version.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Version.class)
3,990
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
3,991
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north), ((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla)); <BUG>sOrientationListener = new SensorListener() { </BUG> public void onSensorChanged(int s, float v[]) { float northDirection = v[SensorManager.DATA_X]; qiblaCompassView.setDirections(northDirection, sQiblaDirection);
sOrientationListener = new android.hardware.SensorListener() {
3,992
waiting = true; if (canBlock) manager.beginMonitoring(threadJob, monitor); final Thread currentThread = Thread.currentThread(); while (true) { <BUG>if (isCanceled(monitor)) </BUG> throw new OperationCanceledException(); blockingJob = manager.runNow(threadJob, true); if (blockingJob == null) {
if (interrupted || isCanceled(monitor))
3,993
waitEnd(threadJob, threadJob == result, monitor); if (threadJob == result) { if (waiting) manager.implicitJobs.removeWaiting(threadJob); } <BUG>if (canBlock) manager.endMonitoring(threadJob); }</BUG> }
if (canBlock) {
3,994
static boolean DEBUG_DEADLOCK = false; static boolean DEBUG_LOCKS = false; static boolean DEBUG_TIMING = false; static boolean DEBUG_SHUTDOWN = false; private static DateFormat DEBUG_FORMAT; <BUG>private static JobManager instance; private static final ISchedulingRule nullRule = new ISchedulingRule() {</BUG> @Override public boolean contains(ISchedulingRule rule) { return rule == this;
public static boolean reactToInterruption; private static final ISchedulingRule nullRule = new ISchedulingRule() {
3,995
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> a[i][j] = operator.applyAsBoolean(a[i][j]); }
public boolean[] row(final int rowIndex) { N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex); return a[rowIndex];
3,996
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j]); }
public boolean get(final int i, final int j) { return a[i][j];
3,997
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j], c[i][j]); }
return new BooleanMatrix(c);
3,998
} public AsyncExecutor(int maxConcurrentThreadNumber, long keepAliveTime, TimeUnit unit) { this.maxConcurrentThreadNumber = maxConcurrentThreadNumber; this.keepAliveTime = keepAliveTime; this.unit = unit; <BUG>} public AsyncExecutor(final ExecutorService executorService) { this(8, 300, TimeUnit.SECONDS); this.executorService = executorService;</BUG> Runtime.getRuntime().addShutdownHook(new Thread() {
[DELETED]
3,999
results.add(execute(cmd)); } return results; } public <T> CompletableFuture<T> execute(final Callable<T> command) { <BUG>final CompletableFuture<T> future = new CompletableFuture<T>(this, command); getExecutorService().execute(future);</BUG> return future; } public <T> List<CompletableFuture<T>> execute(final Callable<T>... commands) {
final CompletableFuture<T> future = new CompletableFuture<>(this, command); getExecutorService().execute(future);
4,000
import org.apache.commons.lang3.math.NumberUtils; import org.json.JSONException; import org.mariotaku.microblog.library.MicroBlog; import org.mariotaku.microblog.library.MicroBlogException; import org.mariotaku.microblog.library.twitter.model.RateLimitStatus; <BUG>import org.mariotaku.microblog.library.twitter.model.Status; import org.mariotaku.sqliteqb.library.AllColumns;</BUG> import org.mariotaku.sqliteqb.library.Columns; import org.mariotaku.sqliteqb.library.Columns.Column; import org.mariotaku.sqliteqb.library.Expression;
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;