id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
36,301
package org.qcri.rheem.core.function; import org.qcri.rheem.core.optimizer.ProbabilisticDoubleInterval; <BUG>import org.qcri.rheem.core.optimizer.costs.LoadEstimator; </BUG> import org.qcri.rheem.core.types.BasicDataUnitType; import java.util.Optional; public class PredicateDescriptor<Input> extends FunctionDescriptor ...
import org.qcri.rheem.core.optimizer.costs.LoadProfileEstimator;
36,302
private final SerializablePredicate<Input> javaImplementation; private String sqlImplementation; private ProbabilisticDoubleInterval selectivity; public PredicateDescriptor(SerializablePredicate<Input> javaImplementation, Class<Input> inputTypeClass) { <BUG>this(javaImplementation, inputTypeClass, null); </BUG> } publi...
this(javaImplementation, inputTypeClass, (ProbabilisticDoubleInterval) null);
36,303
package org.qcri.rheem.core.function; <BUG>import org.qcri.rheem.core.optimizer.costs.LoadEstimator; import org.qcri.rheem.core.types.BasicDataUnitType;</BUG> import org.qcri.rheem.core.types.DataUnitGroupType; import org.qcri.rheem.core.types.DataUnitType; import java.util.Iterator;
import org.qcri.rheem.core.optimizer.costs.LoadProfileEstimator; import org.qcri.rheem.core.optimizer.costs.NestableLoadProfileEstimator; import org.qcri.rheem.core.types.BasicDataUnitType;
36,304
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG>...
public class ErrorController { @RequestMapping(value = {"/404"})
36,305
protected PrefixRegistrationManager _prefixMgr = null; protected TreeMap<ContentName, RegisteredPrefix> _registeredPrefixes = new TreeMap<ContentName, RegisteredPrefix>(); protected Boolean _registrationChangeInProgress = false; protected Timer _periodicTimer = null; protected Object _timersSetupLock = new Object(); <B...
protected static final long NOT_IN_HANDLER = -1; protected long _handlerCallTime = NOT_IN_HANDLER; // Time handler was called public class RegisteredPrefix implements CCNInterestListener {
36,306
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSyste...
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
36,307
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(...
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
36,308
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
36,309
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THR...
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.g...
36,310
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_...
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART...
36,311
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backup...
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
36,312
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) ...
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
36,313
for (PathPattern pattern : patterns) { log.info(" " + pattern); } } } <BUG>public boolean accept(File ioFile, String relativePathFromBasedir, InputFile.Type type) { PathPattern[] inclusionPatterns = null;</BUG> PathPattern[] exclusionPatterns = null; if (InputFile.Type.MAIN==type) { inclusionPatterns = sourceInclusions...
public boolean accept(InputFile inputFile, InputFile.Type type) { PathPattern[] inclusionPatterns = null;
36,314
exclusionPatterns = testExclusions; } boolean matchInclusion = false; if (inclusionPatterns != null && inclusionPatterns.length > 0) { for (PathPattern pattern : inclusionPatterns) { <BUG>matchInclusion |= pattern.match(ioFile, relativePathFromBasedir); }</BUG> if (!matchInclusion) { return false; }
matchInclusion |= pattern.match(inputFile);
36,315
return false; } } if (exclusionPatterns != null && exclusionPatterns.length > 0) { for (PathPattern pattern : exclusionPatterns) { <BUG>if (pattern.match(ioFile, relativePathFromBasedir)) { return false;</BUG> } } }
if (pattern.match(inputFile)) {
36,316
import org.apache.commons.io.filefilter.IOFileFilter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.sonar.api.BatchComponent; import org.sonar.api.batch.fs.InputFile; <BUG>import org.sonar.api.batch.fs.InputFileFilter; import org.sonar.api.resources.Project;</BUG> import org.sonar.api.scan.filesys...
import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.api.resources.Project;
36,317
} catch (SAXException e) { logger.log(Level.SEVERE, "Error loading hash sets: can't parse XML.", e); } catch (IOException e) { logger.log(Level.SEVERE, "Error loading hash sets: can't read file.", e); } <BUG>try{ PlatformUtil.xmlIsValid(ret, PlatformUtil.hashsetXSD); } catch(SAXException e){ logger.log(Level.SEVERE, "...
[DELETED]
36,318
import org.sleuthkit.autopsy.coreutils.ModuleSettings; public final class IngestModuleLoader { private static final String PIPELINE_CONFIG_XML = "pipeline_config.xml"; private String absFilePath; private static IngestModuleLoader instance; <BUG>private final List<XmlPipelineRaw> pipelinesXML; </BUG> private final List<...
private final List<IngestModuleLoader.XmlPipelineRaw> pipelinesXML;
36,319
private static String CUR_MODULES_DISCOVERED_SETTING = "curModulesDiscovered"; enum Event { ModulesReloaded }; private IngestModuleLoader() { <BUG>pipelinesXML = new ArrayList<XmlPipelineRaw>(); </BUG> filePipeline = new ArrayList<IngestModuleAbstractFile>(); imagePipeline = new ArrayList<IngestModuleImage>(); dateForm...
pipelinesXML = new ArrayList<IngestModuleLoader.XmlPipelineRaw>();
36,320
} catch (IllegalArgumentException e) { pipelineErrors = true; logger.log(Level.SEVERE, "Unknown pipeline type: " + pipelineType); } Map<Integer, Integer> orderings = new HashMap<Integer, Integer>(); <BUG>for (XmlModuleRaw pMod : pRaw.modules) { </BUG> boolean moduleErrors = false; int order = pMod.order; if (orderings....
for (IngestModuleLoader.XmlModuleRaw pMod : pRaw.modules) {
36,321
orderings.put(order, orderings.get(order) + 1); } else { orderings.put(order, 1); } String modType = pMod.type; <BUG>if (!modType.equals(XmlModuleRaw.MODULE_TYPE.PLUGIN.toString())) { </BUG> moduleErrors = true; logger.log(Level.SEVERE, "Unknown module type: " + modType); }
if (!modType.equals(IngestModuleLoader.XmlModuleRaw.MODULE_TYPE.PLUGIN.toString())) {
36,322
Exceptions.printStackTrace(ex); } catch (SecurityException ex) { Exceptions.printStackTrace(ex); } } //if image module: check if has public constructor with no args <BUG>else if (pType == XmlPipelineRaw.PIPELINE_TYPE.IMAGE_ANALYSIS) { </BUG> try { Constructor<?> constr = moduleClass.getConstructor(); int modifiers = co...
else if (pType == IngestModuleLoader.XmlPipelineRaw.PIPELINE_TYPE.IMAGE_ANALYSIS) {
36,323
boolean modulesChanged = false; it = fileModules.iterator(); while (it.hasNext()) { boolean exists = false; Class<IngestModuleAbstractFile> foundClass = (Class<IngestModuleAbstractFile>) it.next(); <BUG>for (XmlPipelineRaw rawP : pipelinesXML) { if (!rawP.type.equals(XmlPipelineRaw.PIPELINE_TYPE.FILE_ANALYSIS.toString...
for (IngestModuleLoader.XmlPipelineRaw rawP : pipelinesXML) { if (!rawP.type.equals(IngestModuleLoader.XmlPipelineRaw.PIPELINE_TYPE.FILE_ANALYSIS.toString())) {
36,324
if (!rawP.type.equals(XmlPipelineRaw.PIPELINE_TYPE.FILE_ANALYSIS.toString())) { </BUG> continue; //skip } <BUG>for (XmlModuleRaw rawM : rawP.modules) { </BUG> if (foundClass.getName().equals(rawM.location)) { exists = true; break;
boolean modulesChanged = false; it = fileModules.iterator(); while (it.hasNext()) { boolean exists = false; Class<IngestModuleAbstractFile> foundClass = (Class<IngestModuleAbstractFile>) it.next(); for (IngestModuleLoader.XmlPipelineRaw rawP : pipelinesXML) { if (!rawP.type.equals(IngestModuleLoader.XmlPipelineRaw.PIPE...
36,325
break; } } if (exists == false) { logger.log(Level.INFO, "Discovered a new file module to load: " + foundClass.getName()); <BUG>addModuleToRawPipeline(foundClass, XmlPipelineRaw.PIPELINE_TYPE.FILE_ANALYSIS); </BUG> modulesChanged = true; } }
if (exists == true) { addModuleToRawPipeline(foundClass, IngestModuleLoader.XmlPipelineRaw.PIPELINE_TYPE.FILE_ANALYSIS);
36,326
if (!rawP.type.equals(XmlPipelineRaw.PIPELINE_TYPE.IMAGE_ANALYSIS.toString())) { </BUG> continue; //skip } <BUG>for (XmlModuleRaw rawM : rawP.modules) { </BUG> if (foundClass.getName().equals(rawM.location)) { exists = true; break;
for (IngestModuleLoader.XmlModuleRaw rawM : rawP.modules) {
36,327
} catch (SAXException e) { logger.log(Level.SEVERE, "Error loading pipeline configuration: can't parse XML.", e); } catch (IOException e) { logger.log(Level.SEVERE, "Error loading pipeline configuration: can't read file.", e); } <BUG>try{ PlatformUtil.xmlIsValid(ret, PlatformUtil.pipelineXSD); } catch(SAXException e){...
[DELETED]
36,328
if (root == null) { String msg = "Error loading pipeline configuration: invalid file format."; logger.log(Level.SEVERE, msg); throw new IngestModuleLoaderException(msg); } <BUG>NodeList pipelineNodes = root.getElementsByTagName(XmlPipelineRaw.XML_PIPELINE_EL); </BUG> int numPipelines = pipelineNodes.getLength(); if (nu...
NodeList pipelineNodes = root.getElementsByTagName(IngestModuleLoader.XmlPipelineRaw.XML_PIPELINE_EL);
36,329
import java.util.List; import java.util.Map; </BUG> import static org.dalesbred.internal.utils.Primitives.wrap; import static org.dalesbred.internal.utils.TypeUtils.*; <BUG>final class ConversionMap { private final Map<Type, List<TypeConversion<?,?>>> mappings = new HashMap<>();</BUG> void register(@NotNull TypeConvers...
package org.dalesbred.instantiation; import org.jetbrains.annotations.NotNull; import java.lang.reflect.Type; import java.util.*; @NotNull private final Map<Type, List<TypeConversion<?,?>>> mappings = new HashMap<>();
36,330
if (registeredInstantiator != null) return registeredInstantiator; if (types.size() == 1) { @SuppressWarnings("unchecked") TypeConversion<Object, ? extends T> conversion = <BUG>(TypeConversion<Object, ? extends T>) findConversionFromDbValue(types.getType(0), type); </BUG> if (conversion != null) return new ConversionIn...
(TypeConversion<Object, ? extends T>) findConversionFromDbValue(types.getType(0), type).orElse(null);
36,331
Class<T> cl = (Class<T>) rawType(type); if (!isPublic(cl.getModifiers())) throw new InstantiationException(type + " can't be instantiated reflectively because it is not public"); for (Constructor<T> constructor : constructorsSortedByDescendingParameterCount(cl)) { if (!constructor.isAnnotationPresent(DalesbredIgnore.cl...
Instantiator<T> instantiator = instantiatorFrom(constructor, types).orElse(null);
36,332
public List getPointsEarnedSortedGradeRecords(GradableObject gradableObject, Collection studentUids); public List getPointsEarnedSortedAllGradeRecords(Long gradebookId, Collection studentUids); public List getPointsEarnedSortedAllGradeRecords(Long gradebookId); public boolean isExplicitlyEnteredCourseGradeRecords(Long ...
public Set updateAssignmentGradeRecords(GradeRecordSet gradeRecordSet) public void updateCourseGradeRecords(GradeRecordSet gradeRecordSet)
36,333
private void addBuffer() { try { if (!isClosed && bufferQueue.size() <= BUFFER_QUEUE_SIZE) bufferQueue.put(new byte[size]); } catch (InterruptedException e) { <BUG>LOGGER.log(LogLevel.INFO, "Unable to add buffer to buffer queue", e); }</BUG> } } public AsyncBufferWriter(OutputStream outputStream, int size, ThreadFactor...
LOGGER.log(LogLevel.INFO, Messages.getString("HDFS_ASYNC_UNABLE_ADD_TO_QUEUE"), e);
36,334
isClosed = true; exService.shutdown(); try { exService.awaitTermination(Integer.MAX_VALUE, TimeUnit.SECONDS); } catch (InterruptedException e) { <BUG>LOGGER.log(LogLevel.WARN, "Execution Service shutdown is interrupted.", e); }finally {</BUG> flushNow(); out.close(); bufferQueue.clear();
LOGGER.log(LogLevel.WARN, Messages.getString("HDFS_ASYNC_SERVICE_SHUTDOWN_INTERRUPTED"), e); }finally {
36,335
opened(); return conn; } public boolean absolute(final int p) throws XQException { final SeqIter seq = sequence(); <BUG>cursor(seq, p >= 0 ? p - 1 : seq.size + p); </BUG> return pos > 0; } public void afterLast() throws XQException {
cursor(seq, p >= 0 ? p - 1 : seq.size() + p);
36,336
public Object getObject() throws XQException { return item().getObject(); } public int getPosition() throws XQException { final SeqIter iter = sequence(); <BUG>return pos != -1 ? pos : iter.size + 1; </BUG> } public synchronized XMLStreamReader getSequenceAsStream() throws XQException { opened();
return pos != -1 ? pos : iter.size() + 1;
36,337
sequence(); return pos == -1; } public boolean isBeforeFirst() throws XQException { sequence(); <BUG>return pos == 0 && pos < sequence().size; </BUG> } public boolean isFirst() throws XQException { sequence();
return pos == 0 && pos < sequence().size();
36,338
public boolean isFirst() throws XQException { sequence(); return pos == 1; } public boolean isLast() throws XQException { <BUG>return pos == sequence().size; </BUG> } public boolean isOnItem() throws XQException { opened();
return pos == sequence().size();
36,339
opened(); return scrollable; } public boolean last() throws XQException { final SeqIter seq = sequence(); <BUG>return cursor(seq, seq.size - 1); </BUG> } public boolean next() throws XQException { opened();
return pos > 0; public boolean isScrollable() throws XQException { return cursor(seq, seq.size() - 1);
36,340
import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.math.BigInteger; import java.util.ArrayList; <BUG>import java.util.Collection; import static com.n1analytics.paillier.TestConfiguration.CONFIGURATIONS;</BUG> import static com.n1analyt...
import java.util.Random; import static com.n1analytics.paillier.TestConfiguration.CONFIGURATIONS;
36,341
@RunWith(Parameterized.class) @Category(SlowTests.class) public class AdditionTest { private PaillierContext context; private PaillierPrivateKey privateKey; <BUG>static private int maxIteration = 100; @Parameterized.Parameters</BUG> public static Collection<Object[]> configurations() { Collection<Object[]> configuratio...
static private int MAX_ITERATIONS = TestConfiguration.MAX_ITERATIONS; @Parameterized.Parameters
36,342
} }}; BinaryAdder4 binaryAdders4[] = new BinaryAdder4[]{new BinaryAdder4() {</BUG> @Override public EncodedNumber eval(EncodedNumber arg1, EncodedNumber arg2) { return arg1.add(arg2); } <BUG>}, new BinaryAdder4() { @Override</BUG> public EncodedNumber eval(EncodedNumber arg1, EncodedNumber arg2) {
}, new EncodedToEncodedAdder() { return arg2.add(arg1);
36,343
return context.add(arg2, arg1); } }}; <BUG>void testDoubleAddition(BinaryAdder1 adder) { double a, b, plainResult, decodedResult, tolerance; EncryptedNumber ciphertTextA, ciphertTextB, encryptedResult; EncodedNumber decryptedResult; for(int i = 0; i < maxIteration; i++) { a = randomFiniteDouble();</BUG> b = randomFini...
@Test public void testDoubleAddition() { EncryptedNumber cipherTextA, cipherTextA_obf, cipherTextB, cipherTextB_obf, encryptedResult; EncodedNumber encodedA, encodedB, encodedResult, decryptedResult; Random rnd = new Random(); int maxExponentDiff = (int)(0.5 * context.getPublicKey().getModulus().bitLength() / (Math.log...
36,344
@RunWith(Parameterized.class) @Category(SlowTests.class) public class DivisionTest { private PaillierContext context; private PaillierPrivateKey privateKey; <BUG>static private int maxIteration = 100; @Parameters</BUG> public static Collection<Object[]> configurations() { Collection<Object[]> configurationParams = new ...
static private int maxIteration = TestConfiguration.MAX_ITERATIONS; @Parameters
36,345
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG>...
public class ErrorController { @RequestMapping(value = {"/404"})
36,346
package wew.water.gpf; <BUG>import org.esa.beam.framework.gpf.OperatorException; public class ChlorophyllNetworkOperation implements NeuralNetworkOperation { @Override public void compute(float[] in, float[] out, int mask, int errMask, float a) {</BUG> if(in.length != getNumberOfInputNodes()) {
public class ChlorophyllNetworkOperation { public static int compute(float[] in, float[] out) {
36,347
if(in.length != getNumberOfInputNodes()) { throw new IllegalArgumentException("Wrong input array size"); } if(out.length != getNumberOfOutputNodes()) { throw new IllegalArgumentException("Wrong output array size"); <BUG>} NeuralNetworkComputer.compute(in, out, mask, errMask, a, </BUG> NeuralNetworkConstants.INPUT_SCALE...
final int[] rangeCheckErrorMasks = { WaterProcessorOp.RESULT_ERROR_VALUES[1], WaterProcessorOp.RESULT_ERROR_VALUES[2] }; return NeuralNetworkComputer.compute(in, out, rangeCheckErrorMasks,
36,348
+4.332827e-01, +4.453712e-01, -2.355489e-01, +4.329192e-02, -3.259577e-02, +4.245090e-01, -1.132328e-01, +2.511418e-01, -1.995074e-01, +1.797701e-01, -3.817864e-01, +2.854951e-01, }, }; <BUG>private final double[][] input_hidden_weights = new double[][]{ </BUG> { -5.127986e-01, +5.872741e-01, +4.411426e-01, +1.344507e+...
private static final double[][] input_hidden_weights = new double[][]{
36,349
-1.875955e-01, +7.851294e-01, -1.226189e+00, -1.852845e-01, +9.392875e-01, +9.886471e-01, +8.400441e-01, -1.657109e+00, +8.292500e-01, +6.291445e-01, +1.855838e+00, +7.817575e-01, }, }; <BUG>private final double[][] input_intercept_and_slope = new double[][]{ </BUG> {+4.165578e-02, +1.161174e-02}, {+3.520901e-02, +1.06...
private static final double[][] input_intercept_and_slope = new double[][]{
36,350
{+2.468300e-01, +8.368545e-01}, {-6.613120e-01, +1.469582e+00}, {-6.613120e-01, +1.469582e+00}, {+7.501110e-01, +2.776545e-01}, }; <BUG>private final double[][] output_weights = new double[][]{ </BUG> {-6.498447e+00,}, {-1.118659e+01,}, {+7.141798e+00,},
private static final double[][] output_weights = new double[][]{
36,351
package wew.water.gpf; public class NeuralNetworkComputer { <BUG>public static void compute(float[] in, float[] out, int mask, int errMask, float a, </BUG> double[][] input_scale_limits, double[] input_scale_offset_factors, int[] input_scale_flag,
public static int compute(float[] in, float[] out, int[] rangeCheckErrorMasks,
36,352
package wew.water.gpf; <BUG>public class AtmosphericCorrectionNetworkOperation implements NeuralNetworkOperation { @Override public void compute(float[] in, float[] out, int mask, int errMask, float a) { if(in.length != getNumberOfInputNodes()) { </BUG> throw new IllegalArgumentException("Wrong input array size");
import java.util.Arrays; public class AtmosphericCorrectionNetworkOperation { public static int compute(float[] in, float[] out) { if (in.length != getNumberOfInputNodes()) {
36,353
public ReportElement getBase() { return base; } @Override public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException { <BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pag...
PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo); PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
36,354
public PdfTextStyle(String config) { Assert.hasText(config); String[] split = config.split(","); Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000"); fontSize = Integer.parseInt(split[0]); <BUG>font = resolveStandard14Name(split[1]); color = new Color(Integer.valueOf(split[2].substring(1),...
font = getFont(split[1]); color = new Color(Integer.valueOf(split[2].substring(1), 16));
36,355
package cc.catalysts.boot.report.pdf.elements; import cc.catalysts.boot.report.pdf.config.PdfTextStyle; import cc.catalysts.boot.report.pdf.utils.ReportAlignType; import org.apache.pdfbox.pdmodel.PDPageContentStream; <BUG>import org.apache.pdfbox.pdmodel.font.PDFont; import org.slf4j.Logger;</BUG> import org.slf4j.Logg...
import org.apache.pdfbox.pdmodel.font.PDType1Font; import org.apache.pdfbox.util.Matrix; import org.slf4j.Logger;
36,356
addTextSimple(stream, textConfig, textX, nextLineY, ""); return nextLineY; } try { <BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText); </BUG> float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]); if (!underline) { addTextSimple(stream, ...
String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
36,357
public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { try { stream.setFont(textConfig.getFont(), textConfig.getFontSize()); stream.setNonStrokingColor(textConfig.getColor()); stream.beginText(); <BUG>stream.newLineAtOffset(textX, textY); stream.sh...
stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY)); stream.showText(text);
36,358
public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) { addTextSimple(stream, textConfig, textX, textY, text); try { float lineOffset = textConfig.getFontSize() / 8F; stream.setStrokingColor(textConfig.getColor()); <BUG>stream.setLineWidth...
stream.moveTo(textX, textY - lineOffset); stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
36,359
list.add(text.length()); return list; } public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) { String endPart = ""; <BUG>String shortenedText = text; List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); ...
List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList()); if (breakSplitted.size() > 1) {
36,360
package cc.catalysts.boot.report.pdf.elements; import org.apache.pdfbox.pdmodel.PDDocument; <BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream; import java.io.IOException;</BUG> import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList;
import org.apache.pdfbox.pdmodel.PDPageContentStream; import java.io.IOException;
36,361
gen.writeString(text); } gen.writeEndArray(); gen.close(); byte[] docData = bow.toByteArray(); <BUG>JsonParser jp = FACTORY.createParser(new ByteArrayInputStream(docData)); assertEquals(JsonToken.START_ARRAY, jp.nextToken()); JsonToken t = jp.nextToken(); assertEquals(JsonToken.VALUE_STRING, t); String act = jp.getText...
JsonParser p = FACTORY.createParser(new ByteArrayInputStream(docData)); assertEquals(JsonToken.START_ARRAY, p.nextToken()); JsonToken t = p.nextToken(); String act = p.getText(); if (!text.equals(act)) {
36,362
break; } } fail("Strings differ at position #"+i+" (len "+text.length()+"): expected char 0x"+Integer.toHexString(text.charAt(i))+", actual 0x"+Integer.toHexString(act.charAt(i))); } <BUG>assertEquals(JsonToken.END_ARRAY, jp.nextToken()); assertEquals(null, jp.nextToken()); jp.close(); }</BUG> private void doTestLonger...
assertEquals(JsonToken.END_ARRAY, p.nextToken()); assertEquals(null, p.nextToken());
36,363
offset += len; } gen.writeEndArray(); gen.close(); byte[] docData = bow.toByteArray(); <BUG>JsonParser jp = FACTORY.createParser(new ByteArrayInputStream(docData)); assertEquals(JsonToken.START_ARRAY, jp.nextToken()); offset = 0; while (jp.nextToken() == JsonToken.VALUE_STRING) { String act = jp.getText(); String exp =...
JsonParser p = FACTORY.createParser(new ByteArrayInputStream(docData)); assertEquals(JsonToken.START_ARRAY, p.nextToken()); while (p.nextToken() == JsonToken.VALUE_STRING) { String act = p.getText(); String exp = text.substring(offset, offset+act.length());
36,364
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> a[i][j] = operator.applyAsBoolean(a[i][j]); }
public boolean[] row(final int rowIndex) { N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex); return a[rowIndex];
36,365
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j]); }
public boolean get(final int i, final int j) { return a[i][j];
36,366
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j], c[i][j]); }
return new BooleanMatrix(c);
36,367
} public AsyncExecutor(int maxConcurrentThreadNumber, long keepAliveTime, TimeUnit unit) { this.maxConcurrentThreadNumber = maxConcurrentThreadNumber; this.keepAliveTime = keepAliveTime; this.unit = unit; <BUG>} public AsyncExecutor(final ExecutorService executorService) { this(8, 300, TimeUnit.SECONDS); this.executorS...
[DELETED]
36,368
results.add(execute(cmd)); } return results; } public <T> CompletableFuture<T> execute(final Callable<T> command) { <BUG>final CompletableFuture<T> future = new CompletableFuture<T>(this, command); getExecutorService().execute(future);</BUG> return future; } public <T> List<CompletableFuture<T>> execute(final Callable<...
final CompletableFuture<T> future = new CompletableFuture<>(this, command); getExecutorService().execute(future);
36,369
import de.vanita5.twittnuker.receiver.NotificationReceiver; import de.vanita5.twittnuker.service.LengthyOperationsService; import de.vanita5.twittnuker.util.ActivityTracker; import de.vanita5.twittnuker.util.AsyncTwitterWrapper; import de.vanita5.twittnuker.util.DataStoreFunctionsKt; <BUG>import de.vanita5.twittnuker.u...
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
36,370
final List<InetAddress> addresses = mDns.lookup(host); for (InetAddress address : addresses) { c.addRow(new String[]{host, address.getHostAddress()}); } } catch (final IOException ignore) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, ignore); }</BUG> }
DebugLog.w(LOGTAG, null, ignore);
36,371
@Override public void afterExecute(Bus handler, SingleResponse<Relationship> result) { if (result.hasData()) { handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData())); } else if (result.hasException()) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, "Unable to update friendship", result.getExcepti...
public UserKey[] getAccountKeys() { return DataStoreUtils.getActivatedAccountKeys(context);
36,372
MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId); if (!Utils.isOfficialCredentials(context, accountId)) continue; try { microBlog.setActivitiesAboutMeUnread(cursor); } catch (MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
36,373
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBannerImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.form...
if (deleteImage) { Utils.deleteMedia(context, imageUri);
36,374
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); twitter.updateProfileBackgroundImage(fileBody, tile); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, S...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
36,375
FileBody fileBody = null; try { fileBody = getFileBody(context, imageUri); return twitter.updateProfileImage(fileBody); } finally { <BUG>Utils.closeSilently(fileBody); if (deleteImage && "file".equals(imageUri.getScheme())) { final File file = new File(imageUri.getPath()); if (!file.delete()) { Log.w(LOGTAG, String.for...
twitter.updateProfileBannerImage(fileBody); if (deleteImage) { Utils.deleteMedia(context, imageUri);
36,376
import de.vanita5.twittnuker.annotation.CustomTabType; import de.vanita5.twittnuker.library.MicroBlog; import de.vanita5.twittnuker.library.MicroBlogException; import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus; import de.vanita5.twittnuker.library.twitter.model.Status; <BUG>import de.vanita5.twittnuker...
import org.mariotaku.pickncrop.library.PNCUtils; import org.mariotaku.sqliteqb.library.AllColumns;
36,377
context.getApplicationContext().sendBroadcast(intent); } } @Nullable public static Location getCachedLocation(Context context) { <BUG>if (BuildConfig.DEBUG) { Log.v(LOGTAG, "Fetching cached location", new Exception()); }</BUG> Location location = null;
DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
36,378
import java.util.List; import java.util.Map.Entry; import javax.inject.Singleton; import okhttp3.Dns; @Singleton <BUG>public class TwidereDns implements Constants, Dns { </BUG> private static final String RESOLVER_LOGTAG = "TwittnukerDns"; private final SharedPreferences mHostMapping; private final SharedPreferencesWra...
public class TwidereDns implements Dns, Constants {
36,379
for (Location location : twitter.getAvailableTrends()) { map.put(location); } return map.pack(); } catch (final MicroBlogException e) { <BUG>if (BuildConfig.DEBUG) { Log.w(LOGTAG, e); }</BUG> }
DebugLog.w(LOGTAG, null, e);
36,380
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> a[i][j] = operator.applyAsBoolean(a[i][j]); }
public boolean[] row(final int rowIndex) { N.checkArgument(rowIndex >= 0 && rowIndex < n, "Invalid row Index: %s", rowIndex); return a[rowIndex];
36,381
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j]); }
public boolean get(final int i, final int j) { return a[i][j];
36,382
} } }); } } else { <BUG>if (n <= m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) {</BUG> result[i][j] = zipFunction.apply(a[i][j], b[i][j], c[i][j]); }
return new BooleanMatrix(c);
36,383
} public AsyncExecutor(int maxConcurrentThreadNumber, long keepAliveTime, TimeUnit unit) { this.maxConcurrentThreadNumber = maxConcurrentThreadNumber; this.keepAliveTime = keepAliveTime; this.unit = unit; <BUG>} public AsyncExecutor(final ExecutorService executorService) { this(8, 300, TimeUnit.SECONDS); this.executorS...
[DELETED]
36,384
results.add(execute(cmd)); } return results; } public <T> CompletableFuture<T> execute(final Callable<T> command) { <BUG>final CompletableFuture<T> future = new CompletableFuture<T>(this, command); getExecutorService().execute(future);</BUG> return future; } public <T> List<CompletableFuture<T>> execute(final Callable<...
final CompletableFuture<T> future = new CompletableFuture<>(this, command); getExecutorService().execute(future);
36,385
import com.fincatto.nfe310.FabricaDeObjetosFake; import org.junit.Assert; import org.junit.Test; import java.math.BigDecimal; import java.util.ArrayList; <BUG>import java.util.Arrays; import java.util.List;</BUG> public class NFEnviaEventoCancelamentoTest { @Test public void deveObterEventosComoFoiSetado() {
import java.util.Collections; import java.util.List;
36,386
import com.fincatto.nfe310.FabricaDeObjetosFake; import com.fincatto.nfe310.classes.nota.NFNota; import org.junit.Assert; import org.junit.Test; import java.util.ArrayList; <BUG>import java.util.Arrays; import java.util.List;</BUG> public class NFLoteEnvioTest { @Test public void devePermitirNotasComTamanho50() {
import java.util.Collections; import java.util.List;
36,387
public void deveGerarXMLDeAcordoComOPadraoEstabelecido() { final NFLoteEnvio loteEnvio = new NFLoteEnvio(); loteEnvio.setIdLote("333972757970401"); loteEnvio.setVersao("3.10"); loteEnvio.setIndicadorProcessamento(NFLoteIndicadorProcessamento.PROCESSAMENTO_ASSINCRONO); <BUG>loteEnvio.setNotas(Arrays.asList(FabricaDeObje...
loteEnvio.setNotas(Collections.singletonList(FabricaDeObjetosFake.getNFNota()));
36,388
import org.joda.time.DateTime; import org.joda.time.LocalDate; import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayList; <BUG>import java.util.Arrays; public class FabricaDeObjetosFake {</BUG> public static NFInformacaoImpostoDevolvido getNFInformacaoImpostoDevolvido() { final NFInformacaoIm...
import java.util.Collections; public class FabricaDeObjetosFake {
36,389
info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFN...
info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe()));
36,390
imposto.setValorTotalTributos(new BigDecimal("999999999999.99")); item.setImposto(imposto); item.setNumeroItem(990); item.setProduto(FabricaDeObjetosFake.getProdutoMedicamento()); item.setImpostoDevolvido(FabricaDeObjetosFake.getNFImpostoDevolvido()); <BUG>info.setItens(Arrays.asList(item)); info.setRetirada(FabricaDeO...
info.setItens(Collections.singletonList(item)); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal());
36,391
identificacao.setFormaPagamento(NFFormaPagamentoPrazo.A_PRAZO); identificacao.setModelo(NFModelo.NFE); identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); <BUG>ident...
identificacao.setReferenciadas(Collections.singletonList(referenciada));
36,392
produtoMedicamento.setCfop("1302"); produtoMedicamento.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produtoMedicamento.setCodigoDeBarras("36811963532505"); produtoMedicamento.setCodigoDeBarrasTributavel("36811963532505"); produtoMedicamento.setCampoeValorNota(NFProdutoCompoeValorNota.SIM);...
produtoMedicamento.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao()));
36,393
produtoMedicamento.setValorSeguro(new BigDecimal("999999999999.99")); produtoMedicamento.setValorTotalBruto(new BigDecimal("999999999999.99")); produtoMedicamento.setValorUnitario(new BigDecimal("9999999999.9999999999")); produtoMedicamento.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produtoMed...
produtoMedicamento.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123"));
36,394
info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("3.10")); <BUG>info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutori...
info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe()));
36,395
identificacao.setFormaPagamento(NFFormaPagamentoPrazo.A_PRAZO); identificacao.setModelo(NFModelo.NFE); identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); <BUG>ident...
identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada()));
36,396
return compra; } public static NFNotaInfoCobranca getNFNotaInfoCobranca() { final NFNotaInfoCobranca cobranca = new NFNotaInfoCobranca(); cobranca.setFatura(FabricaDeObjetosFake.getNFNotaInfoFatura()); <BUG>cobranca.setDuplicatas(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoDuplicata())); </BUG> return cobranca; } p...
cobranca.setDuplicatas(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoDuplicata()));
36,397
</BUG> produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); produto.setCodigoEspecificadorSituacaoTributaria("9999999"); <BUG>produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoIte...
produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); produto.setDeclaracoesImportacao(Collections.singleton...
36,398
produto.setValorFrete(new BigDecimal("999999999999.99")); produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999"...
produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123"));
36,399
medicamento.setQuantidade(new BigDecimal("9999999.999")); return medicamento; } public static NFNotaInfoItemProdutoDeclaracaoImportacao getNFNotaInfoItemProdutoDeclaracaoImportacao() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); <BUG>declaraoImpo...
declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao()));
36,400
public static NFNotaInfoVolume getNFNotaInfoVolume() { final NFNotaInfoVolume volume = new NFNotaInfoVolume(); volume.setEspecieVolumesTransportados("3Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecb"); final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre(); notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLb...
volume.setLacres(Collections.singletonList(notaInfoLacre));