id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
28,601
rep.saveJobEntryAttribute(id_job, getObjectId(), "targetdirectory", targetdirectory); rep.saveJobEntryAttribute(id_job, getObjectId(), "movetodirectory", movetodirectory); rep.saveJobEntryAttribute(id_job, getObjectId(), "addfiletoresult", addfiletoresult); rep.saveJobEntryAttribute(id_job, getObjectId(), "isfromprevio...
rep.saveJobEntryAttribute(id_job, getObjectId(), "addOriginalTimestamp", addOriginalTimestamp); rep.saveJobEntryAttribute(id_job, getObjectId(), "SpecifyFormat", SpecifyFormat);
28,602
rep.saveJobEntryAttribute(id_job, getObjectId(), "createfolder", createfolder); rep.saveJobEntryAttribute(id_job, getObjectId(), "nr_limit", nr_limit); rep.saveJobEntryAttribute(id_job, getObjectId(), "wildcardSource", wildcardSource); rep.saveJobEntryAttribute(id_job, getObjectId(), "success_condition", success_con...
rep.saveJobEntryAttribute(id_job, getObjectId(), "setOriginalModificationDate", setOriginalModificationDate); }
28,603
protected byte[] _source; protected ORecordSerializer _recordFormat; protected boolean _pinned = false; protected boolean _dirty = true; protected STATUS _status = STATUS.NEW; <BUG>protected ORecordListener listener = null; </BUG> public ORecordAbstract() { } public ORecordAbstract(final ODataba...
protected ORecordListener _listener = null;
28,604
import com.orientechnologies.orient.core.db.OUserObject2RecordHandler; import com.orientechnologies.orient.core.db.object.ODatabaseObjectTx; import com.orientechnologies.orient.core.db.record.ODatabaseRecord; import com.orientechnologies.orient.core.db.record.OLazyRecordList; import com.orientechnologies.orient.core.db...
import com.orientechnologies.orient.core.db.record.ORecordTrackedList; import com.orientechnologies.orient.core.db.record.ORecordTrackedSet; import com.orientechnologies.orient.core.entity.OEntityManagerInternal;
28,605
if (iValue == null) return null; switch (iType) { case EMBEDDEDLIST: case EMBEDDEDSET: <BUG>return embeddedCollectionFromStream(iSourceRecord.getDatabase(), iType, iLinkedClass, iLinkedType, iValue); </BUG> case LINKLIST: case LINKSET: { if (iValue.length() == 0)
return embeddedCollectionFromStream((ODocument) iSourceRecord, iType, iLinkedClass, iLinkedType, iValue);
28,606
</BUG> if (iValue.length() == 0) return null; String value = iValue.substring(1, iValue.length() - 1); @SuppressWarnings("rawtypes") <BUG>final Map map = new OLazyRecordMap(iSourceRecord, ODocument.RECORD_TYPE); </BUG> if (value.length() == 0) return map; final List<String> items = OStringSerializerHelper.smartSplit(va...
[DELETED]
28,607
iLinkedType = getNumber(mapValue); } else if (mapValue.charAt(0) == '\'' || mapValue.charAt(0) == '"') iLinkedType = OType.STRING; } else iLinkedType = OType.EMBEDDED; <BUG>} map.put((String) OStringSerializerHelper.fieldTypeFromStream(OType.STRING, entry.get(0)), OStringSerializerHelper.fieldTypeFromStream(iLinkedTyp...
[DELETED]
28,608
default: return OStringSerializerHelper.fieldTypeToString(iType, iValue); } return buffer.toString(); } <BUG>public Object embeddedCollectionFromStream(final ODatabaseRecord<?> iDatabase, final OType iType, OClass iLinkedClass, OType iLinkedType, final String iValue) { if (iValue.length() == 0)</BUG> return null;
public Object embeddedCollectionFromStream(final ODocument iDocument, final OType iType, OClass iLinkedClass, OType iLinkedType, if (iValue.length() == 0)
28,609
import com.orientechnologies.orient.core.id.ORecordId; import com.orientechnologies.orient.core.iterator.OEmptyIterator; import com.orientechnologies.orient.core.metadata.schema.OClass; import com.orientechnologies.orient.core.metadata.schema.OProperty; import com.orientechnologies.orient.core.metadata.schema.OType; <B...
import com.orientechnologies.orient.core.record.ORecordAbstract; import com.orientechnologies.orient.core.record.ORecordVirtualAbstract;
28,610
package com.google.classyshark.silverghost.contentreader.apk; import com.google.classyshark.silverghost.contentreader.BinaryContentReader; import com.google.classyshark.silverghost.contentreader.ContentReader; import com.google.classyshark.silverghost.contentreader.dex.DexReader; <BUG>import com.google.classyshark.silv...
import com.google.classyshark.silverghost.translator.xml.XmlDecompressor; import java.io.FileOutputStream; import java.util.ArrayList;
28,611
public AndroidXmlTranslator(File archiveFile) { this.archiveFile = archiveFile; }</BUG> @Override public String getClassName() { <BUG>return "AndroidManifest.xml"; }</BUG> @Override public void addMapper(ProguardMapper reverseMappings) { }
this(DEFAULT_CLASS_NAME, archiveFile); return xmlName;
28,612
long size; if (archiveFile.getName().endsWith(".apk") || archiveFile.getName().endsWith(".zip") || archiveFile.getName().endsWith(".aar")) { zip = new ZipFile(archiveFile); <BUG>ZipEntry mft = zip.getEntry("AndroidManifest.xml"); </BUG> size = mft.getSize(); is = zip.getInputStream(mft); } else {
ZipEntry mft = zip.getEntry(xmlName);
28,613
public String toString() { return xml; } public static void main(String[] args) throws Exception { String archiveName = System.getProperty("user.home") + <BUG>"/Desktop/Scenarios/2 Samples/app-debug.apk"; </BUG> AndroidXmlTranslator t2ax = new AndroidXmlTranslator(new File(archiveName)); t2ax.apply(); System.out.print(...
"/Desktop/Scenarios/ 2 Samples/app-debug.apk";
28,614
return createTranslator(className, archiveFile, new LinkedList<String>()); } public static Translator createTranslator(String className, File archiveFile, List<String> allClassNames) { if(className.endsWith(".xml")) { <BUG>return new AndroidXmlTranslator(archiveFile); </BUG> } if (className.endsWith(".dex")) { return n...
return new AndroidXmlTranslator(className, archiveFile);
28,615
new BasicArguments(), new BasicArguments())); store.setStart(programId, runtimeInfo.getController().getRunId().getId(), System.currentTimeMillis()/1000); return new RunIdentifier(runtimeInfo.getController().getRunId().toString()); <BUG>} catch (IOException e) { LOG.warn(StackTraceUtil.toStringStackTrace(e)); throw Thro...
} catch (Exception e) { throw new AppFabricServiceException(e.getMessage());
28,616
}</BUG> Location appArchive = getApplicationLocation(appId); try { appArchive.delete(); } catch (IOException e) { <BUG>throw Throwables.propagate(e); }</BUG> try { MetricsFrontendServiceImpl mfs = new MetricsFrontendServiceImpl(configuration); mfs.clear(accountId.getId(), appId.getId());
LOG.warn(StackTraceUtil.toStringStackTrace(e)); throw new AppFabricServiceException(e.getMessage()); } LOG.warn(StackTraceUtil.toStringStackTrace(e)); throw new AppFabricServiceException(e.getMessage()); }
28,617
<BUG>package org.gbif.ipt.action.portal; import com.google.inject.Inject; import com.opensymphony.xwork2.ActionSupport; import org.gbif.ipt.task.GenerateDCAT; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; public class DCATAction extends ActionSupport { pri...
import java.io.IOException; import com.google.common.io.Closer; import org.apache.log4j.Logger; private static final Logger LOG = Logger.getLogger(DCATAction.class); private GenerateDCAT generateDCAT;
28,618
@Inject public DCATAction(GenerateDCAT generateDCAT) { this.generateDCAT = generateDCAT; } @Override <BUG>public String execute() { String out = generateDCAT.getDCAT(); try { dcatInfo = new ByteArrayInputStream(out.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { e.printStackTrace(); }</BUG> return SUCCE...
public String execute() throws Exception { Closer closer = Closer.create(); dcatInfo = closer.register(new ByteArrayInputStream(generateDCAT.getFeed().getBytes("UTF-8")));
28,619
INSERT_OR_UPDATE_TUPLE, REMOVE_TUPLE, CREATE_ASSOCIATION_WITH_KEY, INSERT_OR_UPDATE_ASSOCIATION, REMOVE_ASSOCIATION, <BUG>EXECUTE_BATCH, CREATE_TUPLE,</BUG> INSERT_TUPLE, UPDATE_TUPLE_WITH_OPTIMISTIC_LOCK, REMOVE_TUPLE_WITH_OPTIMISTIC_LOCK;
FLUSH_PENDING_OPERATIONS, CREATE_TUPLE,
28,620
private final MultigetGridDialect multigetGridDialect; @SuppressWarnings("unchecked") public ForwardingGridDialect(GridDialect gridDialect) { Contracts.assertParameterNotNull( gridDialect, "gridDialect" ); this.gridDialect = gridDialect; <BUG>this.batchableGridDialect = GridDialects.getDialectFacetOrNull( gridDialect, ...
this.groupingByEntityGridDialect = GridDialects.getDialectFacetOrNull( gridDialect, GroupingByEntityDialect.class ); this.queryableGridDialect = GridDialects.getDialectFacetOrNull( gridDialect, QueryableGridDialect.class );
28,621
import org.hibernate.ogm.compensation.ErrorHandler; import org.hibernate.ogm.compensation.ErrorHandlingStrategy; import org.hibernate.ogm.compensation.operation.CreateAssociationWithKey; import org.hibernate.ogm.compensation.operation.CreateTuple; import org.hibernate.ogm.compensation.operation.CreateTupleWithKey; <BUG...
import org.hibernate.ogm.compensation.operation.FlushPendingOperations; import org.hibernate.ogm.compensation.operation.GridDialectOperation;
28,622
import org.hibernate.ogm.compensation.operation.RemoveTuple; import org.hibernate.ogm.compensation.operation.UpdateTupleWithOptimisticLock; import org.hibernate.ogm.compensation.operation.impl.CreateAssociationWithKeyImpl; import org.hibernate.ogm.compensation.operation.impl.CreateTupleImpl; import org.hibernate.ogm.co...
import org.hibernate.ogm.compensation.operation.impl.FlushPendingOperationsImpl; import org.hibernate.ogm.compensation.operation.impl.InsertOrUpdateAssociationImpl;
28,623
e.printStackTrace(); } filePlayback=null; } @Override <BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); } void initFiles() throws FileNotFoundException {</BUG> if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed String samples_str = dataDir ...
@Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; } void initFiles() throws FileNotFoundException {
28,624
public class BufferMonitor extends Thread implements FieldtripBufferMonitor { public static final String TAG = BufferMonitor.class.toString(); private final Context context; private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>(); private final BufferInfo info; <BUG>private fin...
[DELETED]
28,625
public static final String CLIENT_INFO_TIME = "c_time"; public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout"; public static final String CLIENT_INFO_CONNECTED = "c_connected"; public static final String CLIENT_INFO_CHANGED = "c_changed"; public static final String CLIENT_INFO_DIFF = "c_diff"; <BUG>publi...
public static final int THREAD_INFO_TYPE = 0;
28,626
package nl.dcc.buffer_bci.bufferclientsservice; import android.os.Parcel; import android.os.Parcelable; <BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C; public class ThreadInfo implements Parcelable {</BUG> public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() { @Override public ThreadInfo...
import nl.dcc.buffer_bci.C; public class ThreadInfo implements Parcelable {
28,627
import org.livespark.formmodeler.service.impl.fieldProviders.MultipleSubFormFieldProvider; @Portable @Bindable public class MultipleSubFormFieldDefinition extends FieldDefinition implements EmbeddedFormField, MultipleField { public static final String CODE = "MultipleSubForm"; <BUG>@FieldDef( label = "Create Form" ) </...
@FieldDef( label = "Create Form", position = 4 )
28,628
@ListBox( provider = @SelectorDataProvider( type = SelectorDataProvider.ProviderType.REMOTE, className = "org.livespark.formmodeler.editor.backend.dataProviders.VFSSelectorFormProvider")) @NotEmpty protected String creationForm = ""; <BUG>@FieldDef( label = "Edit Form") </BUG> @ListBox( provider = @SelectorDataProvider...
[DELETED]
28,629
package org.livespark.formmodeler.metaModel; <BUG>import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )</BUG> @java.lang.annotation.Target({ ElementType.PARAMETER }) public @interface SelectorDataProvider {
import java.lang.annotation.Inherited; @Inherited @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )
28,630
package org.livespark.formmodeler.metaModel; <BUG>import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )</BUG> @java.lang.annotation.Target({ ElementType.TYPE, ElementType.FIELD }) public @interface RadioGroup {
import java.lang.annotation.Inherited; @Inherited @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )
28,631
package org.livespark.formmodeler.metaModel; <BUG>import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )</BUG> @java.lang.annotation.Target({ ElementType.TYPE, ElementType.FIELD }) public @interface FieldDef {
import java.lang.annotation.Inherited; @Inherited @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )
28,632
public class DefaultSelectorOption<T> implements SelectorOption<T> { @FieldDef( label = "Value") private T value; @FieldDef( label = "Text") private String text; <BUG>@FieldDef( label = "Is default value") private boolean defaultValue = false; </BUG> public DefaultSelectorOption() {
@FieldDef( label = "Is default value", position = 2 ) private Boolean defaultValue = false;
28,633
package org.livespark.formmodeler.metaModel; <BUG>import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )</BUG> @java.lang.annotation.Target({ ElementType.PARAMETER }) public @interface Option {
import java.lang.annotation.Inherited; @Inherited @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )
28,634
public class StringSelectorOption implements SelectorOption<String> { @FieldDef( label = "Value") private String value; @FieldDef( label = "Text") private String text; <BUG>@FieldDef( label = "Is default value") private boolean defaultValue = false; </BUG> public StringSelectorOption() {
@FieldDef( label = "Is default value", position = 2 ) private Boolean defaultValue = false;
28,635
package org.livespark.formmodeler.metaModel; <BUG>import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )</BUG> @java.lang.annotation.Target({ ElementType.TYPE, ElementType.FIELD }) public @interface TextArea {
import java.lang.annotation.Inherited; @Inherited @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )
28,636
package org.livespark.formmodeler.metaModel; <BUG>import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )</BUG> @java.lang.annotation.Target({ ElementType.TYPE, ElementType.FIELD }) public @interface ListBox {
import java.lang.annotation.Inherited; @Inherited @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )
28,637
package org.livespark.formmodeler.metaModel; <BUG>import java.lang.annotation.ElementType; import java.lang.annotation.RetentionPolicy; @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )</BUG> @java.lang.annotation.Target({ ElementType.TYPE, ElementType.FIELD }) public @interface Slider {
import java.lang.annotation.Inherited; @Inherited @java.lang.annotation.Retention( RetentionPolicy.RUNTIME )
28,638
<BUG>package org.livespark.formmodeler.metaModel; public @interface TextBox {</BUG> String label(); String placeHolder() default ""; int maxLength() default 100;
import java.lang.annotation.Inherited; @Inherited public @interface TextBox {
28,639
import org.apache.http.entity.StringEntity; import org.apache.http.message.BasicNameValuePair; import org.codehaus.groovy.runtime.DefaultGroovyMethods; import org.codehaus.groovy.runtime.MethodClosure; import java.io.*; <BUG>import java.util.*; public class EncoderRegistry {</BUG> private Map<String, Closure> registere...
import static com.jayway.restassured.internal.support.FileReader.readToString; public class EncoderRegistry {
28,640
"Don't know how to encode " + data + " as a byte stream.\n\nPlease use EncoderConfig (EncoderConfig#encodeContentTypeAs) to specify how to serialize data for this content-type.\n" + "For example: \"given().config(RestAssured.config().encoderConfig(encoderConfig().encodeContentTypeAs(\"" + ContentTypeExtractor.getConten...
String contentTypeAsString = contentTypeToString(contentType); if (data instanceof Closure) {
28,641
if (data instanceof BufferedReader) { StringWriter out = new StringWriter(); DefaultGroovyMethods.leftShift(out, (BufferedReader) data); data = out; } <BUG>return createEntity(contentTypeToString(contentType), data); </BUG> } public UrlEncodedFormEntity encodeForm(Map<?, ?> params) throws UnsupportedEncodingException {...
return createEntity(contentTypeAsString, data);
28,642
} @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...
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
28,643
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, s...
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
28,644
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...
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
28,645
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 +...
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
28,646
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.e...
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
28,647
} @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);
28,648
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);
28,649
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);
28,650
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(() ...
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
28,651
int version = entry.getValue().getVersion(); if (version >= MQVersion.Version.V3_0_7_SNAPSHOT.ordinal()) { try { this.brokerController.getRemotingServer().invokeOneway(entry.getKey(), request, 5000); log.info("[reset-offset] reset offset success. topic={}, group={}, clientId={}", <BUG>new Object[]{topic, group, entry.g...
topic, group, entry.getValue().getClientId()); } catch (Exception e) {
28,652
GetConsumerStatusBody.decode(response.getBody(), GetConsumerStatusBody.class); consumerStatusTable.put(clientId, body.getMessageQueueTable()); log.info( "[get-consumer-status] get consumer status success. topic={}, group={}, channelRemoteAddr={}", <BUG>new Object[]{topic, group, clientId}); }</BUG> } default: break;
topic, group, clientId);
28,653
final Runnable runnable = this.brokerController.getSendThreadPoolQueue().peek(); if (null == runnable) { break; } final RequestTask rt = castRunnable(runnable); <BUG>if (rt.isStopRun()) { </BUG> break; } final long behind = System.currentTimeMillis() - rt.getCreateTimestamp();
if (rt == null || rt.isStopRun()) {
28,654
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 ...
[DELETED]
28,655
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 st...
[DELETED]
28,656
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 SELEC...
[DELETED]
28,657
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 sta...
[DELETED]
28,658
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, ...
[DELETED]
28,659
+ "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 stat...
[DELETED]
28,660
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;
28,661
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.ser...
import org.hawkular.alerts.api.services.PropertiesService; import org.hawkular.alerts.engine.impl.IncomingDataManagerImpl.IncomingData;
28,662
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; pr...
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;
28,663
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...
[DELETED]
28,664
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.getStatu...
[DELETED]
28,665
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]
28,666
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(deleteAlertSeveri...
[DELETED]
28,667
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_STAT...
[DELETED]
28,668
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.ge...
[DELETED]
28,669
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() {
28,670
} @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=" + ...
public void addTag(String name, String value) { if (null == tags) { tags = new HashMap<>();
28,671
package org.jackhuang.hellominecraft.launcher.core.download; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; import org.jackhuang.hellominecraft.util.C; import org.jackhuang.hellominecraft.util.NetUtils; <BUG>import org.jackhuang.hellominecraft.util.OverridableSwingWorker; </BUG> public c...
import org.jackhuang.hellominecraft.util.AbstractSwingWorker;
28,672
}; } public static RemoteVersionsTask refreshRomoteVersions(DownloadType type) { return new RemoteVersionsTask(type); } <BUG>public static class RemoteVersionsTask extends OverridableSwingWorker<MinecraftRemoteVersion> { </BUG> DownloadType type; public RemoteVersionsTask(DownloadType type) { this.type = type;
public static class RemoteVersionsTask extends AbstractSwingWorker<MinecraftRemoteVersion> {
28,673
import org.jackhuang.hellominecraft.launcher.core.service.IMinecraftService; import org.jackhuang.hellominecraft.launcher.core.version.GameDirType; import org.jackhuang.hellominecraft.launcher.core.version.MinecraftVersion; import org.jackhuang.hellominecraft.launcher.setting.VersionSetting; import org.jackhuang.hellom...
import org.jackhuang.hellominecraft.util.AbstractSwingWorker;
28,674
reloadingMods = false; } }).execute(); } } <BUG>private static class OverridableSwingWorkerImpl extends OverridableSwingWorker<List<ModInfo>> { </BUG> @Override protected void work() throws Exception { publish(Settings.getLastProfile().service().mod().recacheMods(Settings.getLastProfile().getSelectedVersion()));
private static class OverridableSwingWorkerImpl extends AbstractSwingWorker<List<ModInfo>> {
28,675
import java.io.IOException; import java.io.InputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Properties; <BUG>import org.jackhuang.hellominecraft.util.logging.HMCLog; public class ServerProperties {</BUG> public static ServerProperties getInstance() { return instance; }
import org.jackhuang.hellominecraft.util.system.IOUtils; public class ServerProperties {
28,676
p.load(is); return p.getProperty(key, defaultValue); } catch (IOException ex) { HMCLog.warn("Failed to get property in server.properties", ex); return ""; <BUG>} finally { try { if (is != null) is.close(); } catch (IOException ex) { HMCLog.warn("Failed to close InputStream for server.properties", ex); }</BUG> }
IOUtils.closeQuietly(is);
28,677
SimpleDateFormat f = new SimpleDateFormat("E M d HH:mm:ss z y"); p.store(new FileOutputStream(new File(path, "server.properties")), "Minecraft server properties\n" + f.format(new Date())); } catch (IOException ex) { HMCLog.warn("Failed to set property in server.properties", ex); <BUG>} finally { try { if (is != null) i...
IOUtils.closeQuietly(is);
28,678
t -> t.putTextFile(C.GSON.toJson(((HMCLMinecraftService) profile.service()).getVersionSetting(gameVersion)), "minecraft/hmclversion.cfg")); String summary = "<html>" + C.i18n("modpack.export_finished") + ": " + loc.getAbsolutePath(); boolean including = false; if ((Boolean) settings.get(ModpackInitializationPanel.KEY_I...
try (ZipEngine engine = new ZipEngine(loc)) {
28,679
} catch (IOException | URISyntaxException e) { HMCLog.err("Failed to add launcher files.", e); flag = false; break; } <BUG>engine.closeFile(); if (flag) {</BUG> including = true; if (!modpack.delete()) HMCLog.warn("Failed to delete modpack.zip.temp, maybe the file is in using.");
if (flag) {
28,680
this(DEFAULT_SETTINGS); } public HelloMinecraftLookAndFeel(Map<String, String> settings) throws ParseException { try { try (InputStream is = HelloMinecraftLookAndFeel.class.getResourceAsStream("/org/jackhuang/hellominecraft/lookandfeel/synth.xml")) { <BUG>String s = IOUtils.getStreamContent(is, "UTF-8"); </BUG> for (Ma...
String s = IOUtils.toString(is, "UTF-8");
28,681
if (enableLogger) HMCLog.err(text); else System.out.println(text); if (checkThrowable(e) && !System.getProperty("java.vm.name").contains("OpenJDK")) { <BUG>SwingUtilities.invokeLater(() -> LogWindow.INSTANCE.showAsCrashWindow(Settings.UPDATE_CHECKER.OUT_DATED)); if (!Settings.UPDATE_CHECKER.OUT_DATED) </BUG> reportToS...
SwingUtilities.invokeLater(() -> LogWindow.INSTANCE.showAsCrashWindow(Settings.UPDATE_CHECKER.isOutOfDate())); if (!Settings.UPDATE_CHECKER.isOutOfDate())
28,682
continue; boolean need = true; try { if (location.exists()) { FileInputStream fis = new FileInputStream(location); <BUG>String sha = DigestUtils.sha1Hex(IOUtils.getBytesFromStream(fis)); IOUtils.closeQuietly(fis);</BUG> if (contents.get(i).geteTag().equals(sha)) { ++hasDownloaded; HMCLog.log("File " + assetsLocalNames....
String sha = DigestUtils.sha1Hex(IOUtils.readFully(fis).toByteArray()); IOUtils.closeQuietly(fis);
28,683
public void closeMessage() { if (isShowedMessage) { isShowedMessage = false; reloadColor(Settings.getInstance().getTheme()); windowTitle.setText(defaultTitle); <BUG>windowTitle.setForeground(Settings.UPDATE_CHECKER.OUT_DATED ? Color.red : Color.white); </BUG> } } public void showMessage(String message) {
windowTitle.setForeground(Settings.UPDATE_CHECKER.isOutOfDate() ? Color.red : Color.white);
28,684
UIManager.setLookAndFeel(LOOK_AND_FEEL); RepaintManager.setCurrentManager(new MyRepaintManager()); } catch (ParseException | UnsupportedLookAndFeelException ex) { HMCLog.warn("Failed to set look and feel...", ex); } <BUG>Settings.UPDATE_CHECKER.outdated.register(IUpgrader.NOW_UPGRADER); </BUG> Settings.UPDATE_CHECKER.p...
Settings.UPDATE_CHECKER.outOfDateEvent.register(IUpgrader.NOW_UPGRADER);
28,685
} public void install() throws Exception { HMCLog.log("Extracting install profiles..."); ZipFile zipFile = new ZipFile(forgeInstaller); ZipEntry entry = zipFile.getEntry("install_profile.json"); <BUG>String content = IOUtils.getStreamContent(zipFile.getInputStream(entry)); </BUG> InstallProfile profile = gson.fromJson(...
String content = IOUtils.toString(zipFile.getInputStream(entry));
28,686
jos.closeEntry(); } } private static boolean checksumValid(File libPath, List<String> checksums) { try { <BUG>byte[] fileData = IOUtils.getBytesFromStream(FileUtils.openInputStream(libPath)); </BUG> boolean valid = (checksums == null) || (checksums.isEmpty()) || (checksums.contains(DigestUtils.sha1Hex(fileData))); if (...
byte[] fileData = IOUtils.readFully(FileUtils.openInputStream(libPath)).toByteArray();
28,687
import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; <BUG>import org.jackhuang.hellominecraft.util.C; public class ModType {</BUG> public static final int FORGE_MOD = 0; public static final int MODLOADER_MOD = 1; public...
import org.jackhuang.hellominecraft.util.system.IOUtils; public class ModType {
28,688
else if (gbkPath.trim().startsWith("mod_")) return MODLOADER_MOD; } } } catch (Exception e) { <BUG>} finally { try { if (zipFile != null) zipFile.close(); } catch (IOException ex) { Logger.getLogger(ModType.class.getName()).log(Level.SEVERE, null, ex); } catch (Throwable t) { }</BUG> }
IOUtils.closeQuietly(zipFile);
28,689
import org.jackhuang.hellominecraft.util.system.CompressingUtils; import org.jackhuang.hellominecraft.util.system.FileUtils; import org.jackhuang.hellominecraft.util.system.ZipEngine; import org.jackhuang.hellominecraft.util.tasks.Task; import org.jackhuang.hellominecraft.util.ui.WebPage; <BUG>import org.jackhuang.hell...
import org.jackhuang.hellominecraft.util.system.IOUtils; import org.jackhuang.hellominecraft.util.tasks.NoShownTaskException;
28,690
mv.runDir = "version"; zip.putTextFile(C.GSON.toJson(mv), "minecraft/pack.json"); zip.putTextFile(C.GSON.toJson(modpackJson), "modpack.json"); if (callback != null) callback.call(zip); <BUG>} finally { if (zip != null) zip.closeFile();</BUG> } }
IOUtils.closeQuietly(zip);
28,691
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.TangoC...
import com.google.atap.tangoservice.TangoErrorException; import com.google.atap.tangoservice.TangoEvent;
28,692
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();
28,693
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: " +
28,694
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....
import org.rajawali3d.math.Quaternion; import org.rajawali3d.math.vector.Vector3;
28,695
translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE); translationMoon.setTransformable3D(moon); getCurrentScene().registerAnimation(translationMoon); translationMoon.play(); } <BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) { Pose cameraPose = ScenePoseCalculator.t...
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()...
28,696
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.tangos...
import com.google.atap.tangoservice.TangoAreaDescriptionMetaData; import com.google.atap.tangoservice.TangoConfig;
28,697
public void replaceVariableHolder() throws Exception { wireMockRule.stubFor(post(urlEqualTo("/get/this")) .willReturn(aResponse() .withStatus(200) .withHeader("content-type", "application/json") <BUG>.withBody("{\"var\":$(var), \"got\":\"it\"}"))); given()</BUG> .contentType("application/json") .body("{\"var\":1111}") ...
.withBody("{\"var\":$(var), \"got\":\"it\"}") .withTransform("body-transformer"))); given()
28,698
public void replaceNestedVariables() throws Exception { wireMockRule.stubFor(post(urlEqualTo("/get/this")) .willReturn(aResponse() .withStatus(200) .withHeader("content-type", "application/json") <BUG>.withBody("{\"var\":$(var), \"got\":\"it\", \"nested_attr\": \"$(nested.attr)\"}"))); given()</BUG> .contentType("appli...
.withBody("{\"var\":$(var), \"got\":\"it\", \"nested_attr\": \"$(nested.attr)\"}") .withTransform("body-transformer"))); given()
28,699
public void nullVariableNotFound() throws Exception { wireMockRule.stubFor(post(urlEqualTo("/get/this")) .willReturn(aResponse() .withStatus(200) .withHeader("content-type", "application/json") <BUG>.withBody("{\"var\":$(var)}"))); given()</BUG> .contentType("application/json") .body("{\"something\":\"different\"}") .w...
.withBody("{\"var\":$(var)}") .withTransform("body-transformer"))); given()
28,700
.withBody(transformResponse(object, responseDefinition.getBody())) .build(); } public String name() { return "body-transformer"; <BUG>} private String transformResponse(Map requestObject, String response) {</BUG> String modifiedResponse = response; Matcher matcher = pattern.matcher(response); while (matcher.find())
@Override public boolean applyGlobally() { return false; private String transformResponse(Map requestObject, String response) {