id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
42,801
public final IClassPathItem getModuleWithDependenciesClassPathItem() { return SModuleOperations.getModuleWithDependenciesClassPathItem(this); } @Deprecated protected final void invalidateClassPath() { <BUG>getJavaFacet().invalidateClassPath(); </BUG> } @Override @Deprecated
((JavaModuleFacetImpl) getJavaFacet()).invalidateClassPath();
42,802
Patient getPatient(String id); List<Patient> searchPatientsById(String id); List<Patient> searchPatientsByIdentifier(String identifierValue, String identifierTypeName); List<Patient> searchPatientsByIdentifier(String identifierValue); List<Patient> searchPatients(boolean active); <BUG>List<Patient> searchPatientsByGivenName(String givenName); List<Patient> searchPatientsByFamilyName(String familyName); List<Patient> searchPatientsByName(String name); </BUG> public Bundle getPatientOperationsById(String patientId);
Bundle searchPatientsByGivenName(String givenName); Bundle searchPatientsByFamilyName(String familyName); Bundle searchPatientsByName(String name);
42,803
</BUG> return patientResource.searchByFamilyName(theFamilyName); } @Search() <BUG>public List<Patient> findPatientsByName(@RequiredParam(name = Patient.SP_NAME) StringParam name) { </BUG> return patientResource.searchByName(name); } @Search() public List<Patient> searchPatientsByIdentifier(@RequiredParam(name = Patient.SP_IDENTIFIER) TokenParam identifier) {
public List<Patient> searchPatientByUniqueId(@RequiredParam(name = Patient.SP_RES_ID) TokenParam id) { return patientResource.searchByUniqueId(id); public Bundle findPatientsByFamilyName(@RequiredParam(name = Patient.SP_FAMILY) StringParam theFamilyName) { public Bundle findPatientsByName(@RequiredParam(name = Patient.SP_NAME) StringParam name) {
42,804
String args[] = theConditional.split("?"); String parameterPart = args[1]; String paraArgs[] = parameterPart.split("="); parameterName = paraArgs[0]; paramValue = paraArgs[1]; <BUG>} catch (Exception e) { // will catch nullpointerexceptions and indexoutofboundexceptions </BUG> operationoutcome = new OperationOutcome(); operationoutcome.addIssue().setDetails("Please check Condition URL format");
} catch (Exception e) { // will catch nullpointerexceptions and indexoutofboundexceptions
42,805
package org.openmrs.module.fhir.api; <BUG>import ca.uhn.fhir.model.dstu2.composite.IdentifierDt; import ca.uhn.fhir.model.dstu2.resource.Bundle; import ca.uhn.fhir.model.dstu2.resource.Patient; import org.junit.Before;</BUG> import org.junit.Test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.List; import org.junit.Before;
42,806
return fhirPatientList; } public List<Patient> searchPatientsByIdentifier(String identifier) { org.openmrs.api.PatientService patientService = Context.getPatientService(); List<PatientIdentifierType> allPatientIdentifierTypes = patientService.getAllPatientIdentifierTypes(); <BUG>List<org.openmrs.Patient> patientList = patientService.getPatients(null, identifier, allPatientIdentifierTypes, true); List<Patient> fhirPatientList = new ArrayList<Patient>();</BUG> for (org.openmrs.Patient patient : patientList) { fhirPatientList.add(FHIRPatientUtil.generatePatient(patient));
List<org.openmrs.Patient> patientList = patientService .getPatients(null, identifier, allPatientIdentifierTypes, true); List<Patient> fhirPatientList = new ArrayList<Patient>();
42,807
fhirPatientList.add(FHIRPatientUtil.generatePatient(patient));</BUG> } } } } <BUG>return fhirPatientList; } public List<Patient> searchPatientsByFamilyName(String familyName) { </BUG> List<org.openmrs.Patient> patients = searchPatientByQuery(familyName);
public List<Patient> searchPatientsByIdentifier(String identifier) { org.openmrs.api.PatientService patientService = Context.getPatientService(); List<PatientIdentifierType> allPatientIdentifierTypes = patientService.getAllPatientIdentifierTypes(); List<org.openmrs.Patient> patientList = patientService .getPatients(null, identifier, allPatientIdentifierTypes, true);
42,808
fhirPatientList.add(FHIRPatientUtil.generatePatient(patient));</BUG> } } } } <BUG>return fhirPatientList; } public List<Patient> searchPatientsByName(String name) { </BUG> List<org.openmrs.Patient> patients = searchPatientByQuery(name);
public List<Patient> searchPatientsByIdentifier(String identifier) { org.openmrs.api.PatientService patientService = Context.getPatientService(); List<PatientIdentifierType> allPatientIdentifierTypes = patientService.getAllPatientIdentifierTypes(); List<org.openmrs.Patient> patientList = patientService .getPatients(null, identifier, allPatientIdentifierTypes, true);
42,809
Bundle.Entry patient = bundle.addEntry(); patient.setResource(FHIRPatientUtil.generatePatient(omsrPatient)); for (Encounter enc : Context.getEncounterService().getEncountersByPatient(omsrPatient)) { encounterService.getEncounterOperationsById(enc.getUuid(), bundle, false); } <BUG>for (FamilyMemberHistory familyHistory : familyHistoryService.searchFamilyHistoryByPersonId( omsrPatient.getUuid())) { bundle.addEntry().setResource(familyHistory);</BUG> }
for (FamilyMemberHistory familyHistory : familyHistoryService.searchFamilyHistoryByPersonId(omsrPatient bundle.addEntry().setResource(familyHistory);
42,810
throw new UnprocessableEntityException(errorMessage.toString()); } org.openmrs.api.PatientService patientService = Context.getPatientService(); try { omrsPatient = patientService.savePatient(omrsPatient); <BUG>} catch (Exception e) { </BUG> StringBuilder errorMessage = new StringBuilder("The request cannot be processed due to the following issues \n"); errorMessage.append(e.getMessage());
} catch (Exception e) {
42,811
List<String> errors = new ArrayList<String>(); org.openmrs.Patient omrsPatient = FHIRPatientUtil.generateOmrsPatient(patient, errors); retrievedPatient = FHIRPatientUtil.updatePatientAttributes(omrsPatient, retrievedPatient); try { Context.getPatientService().savePatient(retrievedPatient); <BUG>} catch (Exception e) { </BUG> StringBuilder errorMessage = new StringBuilder( "The request cannot be processed due to the following issues \n");
} catch (Exception e) {
42,812
} else { List<NameValuePair> nameValuePairs = new ArrayList<>(); nameValuePairs.add(new BasicNameValuePair(SendDocument.CHATID_FIELD, sendDocument.getChatId())); nameValuePairs.add(new BasicNameValuePair(SendDocument.DOCUMENT_FIELD, sendDocument.getDocument())); if (sendDocument.getReplayMarkup() != null) { <BUG>nameValuePairs.add(new BasicNameValuePair(SendDocument.REPLYMARKUP_FIELD, sendDocument.getReplayMarkup().toString())); </BUG> } if (sendDocument.getReplayToMessageId() != null) { nameValuePairs.add(new BasicNameValuePair(SendDocument.REPLYTOMESSAGEID_FIELD, sendDocument.getReplayToMessageId().toString()));
nameValuePairs.add(new BasicNameValuePair(SendDocument.REPLYMARKUP_FIELD, sendDocument.getReplayMarkup().toJson().toString()));
42,813
package org.jboss.as.domain.controller.operations.coordination; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; <BUG>import java.util.Iterator; import java.util.Map;</BUG> import java.util.Set; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationContext.AttachmentKey;
import java.util.List; import java.util.Map;
42,814
import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationContext.AttachmentKey; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.ProxyController; import org.jboss.as.controller.descriptions.ModelDescriptionConstants; <BUG>import org.jboss.as.controller.descriptions.common.InterfaceDescription; import org.jboss.as.controller.operations.OperationAttachments;</BUG> import org.jboss.as.controller.operations.common.ResolveExpressionHandler; import org.jboss.as.controller.operations.common.SystemPropertyAddHandler; import org.jboss.as.controller.operations.common.SystemPropertyRemoveHandler;
import org.jboss.as.controller.operations.DomainOperationTransformer; import org.jboss.as.controller.operations.OperationAttachments;
42,815
final Boolean regularExpression = DeploymentOverlayDeploymentDefinition.REGULAR_EXPRESSION.resolveModelAttribute(context, model).asBoolean(); installServices(context, verificationHandler, newControllers, name, deploymentOverlay, regularExpression, priority); } static void installServices(final OperationContext context, final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers, final String name, final String deploymentOverlay, final boolean regularExpression, final DeploymentOverlayPriority priority) { final DeploymentOverlayLinkService service = new DeploymentOverlayLinkService(name, regularExpression, priority); <BUG>final ServiceName serviceName = DeploymentOverlayLinkService.SERVICE_NAME.append(name); </BUG> ServiceBuilder<DeploymentOverlayLinkService> builder = context.getServiceTarget().addService(serviceName, service) .addDependency(DeploymentOverlayIndexService.SERVICE_NAME, DeploymentOverlayIndexService.class, service.getDeploymentOverlayIndexServiceInjectedValue()) .addDependency(DeploymentOverlayService.SERVICE_NAME.append(deploymentOverlay), DeploymentOverlayService.class, service.getDeploymentOverlayServiceInjectedValue());
final ServiceName serviceName = DeploymentOverlayLinkService.SERVICE_NAME.append(deploymentOverlay).append(name);
42,816
package org.jboss.as.server.deploymentoverlay; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; <BUG>import java.net.MalformedURLException; import java.util.Arrays;</BUG> import java.util.List; import org.jboss.as.controller.AbstractAddStepHandler; import org.jboss.as.controller.AttributeDefinition;
import java.util.ArrayList; import java.util.Arrays;
42,817
import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.PathAddress; import org.jboss.as.controller.RunningMode; import org.jboss.as.controller.ServiceVerificationHandler; <BUG>import org.jboss.as.controller.descriptions.ModelDescriptionConstants; import org.jboss.as.controller.operations.OperationAttachments;</BUG> import org.jboss.as.controller.operations.validation.AbstractParameterValidator; import org.jboss.as.controller.operations.validation.ListValidator; import org.jboss.as.controller.operations.validation.ModelTypeValidator;
import org.jboss.as.controller.operations.CompositeOperationAwareTransformer; import org.jboss.as.controller.operations.DomainOperationTransformer; import org.jboss.as.controller.operations.OperationAttachments;
42,818
import java.util.Set; import java.util.concurrent.ExecutionException; import org.jboss.as.controller.OperationContext; import org.jboss.as.controller.OperationFailedException; import org.jboss.as.controller.OperationStepHandler; <BUG>import org.jboss.as.controller.ProxyController; import org.jboss.as.controller.operations.OperationAttachments;</BUG> import org.jboss.as.controller.remote.TransactionalProtocolClient; import org.jboss.dmr.ModelNode; public class DomainSlaveHandler implements OperationStepHandler {
import org.jboss.as.controller.operations.DomainOperationTransformer; import org.jboss.as.controller.operations.OperationAttachments;
42,819
final List<TransactionalProtocolClient.PreparedOperation<HostControllerUpdateTask.ProxyOperation>> results = new ArrayList<TransactionalProtocolClient.PreparedOperation<HostControllerUpdateTask.ProxyOperation>>(); final Map<String, HostControllerUpdateTask.ExecutedHostRequest> finalResults = new HashMap<String, HostControllerUpdateTask.ExecutedHostRequest>(); final HostControllerUpdateTask.ProxyOperationListener listener = new HostControllerUpdateTask.ProxyOperationListener(); for (Map.Entry<String, ProxyController> entry : hostProxies.entrySet()) { final String host = entry.getKey(); <BUG>final TransformingProxyController proxyController = (TransformingProxyController) entry.getValue(); ModelNode op = context.getAttachment(OperationAttachments.SLAVE_SERVER_OPERATION); if(op == null) { op = operation; }</BUG> final HostControllerUpdateTask task = new HostControllerUpdateTask(host, op.clone(), context, proxyController);
List<DomainOperationTransformer> transformers = context.getAttachment(OperationAttachments.SLAVE_SERVER_OPERATION_TRANSFORMERS); ModelNode op = operation; if(transformers != null) { for(final DomainOperationTransformer transformer : transformers) { op = transformer.transform(context, op); } }
42,820
import java.util.function.Function; import java.util.logging.Level; import javafx.application.Platform; import javafx.beans.Observable; import javafx.beans.value.ChangeListener; <BUG>import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent;</BUG> import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.MenuItem;
import javafx.collections.ObservableList; import javafx.event.ActionEvent;
42,821
categoryEventBus.unregister(listener); } synchronized public TagName getTagName(Category cat) { return catTagNameMap.getUnchecked(cat); } <BUG>public static Category fromTagName(TagName tagName) { </BUG> return Category.fromDisplayName(tagName.getDisplayName()); } public static boolean isCategoryTagName(TagName tName) {
public static Category categoryFromTagName(TagName tagName) {
42,822
public ReadOnlyDoubleProperty regroupProgress() { return regroupProgress.getReadOnlyProperty(); } @Subscribe public void handleTagAdded(ContentTagAddedEvent evt) { <BUG>if (groupBy == DrawableAttribute.TAGS || groupBy == DrawableAttribute.CATEGORY) { final GroupKey<TagName> groupKey = new GroupKey<>(DrawableAttribute.TAGS, evt.getAddedTag().getName()); final long fileID = evt.getAddedTag().getContent().getId();</BUG> DrawableGroup g = getGroupForKey(groupKey);
GroupKey<?> groupKey = null; if (groupBy == DrawableAttribute.TAGS) { groupKey = new GroupKey<TagName>(DrawableAttribute.TAGS, evt.getAddedTag().getName()); } else if (groupBy == DrawableAttribute.CATEGORY) { groupKey = new GroupKey<Category>(DrawableAttribute.CATEGORY, CategoryManager.categoryFromTagName(evt.getAddedTag().getName())); final long fileID = evt.getAddedTag().getContent().getId();
42,823
if (groupMap.containsKey(groupKey)) { group = groupMap.get(groupKey); group.setFiles(ObjectUtils.defaultIfNull(fileIDs, Collections.emptySet())); } else { group = new DrawableGroup(groupKey, fileIDs, groupSeen); <BUG>group.seenProperty().addListener((observable, oldSeen, newSeen) -> { markGroupSeen(group, newSeen);</BUG> }); groupMap.put(groupKey, group); }
group.seenProperty().addListener((o, oldSeen, newSeen) -> { markGroupSeen(group, newSeen);
42,824
message.getCompanyId(), MBMessage.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, message.getMessageId()); } mbMessagePersistence.remove(message); } <BUG>if (!rootMessage.isDiscussion()) { MBCategory category = mbCategoryPersistence.findByPrimaryKey(</BUG> thread.getCategoryId()); category.setThreadCount(category.getThreadCount() - 1); category.setMessageCount(
if (rootMessage.getCategoryId() > 0) { MBCategory category = mbCategoryPersistence.findByPrimaryKey(
42,825
package org.jenkinsci.plugins.workflow.multibranch; <BUG>import hudson.model.Result; import jenkins.branch.BranchSource; import jenkins.plugins.git.GitSampleRepoRule;</BUG> import jenkins.plugins.git.GitStep; import org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition;
import jenkins.branch.BranchProperty; import jenkins.branch.DefaultBranchPropertyStrategy; import jenkins.plugins.git.GitSampleRepoRule;
42,826
sampleRepo.write("Jenkinsfile", "echo \"said ${readTrusted 'message'}\""); sampleRepo.write("message", "how do you do"); sampleRepo.git("add", "Jenkinsfile", "message"); sampleRepo.git("commit", "--all", "--message=defined"); WorkflowMultiBranchProject mp = r.jenkins.createProject(WorkflowMultiBranchProject.class, "p"); <BUG>mp.getSourcesList().add(new BranchSource(new SCMBinderTest.WarySource(null, sampleRepo.toString(), "", "*", "", false))); </BUG> WorkflowJob p = WorkflowMultiBranchProjectTest.scheduleAndFindBranchProject(mp, "master"); r.waitUntilNoActivity(); WorkflowRun b = p.getLastBuild();
mp.getSourcesList().add(new BranchSource(new SCMBinderTest.WarySource(null, sampleRepo.toString(), "", "*", "", false), new DefaultBranchPropertyStrategy(new BranchProperty[0])));
42,827
sampleRepo.write("Jenkinsfile", "evaluate readTrusted('lib.groovy')"); sampleRepo.write("lib.groovy", "echo 'trustworthy library'"); sampleRepo.git("add", "Jenkinsfile", "lib.groovy"); sampleRepo.git("commit", "--all", "--message=defined"); WorkflowMultiBranchProject mp = r.jenkins.createProject(WorkflowMultiBranchProject.class, "p"); <BUG>mp.getSourcesList().add(new BranchSource(new SCMBinderTest.WarySource(null, sampleRepo.toString(), "", "*", "", false))); </BUG> WorkflowJob p = WorkflowMultiBranchProjectTest.scheduleAndFindBranchProject(mp, "master"); r.waitUntilNoActivity(); WorkflowRun b = p.getLastBuild();
mp.getSourcesList().add(new BranchSource(new SCMBinderTest.WarySource(null, sampleRepo.toString(), "", "*", "", false), new DefaultBranchPropertyStrategy(new BranchProperty[0])));
42,828
sampleRepo.write("Jenkinsfile", "echo \"said ${readTrusted 'message'}\""); sampleRepo.write("message", "how do you do"); sampleRepo.git("add", "Jenkinsfile", "message"); sampleRepo.git("commit", "--all", "--message=defined"); WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p"); <BUG>GitStep step = new GitStep(sampleRepo.toString()); step.setCredentialsId("nonexistent"); // TODO work around NPE pending https://github.com/jenkinsci/git-plugin/pull/467 p.setDefinition(new CpsScmFlowDefinition(step.createSCM(), "Jenkinsfile")); </BUG> WorkflowRun b = r.assertBuildStatusSuccess(p.scheduleBuild2(0));
p.setDefinition(new CpsScmFlowDefinition(new GitStep(sampleRepo.toString()).createSCM(), "Jenkinsfile"));
42,829
@Override public String getDisplayName() { return "Pipeline script from " + WorkflowBranchProjectFactory.SCRIPT; } } @Extension public static class HideMeElsewhere extends DescriptorVisibilityFilter { <BUG>@SuppressWarnings("rawtypes")</BUG> @Override public boolean filter(Object context, Descriptor descriptor) { if (descriptor instanceof DescriptorImpl) { return context instanceof WorkflowJob && ((WorkflowJob) context).getParent() instanceof WorkflowMultiBranchProject; } return true; } } }
[DELETED]
42,830
delegate.checkout(build, dir, listener, node.createLauncher(listener)); if (!file.exists()) { throw new AbortException(file + " not found"); } return file.readToString(); <BUG>} }</BUG> Branch branch = property.getBranch(); ItemGroup<?> parent = job.getParent(); if (!(parent instanceof WorkflowMultiBranchProject)) {
throw new AbortException("‘readTrusted’ is only available when using “" + Jenkins.getActiveInstance().getDescriptorByType(WorkflowMultiBranchProject.DescriptorImpl.class).getDisplayName() + "” or “" + Jenkins.getActiveInstance().getDescriptorByType(CpsScmFlowDefinition.DescriptorImpl.class).getDisplayName() + "”");
42,831
delegate.setChangelog(true); delegate.checkout(build, dir, listener, node.createLauncher(listener)); if (!file.exists()) { throw new AbortException(file + " not found"); } <BUG>content = file.readToString(); } } } if (trustCheck && !untrustedFile.equals(content)) { </BUG> throw new AbortException(Messages.ReadTrustedStep__has_been_modified_in_an_untrusted_revis(step.path));
[DELETED]
42,832
long t=t0; long pnext=t+printInterval_ms; boolean run = true; while (!endEvent && run) { SamplesEventsCount status = null; <BUG>try { System.out.println( TAG+" Waiting for " + (nSamples + trialLength_samp + 1) + " samples");</BUG> status = C.waitForSamples(nSamples + trialLength_samp + 1, this.timeout_ms); } catch (IOException e) { e.printStackTrace();
if ( VERB>1 ) System.out.println( TAG+" Waiting for " + (nSamples + trialLength_samp + 1) + " samples");
42,833
dv = null; continue; } t = System.currentTimeMillis(); if ( t > pnext ) { <BUG>System.out.println(TAG+ String.format("%d %d %5.3f (samp,event,sec)\r", status.nSamples,status.nEvents,(t-t0)/1000.0));</BUG> pnext = t+printInterval_ms; } int onSamples = nSamples;
System.out.println(String.format("%d %d %5.3f (samp,event,sec)\r", status.nSamples,status.nEvents,(t-t0)/1000.0));
42,834
try { data = new Matrix(new Matrix(C.getDoubleData(fromId, toId)).transpose()); } catch (IOException e) { e.printStackTrace(); } <BUG>if ( VERB>0 ) { </BUG> System.out.println(TAG+ String.format("Got data @ %d->%d samples", fromId, toId)); } Matrix f = new Matrix(classifiers.get(0).getOutputSize(), 1);
if ( VERB>1 ) {
42,835
ClassifierResult result = null; for (PreprocClassifier c : classifiers) { result = c.apply(data); f = new Matrix(f.add(result.f)); fraw = new Matrix(fraw.add(result.fraw)); <BUG>} double[] dvColumn = f.getColumn(0);</BUG> f = new Matrix(dvColumn.length - 1, 1); f.setColumn(0, Arrays.copyOfRange(dvColumn, 1, dvColumn.length)); if (normalizeLateralization){ // compute alphaLat score
if ( f.getRowDimension() > 1 ) { double[] dvColumn = f.getColumn(0);
42,836
f.setColumn(0, Arrays.copyOfRange(dvColumn, 1, dvColumn.length)); if (normalizeLateralization){ // compute alphaLat score f.setEntry(0, 0, (dvColumn[0] - dvColumn[1]) / (dvColumn[0] + dvColumn[1])); } else { f.setEntry(0, 0, dvColumn[0] - dvColumn[1]); <BUG>} if (dv == null || predictionFilter < 0) {</BUG> dv = f; } else { if (predictionFilter >= 0.) {// exponiential smoothing of predictions
if (dv == null || predictionFilter < 0) {
42,837
if (baselinePhase) { nBaseline++; dvBaseline = new Matrix(dvBaseline.add(dv)); dv2Baseline = new Matrix(dv2Baseline.add(dv.multiplyElements(dv))); if (nBaselineStep > 0 && nBaseline > nBaselineStep) { <BUG>System.out.println( "Baseline timeout\n"); </BUG> baselinePhase = false; Tuple<Matrix, Matrix> ret = baselineValues(dvBaseline, dv2Baseline, nBaseline); baseLineVal = ret.x;
if(VERB>1) System.out.println( "Baseline timeout\n");
42,838
Tuple<Matrix, Matrix> ret=baselineValues(dvBaseline,dv2Baseline,nBaseline); baseLineVal = ret.x; baseLineVar = ret.y; } } else if ( value.equals(baselineStart) ) { <BUG>System.out.println( "Baseline start event received"); </BUG> baselinePhase = true; nBaseline = 0; dvBaseline = Matrix.zeros(classifiers.get(0).getOutputSize() - 1, 1);
if(VERB>1)System.out.println(TAG+ "Baseline start event received");
42,839
package org.sleuthkit.autopsy.examples; import java.io.File; import java.io.FileOutputStream; <BUG>import java.io.IOException; import java.util.ArrayList;</BUG> import java.util.List; import java.util.logging.Level; import javax.xml.parsers.DocumentBuilder;
import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList;
42,840
import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; <BUG>import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.Logger;</BUG> import org.sleuthkit.autopsy.externalresults.ExternalResults; import org.sleuthkit.autopsy.externalresults.ExternalResultsImporter; import org.sleuthkit.autopsy.externalresults.ExternalResultsXMLParser;
import org.sleuthkit.autopsy.coreutils.ErrorInfo; import org.sleuthkit.autopsy.coreutils.ExecUtil; import org.sleuthkit.autopsy.coreutils.Logger;
42,841
import org.sleuthkit.datamodel.TskCoreException; import org.w3c.dom.Document; import org.w3c.dom.Element; public class SampleExecutableDataSourceIngestModule implements DataSourceIngestModule { private static final IngestModuleReferenceCounter refCounter = new IngestModuleReferenceCounter(); <BUG>private static final String moduleName = SampleExecutableIngestModuleFactory.getModuleName(); private long jobId; private String outputDirPath; @Override</BUG> public void startUp(IngestJobContext context) throws IngestModuleException {
private final String fileInCaseDatabase = "/WINDOWS/system32/ntmsapi.dll"; // Probably private String derivedFileInCaseDatabase; @Override
42,842
ExternalResultsImporter importer = new ExternalResultsImporter(); importer.importResults(results); </BUG> progressBar.progress(2); <BUG>} catch (TskCoreException | ParserConfigurationException | TransformerException | IOException ex) { </BUG> Logger logger = IngestServices.getInstance().getLogger(moduleName); logger.log(Level.SEVERE, "Failed to simulate analysis and results import", ex); //NON-NLS return ProcessResult.ERROR; }
errors.addAll(importer.importResults(results)); } catch (TskCoreException | InterruptedException | ParserConfigurationException | TransformerException | IOException ex) {
42,843
file.createNewFile(); } try (FileOutputStream fileStream = new FileOutputStream(file)) { fileStream.write(fileContents); fileStream.flush(); <BUG>} } private void generateSimulatedResultsFile(String dataSourcePath, List<String> derivedFilePaths, String reportPath, String resultsFilePath) throws ParserConfigurationException, TransformerConfigurationException, TransformerException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();</BUG> DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
return filePath; private void generateSimulatedResultsFile(List<String> derivedFilePaths, String reportPath, String resultsFilePath) throws ParserConfigurationException, TransformerConfigurationException, TransformerException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
42,844
byte [] existingValue = get(key); byte [] newValue = modifier.modify(existingValue); if (compareAndSwap(key, existingValue, newValue)) break; } } <BUG>public void increment(byte [] key, long amount) { </BUG> Count count = this.countermap.get(key); if (count == null) { count = new Count();
public long increment(byte [] key, long amount) {
42,845
Count count = this.countermap.get(key); if (count == null) { count = new Count(); this.countermap.put(key, count); } <BUG>count.count += amount; }</BUG> public long getCounter(byte [] key) { Count count = this.countermap.get(key); if (count == null) return 0L;
return count.count;
42,846
package com.continuuity.fabric.operations.impl; import com.continuuity.fabric.operations.ReadOperation; public class QueuePop implements ReadOperation<byte[]> { <BUG>private final byte [] queueName; public QueuePop(byte [] queueName) {</BUG> this.queueName = queueName; } public byte [] getQueueName() {
private byte [] result; public QueuePop(byte [] queueName) {
42,847
import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import com.continuuity.fabric.engine.memory.MemoryEngine; import com.continuuity.fabric.engine.memory.MemorySimpleExecutor; <BUG>import com.continuuity.fabric.operations.OperationExecutor; import com.continuuity.fabric.operations.WriteOperation;</BUG> import com.continuuity.fabric.operations.impl.CompareAndSwap; import com.continuuity.fabric.operations.impl.Increment; import com.continuuity.fabric.operations.impl.QueuePop;
import com.continuuity.fabric.operations.OperationGenerator; import com.continuuity.fabric.operations.WriteOperation;
42,848
generateRandomOrderKey(key), expectedValue, newValue); } public void readModifyWrite(byte [] key, Modifier<byte[]> modifier) { this.engine.readModifyWrite(generateRandomOrderKey(key), modifier); } <BUG>public void increment(byte [] key, long amount) { this.engine.increment(generateRandomOrderKey(key), amount); </BUG> }
public long increment(byte [] key, long amount) { return this.engine.increment(generateRandomOrderKey(key), amount);
42,849
package com.continuuity.fabric.operations.memory; import java.util.List; import java.util.Map; <BUG>import com.continuuity.fabric.engine.memory.MemorySimpleExecutor; import com.continuuity.fabric.operations.SimpleOperationExecutor;</BUG> import com.continuuity.fabric.operations.SyncReadTimeoutException; import com.continuuity.fabric.operations.WriteOperation; import com.continuuity.fabric.operations.impl.CompareAndSwap;
import com.continuuity.fabric.operations.OperationGenerator; import com.continuuity.fabric.operations.SimpleOperationExecutor;
42,850
return this.executor.compareAndSwap(cas.getKey(), cas.getExpectedValue(), cas.getNewValue()); } @Override public byte [] execute(Read read) throws SyncReadTimeoutException { <BUG>return this.executor.readRandom(read.getKey()); }</BUG> @Override public long execute(ReadCounter readCounter)
byte [] result = this.executor.readRandom(read.getKey()); read.setResult(result); return result;
42,851
import com.continuuity.fabric.operations.WriteOperation; public class Increment implements WriteOperation { </BUG> private byte [] key; <BUG>private long amount; public Increment(byte [] key, long amount) {</BUG> this.key = key; this.amount = amount; } public byte [] getKey() {
public class Increment implements WriteOperation, ReadOperation<Long> { private long incrementedValue; private OperationGenerator<Long> postOperationGenerator; public Increment(byte [] key, long amount) {
42,852
.anyMatch(var -> synthesizedVariables.get(var.getIndex()))) { insn.delete(); } else { insn.acceptVisitor(variableMapper); } <BUG>} }</BUG> } public static NullnessInformation build(Program program, MethodDescriptor methodDescriptor) { NullnessInformationBuilder builder = new NullnessInformationBuilder(program, methodDescriptor);
variableMapper.applyToPhis(block); variableMapper.applyToTryCatchBlocks(block);
42,853
<BUG>package org.teavm.model.optimization; import java.util.*; import java.util.function.UnaryOperator;</BUG> import org.teavm.common.DominatorTree;
import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.function.UnaryOperator;
42,854
for (Instruction currentInsn : block) { evaluatedConstant = null; currentInsn.acceptVisitor(optimizer); if (eliminate) { affected = true; <BUG>EmptyInstruction empty = new EmptyInstruction(); empty.setLocation(currentInsn.getLocation()); currentInsn.replace(empty); </BUG> eliminate = false;
currentInsn.delete();
42,855
List<Phi> phis = new ArrayList<>(blockToInline.getPhis()); blockToInline.getPhis().clear(); inlineBlock.getPhis().addAll(phis); List<TryCatchBlock> tryCatches = new ArrayList<>(blockToInline.getTryCatchBlocks()); blockToInline.getTryCatchBlocks().clear(); <BUG>inlineBlock.getTryCatchBlocks().addAll(tryCatches); }</BUG> BasicBlockMapper blockMapper = new BasicBlockMapper((BasicBlock b) -> program.basicBlockAt(b.getIndex() + firstInlineBlock.getIndex())); InstructionVariableMapper variableMapper = new InstructionVariableMapper(var -> {
inlineBlock.setExceptionVariable(blockToInline.getExceptionVariable()); }
42,856
package org.apache.raft.util; import com.google.common.base.Preconditions; <BUG>import org.apache.raft.protocol.RaftPeer; import java.io.IOException;</BUG> import java.util.Collection; import java.util.Collections; import java.util.HashMap;
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Closeable; import java.io.IOException;
42,857
import org.apache.raft.grpc.proto.RaftClientProtocolServiceGrpc.RaftClientProtocolServiceBlockingStub; import org.apache.raft.grpc.proto.RaftClientProtocolServiceGrpc.RaftClientProtocolServiceStub; import org.apache.raft.proto.RaftProtos.RaftClientReplyProto; import org.apache.raft.proto.RaftProtos.RaftClientRequestProto; import org.apache.raft.proto.RaftProtos.SetConfigurationRequestProto; <BUG>import org.apache.raft.protocol.RaftPeer; import java.io.IOException; public class RaftClientProtocolClient { </BUG> private final ManagedChannel channel;
import java.io.Closeable; public class RaftClientProtocolClient implements Closeable {
42,858
public RaftClientProtocolClient(RaftPeer target) { channel = ManagedChannelBuilder.forTarget(target.getAddress()) .usePlaintext(true).build(); blockingStub = RaftClientProtocolServiceGrpc.newBlockingStub(channel); asyncStub = RaftClientProtocolServiceGrpc.newStub(channel); <BUG>} public void shutdown() { </BUG> channel.shutdownNow(); }
@Override public void close() {
42,859
package org.apache.raft.client; import org.apache.raft.protocol.RaftClientReply; import org.apache.raft.protocol.RaftClientRequest; <BUG>import org.apache.raft.protocol.RaftPeer; import java.io.IOException; public interface RaftClientRequestSender { </BUG> RaftClientReply sendRequest(RaftClientRequest request) throws IOException;
import java.io.Closeable; public interface RaftClientRequestSender extends Closeable {
42,860
m.put(RUNNING, Collections.unmodifiableList(Arrays.asList(STARTING))); m.put(PAUSING, Collections.unmodifiableList(Arrays.asList(RUNNING))); m.put(PAUSED, Collections.unmodifiableList(Arrays.asList(PAUSING))); m.put(EXCEPTION, Collections.unmodifiableList(Arrays.asList(STARTING, PAUSING, RUNNING))); m.put(CLOSING, Collections.unmodifiableList(Arrays.asList(RUNNING, EXCEPTION))); <BUG>m.put(CLOSED, Collections.unmodifiableList(Arrays.asList(CLOSING))); </BUG> PREDECESSORS = Collections.unmodifiableMap(m); } static void validate(State from, State to) {
m.put(CLOSED, Collections.unmodifiableList(Arrays.asList(NEW, CLOSING)));
42,861
"Illegal transition: %s -> %s", from, to); } } private final String name; private final AtomicReference<State> current = new AtomicReference<>(State.NEW); <BUG>public LifeCycle(String name) { this.name = name; </BUG> }
public LifeCycle(Object name) { this.name = name.toString();
42,862
@Test public void testHandleStateMachineException() throws Exception { cluster.start(); RaftTestUtil.waitForLeader(cluster); final String leaderId = cluster.getLeader().getId(); <BUG>final RaftClient client = cluster.createClient("client", leaderId); try {</BUG> client.send(new RaftTestUtil.SimpleMessage("m")); fail("Exception expected");
try(final RaftClient client = cluster.createClient("client", leaderId)) {
42,863
import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import static org.apache.raft.client.ClientProtoUtils.toRaftClientReply; import static org.apache.raft.client.ClientProtoUtils.toRaftClientRequestProto; import static org.apache.raft.client.ClientProtoUtils.toSetConfigurationRequestProto; <BUG>public class RaftClientSenderWithGrpc implements RaftClientRequestSender, Closeable { public static final Logger LOG = LoggerFactory.getLogger(RaftClientSenderWithGrpc.class);</BUG> private final PeerProxyMap<RaftClientProtocolClient> proxies = new PeerProxyMap<RaftClientProtocolClient>() { @Override
public class RaftClientSenderWithGrpc implements RaftClientRequestSender { public static final Logger LOG = LoggerFactory.getLogger(RaftClientSenderWithGrpc.class);
42,864
@Override public void addServers(Iterable<RaftPeer> servers) { proxies.addPeers(servers); } @Override <BUG>public void close() throws IOException { proxies.getPeerIds().forEach(id -> { try { proxies.getProxy(id).shutdown(); } catch (IOException e) { LOG.info("Got IOException when closing proxy with id " + id, e); } });</BUG> }
public RaftClientProtocolClient createProxy(RaftPeer peer) return new RaftClientProtocolClient(peer);
42,865
assertRaftClientReply(r, null); r = client.send(nullB); assertRaftClientReply(r, null); r = client.send(nullC); assertRaftClientReply(r, null); <BUG>} cluster.shutdown();</BUG> } static void assertRaftClientReply(RaftClientReply reply, Double expected) { Assert.assertTrue(reply.isSuccess());
client.close(); cluster.shutdown();
42,866
import org.apache.raft.RaftClientConfigKeys; import org.apache.raft.conf.RaftProperties; import org.apache.raft.protocol.*; import org.apache.raft.util.RaftUtils; import org.slf4j.Logger; <BUG>import org.slf4j.LoggerFactory; import java.io.IOException;</BUG> import java.io.InterruptedIOException; import java.util.Arrays; import java.util.Collection;
import java.io.Closeable; import java.io.IOException;
42,867
import java.util.Iterator; import java.util.Map; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; <BUG>public class RaftClient { public static final Logger LOG = LoggerFactory.getLogger(RaftClient.class);</BUG> public static final long DEFAULT_SEQNUM = 0; private final String clientId; private final RaftClientRequestSender requestSender;
public class RaftClient implements Closeable { public static final Logger LOG = LoggerFactory.getLogger(RaftClient.class);
42,868
for (int i = 1; i < SNAPSHOT_TRIGGER_THRESHOLD * 2 - 1; i++) { Assert.assertEquals(i+1, entries[i].getIndex()); Assert.assertArrayEquals(new SimpleMessage("m" + i).getContent(), entries[i].getSmLogEntry().getData().toByteArray()); } <BUG>final RaftClient client = cluster.createClient("client", cluster.getLeader().getId()); Assert.assertTrue(client.send(new SimpleMessage("test")).isSuccess()); MiniRaftCluster.PeerChanges change = cluster.addNewPeers(</BUG> new String[]{"s3", "s4"}, true);
try(final RaftClient client = cluster.createClient("client", cluster.getLeader().getId())) { MiniRaftCluster.PeerChanges change = cluster.addNewPeers(
42,869
public static void transformConfigFile(InputStream sourceStream, String destPath) throws Exception { try { Yaml yaml = new Yaml(); final Object loadedObject = yaml.load(sourceStream); if (loadedObject instanceof Map) { <BUG>final Map<String, Object> result = (Map<String, Object>) loadedObject; ByteArrayOutputStream nifiPropertiesOutputStream = new ByteArrayOutputStream(); writeNiFiProperties(result, nifiPropertiesOutputStream); DOMSource flowXml = createFlowXml(result); </BUG> writeNiFiPropertiesFile(nifiPropertiesOutputStream, destPath);
final Map<String, Object> loadedMap = (Map<String, Object>) loadedObject; ConfigSchema configSchema = new ConfigSchema(loadedMap); if (!configSchema.isValid()) { throw new InvalidConfigurationException("Failed to transform config file due to:" + configSchema.getValidationIssuesAsString()); } writeNiFiProperties(configSchema, nifiPropertiesOutputStream); DOMSource flowXml = createFlowXml(configSchema);
42,870
writer.println("nifi.h2.url.append=;LOCK_TIMEOUT=25000;WRITE_DELAY=0;AUTO_SERVER=FALSE"); writer.println(); writer.println("# FlowFile Repository"); writer.println("nifi.flowfile.repository.implementation=org.apache.nifi.controller.repository.WriteAheadFlowFileRepository"); writer.println("nifi.flowfile.repository.directory=./flowfile_repository"); <BUG>writer.println("nifi.flowfile.repository.partitions=" + getValueString(flowfileRepo, PARTITIONS_KEY)); writer.println("nifi.flowfile.repository.checkpoint.interval=" + getValueString(flowfileRepo,CHECKPOINT_INTERVAL_KEY)); writer.println("nifi.flowfile.repository.always.sync=" + getValueString(flowfileRepo,ALWAYS_SYNC_KEY)); </BUG> writer.println();
writer.println("nifi.flowfile.repository.partitions=" + flowfileRepoSchema.getPartitions()); writer.println("nifi.flowfile.repository.checkpoint.interval=" + flowfileRepoSchema.getCheckpointInterval()); writer.println("nifi.flowfile.repository.always.sync=" + flowfileRepoSchema.getAlwaysSync());
42,871
writer.println("# cluster manager properties (only configure for cluster manager) #"); writer.println("nifi.cluster.is.manager=false"); } catch (NullPointerException e) { throw new ConfigurationChangeException("Failed to parse the config YAML while creating the nifi.properties", e); } finally { <BUG>if (writer != null){ </BUG> writer.flush(); writer.close(); }
if (writer != null) {
42,872
writer.flush(); writer.close(); } } } <BUG>private static DOMSource createFlowXml(Map<String, Object> topLevelYaml) throws IOException, ConfigurationChangeException { </BUG> try { final DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); docFactory.setNamespaceAware(true);
private static DOMSource createFlowXml(ConfigSchema configSchema) throws IOException, ConfigurationChangeException {
42,873
docFactory.setNamespaceAware(true); final DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); final Document doc = docBuilder.newDocument(); final Element rootNode = doc.createElement("flowController"); doc.appendChild(rootNode); <BUG>Map<String, Object> processorConfig = (Map<String, Object>) topLevelYaml.get(PROCESSOR_CONFIG_KEY); addTextElement(rootNode, "maxTimerDrivenThreadCount", getValueString(processorConfig, MAX_CONCURRENT_TASKS_KEY, "1")); addTextElement(rootNode, "maxEventDrivenThreadCount", getValueString(processorConfig, MAX_CONCURRENT_TASKS_KEY, "1")); addProcessGroup(rootNode, topLevelYaml, "rootGroup"); Map<String, Object> securityProps = (Map<String, Object>) topLevelYaml.get(SECURITY_PROPS_KEY); if (securityProps != null) { String sslAlgorithm = (String) securityProps.get(SSL_PROTOCOL_KEY); if (sslAlgorithm != null && !(sslAlgorithm.isEmpty())) {</BUG> final Element controllerServicesNode = doc.createElement("controllerServices");
CorePropertiesSchema coreProperties = configSchema.getCoreProperties(); addTextElement(rootNode, "maxTimerDrivenThreadCount", String.valueOf(coreProperties.getMaxConcurrentThreads())); addTextElement(rootNode, "maxEventDrivenThreadCount", String.valueOf(coreProperties.getMaxConcurrentThreads())); addProcessGroup(rootNode, configSchema, "rootGroup"); SecurityPropertiesSchema securityProperties = configSchema.getSecurityProperties(); if (securityProperties.useSSL()) {
42,874
throw new ConfigurationChangeException("Failed to parse the config YAML while trying to add the Provenance Reporting Task", e); } } private static void addConfiguration(final Element element, Map<String, Object> elementConfig) { final Document doc = element.getOwnerDocument(); <BUG>if (elementConfig == null){ </BUG> return; } for (final Map.Entry<String, Object> entry : elementConfig.entrySet()) {
if (elementConfig == null) {
42,875
else if (t == ANY_CYPHER_OPTION) { r = AnyCypherOption(b, 0); } else if (t == ANY_FUNCTION_INVOCATION) { r = AnyFunctionInvocation(b, 0); <BUG>} else if (t == BULK_IMPORT_QUERY) {</BUG> r = BulkImportQuery(b, 0); } else if (t == CALL) {
else if (t == ARRAY) { r = Array(b, 0); else if (t == BULK_IMPORT_QUERY) {
42,876
if (!r) r = MapLiteral(b, l + 1); if (!r) r = MapProjection(b, l + 1); if (!r) r = CountStar(b, l + 1); if (!r) r = ListComprehension(b, l + 1); if (!r) r = PatternComprehension(b, l + 1); <BUG>if (!r) r = Expression1_12(b, l + 1); if (!r) r = FilterFunctionInvocation(b, l + 1);</BUG> if (!r) r = ExtractFunctionInvocation(b, l + 1); if (!r) r = ReduceFunctionInvocation(b, l + 1); if (!r) r = AllFunctionInvocation(b, l + 1);
if (!r) r = Array(b, l + 1); if (!r) r = FilterFunctionInvocation(b, l + 1);
42,877
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
42,878
final int lineStride = dst.getScanlineStride(); final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final byte[][] data = dst.getByteDataArrays(); final float[] warpData = new float[2 * dstWidth]; <BUG>int lineOffset = 0; if (ctable == null) { // source does not have IndexColorModel if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset;
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
42,879
pixelOffset += pixelStride; } // COLS LOOP } // ROWS LOOP } } else {// source has IndexColorModel <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
} else if (caseB) { for (int h = 0; h < dstHeight; h++) {
42,880
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
42,881
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final short[][] data = dst.getShortDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
42,882
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
42,883
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final short[][] data = dst.getShortDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
42,884
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
42,885
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final int[][] data = dst.getIntDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
42,886
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
42,887
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final float[][] data = dst.getFloatDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
42,888
minX = src.getMinX(); maxX = src.getMaxX(); minY = src.getMinY(); maxY = src.getMaxY(); } else { <BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC); minX = src.getMinX() + 1; // Left padding maxX = src.getMaxX() - 2; // Right padding minY = src.getMinY() + 1; // Top padding maxY = src.getMaxY() - 2; // Bottom padding </BUG> }
iterSource = getRandomIterator(src, null); minX = src.getMinX() + leftPad; // Left padding maxX = src.getMaxX() - rightPad; // Right padding minY = src.getMinY() + topPad; // Top padding maxY = src.getMaxY() - bottomPad; // Bottom padding
42,889
final int pixelStride = dst.getPixelStride(); final int[] bandOffsets = dst.getBandOffsets(); final double[][] data = dst.getDoubleDataArrays(); final float[] warpData = new float[2 * dstWidth]; int lineOffset = 0; <BUG>if (caseA) { for (int h = 0; h < dstHeight; h++) {</BUG> int pixelOffset = lineOffset; lineOffset += lineStride; warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
if(hasROI && !roiContainsTile && roiIter == null){ throw new IllegalArgumentException("Error on creating the ROI iterator"); } if (caseA || (caseB && roiContainsTile)) { for (int h = 0; h < dstHeight; h++) {
42,890
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 FileSystem {</BUG> private URI uri; private Path workingDir; private AmazonS3Client s3;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
42,891
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(ACCESS_KEY, null); String secretKey = conf.get(SECRET_KEY, null); </BUG> String userInfo = name.getUserInfo();
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));
42,892
} 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()
42,893
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_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (partSize < 5 * 1024 * 1024) {
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.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP); awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES))); awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT))); maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS)); partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE)); partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
42,894
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_PURGE_EXISTING_MULTIPART_AGE); </BUG> if (purgeExistingMultipart) {
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_AGE));
42,895
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 backupFile; private boolean closed;
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
42,896
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) != null) {
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
42,897
import org.codehaus.groovy.control.CompilationUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class GroovyTreeParser implements TreeParser { private static final Logger logger = LoggerFactory.getLogger(GroovyTreeParser.class); <BUG>private static final String GROOVY_DEFAULT_INTERFACE = "groovy.lang.GroovyObject"; private static final String JAVA_DEFAULT_OBJECT = "java.lang.Object"; private Map<URI, Set<SymbolInformation>> fileSymbols = Maps.newHashMap(); private Map<String, Set<SymbolInformation>> typeReferences = Maps.newHashMap();</BUG> private final Supplier<CompilationUnit> unitSupplier;
private Indexer indexer = new Indexer();
42,898
if (scriptClass != null) { sourceUnit.getAST().getStatementBlock().getVariableScope().getDeclaredVariables().values().forEach( variable -> { SymbolInformation symbol = getVariableSymbolInformation(scriptClass.getName(), sourceUri, variable); <BUG>addToValueSet(newTypeReferences, variable.getType().getName(), symbol); symbols.add(symbol); }); } newFileSymbols.put(workspaceUriSupplier.get(sourceUri), symbols);</BUG> });
newIndexer.addSymbol(sourceUnit.getSource().getURI(), symbol); if (classes.containsKey(variable.getType().getName())) { newIndexer.addReference(classes.get(variable.getType().getName()), GroovyLocations.createLocation(sourceUri, variable.getType()));
42,899
} if (typeReferences.containsKey(foundSymbol.getName())) { foundReferences.addAll(typeReferences.get(foundSymbol.getName()));</BUG> } <BUG>return foundReferences; }</BUG> @Override public Set<SymbolInformation> getFilteredSymbols(String query) { checkNotNull(query, "query must not be null"); Pattern pattern = getQueryPattern(query);
}); sourceUnit.getAST().getStatementBlock() .visit(new MethodVisitor(newIndexer, sourceUri, sourceUnit.getAST().getScriptClassDummy(), classes, Maps.newHashMap(), Optional.absent(), workspaceUriSupplier));
42,900
<BUG>package com.palantir.ls.server.api; import io.typefox.lsapi.ReferenceParams;</BUG> import io.typefox.lsapi.SymbolInformation; import java.net.URI; import java.util.Map;
import com.google.common.base.Optional; import io.typefox.lsapi.Location; import io.typefox.lsapi.Position; import io.typefox.lsapi.ReferenceParams;