id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
25,601
POINT2 pt0 = null, pt1 = null, pt2; String last = eny; double dist = 0; int sumLabel = 0, sumENY = 0; for (j = 0; j < tg.Pixels.size() - 1; j++) { <BUG>if (eny.isEmpty()) { last = eny; } pt0 = tg.Pixels.get(j);</BUG> pt1 = tg.Pixels.get(j + 1);
if(eny.isEmpty() && last.equalsIgnoreCase(label)) last=eny; if(label.isEmpty() && last.equalsIgnoreCase(eny)) last=label; pt0 = tg.Pixels.get(j);
25,602
package org.web3j.protocol.scenarios; import java.math.BigInteger; <BUG>import org.junit.Test; import org.web3j.protocol.core.methods.request.Transaction;</BUG> import org.web3j.protocol.core.methods.response.EthSendTransaction; import org.web3j.protocol.core.methods.response.TransactionReceipt; import org.web3j.utils....
import java.math.BigDecimal; import org.web3j.abi.Transfer; import org.web3j.protocol.core.methods.request.Transaction;
25,603
GAS_LIMIT, contractAddress, encodedFunction); return signAndSend(rawTransaction); } <BUG>private TransactionReceipt signAndSend(RawTransaction rawTransaction) throws InterruptedException, ExecutionException, TransactionTimeoutException{ byte[] signedMessage = TransactionEncoder.signMessage(rawTransaction, credentials);...
[DELETED]
25,604
<BUG>package org.eclipse.xtext.ui.common.editor.hyperlinking; import org.apache.log4j.Logger; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.Path;</BUG> import org.eclipse.emf.common.util.URI;
import java.io.File; import java.io.IOException; import java.net.URL; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.Path;
25,605
} @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)
25,606
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))
25,607
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)
25,608
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");
25,609
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");
25,610
} @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);
25,611
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);
25,612
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);
25,613
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);
25,614
@Override public String toString() { return "desc"; } }; <BUG>public static final SortOrder DEFAULT = DESC; private static final SortOrder PROTOTYPE = DEFAULT; </BUG> @Override public SortOrder readFrom(StreamInput in) throws IOException {
return "asc"; }, DESC { private static final SortOrder PROTOTYPE = ASC;
25,615
GeoDistance geoDistance = GeoDistance.DEFAULT; boolean reverse = false; MultiValueMode sortMode = null; NestedInnerQueryParseSupport nestedHelper = null; final boolean indexCreatedBeforeV2_0 = context.indexShard().getIndexSettings().getIndexVersionCreated().before(Version.V_2_0_0); <BUG>boolean coerce = false; boolean ...
boolean coerce = GeoDistanceSortBuilder.DEFAULT_COERCE; boolean ignoreMalformed = GeoDistanceSortBuilder.DEFAULT_IGNORE_MALFORMED; XContentParser.Token token;
25,616
String currentName = parser.currentName(); while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentName = parser.currentName(); } else if (token == XContentParser.Token.START_ARRAY) { <BUG>parseGeoPoints(parser, geoPoints); </BUG> fieldName = curr...
GeoDistanceSortBuilder.parseGeoPoints(parser, geoPoints);
25,617
package org.elasticsearch.search.sort; <BUG>import org.elasticsearch.script.Script; public class SortBuilders {</BUG> public static ScoreSortBuilder scoreSort() { return new ScoreSortBuilder(); }
import org.elasticsearch.common.geo.GeoPoint; import java.util.Arrays; public class SortBuilders {
25,618
public GeoDistanceSortBuilder ignoreMalformed(boolean ignoreMalformed) { this.ignoreMalformed = ignoreMalformed; return this; }</BUG> @Override <BUG>public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.startObject("_geo_distance"); if (geohashes.size() == 0 && points.si...
if (coerce == false) { } } public boolean ignoreMalformed() { return this.ignoreMalformed; } builder.startObject(NAME);
25,619
this.descriptorHash = entry.moduleDescriptorHash; this.ageMillis = timeProvider.getCurrentTime() - entry.createTimestamp; if (moduleDescriptor == null) { metaData = null; } else { <BUG>metaData = new ModuleDescriptorAdapter(moduleDescriptor); metaData.setChanging(entry.isChanging); }</BUG> }
ModuleDescriptorAdapter moduleDescriptorAdapter = new ModuleDescriptorAdapter(moduleDescriptor); moduleDescriptorAdapter.setChanging(entry.isChanging); moduleDescriptorAdapter.setMetaDataOnly(entry.isMetaDataOnly); metaData = moduleDescriptorAdapter;
25,620
import org.gradle.util.VersionNumber; import java.io.File; public enum CacheLayout { ROOT(null, "modules", 2), FILE_STORE(ROOT, "files", 1), <BUG>META_DATA(ROOT, "metadata", 3); </BUG> private final String name; private final CacheLayout parent; private final int version;
META_DATA(ROOT, "metadata", 4);
25,621
public class CourseAssessmentRequest {</BUG> public CourseAssessmentRequest() { super(); } <BUG>public CourseAssessmentRequest(Long id, Long courseStudentId, DateTime created, String requestText, Boolean archived) { </BUG> super(); this.id = id; this.courseStudentId = courseStudentId; this.created = created;
package fi.otavanopisto.pyramus.rest.model; import org.threeten.bp.ZonedDateTime; public class CourseAssessmentRequest { public CourseAssessmentRequest(Long id, Long courseStudentId, ZonedDateTime created, String requestText, Boolean archived) {
25,622
package fi.otavanopisto.pyramus.rest.model; <BUG>import org.joda.time.DateTime; import fi.otavanopisto.security.ContextReference;</BUG> public class CourseStudent implements ContextReference { public CourseStudent() { super();
import org.threeten.bp.ZonedDateTime; import fi.otavanopisto.security.ContextReference;
25,623
import fi.otavanopisto.security.ContextReference;</BUG> public class CourseStudent implements ContextReference { public CourseStudent() { super(); } <BUG>public CourseStudent(Long id, Long courseId, Long studentId, DateTime enrolmentTime, Boolean archived, Long participationTypeId, Long enrolmentTypeId, </BUG> Boolean ...
package fi.otavanopisto.pyramus.rest.model; import org.threeten.bp.ZonedDateTime; import fi.otavanopisto.security.ContextReference; public CourseStudent(Long id, Long courseId, Long studentId, ZonedDateTime enrolmentTime, Boolean archived, Long participationTypeId, Long enrolmentTypeId,
25,624
this.billingDetailsId = billingDetailsId; } private Long id; private Long courseId; private Long studentId; <BUG>private DateTime enrolmentTime; </BUG> private Boolean archived; private Long participationTypeId; private Long enrolmentTypeId;
private ZonedDateTime enrolmentTime;
25,625
public void setCurriculumId(Long curriculumId) { this.curriculumId = curriculumId; } private Long id; private String name; <BUG>private DateTime created; private DateTime lastModified; </BUG> private String description;
private ZonedDateTime created; private ZonedDateTime lastModified;
25,626
</BUG> private String description; private Boolean archived; private Integer courseNumber; private Long maxParticipantCount; <BUG>private DateTime beginDate; private DateTime endDate; </BUG> private String nameExtension;
public void setCurriculumId(Long curriculumId) { this.curriculumId = curriculumId; } private Long id; private String name; private ZonedDateTime created; private ZonedDateTime lastModified; private ZonedDateTime beginDate; private ZonedDateTime endDate;
25,627
private Double teachingHours; private Double distanceTeachingHours; private Double distanceTeachingDays; private Double assessingHours; private Double planningHours; <BUG>private DateTime enrolmentTimeEnd; </BUG> private Long creatorId; private Long lastModifierId; private Long subjectId;
private ZonedDateTime enrolmentTimeEnd;
25,628
@XmlRootElement</BUG> public class AcademicTerm { public AcademicTerm() { } <BUG>public AcademicTerm(Long id, String name, DateTime startDate, DateTime endDate, Boolean archived) { </BUG> super(); this.id = id; this.name = name; this.startDate = startDate;
package fi.otavanopisto.pyramus.rest.model; import javax.xml.bind.annotation.XmlRootElement; import org.threeten.bp.ZonedDateTime; @XmlRootElement public AcademicTerm(Long id, String name, ZonedDateTime startDate, ZonedDateTime endDate, Boolean archived) {
25,629
public class CourseAssessment {</BUG> public CourseAssessment() { super(); } <BUG>public CourseAssessment(Long id, Long courseStudentId, Long gradeId, Long gradingScaleId, Long assessorId, DateTime date, String verbalAssessment) { </BUG> super(); this.id = id; this.courseStudentId = courseStudentId; this.gradeId = grad...
package fi.otavanopisto.pyramus.rest.model; import org.threeten.bp.ZonedDateTime; public class CourseAssessment { public CourseAssessment(Long id, Long courseStudentId, Long gradeId, Long gradingScaleId, Long assessorId, ZonedDateTime date, String verbalAssessment) {
25,630
<BUG>import java.util.ArrayList; import java.util.HashMap;</BUG> import java.util.HashSet; import java.util.Iterator; import com.sun.media.jfxmedia.events.NewFrameEvent;
import java.util.Collection; import java.util.Collections; import java.util.HashMap;
25,631
private static final boolean create_chains = true; private static final boolean chains_expanded = true; private static final boolean methods_expanded = true; private static final int CHAIN_LENGTH = 3 ; // This value should ALWAYS be LARGEN THAN OR EQUAL 3 (otherwise it will break) static HashMap<String, Vertex> id_to_v...
static AbstractVertex getLayeredGraph(Graph graph){ return get2layer(graph); } static AbstractVertex get2layer(Graph graph)
25,632
HashMap<String, AbstractVertex> methodVertices = new HashMap<>(); Iterator<String> iter = buckets.keySet().iterator(); while(iter.hasNext()) { String method = iter.next(); <BUG>AbstractVertex vertex = new Vertex(method, AbstractVertex.VertexType.METHOD); vertex.setExpanded(methods_expanded);</BUG> vertex.getMetaData()....
vertex.getMetaData().put(AbstractVertex.METADATA_METHOD_NAME, method); vertex.setExpanded(methods_expanded);
25,633
Iterator<Vertex> it = innerVertexSet.iterator(); HashMap<String,String> idMapping = new HashMap<>(); // first id is the Main.graph vertex id and the second id the New vertex id while(it.hasNext()) { Vertex oldV = it.next(); <BUG>Vertex newV = new Vertex("instruction:" + oldV.getStrID(), AbstractVertex.VertexType.INSTRU...
newV.getMetaData().put(AbstractVertex.METADATA_METHOD_NAME, methodVertex.getMetaData().get(AbstractVertex.METADATA_METHOD_NAME)); System.out.println("Loop height: " + oldV.loopHeight);
25,634
AbstractVertex end = id_to_abs_vertex.get(endOriginal.getStrID()); start.getSelfGraph().addEdge(new Edge(start,end,Edge.EDGE_TYPE.EDGE_DUMMY)); } AbstractVertex root = new Vertex("root", AbstractVertex.VertexType.ROOT); root.setInnerGraph(methodGraph); <BUG>createChainVertices(root, CHAIN_LENGTH); return root;</BUG> } ...
System.out.println("Statistics:"); System.out.println(JAAMUtils.RED("Number of edges: ") +JAAMUtils.YELLOW(""+root.getTotalEdgeCount())); System.out.println(JAAMUtils.RED("Number of vertices: ") + JAAMUtils.YELLOW(""+root.getTotalVertexCount())); return root;
25,635
if(id_to_abs_vertex.containsKey(vertex.getStrID())){ System.out.println("WARINING: there exists two vertices with the same StrID: " + vertex.getStrID()); }else{ Vertex newV = new Vertex("instruction:" + vertex.getStrID(), AbstractVertex.VertexType.INSTRUCTION); newV.setMinInstructionLine(vertex.getMinInstructionLine())...
newV.getMetaData().put(AbstractVertex.METADATA_METHOD_NAME, method); abstractGraph.addVertex(newV);
25,636
import javax.swing.JTextArea; import java.awt.Font; import java.awt.Color; public class Parameters { <BUG>public static boolean debugMode = false; public static int width = 1200, height = 800;</BUG> public static double boxFactor = 3.0/4.0; public static StacFrame stFrame; public static JTextArea rightArea;
public static boolean edgeVisible = true; public static int width = 1200, height = 800;
25,637
import javax.swing.tree.DefaultMutableTreeNode; import javafx.scene.paint.Color; <BUG>import java.util.ArrayList; import java.util.HashMap;</BUG> import java.util.HashSet; import java.util.Iterator; abstract class AbstractVertex implements Comparable<AbstractVertex>
import java.util.Collections; import java.util.HashMap;
25,638
abstract class AbstractVertex implements Comparable<AbstractVertex> { public static final double DEFAULT_WIDTH = 1.0; public static final double DEFAULT_HEIGHT = 1.0; public static final String METADATA_MERGE_PARENT = "MERGE_PARENT"; <BUG>public static final String METADATA_INSTRUCTION = "INSTRUCTION_STATEMENT"; public...
public static final String METADATA_METHOD_NAME = "METHOD_NAME"; public Color highlightColor = Color.ORANGE;
25,639
this.abstractIncomingNeighbors = new HashSet<AbstractVertex>(); this.id = idCounter++; this.strId = "vertex:"+this.id; this.metadata = new HashMap<String,Object>(); } <BUG>private javafx.scene.paint.Color[] colors = {javafx.scene.paint.Color.AQUAMARINE, javafx.scene.paint.Color.GREEN, javafx.scene.paint.Color.AZURE, ...
private javafx.scene.paint.Color[] colors = {javafx.scene.paint.Color.LIGHTCORAL, javafx.scene.paint.Color.LIGHTBLUE, javafx.scene.paint.Color.LIGHTCYAN, javafx.scene.paint.Color.LIGHTSEAGREEN, javafx.scene.paint.Color.LIGHTSALMON, javafx.scene.paint.Color.LIGHTSKYBLUE, javafx.scene.paint.Color.LIGHTGOLDENRODYELLOW, ja...
25,640
public void toggleEdges() { Iterator<Edge> it = this.getInnerGraph().getEdges().values().iterator(); while(it.hasNext()){ Edge e = it.next(); if(e.getGraphics()!=null){ <BUG>e.getGraphics().setVisible(!e.getGraphics().isVisible()); </BUG> } } Iterator<AbstractVertex> itN = this.getInnerGraph().getVertices().values().it...
e.getGraphics().setVisible(!e.getGraphics().isVisible() && Parameters.edgeVisible);
25,641
} } else { System.out.println("Unrecognized type in method getInstructions: " + this.getType()); } return set; <BUG>} } </BUG>
Iterator<AbstractVertex> it = this.getInnerGraph().getVertices().values().iterator(); while(it.hasNext()){ it.next().toggleNodesOfType(type,methodExpanded);
25,642
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 {
25,643
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]
25,644
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;
25,645
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 {
25,646
CallPeerSipImpl callPeer = call.getCallPeers().next(); callPeer.addMethodProcessorListener(this); callPeer.addCallPeerListener(callPeerListener); size = (((VideoMediaFormat)call.getDefaultDevice(MediaType.VIDEO). getFormat()).getSize()); <BUG>origin = null; return call;</BUG> } @Override public Call createVideoCall(Con...
origin = getOriginForMediaDevice(device); return call;
25,647
device); CallPeerJabberImpl callPeer = call.getCallPeers().next(); callPeer.addCallPeerListener(callPeerListener); size = (((VideoMediaFormat)call.getDefaultDevice( MediaType.VIDEO).getFormat()).getSize()); <BUG>origin = null; return call;</BUG> } @Override public Call createVideoCall(Contact callee, MediaDevice device...
origin = getOriginForMediaDevice(device); return call;
25,648
public void setLocalVideoAllowed(Call call, boolean allowed) throws OperationFailedException { ((CallJabberImpl)call).setLocalVideoAllowed(allowed, MediaUseCase.DESKTOP); <BUG>size = (((VideoMediaFormat)((CallJabberImpl)call).getDefaultDevice( MediaType.VIDEO).getFormat()).getSize()); ((CallJabberImpl)call).modifyVideo...
MediaDevice device = ((CallJabberImpl)call).getDefaultDevice( MediaType.VIDEO); size = (((VideoMediaFormat)device.getFormat()).getSize()); origin = getOriginForMediaDevice(device); }
25,649
Address toAddress = parentProvider.parseAddressString(uri); CallSipImpl call = basicTelephony.createOutgoingCall(); call.setVideoDevice(mediaDevice); call.setLocalVideoAllowed(true, getMediaUseCase()); call.invite(toAddress, null); <BUG>origin = null; return call;</BUG> } public Call createVideoCall(Contact callee, Med...
origin = getOriginForMediaDevice(mediaDevice); return call;
25,650
@Override public Call createVideoCall(String uri) throws OperationFailedException, ParseException { Call call = super.createVideoCall(uri); <BUG>size = (((VideoMediaFormat)((CallSipImpl)call). getDefaultDevice(MediaType.VIDEO). getFormat()).getSize()); origin = null; return call;</BUG> }
public MediaUseCase getMediaUseCase() return MediaUseCase.DESKTOP;
25,651
((CallSipImpl)call).setVideoDevice(mediaDevice); ((CallSipImpl)call).setLocalVideoAllowed(allowed, MediaUseCase.DESKTOP); size = (((VideoMediaFormat)((CallSipImpl)call). getDefaultDevice(MediaType.VIDEO). getFormat()).getSize()); <BUG>origin = null; ((CallSipImpl)call).reInvite();</BUG> } public boolean isPartialStream...
origin = getOriginForMediaDevice(mediaDevice); ((CallSipImpl)call).reInvite();
25,652
import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; public class Preferences { public static final String FILE_SLAVE_MODE= <BUG>Preferences.class.getPackage().getName() + ".slave_mode"; public static final String KEY_X_AXIS_SPEED= "x_axis_speed"; public stati...
public static final String KEY_HORIZONTAL_SPEED = "horizontal_speed"; public static final String KEY_VERTICAL_SPEED = "vertical_speed";
25,653
return constrainSpeedValue (result); }</BUG> public static int setHorizontalSpeed(Context c, int v) { <BUG>if (!sRuntimeConstantsLoaded) loadRuntimeConstants(c); v= constrainSpeedValue(v); SharedPreferences.Editor spe= getSharedPreferences(c).edit(); spe.putInt(Preferences.KEY_X_AXIS_SPEED, v); </BUG> spe.apply();
MOTION_SMOOTHING_MAX= r.getInteger(R.integer.motion_smoothing_max); MOTION_THRESHOLD_DEFAULT= r.getInteger(R.integer.motion_threshold_default); MOTION_THRESHOLD_MIN= r.getInteger(R.integer.motion_threshold_min); MOTION_THRESHOLD_MAX= r.getInteger(R.integer.motion_threshold_max); SOUND_ON_CLICK_DEFAULT= r.getBoolean(R.b...
25,654
return constrainSpeedValue (result); }</BUG> public static int setVerticalSpeed(Context c, int v) { <BUG>if (!sRuntimeConstantsLoaded) loadRuntimeConstants(c); v= constrainSpeedValue(v); SharedPreferences.Editor spe= getSharedPreferences(c).edit(); spe.putInt(Preferences.KEY_Y_AXIS_SPEED, v); </BUG> spe.apply();
MOTION_SMOOTHING_MAX= r.getInteger(R.integer.motion_smoothing_max); MOTION_THRESHOLD_DEFAULT= r.getInteger(R.integer.motion_threshold_default); MOTION_THRESHOLD_MIN= r.getInteger(R.integer.motion_threshold_min); MOTION_THRESHOLD_MAX= r.getInteger(R.integer.motion_threshold_max); SOUND_ON_CLICK_DEFAULT= r.getBoolean(R.b...
25,655
SharedPreferences.Editor spe= getSharedPreferences(c).edit(); spe.putInt(Preferences.KEY_Y_AXIS_SPEED, v); </BUG> spe.apply(); return v; <BUG>} public static boolean getSoundOnClick(Context c) { if (!sRuntimeConstantsLoaded) loadRuntimeConstants(c); return getSharedPreferences(c).getBoolean(</BUG> Preferences.KEY_SOUND...
spe.putInt(Preferences.KEY_HORIZONTAL_SPEED, v);
25,656
private final int MOTION_SMOOTHING_MIN; private final int MOTION_SMOOTHING_MAX; private final int MOTION_THRESHOLD_MIN;</BUG> private final int ACCEL_ARRAY_SIZE= 30; <BUG>private float mHorizontalSpeed, mVerticalSpeed; </BUG> private float mAccelArray[]= new float[ACCEL_ARRAY_SIZE]; private float mLowPassFilterWeight; ...
import android.graphics.PointF; import com.crea_si.eviacam.Preferences; import java.lang.Math; class PointerControl implements OnSharedPreferenceChangeListener { private float mHorizontalMultiplier, mVerticalMultiplier;
25,657
title = site.getTitle(); } catch (Exception ignore) { } <BUG>return "[ " + title + " - " + rb.getString("Announcement") + " ] " + hdr.getSubject(); }</BUG> protected String getFromAddress(Event event) { String userEmail = "no-reply@" + ServerConfigurationService.getServerName();
return rb.getFormattedMessage("noti.subj", new Object[]{title, hdr.getSubject()});
25,658
Element dependenciesElement = document.createElement(ELEMENT_AUTHORS); parentElement.appendChild(dependenciesElement); for (ExtensionAuthor author : authors) { Element dependencyElement = document.createElement(ELEMENT_AAUTHOR); dependenciesElement.appendChild(dependencyElement); <BUG>addElement(document, dependencyEle...
URL authorURL = author.getURL(); if (authorURL != null) { addElement(document, dependencyElement, ELEMENT_AAURL, authorURL.toString());
25,659
import org.kohsuke.stapler.DataBoundConstructor; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import com.google.common.cache.Cache; <BUG>import com.google.common.cache.CacheBuilder; import java.io.File;</BUG> import java.io.FileInputStream; import java.io.Fi...
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File;
25,660
import java.io.ObjectOutputStream; import java.io.PrintStream; import java.util.ArrayList; import java.util.Collection; import java.util.Date; <BUG>import java.util.List; import java.util.logging.Logger;</BUG> import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.pa...
import java.util.logging.Level; import java.util.logging.Logger;
25,661
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; public class JMeterParser extends PerformanceReportParser { private static final Logger LOGGER = Logger.getLogger(JMeterParser.class.getName()); <BUG>private static final Cache<String, P...
private static final Cache<String, PerformanceReport> cache = CacheBuilder.newBuilder().maximumSize(1000).build();
25,662
ObjectInputStream in = null; synchronized (JMeterParser.class) { try { PerformanceReport r = cache.getIfPresent(fser); if (r == null) { <BUG>in = new ObjectInputStream(new FileInputStream(fser)); r = (PerformanceReport) in.readObject(); }</BUG> result.add(r);
in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(fser))); cache.put(fser, r); }
25,663
import org.kohsuke.stapler.Stapler; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Locale; public abstract class AbstractReport { <BUG>private NumberFormat percentFormat; private NumberFormat dataFormat; abstract public int countErrors();</BUG> abstract public double errorPercent(); pub...
private final NumberFormat percentFormat = new DecimalFormat("0.0"); private final NumberFormat dataFormat = new DecimalFormat("#,###"); abstract public int countErrors();
25,664
return "graph.gif"; } public String getUrlName() { return PLUGIN_NAME; } <BUG>public PerformanceProjectAction(AbstractProject project) { </BUG> this.project = project; } private JFreeChart createErrorsChart(CategoryDataset dataset) {
public PerformanceProjectAction(AbstractProject<?, ?> project) {
25,665
if (CONFIGURE_LINK.equals(link)) { return createUserConfiguration(request); } else if (TRENDREPORT_LINK.equals(link)) { return createTrendReport(request); } else if (TESTSUITE_LINK.equals(link)) { <BUG>return createTestsuiteReport(request, response); } else {</BUG> return null; } }
return createTestsuiteReport(request); } else {
25,666
CategoryDataset dataSet = getTrendReportData(request, filename).build(); TrendReportDetail report = new TrendReportDetail(project, PLUGIN_NAME, request, filename, dataSet); return report; } <BUG>private Object createTestsuiteReport(final StaplerRequest request, final StaplerResponse response) {</BUG> String filename =...
private Object createTestsuiteReport(final StaplerRequest request) {
25,667
package hudson.plugins.performance; import java.util.Date; import java.io.Serializable; public class HttpSample implements Serializable, Comparable<HttpSample> { <BUG>private static final long serialVersionUID = -1980997520755400556L; </BUG> private long duration; private boolean successful; private boolean errorObtain...
private static final long serialVersionUID = -3531990216789038711L;
25,668
import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import com.appboy.configuration.XmlAppConfigurationProvider; <BUG>import com.appboy.push.AppboyNotificationUtils; public final class AppboyGcmReceiver extends BroadcastReceiver {</BUG> private static final Str...
import com.appboy.support.AppboyLogger; public final class AppboyGcmReceiver extends BroadcastReceiver {
25,669
private static final String GCM_DELETED_MESSAGES_KEY = "deleted_messages"; private static final String GCM_NUMBER_OF_MESSAGES_DELETED_KEY = "total_deleted"; public static final String CAMPAIGN_ID_KEY = Constants.APPBOY_PUSH_CAMPAIGN_ID_KEY; @Override public void onReceive(Context context, Intent intent) { <BUG>Log.i(TA...
AppboyLogger.i(TAG, String.format("Received broadcast message. Message: %s", intent.toString()));
25,670
} else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) { int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID); NotificationManager notificationManager = (NotificationManage...
AppboyLogger.w(TAG, String.format("The GCM receiver received a message not sent from Appboy. Ignoring the message."));
25,671
Log.e(TAG, "Device does not support GCM."); } else if ("INVALID_PARAMETERS".equals(error)) { Log.e(TAG, "The request sent by the device does not contain the expected parameters. This phone does not " + "currently support GCM."); } else { <BUG>Log.w(TAG, String.format("Received an unrecognised GCM registration error typ...
AppboyLogger.w(TAG, String.format("Received an unrecognised GCM registration error type. Ignoring. Error: %s", error));
25,672
} else if (registrationId != null) { Appboy.getInstance(context).registerAppboyPushMessages(registrationId); } else if (intent.hasExtra(GCM_UNREGISTERED_KEY)) { Appboy.getInstance(context).unregisterAppboyPushMessages(); } else { <BUG>Log.w(TAG, "The GCM registration message is missing error information, registration i...
AppboyLogger.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
25,673
if (GCM_DELETED_MESSAGES_KEY.equals(messageType)) { int totalDeleted = intent.getIntExtra(GCM_NUMBER_OF_MESSAGES_DELETED_KEY, -1); if (totalDeleted == -1) { Log.e(TAG, String.format("Unable to parse GCM message. Intent: %s", intent.toString())); } else { <BUG>Log.i(TAG, String.format("GCM deleted %d messages. Fetch the...
AppboyLogger.i(TAG, String.format("GCM deleted %d messages. Fetch them from Appboy.", totalDeleted));
25,674
package com.appboy; import android.content.BroadcastReceiver; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; <BUG>import android.util.Log; import android.content.Context;</BUG> import android.app.Notification; import android.app.NotificationManager; import com.appboy.configuration...
import com.appboy.support.AppboyLogger; import android.content.Context;
25,675
} else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) { int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID); NotificationManager notificationManager = (NotificationManage...
AppboyLogger.w(TAG, String.format("The ADM receiver received a message not sent from Appboy. Ignoring the message."));
25,676
Notification notification = null; IAppboyNotificationFactory appboyNotificationFactory = AppboyNotificationUtils.getActiveNotificationFactory(); try { notification = appboyNotificationFactory.createNotification(appConfigurationProvider, context, admExtras, appboyExtras); } catch(Exception e) { <BUG>Log.e(TAG, "Failed t...
AppboyLogger.e(TAG, "Failed to create notification.", e);
25,677
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;
25,678
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) { <B...
AppboyLogger.i(TAG, "Null or empty Url string passed to image bitmap download. Not attempting download.");
25,679
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
25,680
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_()...
sink.lineBreak(); sink.section1_();
25,681
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
25,682
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
25,683
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); s...
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
25,684
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
25,685
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
25,686
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
25,687
import java.util.Locale; import java.util.Map; import java.util.TreeMap; public class DependencyConvergenceReport extends AbstractProjectInfoReport <BUG>{ private List reactorProjects; private static final int PERCENTAGE = 100;</BUG> public String getOutputName() {
private static final int PERCENTAGE = 100; private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment .getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
25,688
sink.section1(); sink.sectionTitle1(); sink.text( getI18nString( locale, "title" ) ); sink.sectionTitle1_(); Map dependencyMap = getDependencyMap(); <BUG>generateLegend( locale, sink ); generateStats( locale, sink, dependencyMap ); generateConvergence( locale, sink, dependencyMap ); sink.section1_();</BUG> sink.body_()...
sink.lineBreak(); sink.section1_();
25,689
Iterator it = artifactMap.keySet().iterator(); while ( it.hasNext() ) { String version = (String) it.next(); sink.tableRow(); <BUG>sink.tableCell(); sink.text( version );</BUG> sink.tableCell_(); sink.tableCell(); generateVersionDetails( sink, artifactMap, version );
sink.tableCell( String.valueOf( cellWidth ) + "px" ); sink.text( version );
25,690
sink.tableCell(); sink.text( getI18nString( locale, "legend.shared" ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableCell(); iconError( sink );</BUG> sink.tableCell_(); sink.tableCell(); sink.text( getI18nString( locale, "legend.different" ) );
sink.tableCell( "15px" ); // according /images/icon_error_sml.gif iconError( sink );
25,691
sink.tableCaption(); sink.text( getI18nString( locale, "stats.caption" ) ); sink.tableCaption_();</BUG> sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.subprojects" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); s...
sink.bold(); sink.bold_(); sink.tableCaption_(); sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.subprojects" ) ); sink.tableHeaderCell_();
25,692
sink.tableCell(); sink.text( String.valueOf( reactorProjects.size() ) ); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.dependencies" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); sink.text( String.valueOf( depCount ) );
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.dependencies" ) ); sink.tableHeaderCell_();
25,693
sink.text( String.valueOf( convergence ) + "%" ); sink.bold_(); sink.tableCell_(); sink.tableRow_(); sink.tableRow(); <BUG>sink.tableHeaderCell(); sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" ); sink.tableHeaderCell_();</BUG> sink.tableCell(); if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
sink.tableHeaderCell( headerCellWidth ); sink.text( getI18nString( locale, "stats.readyrelease" ) ); sink.tableHeaderCell_();
25,694
{ ReverseDependencyLink p1 = (ReverseDependencyLink) o1; ReverseDependencyLink p2 = (ReverseDependencyLink) o2; return p1.getProject().getId().compareTo( p2.getProject().getId() ); } <BUG>else {</BUG> return 0; } }
iconError( sink );
25,695
Collection collection) { if (state.getConfiguration().isAutoGrowCollections()) { Object newCollectionElement = null; try { int newElements = index-collection.size(); <BUG>if (elementType == null) { throw new SpelEvaluationException(getStartPosition(), SpelMessage.UNABLE_TO_GROW_COLLECTION_UNKNOWN_ELEMENT_TYPE);</BUG> }...
if (elementType == null || elementType == Object.class) { throw new SpelEvaluationException(getStartPosition(), SpelMessage.UNABLE_TO_GROW_COLLECTION_UNKNOWN_ELEMENT_TYPE);
25,696
data.addAll(c); List<Object> result = new ArrayList<Object>(); int idx = 0; for (Object element : data) { try { <BUG>state.pushActiveContextObject(new TypedValue(element,TypeDescriptor.valueOf(op.getTypeDescriptor().getElementType()))); </BUG> state.enterScope("index", idx); Object o = selectionCriteria.getValueInterna...
state.pushActiveContextObject(new TypedValue(element, op.getTypeDescriptor().getElementTypeDescriptor()));
25,697
state.enterScope("index", idx); Object o = selectionCriteria.getValueInternal(state).getValue(); if (o instanceof Boolean) { if (((Boolean) o).booleanValue() == true) { if (variant == FIRST) { <BUG>return new TypedValue(element,TypeDescriptor.valueOf(op.getTypeDescriptor().getElementType())); </BUG> } result.add(elemen...
return new TypedValue(element, op.getTypeDescriptor().getElementTypeDescriptor());
25,698
context.setAuthCache(authCache); ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpclient, context); ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build(); client.register(JacksonJaxbJsonProvider.class); client.register(JacksonObjectMapperProvider.class); <BUG>client.register(Req...
client.register(RestRequestFilter.class); client.register(RestResponseFilter.class);
25,699
import org.hawkular.alerts.api.model.condition.Condition; import org.hawkular.inventory.api.model.CanonicalPath; import org.hawkular.inventory.api.model.Tenant; import org.hawkular.inventory.json.DetypedPathDeserializer; import org.hawkular.inventory.json.InventoryJacksonConfig; <BUG>import org.hawkular.inventory.json....
import org.hawkular.inventory.json.mixins.model.CanonicalPathMixin;
25,700
import org.eclipse.jetty.util.Fields; public class HttpRequest implements Request { private final HttpFields headers = new HttpFields(); private final Fields params = new Fields(true); <BUG>private final Map<String, Object> attributes = new HashMap<>(); private final List<RequestListener> requestListeners = new ArrayLi...
[DELETED]