id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
9,501 | package com.appboy;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
<BUG>import android.util.Log;
import java.io.InputStream;</BUG>
import java.net.MalformedURLException;
import java.net.UnknownHostException;
public class AppboyImageUtils {
| import com.appboy.support.AppboyLogger;
import java.io.InputStream;
|
9,502 | public class AppboyImageUtils {
private static final String TAG = String.format("%s.%s", Constants.APPBOY_LOG_TAG_PREFIX, AppboyImageUtils.class.getName());
public static final int BASELINE_SCREEN_DPI = 160;
public static Bitmap downloadImageBitmap(String imageUrl) {
if (imageUrl == null || imageUrl.length() == 0) {
<BUG>Log.i(TAG, "Null or empty Url string passed to image bitmap download. Not attempting download.");
</BUG>
return null;
}
Bitmap bitmap = null;
| AppboyLogger.i(TAG, "Null or empty Url string passed to image bitmap download. Not attempting download.");
|
9,503 | public static final String DELETE_ACTION_HISTORY_RESULT;
public static final String DELETE_ACTION_PLUGIN;
public static final String DELETE_ALERT;
public static final String DELETE_ALERT_CTIME;
public static final String DELETE_ALERT_LIFECYCLE;
<BUG>public static final String DELETE_ALERT_SEVERITY;
public static final String DELETE_ALERT_STATUS;</BUG>
public static final String DELETE_ALERT_TRIGGER;
public static final String DELETE_CONDITIONS;
public static final String DELETE_CONDITIONS_MODE;
| [DELETED] |
9,504 | public static final String INSERT_ACTION_PLUGIN;
public static final String INSERT_ACTION_PLUGIN_DEFAULT_PROPERTIES;
public static final String INSERT_ALERT;
public static final String INSERT_ALERT_CTIME;
public static final String INSERT_ALERT_LIFECYCLE;
<BUG>public static final String INSERT_ALERT_SEVERITY;
public static final String INSERT_ALERT_STATUS;</BUG>
public static final String INSERT_ALERT_TRIGGER;
public static final String INSERT_CONDITION_AVAILABILITY;
public static final String INSERT_CONDITION_COMPARE;
| [DELETED] |
9,505 | public static final String SELECT_ALERT_CTIME_START;
public static final String SELECT_ALERT_CTIME_START_END;
public static final String SELECT_ALERT_LIFECYCLE_END;
public static final String SELECT_ALERT_LIFECYCLE_START;
public static final String SELECT_ALERT_LIFECYCLE_START_END;
<BUG>public static final String SELECT_ALERT_STATUS;
public static final String SELECT_ALERT_SEVERITY;</BUG>
public static final String SELECT_ALERT_TRIGGER;
public static final String SELECT_ALERTS_BY_TENANT;
public static final String SELECT_CONDITION_ID;
| [DELETED] |
9,506 | DELETE_ALERT = "DELETE FROM " + keyspace + ".alerts " + "WHERE tenantId = ? AND alertId = ? ";
DELETE_ALERT_CTIME = "DELETE FROM " + keyspace + ".alerts_ctimes "
+ "WHERE tenantId = ? AND ctime = ? AND alertId = ? ";
DELETE_ALERT_LIFECYCLE = "DELETE FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime = ? AND alertId = ? ";
<BUG>DELETE_ALERT_SEVERITY = "DELETE FROM " + keyspace + ".alerts_severities "
+ "WHERE tenantId = ? AND severity = ? AND alertId = ? ";
DELETE_ALERT_STATUS = "DELETE FROM " + keyspace + ".alerts_statuses "
+ "WHERE tenantId = ? AND status = ? AND alertId = ? ";</BUG>
DELETE_ALERT_TRIGGER = "DELETE FROM " + keyspace + ".alerts_triggers "
| [DELETED] |
9,507 | INSERT_ALERT = "INSERT INTO " + keyspace + ".alerts " + "(tenantId, alertId, payload) VALUES (?, ?, ?) ";
INSERT_ALERT_CTIME = "INSERT INTO " + keyspace + ".alerts_ctimes "
+ "(tenantId, alertId, ctime) VALUES (?, ?, ?) ";
INSERT_ALERT_LIFECYCLE = "INSERT INTO " + keyspace + ".alerts_lifecycle "
+ "(tenantId, alertId, status, stime) VALUES (?, ?, ?, ?) ";
<BUG>INSERT_ALERT_SEVERITY = "INSERT INTO " + keyspace + ".alerts_severities "
+ "(tenantId, alertId, severity) VALUES (?, ?, ?) ";
INSERT_ALERT_STATUS = "INSERT INTO " + keyspace + ".alerts_statuses "
+ "(tenantId, alertId, status) VALUES (?, ?, ?) ";</BUG>
INSERT_ALERT_TRIGGER = "INSERT INTO " + keyspace + ".alerts_triggers "
| [DELETED] |
9,508 | + "WHERE tenantId = ? AND status = ? AND stime <= ? ";
SELECT_ALERT_LIFECYCLE_START = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime >= ? ";
SELECT_ALERT_LIFECYCLE_START_END = "SELECT alertId FROM " + keyspace + ".alerts_lifecycle "
+ "WHERE tenantId = ? AND status = ? AND stime >= ? AND stime <= ? ";
<BUG>SELECT_ALERT_SEVERITY = "SELECT alertId FROM " + keyspace + ".alerts_severities "
+ "WHERE tenantId = ? AND severity = ? ";
SELECT_ALERT_STATUS = "SELECT alertId FROM " + keyspace + ".alerts_statuses "
+ "WHERE tenantId = ? AND status = ? ";</BUG>
SELECT_ALERTS_BY_TENANT = "SELECT payload FROM " + keyspace + ".alerts " + "WHERE tenantId = ? ";
| [DELETED] |
9,509 | import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
<BUG>import java.util.stream.Collectors;
import javax.ejb.EJB;</BUG>
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
| import javax.annotation.PostConstruct;
import javax.ejb.EJB;
|
9,510 | import org.hawkular.alerts.api.model.trigger.Trigger;
import org.hawkular.alerts.api.services.ActionsService;
import org.hawkular.alerts.api.services.AlertsCriteria;
import org.hawkular.alerts.api.services.AlertsService;
import org.hawkular.alerts.api.services.DefinitionsService;
<BUG>import org.hawkular.alerts.api.services.EventsCriteria;
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;</BUG>
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingEvents;
import org.hawkular.alerts.engine.log.MsgLogger;
import org.hawkular.alerts.engine.service.AlertsEngine;
| import org.hawkular.alerts.api.services.PropertiesService;
import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;
|
9,511 | import com.datastax.driver.core.Session;
import com.google.common.util.concurrent.Futures;
@Local(AlertsService.class)
@Stateless
@TransactionAttribute(value = TransactionAttributeType.NOT_SUPPORTED)
<BUG>public class CassAlertsServiceImpl implements AlertsService {
private final MsgLogger msgLog = MsgLogger.LOGGER;
private final Logger log = Logger.getLogger(CassAlertsServiceImpl.class);
@EJB</BUG>
AlertsEngine alertsEngine;
| private static final String CRITERIA_NO_QUERY_SIZE = "hawkular-alerts.criteria-no-query-size";
private static final String CRITERIA_NO_QUERY_SIZE_ENV = "CRITERIA_NO_QUERY_SIZE";
private static final String CRITERIA_NO_QUERY_SIZE_DEFAULT = "200";
private int criteriaNoQuerySize;
|
9,512 | log.debug("Adding " + alerts.size() + " alerts");
}
PreparedStatement insertAlert = CassStatement.get(session, CassStatement.INSERT_ALERT);
PreparedStatement insertAlertTrigger = CassStatement.get(session, CassStatement.INSERT_ALERT_TRIGGER);
PreparedStatement insertAlertCtime = CassStatement.get(session, CassStatement.INSERT_ALERT_CTIME);
<BUG>PreparedStatement insertAlertStatus = CassStatement.get(session, CassStatement.INSERT_ALERT_STATUS);
PreparedStatement insertAlertSeverity = CassStatement.get(session, CassStatement.INSERT_ALERT_SEVERITY);</BUG>
PreparedStatement insertTag = CassStatement.get(session, CassStatement.INSERT_TAG);
try {
List<ResultSetFuture> futures = new ArrayList<>();
| [DELETED] |
9,513 | futures.add(session.executeAsync(insertAlertTrigger.bind(a.getTenantId(),
a.getAlertId(),
a.getTriggerId())));
futures.add(session.executeAsync(insertAlertCtime.bind(a.getTenantId(),
a.getAlertId(), a.getCtime())));
<BUG>futures.add(session.executeAsync(insertAlertStatus.bind(a.getTenantId(),
a.getAlertId(),
a.getStatus().name())));
futures.add(session.executeAsync(insertAlertSeverity.bind(a.getTenantId(),
a.getAlertId(),
a.getSeverity().name())));</BUG>
a.getTags().entrySet().stream().forEach(tag -> {
| [DELETED] |
9,514 | for (Row row : rsAlerts) {
String payload = row.getString("payload");
Alert alert = JsonUtil.fromJson(payload, Alert.class, thin);
alerts.add(alert);
}
<BUG>}
} catch (Exception e) {
msgLog.errorDatabaseException(e.getMessage());
throw e;
}
return preparePage(alerts, pager);</BUG>
}
| [DELETED] |
9,515 | for (Alert a : alertsToDelete) {
String id = a.getAlertId();
List<ResultSetFuture> futures = new ArrayList<>();
futures.add(session.executeAsync(deleteAlert.bind(tenantId, id)));
futures.add(session.executeAsync(deleteAlertCtime.bind(tenantId, a.getCtime(), id)));
<BUG>futures.add(session.executeAsync(deleteAlertSeverity.bind(tenantId, a.getSeverity().name(), id)));
futures.add(session.executeAsync(deleteAlertStatus.bind(tenantId, a.getStatus().name(), id)));</BUG>
futures.add(session.executeAsync(deleteAlertTrigger.bind(tenantId, a.getTriggerId(), id)));
a.getLifecycle().stream().forEach(l -> {
futures.add(
| [DELETED] |
9,516 | private Alert updateAlertStatus(Alert alert) throws Exception {
if (alert == null || alert.getAlertId() == null || alert.getAlertId().isEmpty()) {
throw new IllegalArgumentException("AlertId must be not null");
}
try {
<BUG>PreparedStatement deleteAlertStatus = CassStatement.get(session,
CassStatement.DELETE_ALERT_STATUS);
PreparedStatement insertAlertStatus = CassStatement.get(session,
CassStatement.INSERT_ALERT_STATUS);</BUG>
PreparedStatement insertAlertLifecycle = CassStatement.get(session,
| [DELETED] |
9,517 | PreparedStatement insertAlertLifecycle = CassStatement.get(session,
CassStatement.INSERT_ALERT_LIFECYCLE);
PreparedStatement updateAlert = CassStatement.get(session,
CassStatement.UPDATE_ALERT);
List<ResultSetFuture> futures = new ArrayList<>();
<BUG>for (Status statusToDelete : EnumSet.complementOf(EnumSet.of(alert.getStatus()))) {
futures.add(session.executeAsync(deleteAlertStatus.bind(alert.getTenantId(), statusToDelete.name(),
alert.getAlertId())));
}
futures.add(session.executeAsync(insertAlertStatus.bind(alert.getTenantId(), alert.getAlertId(), alert
.getStatus().name())));</BUG>
Alert.LifeCycle lifecycle = alert.getCurrentLifecycle();
| [DELETED] |
9,518 | String category = null;
Collection<String> categories = null;
String triggerId = null;
Collection<String> triggerIds = null;
Map<String, String> tags = null;
<BUG>boolean thin = false;
public EventsCriteria() {</BUG>
super();
}
public Long getStartTime() {
| Integer criteriaNoQuerySize = null;
public EventsCriteria() {
|
9,519 | }
@Override
public String toString() {
return "EventsCriteria [startTime=" + startTime + ", endTime=" + endTime + ", eventId=" + eventId
+ ", eventIds=" + eventIds + ", category=" + category + ", categories=" + categories + ", triggerId="
<BUG>+ triggerId + ", triggerIds=" + triggerIds + ", tags=" + tags + ", thin=" + thin + "]";
}</BUG>
}
| public void addTag(String name, String value) {
if (null == tags) {
tags = new HashMap<>();
|
9,520 | SearchPhenotypesResponse response = client.genotypePhenotype.searchPhenotypes(request);
assertThat(response.getPhenotypes()).isNotNull();
assertThat(response.getPhenotypes()).isNotEmpty();
}
@Test
<BUG>public void simplePhenotypeSearchNoFind() throws AvroRemoteException {
final String phenotypeAssociationSetId = Utils.getPhenotypeAssociationSetId(client);</BUG>
SearchPhenotypeRequest request = SearchPhenotypeRequest
.newBuilder()
.setPhenotypeAssociationSetId(phenotypeAssociationSetId)
| public void phenotypeSearchByOntologyTerm() throws InvalidProtocolBufferException, UnirestException, GAWrapperException {
final String phenotypeAssociationSetId = Utils.getPhenotypeAssociationSetId(client);
SearchPhenotypesRequest request = SearchPhenotypesRequest
|
9,521 | String getSearchDataSets();
void setSearchDataSets(String searchDataSets);
String getGetDataSet();
void setGetDataSet(String getDataSet);
String getSearchReads();
<BUG>void setSearchReads(String searchReads);
String getSearchGenotypePhenotype();</BUG>
void setSearchGenotypePhenotype(String searchGenotypePhenotype);
String getSearchPhenotypeAssociationSets();
void setSearchPhenotypeAssociationSets(String searchPhenotypeAssociationSets);
| String getSearchPhenotypes();
void setSearchPhenotypes(String searchPhenotypes);
String getSearchGenotypePhenotype();
|
9,522 | private final URLMAPPING urls;
public final WireTracker wireTracker;
public final Variants variants = new Variants();
public final Reads reads = new Reads();
public final References references = new References();
<BUG>public final GenotypePhenotype genotypePhenotype = new GenotypePhenotype();
public final Metadata metadata = new Metadata();</BUG>
public final BioMetadata bioMetadata = new BioMetadata();
public Client(URLMAPPING urls) {
this(urls, null);
| public final VariantAnnotations variantAnnotations = new VariantAnnotations();
public final SequenceAnnotations sequenceAnnotations = new SequenceAnnotations();
public final Metadata metadata = new Metadata();
|
9,523 | 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;
|
9,524 | 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();
|
9,525 | 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: " +
|
9,526 | 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;
|
9,527 | 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]);
|
9,528 | 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;
|
9,529 | import com.couchbase.client.core.ClusterFacade;
import com.couchbase.client.core.CouchbaseException;
import com.couchbase.client.core.RequestCancelledException;
import com.couchbase.client.core.annotations.InterfaceAudience;
import com.couchbase.client.core.annotations.InterfaceStability;
<BUG>import com.couchbase.client.core.message.ResponseStatus;
import com.couchbase.client.core.message.kv.MutationToken;
import com.couchbase.client.core.message.kv.subdoc.multi.Lookup;</BUG>
import com.couchbase.client.java.bucket.AsyncBucketManager;
import com.couchbase.client.java.document.BinaryDocument;
| [DELETED] |
9,530 | import com.couchbase.client.java.document.Document;
import com.couchbase.client.java.document.JsonDocument;
import com.couchbase.client.java.document.JsonLongDocument;
import com.couchbase.client.java.document.LegacyDocument;
import com.couchbase.client.java.document.StringDocument;
<BUG>import com.couchbase.client.java.document.subdoc.DocumentFragment;
import com.couchbase.client.java.document.subdoc.ExtendDirection;
import com.couchbase.client.java.document.subdoc.LookupResult;
import com.couchbase.client.java.document.subdoc.LookupSpec;
import com.couchbase.client.java.document.subdoc.MultiLookupResult;</BUG>
import com.couchbase.client.java.env.CouchbaseEnvironment;
| [DELETED] |
9,531 | import com.couchbase.client.java.query.N1qlQuery;
import com.couchbase.client.java.query.Statement;
import com.couchbase.client.java.repository.AsyncRepository;
import com.couchbase.client.java.repository.Repository;
import com.couchbase.client.java.search.SearchQueryResult;
<BUG>import com.couchbase.client.java.search.query.SearchQuery;
import com.couchbase.client.java.transcoder.Transcoder;
import com.couchbase.client.java.view.AsyncSpatialViewResult;</BUG>
import com.couchbase.client.java.view.AsyncViewResult;
import com.couchbase.client.java.view.SpatialViewQuery;
| import com.couchbase.client.java.subdoc.AsyncLookupInBuilder;
import com.couchbase.client.java.subdoc.AsyncMutateInBuilder;
import com.couchbase.client.java.transcoder.subdoc.FragmentTranscoder;
import com.couchbase.client.java.view.AsyncSpatialViewResult;
|
9,532 | import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
<BUG>import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import com.couchbase.client.core.message.ResponseStatus;
import com.couchbase.client.java.bucket.BucketType;</BUG>
import com.couchbase.client.java.document.JsonArrayDocument;
| import static org.junit.Assert.assertThat;
import java.util.concurrent.TimeUnit;
import com.couchbase.client.core.logging.CouchbaseLogger;
import com.couchbase.client.core.logging.CouchbaseLoggerFactory;
import com.couchbase.client.core.message.kv.subdoc.multi.Lookup;
import com.couchbase.client.core.message.kv.subdoc.multi.Mutation;
import com.couchbase.client.java.bucket.BucketType;
|
9,533 | assertEquals(4, storedArray.size());
assertEquals("arrayInsert", storedArray.getString(0));
}
@Test
public void testArrayInsertAtSize() {
<BUG>DocumentFragment<String> fragment = DocumentFragment.create(key, "array[3]", "arrayInsert");
DocumentFragment<String> result = ctx.bucket().arrayInsertIn(fragment, PersistTo.NONE, ReplicateTo.NONE);
assertNotNull(result);
assertNotEquals(fragment.cas(), result.cas());
</BUG>
JsonArray storedArray = ctx.bucket().get(key).content().getArray("array");
| DocumentFragment<Mutation> result = ctx.bucket()
.mutateIn(key)
.arrayInsert("array[3]", "arrayInsert")
.doMutate();
assertNotEquals(0L, result.cas());
|
9,534 | assertEquals(1, storedArray.size());
assertEquals("arrayInsert", storedArray.getString(0));
}
@Test
public void testArrayInsertAtExistingIndex() {
<BUG>DocumentFragment<String> fragment = DocumentFragment.create(key, "array[1]", "arrayInsert");
DocumentFragment<String> result = ctx.bucket().arrayInsertIn(fragment, PersistTo.NONE, ReplicateTo.NONE);
assertNotNull(result);
assertNotEquals(fragment.cas(), result.cas());
</BUG>
JsonArray storedArray = ctx.bucket().get(key).content().getArray("array");
| DocumentFragment<Mutation> result = ctx.bucket()
.mutateIn(key)
.arrayInsert("array[1]", "arrayInsert")
.doMutate();
assertNotEquals(0L, result.cas());
|
9,535 | OWLAnonymousIndividual i = AnonymousIndividual();
OWLAnnotationProperty p = AnnotationProperty(IRI(ns + "#", "p"));
OWLObjectProperty q = ObjectProperty(IRI(ns + "#", "q"));
OWLOntology ontology = getOWLOntology();
OWLAnnotation annotation1 = df.getOWLAnnotation(p, h);
<BUG>OWLAnnotation annotation2 = df.getOWLAnnotation(df.getRDFSLabel(), Literal("Second", "en"));
ontology.add(df.getOWLAnnotationAssertionAxiom(a.getIRI(), annotation1), ClassAssertion(a, h),</BUG>
ObjectPropertyAssertion(q, h, i), df.getOWLAnnotationAssertionAxiom(h, annotation2));
OWLOntology o = roundTrip(ontology, new ManchesterSyntaxDocumentFormat());
equal(ontology, o);
| OWLAnnotation annotation2 = df.getRDFSLabel(Literal("Second", "en"));
ontology.add(df.getOWLAnnotationAssertionAxiom(a.getIRI(), annotation1), ClassAssertion(a, h),
|
9,536 | public DisjointFromHandler(OBOConsumer consumer) {
super("disjoint_from", consumer);
}
@Override
public void handle(String currentId, String value, String qualifierBlock, String comment) {
<BUG>OWLAxiom ax = getDataFactory()
.getOWLDisjointClassesAxiom(CollectionFactory.createSet(getCurrentClass(), getOWLClass(value)));
applyChange(new AddAxiom(getOntology(), ax));</BUG>
}
}
| OWLAxiom ax = getDataFactory().getOWLDisjointClassesAxiom(CollectionFactory.createSet(getCurrentClass(),
applyChange(new AddAxiom(getOntology(), ax));
|
9,537 | } else if (getConsumer().isTypedef()) {
ent = getDataFactory().getOWLObjectProperty(getIRIFromOBOId(currentId));
} else {
ent = getDataFactory().getOWLNamedIndividual(getIRIFromOBOId(currentId));
}
<BUG>OWLLiteral con = getDataFactory().getOWLLiteral(value);
OWLAxiom ax = getDataFactory().getOWLAnnotationAssertionAxiom(getDataFactory().getRDFSLabel(), ent.getIRI(),
con);
applyChange(new AddAxiom(getOntology(), ax));</BUG>
}
| applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLSubObjectPropertyOfAxiom(
getOWLObjectProperty(currentId), getOWLObjectProperty(value))));
|
9,538 | String name = matcher.group(NAME_GROUP);
OWLDataFactory df = getDataFactory();
OWLAnnotationProperty annotationProperty = df.getOWLAnnotationProperty(annotationPropertyIRI);
applyChange(new AddAxiom(getOntology(), df.getOWLDeclarationAxiom(annotationProperty)));
IRI subsetdefIRI = getTagIRI(OBOVocabulary.SUBSETDEF.getName());
<BUG>OWLAnnotationProperty subsetdefAnnotationProperty = df.getOWLAnnotationProperty(subsetdefIRI);
applyChange(new AddAxiom(getOntology(),
df.getOWLSubAnnotationPropertyOfAxiom(annotationProperty, subsetdefAnnotationProperty)));
OWLLiteral nameLiteral = df.getOWLLiteral(name);
applyChange(new AddAxiom(getOntology(),
df.getOWLAnnotationAssertionAxiom(df.getRDFSLabel(), annotationPropertyIRI, nameLiteral)));</BUG>
} else {
| applyChange(new AddAxiom(getOntology(), df.getOWLSubAnnotationPropertyOfAxiom(annotationProperty,
applyChange(new AddAxiom(getOntology(), df.getOWLAnnotationAssertionAxiom(annotationPropertyIRI, df
.getRDFSLabel(name))));
|
9,539 | parser.setDefaultOntology(o);
OWLClassExpression dsvf = parser.parseClassExpression();
assertEquals(expected, dsvf);
}
public OWLAxiom annotation(OWLEntity e, String s) {
<BUG>return df.getOWLAnnotationAssertionAxiom(e.getIRI(), df.getOWLAnnotation(df.getRDFSLabel(), df.getOWLLiteral(
s)));</BUG>
}
@Test
| return df.getOWLAnnotationAssertionAxiom(e.getIRI(), df.getRDFSLabel(s));
|
9,540 | OWLClass cheesy = Class(IRI(NS + "#", "CheeseyPizza"));
OWLClass cheese = Class(IRI(NS + "#", "CheeseTopping"));
OWLObjectProperty hasTopping = df.getOWLObjectProperty(NS + "#", "hasTopping");
OWLAnonymousIndividual i = df.getOWLAnonymousIndividual();
OWLLiteral lit = df.getOWLLiteral(ANONYMOUS_INDIVIDUAL_ANNOTATION);
<BUG>OWLAxiom annAss = df.getOWLAnnotationAssertionAxiom(df.getRDFSLabel(), i, lit);
</BUG>
OWLAxiom classAss = df.getOWLClassAssertionAxiom(cheesy, i);
OWLIndividual j = df.getOWLAnonymousIndividual();
OWLAxiom classAssj = df.getOWLClassAssertionAxiom(cheese, j);
| OWLAxiom annAss = df.getOWLAnnotationAssertionAxiom(i, df.getRDFSLabel(lit));
|
9,541 | if (matcher.matches()) {
OWLDataFactory df = getDataFactory();
String xrefQuotedString = matcher.group(XREF_QUOTED_STRING_GROUP);
@Nonnull Set<OWLAnnotation> xrefDescriptions = new HashSet<>();
if (xrefQuotedString != null) {
<BUG>xrefDescriptions.add(df.getOWLAnnotation(df.getRDFSComment(), df.getOWLLiteral(xrefQuotedString)));
}</BUG>
String xrefId = matcher.group(XREF_ID_GROUP).trim();
OBOIdType idType = OBOIdType.getIdType(xrefId);
OWLAnnotationValue annotationValue;
| xrefDescriptions.add(df.getRDFSComment(xrefQuotedString));
}
|
9,542 | assertTrue(shouldBeInProfile == report.isInProfile());
}
@Test
public void shouldNotFailELBecauseOfBoolean() {
OWLOntology o = getOWLOntology();
<BUG>OWLAnnotation ann = df.getOWLAnnotation(df.getRDFSLabel(), df.getOWLLiteral(true));
OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(IRI.create("urn:test#", "ELProfile"), ann);</BUG>
o.add(ax, Declaration(OWL2Datatype.XSD_BOOLEAN.getDatatype(df)));
checkProfile(o, new OWL2ELProfile(), true);
}
| OWLAnnotation ann = df.getRDFSLabel(df.getOWLLiteral(true));
OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(IRI.create("urn:test#", "ELProfile"), ann);
|
9,543 | SWRLVariable x = df.getSWRLVariable(NS + "#", "x");
SWRLAtom atom1 = df.getSWRLClassAtom(a, x);
SWRLAtom atom2 = df.getSWRLClassAtom(b, x);
Set<SWRLAtom> consequent = new TreeSet<>();
consequent.add(atom1);
<BUG>OWLAnnotation annotation = df.getOWLAnnotation(RDFSComment(), Literal("Not a great rule"));
Set<OWLAnnotation> annotations = new TreeSet<>();</BUG>
annotations.add(annotation);
Set<SWRLAtom> body = new TreeSet<>();
body.add(atom2);
| OWLAnnotation annotation = df.getRDFSComment("Not a great rule");
Set<OWLAnnotation> annotations = new TreeSet<>();
|
9,544 | public void testPositiveUTF8roundTrip() throws Exception {
String ns = "http://protege.org/UTF8.owl";
OWLOntology ontology = getOWLOntology();
OWLClass a = Class(IRI(ns + "#", "A"));
ontology.add(df.getOWLDeclarationAxiom(a));
<BUG>OWLAnnotation ann = df.getOWLAnnotation(df.getRDFSLabel(), df.getOWLLiteral("Chinese=處方"));
OWLAxiom axiom = df.getOWLAnnotationAssertionAxiom(a.getIRI(), ann);</BUG>
ontology.add(axiom);
ontology = roundTrip(ontology, new FunctionalSyntaxDocumentFormat());
}
| OWLAnnotation ann = df.getRDFSLabel("Chinese=處方");
OWLAxiom axiom = df.getOWLAnnotationAssertionAxiom(a.getIRI(), ann);
|
9,545 | + " <owl:annotatedProperty rdf:resource=\"http://www.w3.org/2002/07/owl#equivalentClass\"/>\n"
+ " <owl:annotatedSource rdf:resource=\"urn:my#datatype\"/>\n" + " <owl:annotatedTarget>\n"
+ " <rdfs:Datatype rdf:about=\"http://www.w3.org/2001/XMLSchema#double\"/>\n"
+ " </owl:annotatedTarget>\n" + " </owl:Axiom></rdf:RDF>";
OWLOntology o = loadOntologyFromString(s);
<BUG>OWLDatatypeDefinitionAxiom def = df.getOWLDatatypeDefinitionAxiom(df.getOWLDatatype("urn:my#", "datatype"), df
.getDoubleOWLDatatype(), singleton(df.getOWLAnnotation(df.getRDFSLabel(), df.getOWLLiteral(
"datatype definition", ""))));</BUG>
assertTrue(contains(o.axioms(), def));
}
| .getDoubleOWLDatatype(), singleton(df.getRDFSLabel("datatype definition")));
|
9,546 | + " <annotatedProperty rdf:resource=\"http://www.w3.org/2000/01/rdf-schema#subClassOf\"/>\n"
+ " <annotatedSource rdf:resource=\"urn:test#myClass\"/>\n"
+ " <annotatedTarget rdf:resource=\"urn:test#test\"/>\n" + " </Axiom>\n"
+ " <Class rdf:about=\"urn:test\"/>\n" + "</rdf:RDF>\n" + "";
OWLOntology o = loadOntologyFromString(s);
<BUG>OWLSubClassOfAxiom def = df.getOWLSubClassOfAxiom(df.getOWLClass("urn:test#", "myClass"), df.getOWLClass(
"urn:test#", "test"), singleton(df.getOWLAnnotation(df.getRDFSLabel(), df.getOWLLiteral(
"datatype definition", ""))));</BUG>
assertTrue(contains(o.axioms(), def));
}
| "urn:test#", "test"), singleton(df.getRDFSLabel("datatype definition")));
|
9,547 | package uk.gov.justice.services.eventsourcing.source.core;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
<BUG>import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;</BUG>
import static uk.gov.justice.services.test.utils.core.messaging.JsonEnvelopeBuilder.envelope;
import uk.gov.justice.domain.aggregate.TestAggregate;
import uk.gov.justice.services.eventsourcing.source.core.snapshot.SnapshotService;
| import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
|
9,548 | import uk.gov.justice.services.eventsourcing.publisher.jms.JmsEventPublisher;
import uk.gov.justice.services.eventsourcing.repository.core.EventRepository;
import uk.gov.justice.services.eventsourcing.repository.jdbc.AnsiSQLEventLogInsertionStrategy;
import uk.gov.justice.services.eventsourcing.repository.jdbc.EventLogInsertionStrategy;
import uk.gov.justice.services.eventsourcing.repository.jdbc.JdbcEventRepository;
<BUG>import uk.gov.justice.services.eventsourcing.repository.jdbc.eventlog.EventLogConverter;
import uk.gov.justice.services.eventsourcing.source.core.EventStream;</BUG>
import uk.gov.justice.services.eventsourcing.source.core.EventStreamManager;
import uk.gov.justice.services.eventsourcing.source.core.SnapshotAwareEnvelopeEventStream;
import uk.gov.justice.services.eventsourcing.source.core.SnapshotAwareEventSource;
| import uk.gov.justice.services.eventsourcing.source.core.EventAppender;
import uk.gov.justice.services.eventsourcing.source.core.EventStream;
|
9,549 | DefaultEventDestinationResolver.class,
DefaultAggregateService.class,
SnapshotAwareAggregateService.class,
SnapshotAwareEventSource.class,
SnapshotAwareEnvelopeEventStream.class,
<BUG>EventStreamManager.class,
DefaultSnapshotStrategy.class,</BUG>
ValueProducer.class,
DefaultSnapshotService.class,
UtcClock.class,
| EventAppender.class,
DefaultSnapshotStrategy.class,
|
9,550 | public long append(final Stream<JsonEnvelope> events) throws EventStreamException {
final long currentVersion = super.append(events);
createAggregateSnapshotsFor(currentVersion);
return currentVersion;
}
<BUG>@Override
public long appendAfter(final Stream<JsonEnvelope> events, final long version) throws EventStreamException {</BUG>
final long currentVersion = super.appendAfter(events, version);
createAggregateSnapshotsFor(currentVersion);
return currentVersion;
| [DELETED] |
9,551 | public GlobalValueProducer() throws NamingException {
super();
}
@GlobalValue
@Produces
<BUG>public String produceValue(final InjectionPoint ip) throws NamingException {
return jndiValueFor(globalValueAnnotationOf(ip));
}</BUG>
@Override
| public String stringValueOf(final InjectionPoint ip) throws NamingException {
public long longValueOf(final InjectionPoint ip) throws NamingException {
return Long.valueOf(stringValueOf(ip));
|
9,552 | package uk.gov.justice.services.eventsourcing.source.core;
<BUG>import static java.util.stream.Collectors.toList;
import static uk.gov.justice.services.messaging.DefaultJsonEnvelope.envelopeFrom;
import static uk.gov.justice.services.messaging.JsonObjectMetadata.metadataFrom;
import uk.gov.justice.services.eventsourcing.publisher.core.EventPublisher;</BUG>
import uk.gov.justice.services.eventsourcing.repository.core.EventRepository;
| import uk.gov.justice.services.common.configuration.GlobalValue;
|
9,553 | import uk.gov.justice.services.eventsourcing.repository.jdbc.AnsiSQLEventLogInsertionStrategy;
import uk.gov.justice.services.eventsourcing.repository.jdbc.EventLogInsertionStrategy;
import uk.gov.justice.services.eventsourcing.repository.jdbc.JdbcEventRepository;
import uk.gov.justice.services.eventsourcing.repository.jdbc.eventlog.EventLogConverter;
import uk.gov.justice.services.eventsourcing.source.core.DefaultEventSource;
<BUG>import uk.gov.justice.services.eventsourcing.source.core.EnvelopeEventStream;
import uk.gov.justice.services.eventsourcing.source.core.EventSource;</BUG>
import uk.gov.justice.services.eventsourcing.source.core.EventStream;
import uk.gov.justice.services.eventsourcing.source.core.EventStreamManager;
import uk.gov.justice.services.eventsourcing.source.core.exception.EventStreamException;
| import uk.gov.justice.services.eventsourcing.source.core.EventAppender;
import uk.gov.justice.services.eventsourcing.source.core.EventSource;
|
9,554 | TestEventLogInsertionStrategyProducer.class,
DefaultAggregateService.class,
EventSource.class,
DefaultEventSource.class,
EnvelopeEventStream.class,
<BUG>EventStreamManager.class,
EnvelopeConverter.class,</BUG>
EventLogConverter.class,
StringToJsonObjectConverter.class,
JsonObjectEnvelopeConverter.class,
| EventAppender.class,
|
9,555 | public IndexStatus getIndexStatus() {
return indexStatus;
}
public void setIndexStatus(IndexStatus newValue) {
indexStatus = newValue;
<BUG>}
public void putProperty(String key, String value) {</BUG>
putProperty(key, value, false);
}
public Document toOSIS() {
| public void reload() throws BookException {
public void putProperty(String key, String value) {
|
9,556 | import org.crosswire.common.util.StringUtil;
import org.crosswire.jsword.book.BookData;
import org.crosswire.jsword.book.BookException;
import org.crosswire.jsword.book.BookMetaData;
import org.crosswire.jsword.book.OSISUtil;
<BUG>import org.crosswire.jsword.book.filter.Filter;
</BUG>
import org.crosswire.jsword.book.sword.Backend;
import org.crosswire.jsword.book.sword.processing.RawTextToXmlProcessor;
import org.crosswire.jsword.passage.Key;
| import org.crosswire.jsword.book.filter.SourceFilter;
|
9,557 | super(bmd, backend);
keyf = PassageKeyFactory.instance();
this.versification = bmd.getProperty(BookMetaData.KEY_VERSIFICATION);
}
public Iterator<Content> getOsisIterator(final Key key, final boolean allowEmpty, final boolean allowGenTitles) throws BookException {
<BUG>final Filter filter = getFilter();
</BUG>
Passage ref = VersificationsMapper.instance().map(KeyUtil.getPassage(key), this.getVersification());
final boolean showTitles = ref.hasRanges(RestrictionType.CHAPTER) || (!allowEmpty && allowGenTitles);
RawTextToXmlProcessor processor = new RawTextToXmlProcessor() {
| final SourceFilter filter = getFilter();
|
9,558 | boolean isLeftToRight();
boolean hasFeature(FeatureType feature);
URI getLibrary();
void setLibrary(URI library) throws BookException;
URI getLocation();
<BUG>void setLocation(URI library);
Set<String> getPropertyKeys();</BUG>
String getProperty(String key);
void setProperty(String key, String value);
void putProperty(String key, String value);
| void reload() throws BookException;
Set<String> getPropertyKeys();
|
9,559 | import java.util.regex.Pattern;
import org.crosswire.common.xml.XMLUtil;
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.DataPolice;
import org.crosswire.jsword.book.OSISUtil;
<BUG>import org.crosswire.jsword.book.filter.Filter;
</BUG>
import org.crosswire.jsword.passage.Key;
import org.jdom2.Content;
import org.jdom2.Document;
| import org.crosswire.jsword.book.filter.SourceFilter;
|
9,560 | import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import org.xml.sax.InputSource;
<BUG>public class OSISFilter implements Filter {
</BUG>
public List<Content> toOSIS(Book book, Key key, String plain) {
Element ele = null;
Exception ex = null;
| public class OSISFilter implements SourceFilter {
|
9,561 | import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.util.Enumeration;
<BUG>import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import org.crosswire.jsword.JSMsg;</BUG>
import org.slf4j.LoggerFactory;
public final class IOUtil {
| import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipFile;
import org.crosswire.jsword.JSMsg;
|
9,562 | </BUG>
import org.crosswire.jsword.passage.Key;
import org.jdom2.Content;
import org.jdom2.Element;
<BUG>public class GBFFilter implements Filter {
</BUG>
public List<Content> toOSIS(Book book, Key key, String plain) {
Element ele = OSISUtil.factory().createDiv();
LinkedList<Content> stack = new LinkedList<Content>();
stack.addFirst(ele);
| import java.util.LinkedList;
import java.util.List;
import org.crosswire.jsword.book.Book;
import org.crosswire.jsword.book.DataPolice;
import org.crosswire.jsword.book.OSISUtil;
import org.crosswire.jsword.book.filter.SourceFilter;
public class GBFFilter implements SourceFilter {
|
9,563 | 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;
|
9,564 | 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());
|
9,565 | 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
|
9,566 | <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;
|
9,567 | 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] |
9,568 | <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;
|
9,569 | 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;
|
9,570 | 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;
|
9,571 | 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);
|
9,572 | 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 {
|
9,573 | 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(),
|
9,574 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
9,575 | }
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);
|
9,576 | 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] |
9,577 | <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;
|
9,578 | 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;
|
9,579 | 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()
|
9,580 | range = getSkinnable().getRange();
angleStep = ANGLE_RANGE / range;
minValue = getSkinnable().getMinValue();
sections = getSkinnable().getSections();
resize();
<BUG>redraw();
} else if ("VISBILITY".equals(EVENT_TYPE)) {</BUG>
Helper.enableNode(titleText, !getSkinnable().getTitle().isEmpty());
Helper.enableNode(unitText, !getSkinnable().getUnit().isEmpty());
Helper.enableNode(valueText, getSkinnable().isValueVisible());
| setBar(getSkinnable().getCurrentValue());
} else if ("VISBILITY".equals(EVENT_TYPE)) {
|
9,581 | minValue = getSkinnable().getMinValue();
threshold = getSkinnable().getThreshold();
range = getSkinnable().getRange();
angleStep = angleRange / range;
highlightSections = getSkinnable().isHighlightSections();
<BUG>redraw();
} else if ("VISIBILITY".equals(EVENT_TYPE)) {</BUG>
Helper.enableNode(titleText, !getSkinnable().getTitle().isEmpty());
Helper.enableNode(valueText, getSkinnable().isValueVisible());
Helper.enableNode(sectionPane, getSkinnable().getSectionsVisible());
| rotateNeedle(getSkinnable().getCurrentValue());
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
|
9,582 | } else if ("RECALC".equals(EVENT_TYPE)) {
minValue = getSkinnable().getMinValue();
maxValue = getSkinnable().getMaxValue();
angleStep = ANGLE_RANGE / getSkinnable().getRange();
needleRotate.setAngle((180 - START_ANGLE) + (getSkinnable().getValue() - getSkinnable().getMinValue()) * angleStep);
<BUG>resize();
} else if ("SECTION".equals(EVENT_TYPE)) {</BUG>
sections = getSkinnable().getSections();
highlightSections = getSkinnable().isHighlightSections();
resize();
| rotateNeedle(getSkinnable().getCurrentValue());
} else if ("SECTION".equals(EVENT_TYPE)) {
|
9,583 | } else if ("RECALC".equals(EVENT_TYPE)) {
minValue = getSkinnable().getMinValue();
range = getSkinnable().getRange();
angleStep = ANGLE_RANGE / range;
sections = getSkinnable().getSections();
<BUG>redraw();
} else if ("VISIBILITY".equals(EVENT_TYPE)) {</BUG>
Helper.enableNode(titleText, !getSkinnable().getTitle().isEmpty());
Helper.enableNode(unitText, !getSkinnable().getUnit().isEmpty());
Helper.enableNode(valueText, getSkinnable().isValueVisible());
| setBar(getSkinnable().getCurrentValue());
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
|
9,584 | } else if ("RECALC".equals(EVENT_TYPE)) {
minValue = getSkinnable().getMinValue();
range = getSkinnable().getRange();
angleStep = ANGLE_RANGE / range;
sections = getSkinnable().getSections();
<BUG>redraw();
} else if ("VISIBILITY".equals(EVENT_TYPE)) {</BUG>
Helper.enableNode(valueText, getSkinnable().isValueVisible());
Helper.enableNode(titleText, !getSkinnable().getTitle().isEmpty());
Helper.enableNode(unitText, !getSkinnable().getUnit().isEmpty());
| setBar(getSkinnable().getCurrentValue());
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
|
9,585 | } else if ("RECALC".equals(EVENT_TYPE)) {
minValue = getSkinnable().getMinValue();
maxValue = getSkinnable().getMaxValue();
angleStep = ANGLE_RANGE / getSkinnable().getRange();
needleRotate.setAngle((180 - START_ANGLE) + (getSkinnable().getValue() - getSkinnable().getMinValue()) * angleStep);
<BUG>resize();
} else if ("SECTION".equals(EVENT_TYPE)) {</BUG>
sections = getSkinnable().getSections();
highlightSections = getSkinnable().isHighlightSections();
resize();
| rotateNeedle(getSkinnable().getCurrentValue());
} else if ("SECTION".equals(EVENT_TYPE)) {
|
9,586 | redraw();
} else if ("RECALC".equals(EVENT_TYPE)) {
minValue = getSkinnable().getMinValue();
range = getSkinnable().getRange();
angleStep = ANGLE_RANGE / range;
<BUG>redraw();
} else if ("VISIBILITY".equals(EVENT_TYPE)) {</BUG>
Helper.enableNode(valueText, getSkinnable().isValueVisible());
Helper.enableNode(unitText, !getSkinnable().getUnit().isEmpty());
}
| } else if ("REDRAW".equals(EVENT_TYPE)) {
setBar(getSkinnable().getCurrentValue());
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
|
9,587 | resize();
redraw();
} else if ("REDRAW".equals(EVENT_TYPE)) {
redraw();
} else if ("RECALC".equals(EVENT_TYPE)) {
<BUG>redraw();
} else if ("DECIMALS".equals(EVENT_TYPE)) {</BUG>
formatString = new StringBuilder("%.").append(Integer.toString(getSkinnable().getDecimals())).append("f").toString();
}
}
| setBar(getSkinnable().getCurrentValue());
} else if ("DECIMALS".equals(EVENT_TYPE)) {
|
9,588 | startAngle = getStartAngle();
minValue = getSkinnable().getMinValue();
range = getSkinnable().getRange();
sections = getSkinnable().getSections();
angleStep = angleRange / range;
<BUG>redraw();
} else if ("FINISHED".equals(EVENT_TYPE)) {</BUG>
needleTooltip.setText(String.format(locale, formatString, getSkinnable().getValue()));
double value = getSkinnable().getValue();
if (getSkinnable().isValueVisible()) {
| rotateNeedle(getSkinnable().getCurrentValue());
} else if ("FINISHED".equals(EVENT_TYPE)) {
|
9,589 | minValue = getSkinnable().getMinValue();
maxValue = getSkinnable().getMaxValue();
range = getSkinnable().getRange();
sections = getSkinnable().getSections();
angleStep = ANGLE_RANGE / range;
<BUG>redraw();
} else if ("FINISHED".equals(EVENT_TYPE)) {</BUG>
needleTooltip.setText(String.format(locale, formatString, getSkinnable().getValue()));
}
}
| rotateNeedle(getSkinnable().getCurrentValue());
} else if ("FINISHED".equals(EVENT_TYPE)) {
|
9,590 | } else if ("RECALC".equals(EVENT_TYPE)) {
minValue = getSkinnable().getMinValue();
maxValue = getSkinnable().getMaxValue();
range = getSkinnable().getRange();
angleStep = ANGLE_RANGE / range;
<BUG>redraw();
} else if ("SECTIONS".equals(EVENT_TYPE)) {</BUG>
sections = getSkinnable().getSections();
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
sectionsVisible = getSkinnable().getSectionsVisible();
| setBar(getSkinnable().getCurrentValue());
} else if ("SECTIONS".equals(EVENT_TYPE)) {
|
9,591 | import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.scene.transform.Rotate;
import java.math.BigDecimal;
<BUG>import java.util.Locale;
public class AmpSkin extends SkinBase<Gauge> implements Skin<Gauge> {</BUG>
private static final double PREFERRED_WIDTH = 310;
private static final double PREFERRED_HEIGHT = 260;
private static final double MINIMUM_WIDTH = 31;
| import static eu.hansolo.medusa.tools.Helper.enableNode;
public class AmpSkin extends SkinBase<Gauge> implements Skin<Gauge> {
|
9,592 | } else if ("RECALC".equals(EVENT_TYPE)) {
minValue = getSkinnable().getMinValue();
maxValue = getSkinnable().getMaxValue();
range = getSkinnable().getRange();
angleStep = ANGLE_RANGE / range;
<BUG>redraw();
} else if ("SECTIONS".equals(EVENT_TYPE)) {</BUG>
sections = getSkinnable().getSections();
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
Helper.enableNode(valueBkgText, getSkinnable().isValueVisible());
| setBar(getSkinnable().getCurrentValue());
} else if ("SECTIONS".equals(EVENT_TYPE)) {
|
9,593 | resize();
redraw();
} else if ("REDRAW".equals(EVENT_TYPE)) {
redraw();
} else if ("RECALC".equals(EVENT_TYPE)) {
<BUG>if (getSkinnable().isAutoScale()) getSkinnable().calcAutoScale();
setBar(getSkinnable().getCurrentValue());
resize();
redraw();</BUG>
} else if ("SECTION".equals(EVENT_TYPE)) {
| [DELETED] |
9,594 | } else if ("RECALC".equals(EVENT_TYPE)) {
range = getSkinnable().getRange();
angleStep = ANGLE_RANGE / range;
minValue = getSkinnable().getMinValue();
resize();
<BUG>redraw();
} else if ("VISIBILITY".equals(EVENT_TYPE)) {</BUG>
Helper.enableNode(valueText, getSkinnable().isValueVisible());
Helper.enableNode(titleText, !getSkinnable().getTitle().isEmpty());
Helper.enableNode(unitText, !getSkinnable().getUnit().isEmpty());
| setBar(getSkinnable().getCurrentValue());
} else if ("VISIBILITY".equals(EVENT_TYPE)) {
|
9,595 | if (!(sender instanceof Player)) {
sender.sendMessage(plugin.getCore().getMessage("no-console"));
return true;
}
if (plugin.isBungeeCord()) {
<BUG>plugin.sendBungeeActivateMessage(sender, sender.getName(), false);
String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}</BUG>
} else {
| plugin.getCore().sendLocaleMessage("wait-on-proxy", sender);
|
9,596 | profile.setUuid(null);
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
plugin.getCore().getStorage().save(profile);
});
} else {
<BUG>sender.sendMessage(plugin.getCore().getMessage("not-premium"));
}</BUG>
}
return true;
} else {
| plugin.getCore().sendLocaleMessage("not-premium", sender);
|
9,597 | if (profile == null) {
sender.sendMessage("Error occured");
return;
}
if (profile.getUserId() != -1 && !profile.isPremium()) {
<BUG>sender.sendMessage(plugin.getCore().getMessage("not-premium-other"));
} else {
sender.sendMessage(plugin.getCore().getMessage("remove-premium"));
profile.setPremium(false);</BUG>
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
| plugin.getCore().sendLocaleMessage("not-premium-other", sender);
plugin.getCore().sendLocaleMessage("remove-premium", sender);
profile.setPremium(false);
|
9,598 | import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
import com.github.games647.fastlogin.core.PlayerProfile;
import com.github.games647.fastlogin.core.shared.JoinManagement;
import java.util.Random;
<BUG>import java.util.logging.Level;
import org.bukkit.entity.Player;
public class NameCheckTask extends JoinManagement<Player, ProtocolLibLoginSource> implements Runnable {
private final FastLoginBukkit plugin;</BUG>
private final PacketEvent packetEvent;
| import org.bukkit.command.CommandSender;
public class NameCheckTask extends JoinManagement<Player, CommandSender, ProtocolLibLoginSource>
private final FastLoginBukkit plugin;
|
9,599 | BukkitLoginSession session = plugin.getSessions().get(fromPlayer.getAddress().toString());
if (session == null) {
disconnect(plugin.getCore().getMessage("invalid-requst"), true
, "Player {0} tried to send encryption response at invalid state", fromPlayer.getAddress());
} else {
<BUG>String ip = fromPlayer.getAddress().getAddress().getHostAddress();
plugin.getCore().getPendingLogins().remove(ip + session.getUsername());</BUG>
verifyResponse(session);
}
} finally {
| [DELETED] |
9,600 | if (core != null) {
core.close();
}
getServer().getOnlinePlayers().forEach(player -> player.removeMetadata(getName(), this));
}
<BUG>public BukkitCore getCore() {
return core;</BUG>
}
public void sendBungeeActivateMessage(CommandSender sender, String target, boolean activate) {
if (sender instanceof Player) {
| public FastLoginCore<Player, CommandSender, FastLoginBukkit> getCore() {
return core;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.