auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void gatherInformation(MajorCompactionRequest request) { gatherCalled = true; Collection<SummarizerConfiguration> configs = SummarizerConfiguration.fromTableProperties(request.getTableProperties()); if (configs.size() == 0) { summaryConfigured = false; } else { Set<SummarizerConfiguration> configsSet = configs instanceof Set ? (Set<SummarizerConfiguration>) configs : new HashSet<>(configs); for (FileRef fref : request.getFiles().keySet()) { Map<SummarizerConfiguration,Summary> sMap = new HashMap<>(); Collection<Summary> summaries; try { summaries = request.getSummaries(Collections.singletonList(fref), conf -> configsSet.contains(conf)); } catch (IOException e) { throw new UncheckedIOException(e); } for (Summary summary : summaries) { sMap.put(summary.getSummarizerConfiguration(), summary); } boolean needsCompaction = false; for (SummarizerConfiguration sc : configs) { Summary summary = sMap.get(sc); if (summary == null && selectNoSummary) { needsCompaction = true; break; } if (summary != null && summary.getFileStatistics().getExtra() > 0 && selectExtraSummary) { needsCompaction = true; break; } } if (!needsCompaction) { okFiles.add(fref); } } } }

Target:
void gatherInformation(MajorCompactionRequest request) { gatherCalled = true; Collection<SummarizerConfiguration> configs = SummarizerConfiguration.fromTableProperties(request.getTableProperties()); if (configs.size() == 0) { summaryConfigured = false; } else { Set<SummarizerConfiguration> configsSet = configs instanceof Set ? (Set<SummarizerConfiguration>) configs : new HashSet<>(configs); okFiles = new HashSet<>(); for (FileRef fref : request.getFiles().keySet()) { Map<SummarizerConfiguration,Summary> sMap = new HashMap<>(); Collection<Summary> summaries; try { summaries = request.getSummaries(Collections.singletonList(fref), conf -> configsSet.contains(conf)); } catch (IOException e) { throw new UncheckedIOException(e); } for (Summary summary : summaries) { sMap.put(summary.getSummarizerConfiguration(), summary); } boolean needsCompaction = false; for (SummarizerConfiguration sc : configs) { Summary summary = sMap.get(sc); if (summary == null && selectNoSummary) { needsCompaction = true; break; } if (summary != null && summary.getFileStatistics().getExtra() > 0 && selectExtraSummary) { needsCompaction = true; break; } } if (!needsCompaction) { okFiles.add(fref); } } } }
Source:
public boolean check(final AuthenticationInfo authenticationInfo) { if (authenticationInfo == null || Strings.isNullOrEmpty(authenticationInfo.getUsername()) || Strings.isNullOrEmpty(authenticationInfo.getPassword())) { return false; } AuthConfiguration userAuthConfiguration = env.getUserAuthConfiguration(); return userAuthConfiguration.getAuthUsername().equals(authenticationInfo.getUsername()) && userAuthConfiguration.getAuthPassword().equals(authenticationInfo.getPassword()); }

Target:
public boolean check(final AuthenticationInfo authenticationInfo) { if (null == authenticationInfo || Strings.isNullOrEmpty(authenticationInfo.getUsername()) || Strings.isNullOrEmpty(authenticationInfo.getPassword())) { return false; } AuthConfiguration userAuthConfiguration = env.getUserAuthConfiguration(); return userAuthConfiguration.getAuthUsername().equals(authenticationInfo.getUsername()) && userAuthConfiguration.getAuthPassword().equals(authenticationInfo.getPassword()); }
Source:
public void testCSVImportWrongOrder() throws Exception { String[] csv = {"id,relationship.type,relation.isAuthorOfPublication,collection,dc.identifier.other", "+,Publication,dc.identifier.other:8675309," + col1.getHandle() + ",2", "+,Person,," + col1.getHandle() + ",1",}; assertEquals(1, performImportScript(csv, false)); }

Target:
public void testCSVImportWrongOrder() throws Exception { String[] csv = {"id,relationship.type,relation.isAuthorOfPublication,collection,dc.identifier.other", "+,Publication,dc.identifier.other:8675309," + col1.getHandle() + ",2", "+,Person,," + col1.getHandle() + ",8675309",}; assertEquals(1, performImportScript(csv, false)); }
Source:
public static ApplicationIndexHomePage gotoPage() { ApplicationHomePage.gotoPage("Applications"); return new ApplicationIndexHomePage(); }

Target:
public static ApplicationIndexHomePage gotoPage() { getUtil().gotoPage("Applications", "WebHome"); return new ApplicationIndexHomePage(); }
Source:
private AuthenticationProvider getAuthenticationProvider(OAuth2Authentication oauth2User) { return AuthenticationProvider.GITHUB; }

Target:
private String getAuthenticationProvider(OAuth2Authentication oauth2User) { return AuthenticationProvider.GITHUB.name(); }
Source:
private Object processFlexNegotiation(Channel channel, ByteBuf buf) { if ((byte) buf.readUnsignedByte() != (byte) 0xB0) { return null; } byte flexProtocolVersion, flexStructVersion; flexProtocolVersion = (byte) buf.readUnsignedByte(); flexStructVersion = (byte) buf.readUnsignedByte(); if ((flexProtocolVersion == (byte) 0x0A || flexProtocolVersion == (byte) 0x14) && (flexStructVersion == (byte) 0x0A || flexStructVersion == (byte) 0x14)) { flexBitfieldDataSize = buf.readUnsignedByte(); if (flexBitfieldDataSize > 122) { return null; } buf.readBytes(flexBitfield, 0, (int) Math.ceil((double) flexBitfieldDataSize / 8)); flexDataSize = 0; for (int i = 0; i < flexBitfieldDataSize; i++) { if (checkFlexBitfield(i)) { flexDataSize += FLEX_FIELDS_SIZES[i]; } } } else { flexProtocolVersion = 0x14; flexStructVersion = 0x14; } ByteBuf response = Unpooled.buffer(9); response.writeCharSequence("*<FLEX", StandardCharsets.US_ASCII); response.writeByte(0xB0); response.writeByte(flexProtocolVersion); response.writeByte(flexStructVersion); sendNtcbReply(channel, response); return null; }

Target:
private Object processFlexNegotiation(Channel channel, ByteBuf buf) { if ((byte) buf.readUnsignedByte() != (byte) 0xB0) { return null; } short flexProtocolVersion = buf.readUnsignedByte(); short flexStructVersion = buf.readUnsignedByte(); if ((flexProtocolVersion == 0x0A || flexProtocolVersion == 0x14) && (flexStructVersion == 0x0A || flexStructVersion == 0x14)) { flexBitfieldDataSize = buf.readUnsignedByte(); if (flexBitfieldDataSize > 122) { return null; } buf.readBytes(flexBitfield, 0, (int) Math.ceil((double) flexBitfieldDataSize / 8)); flexDataSize = 0; for (int i = 0; i < flexBitfieldDataSize; i++) { if (checkFlexBitfield(i)) { flexDataSize += FLEX_FIELDS_SIZES[i]; } } } else { flexProtocolVersion = 0x14; flexStructVersion = 0x14; } ByteBuf response = Unpooled.buffer(9); response.writeCharSequence("*<FLEX", StandardCharsets.US_ASCII); response.writeByte(0xB0); response.writeByte(flexProtocolVersion); response.writeByte(flexStructVersion); sendNtcbReply(channel, response); return null; }
Source:
public boolean performNextOperation(int completedChildCount) { restoreCommandState(); switch (getParameters().getVmBackup().getPhase()) { case STARTING: if (runVmBackup()) { updateVmBackupPhase(VmBackupPhase.READY); } else { setCommandStatus(CommandStatus.FAILED); } log.info("Ready to start image transfers using backup URLs"); break; case READY: return true; case FINALIZING: finalizeVmBackup(); setCommandStatus(CommandStatus.SUCCEEDED); break; } persistCommandIfNeeded(); return true; }

Target:
public boolean performNextOperation(int completedChildCount) { restoreCommandState(); switch (getParameters().getVmBackup().getPhase()) { case STARTING: if (runVmBackup()) { updateVmBackupPhase(VmBackupPhase.READY); log.info("Ready to start image transfers using backup URLs"); } else { setCommandStatus(CommandStatus.FAILED); } break; case READY: return true; case FINALIZING: finalizeVmBackup(); setCommandStatus(CommandStatus.SUCCEEDED); break; } persistCommandIfNeeded(); return true; }
Source:
public static <T> Call<T> response(final Response<T> response) { return new Call<T>() { @Override public Response<T> execute() throws IOException { return response; } @Override public void enqueue(Callback<T> callback) { callback.onResponse(response); } @Override public void cancel() { } @SuppressWarnings("CloneDoesntCallSuperClone") @Override public Call<T> clone() { return response(response); } }; }

Target:
public static <T> Call<T> response(final Response<T> response) { return new Call<T>() { @Override public Response<T> execute() throws IOException { return response; } @Override public void enqueue(Callback<T> callback) { callback.onResponse(response); } @Override public void cancel() { } @SuppressWarnings("CloneDoesntCallSuperClone") @Override public Call<T> clone() { return this; } }; }
Source:
public Optional<FieldSortExpectations<Float>> getFieldSortExpectations() { return Optional.of( new FieldSortExpectations<>( 1.01f, 3.2f, 5.1f, Float.MIN_VALUE, 2.0f, 4.00001f, Float.MAX_VALUE ) ); }

Target:
public Optional<FieldSortExpectations<Float>> getFieldSortExpectations() { return Optional.of( new FieldSortExpectations<>( 1.01f, 3.2f, 5.1f, -Float.MIN_VALUE, 2.0f, 4.00001f, Float.MAX_VALUE ) ); }
Source:
private boolean validateLocation(String location) { if(StringUtils.isBlank(location)) { return true; } File file = new File(location); if(!ocBinary.getName().equals(file.getName())) { cliLocationEditor.setErrorMessage(NLS.bind("{0} is not the OpenShift Client ''{1}'' executable.", file.getName(), ocBinary.getName())); return false; } if(!file.exists()) { cliLocationEditor.setErrorMessage(NLS.bind("{0} was not found.", file)); return false; } if(!file.canExecute()) { cliLocationEditor.setErrorMessage(NLS.bind("{0} does not have execute permissions.", file)); return false; } if (!new OCBinaryValidator(location).isCompatibleForPublishing()) { setMessage("Your Openshift 3 client executable is pre-1.1.1 and may cause rsync problems", WARNING); } return true; }

Target:
private boolean validateLocation(String location) { if(StringUtils.isBlank(location)) { return true; } File file = new File(location); if(!ocBinary.getName().equals(file.getName())) { cliLocationEditor.setErrorMessage(NLS.bind("{0} is not the OpenShift Client ''{1}'' executable.", file.getName(), ocBinary.getName())); return false; } if(!file.exists()) { cliLocationEditor.setErrorMessage(NLS.bind("{0} was not found.", file)); return false; } if(!file.canExecute()) { cliLocationEditor.setErrorMessage(NLS.bind("{0} does not have execute permissions.", file)); return false; } setValid(false); ocVersionLabel.setText("Checking version"); Job job = new UIUpdatingJob("Checking oc binary") { private Version version; @Override protected IStatus run(IProgressMonitor monitor) { version = new OCBinaryValidator(location).getVersion(monitor); return Status.OK_STATUS; } @Override protected IStatus updateUI(IProgressMonitor monitor) { if (!ocMessageComposite.isDisposed() && !monitor.isCanceled()) { setValid(true); ocVersionLabel.setText(NLS.bind("Your client version is {0}.{1}.{2}", new Object[] {version.getMajor(), version.getMinor(), version.getMicro()})); ocMessageLabel.setText(NLS.bind("OpenShift client version 1.1.1 or higher is required to avoid rsync issues.", version)); ocMessageComposite.setVisible(!OCBinaryValidator.isCompatibleForPublishing(version)); } return super.updateUI(monitor); } }; job.schedule(); return true; }
Source:
public void testCreate() throws IOException, StripeException { final Account account = Account.retrieve(ACCOUNT_ID, null); PersonCollection personsTmp = getPersonCollectionFixture(account); final Map<String, Object> params = new HashMap<String, Object>(); params.put("first_name", "John"); final Person person = account.persons().create(params); assertNotNull(person); verifyRequest( ApiResource.RequestMethod.POST, String.format("/v1/accounts/%s/persons", account.getId()), params ); }

Target:
public void testCreate() throws IOException, StripeException { final Account account = Account.retrieve(ACCOUNT_ID, null); final PersonCollection personsTmp = getPersonCollectionFixture(account); final Map<String, Object> params = new HashMap<String, Object>(); params.put("first_name", "John"); final Person person = account.persons().create(params); assertNotNull(person); verifyRequest( ApiResource.RequestMethod.POST, String.format("/v1/accounts/%s/persons", account.getId()), params ); }
Source:
public boolean next(List<Cell> list) throws IOException{ if (failure.get() != null) { timer.cancel(); throw failure.get(); } Entry entry; try { entry = queue.take(); final boolean more = entry.more; List<TxnView> txns = waitFor(entry.txns); compactionState.mutate(entry.cells, txns, list, purgeDeletedRows); if (!more) { timer.cancel(); if (context != null) context.close(); } return more; } catch (Exception e) { timer.cancel(); throw new IOException(e); } }

Target:
public boolean next(List<Cell> list) throws IOException{ if (failure.get() != null) { timer.cancel(); throw failure.get(); } Entry entry; try { entry = queue.take(); final boolean more = entry.more; List<TxnView> txns = waitFor(entry.txns); compactionState.mutate(entry.cells, txns, list, purgeDeletedRows); if (!more) { timer.cancel(); context.close(); } return more; } catch (Exception e) { timer.cancel(); throw new IOException(e); } }
Source:
private CoordinatorStats doRun( Map<String, CoordinatorCompactionConfig> compactionConfigs, int numAvailableCompactionTaskSlots, CompactionSegmentIterator iterator ) { int numSubmittedCompactionTasks = 0; while (iterator.hasNext() && numSubmittedCompactionTasks < numAvailableCompactionTaskSlots) { final List<DataSegment> segmentsToCompact = iterator.next(); final String dataSourceName = segmentsToCompact.get(0).getDataSource(); if (segmentsToCompact.size() > 1) { final CoordinatorCompactionConfig config = compactionConfigs.get(dataSourceName); final String taskId = indexingServiceClient.compactSegments( segmentsToCompact, config.getTaskPriority(), config.getTuningConfig(), config.getTaskContext() ); LOG.info("Submit a compactTask[%s] for segments[%s]", taskId, segmentsToCompact); if (++numSubmittedCompactionTasks == numAvailableCompactionTaskSlots) { break; } } else if (segmentsToCompact.size() == 1) { throw new ISE("Found one segments[%s] to compact", segmentsToCompact); } else { throw new ISE("Failed to find segments for dataSource[%s]", dataSourceName); } } return makeStats(numSubmittedCompactionTasks, iterator); }

Target:
private CoordinatorStats doRun( Map<String, CoordinatorCompactionConfig> compactionConfigs, int numAvailableCompactionTaskSlots, CompactionSegmentIterator iterator ) { int numSubmittedTasks = 0; for (; iterator.hasNext() && numSubmittedTasks < numAvailableCompactionTaskSlots; numSubmittedTasks++) { final List<DataSegment> segmentsToCompact = iterator.next(); final String dataSourceName = segmentsToCompact.get(0).getDataSource(); if (segmentsToCompact.size() > 1) { final CoordinatorCompactionConfig config = compactionConfigs.get(dataSourceName); final String taskId = indexingServiceClient.compactSegments( segmentsToCompact, config.getTaskPriority(), config.getTuningConfig(), config.getTaskContext() ); LOG.info("Submitted a compactTask[%s] for segments[%s]", taskId, segmentsToCompact); } else if (segmentsToCompact.size() == 1) { throw new ISE("Found one segments[%s] to compact", segmentsToCompact); } else { throw new ISE("Failed to find segments for dataSource[%s]", dataSourceName); } } return makeStats(numSubmittedTasks, iterator); }
Source:
public static boolean sourceLikeCram(final SeekableStream strm) { String source = strm.getSource(); if (source == null) { return false; } source = source.toLowerCase(); return source.endsWith(".cram") || source.contains(".cram?") || source.contains(".cram&") || source.contains(".cram%26"); }

Target:
public static boolean sourceLikeCram(final SeekableStream strm) { String source = strm.getSource(); if (source == null) { return false; } try { final URL sourceURL = new URL(source); final String urlPath = sourceURL.getPath().toLowerCase(); String queryParams = sourceURL.getQuery(); if (queryParams != null) { queryParams = queryParams.toLowerCase(); } return urlPath.endsWith(".cram") || (queryParams != null && (queryParams.endsWith(".cram") || queryParams.contains(".cram?") || queryParams.contains(".cram&") || queryParams.contains(".cram%26")) ); } catch (MalformedURLException e) { source = source.toLowerCase(); return source.endsWith(".cram") || source.contains(".cram?") || source.contains(".cram&") || source.contains(".cram%26"); } }
Source:
public void triggerMatrixBuildsRemotely() { MatrixProject job = jenkins.jobs.create(MatrixProject.class); job.configure(); job.addParameter(StringParameter.class).setName("ID").setDefault("0"); job.runSequentially.check(); jenkins.control("/pseudoRemoteTrigger").click(); jenkins.control("/pseudoRemoteTrigger/authToken").fillIn("authToken", "TOKEN"); job.addUserAxis("X", "1 2 3"); job.addShellStep("#!/bin/bash\n" + "echo Job request ${ID}\n"); job.save(); FreeStyleJob job2 = jenkins.jobs.create(FreeStyleJob.class); job2.addBuildStep(ShellBuildStep.class); String s = "#!/bin/bash -x\n" + "for i in {1.." + NO_BUILDS + "}\n" + "do\n" + "\tcurl " + job.url.toString() + "buildWithParameters?token=TOKEN\\&ID=$i\n" + "done"; jenkins.control("/builder/command").setAtOnce(s); job2.save(); job2.startBuild().waitUntilFinished(); jenkins.visit("view/All/builds"); List<WebElement> list = all(by.href("/job/" + job.name + "/")); assertThat("All triggered builds have not been run or put in build queue.", list.size() == NO_BUILDS); }

Target:
public void triggerMatrixBuildsRemotely() { GlobalSecurityConfig sc = new GlobalSecurityConfig(jenkins); sc.open(); sc.useRealm(ServletSecurityRealm.class); sc.save(); MatrixProject job = jenkins.jobs.create(MatrixProject.class); job.configure(); job.addParameter(StringParameter.class).setName("ID").setDefault("0"); job.runSequentially.check(); jenkins.control("/pseudoRemoteTrigger").click(); jenkins.control("/pseudoRemoteTrigger/authToken").fillIn("authToken", "TOKEN"); job.addUserAxis("X", "1 2 3"); job.addShellStep("#!/bin/bash\n" + "echo Job request ${ID}\n"); job.save(); FreeStyleJob job2 = jenkins.jobs.create(FreeStyleJob.class); job2.addBuildStep(ShellBuildStep.class); String s = "#!/bin/bash -x\n" + "for i in {1.." + NO_BUILDS + "}\n" + "do\n" + "\tcurl " + job.url.toString() + "buildWithParameters?token=TOKEN\\&ID=$i\n" + "done"; jenkins.control("/builder/command").setAtOnce(s); job2.save(); job2.startBuild().waitUntilFinished(); int nrOfBuilds = jenkins.getBuildHistory().numberOfInclusions(job.name); assertThat("All triggered builds have not been run or put in build queue.", nrOfBuilds == NO_BUILDS); }
Source:
private boolean hasNotAllowedTwoEmptyLinesBefore(DetailAST token) { boolean result = false; if (!allowMultipleEmptyLines) { result = hasEmptyLineBefore(token) && isPrePreviousLineEmpty(token); } return result; }

Target:
private boolean hasNotAllowedTwoEmptyLinesBefore(DetailAST token) { return !allowMultipleEmptyLines && hasEmptyLineBefore(token) && isPrePreviousLineEmpty(token); }
Source:
public GrimlockDinobotLeader(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT,CardType.CREATURE}, "{1}{R}{G}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add("Autobot"); this.power = new MageInt(4); this.toughness = new MageInt(4); this.transformable = true; this.secondSideCardClazz = GrimlockFerociousKing.class; this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, filter, false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, filter2, true))); this.addAbility(new TransformAbility()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), new ManaCostsImpl("{2}"))); }

Target:
public GrimlockDinobotLeader(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT,CardType.CREATURE}, "{1}{R}{G}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.AUTOBOT); this.power = new MageInt(4); this.toughness = new MageInt(4); this.transformable = true; this.secondSideCardClazz = GrimlockFerociousKing.class; this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, filter, false))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, filter2, true))); this.addAbility(new TransformAbility()); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), new ManaCostsImpl("{2}"))); }
Source:
public static ByteBuf encodeMetadata( ByteBufAllocator allocator, String customAuthType, ByteBuf metadata) { int actualASCIILength = ByteBufUtil.utf8Bytes(customAuthType); if (actualASCIILength != customAuthType.length()) { metadata.release(); throw new IllegalArgumentException("custom auth type must be US_ASCII characters only"); } if (actualASCIILength < 1 || actualASCIILength > 128) { metadata.release(); throw new IllegalArgumentException( "custom auth type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128"); } int capacity = 1 + actualASCIILength; ByteBuf headerBuffer = allocator.buffer(capacity, capacity); headerBuffer.writeByte(actualASCIILength - 1); ByteBufUtil.reserveAndWriteUtf8(headerBuffer, customAuthType, actualASCIILength); return TupleByteBuf.of(allocator, headerBuffer, metadata); }

Target:
public static ByteBuf encodeMetadata( ByteBufAllocator allocator, String customAuthType, ByteBuf metadata) { int actualASCIILength = ByteBufUtil.utf8Bytes(customAuthType); if (actualASCIILength != customAuthType.length()) { throw new IllegalArgumentException("custom auth type must be US_ASCII characters only"); } if (actualASCIILength < 1 || actualASCIILength > 128) { throw new IllegalArgumentException( "custom auth type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128"); } int capacity = 1 + actualASCIILength; ByteBuf headerBuffer = allocator.buffer(capacity, capacity); headerBuffer.writeByte(actualASCIILength - 1); ByteBufUtil.reserveAndWriteUtf8(headerBuffer, customAuthType, actualASCIILength); return TupleByteBuf.of(allocator, headerBuffer, metadata); }
Source:
public boolean hasResponsePayload(final ImmutableList<Ds3ResponseCode> responseCodes) { for(final Ds3ResponseCode responseCode : responseCodes) { final int rc = responseCode.getCode(); if( rc >= 200 && rc < 300) for (final Ds3ResponseType responseType : responseCode.getDs3ResponseTypes()) { if(ConverterUtil.hasContent(responseType.getType())) { LOG.debug("response type " + responseType.getType()); return true; } else if(ConverterUtil.hasContent(responseType.getComponentType())) { LOG.debug("response type " + responseType.getComponentType()); return true; } } } return false; }

Target:
public static boolean hasResponsePayload(final ImmutableList<Ds3ResponseCode> responseCodes) { for (final Ds3ResponseCode responseCode : responseCodes) { final int rc = responseCode.getCode(); if (rc >= 200 && rc < 300) for (final Ds3ResponseType responseType : responseCode.getDs3ResponseTypes()) { if (ConverterUtil.hasContent(responseType.getType()) && !Objects.equals(responseType.getType(), "null")) { LOG.debug("response type " + responseType.getType()); return true; } else if (ConverterUtil.hasContent(responseType.getComponentType()) && !Objects.equals(responseType.getComponentType(), "null")) { LOG.debug("response type " + responseType.getComponentType()); return true; } } } return false; }
Source:
private boolean isClobReturningFunction(String castSource) { for (int i = 0; i < clobReturningFunctions.length; i++) { if (castSource.toLowerCase().startsWith(clobReturningFunctions[i] + "(")) { return true; } } return false; }

Target:
private static boolean isClobReturningFunction(String castSource) { for (int i = 0; i < CLOB_RETURNING_FUNCTIONS.length; i++) { if (castSource.toLowerCase().startsWith(CLOB_RETURNING_FUNCTIONS[i])) { return true; } } return false; }
Source:
public void patchByForbiddenUser() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .build(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/netid", "newNetId"); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(eperson.getEmail(), password); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isForbidden()); }

Target:
public void patchByForbiddenUser() throws Exception { context.turnOffAuthorisationSystem(); EPerson ePerson = EPersonBuilder.createEPerson(context) .withNameInMetadata("John", "Doe") .withEmail("Johndoe@fake-email.com") .build(); List<Operation> ops = new ArrayList<Operation>(); ReplaceOperation replaceOperation = new ReplaceOperation("/netid", "newNetId"); ops.add(replaceOperation); String patchBody = getPatchContent(ops); String token = getAuthToken(eperson.getEmail(), password); getClient(token).perform(patch("/api/eperson/epersons/" + ePerson.getID()) .content(patchBody) .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isForbidden()); token = getAuthToken(admin.getEmail(), password); getClient(token).perform(get("/api/eperson/epersons/" + ePerson.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$.netid", Matchers.is(nullValue()))); }
Source:
private List<StereotypeModel> findStereotypes(ComponentModel componentModel, ParameterDeclaration propertyDeclaration) { final String expectedPropertyReference = ExpressionManager.DEFAULT_EXPRESSION_PREFIX + BindingContextUtils.VARS + "." + propertyDeclaration.getName() + ExpressionManager.DEFAULT_EXPRESSION_POSTFIX; if (!componentModel.getModel(ParameterizedModel.class).isPresent()) { return emptyList(); } return ((SpringComponentModel) componentModel).getParameters().stream() .filter(paramAst -> paramAst.getRawValue() != null) .filter(paramAst -> paramAst.getRawValue().equals(expectedPropertyReference)) .map(paramAst -> paramAst.getModel().getName()) .map(attributeName -> findStereotypes(componentModel.getIdentifier(), attributeName)) .flatMap(Collection::stream) .collect(toList()); }

Target:
private List<StereotypeModel> findStereotypes(ComponentModel componentModel, ParameterDeclaration propertyDeclaration) { final String expectedPropertyReference = ExpressionManager.DEFAULT_EXPRESSION_PREFIX + BindingContextUtils.VARS + "." + propertyDeclaration.getName() + ExpressionManager.DEFAULT_EXPRESSION_POSTFIX; if (!componentModel.getModel(ParameterizedModel.class).isPresent()) { return emptyList(); } return ((ComponentAst) componentModel).getParameters().stream() .filter(paramAst -> expectedPropertyReference.equals(paramAst.getRawValue())) .map(paramAst -> paramAst.getModel().getName()) .map(attributeName -> findStereotypes(componentModel.getIdentifier(), attributeName)) .flatMap(Collection::stream) .collect(toList()); }
Source:
public void evaluateOpac() { clearValues(); readProjectConfigs(); try { PrefsInterface myPrefs = serviceManager.getRulesetService().getPreferences(this.template.getRuleset()); this.myRdf = UghImplementation.INSTANCE.createMetsMods(myPrefs); this.myRdf.read(this.metadataFile.getPath()); this.docType = this.myRdf.getDigitalDocument().getLogicalDocStruct().getDocStructType().getName(); fillFieldsFromMetadataFile(this.myRdf); fillFieldsFromConfig(); } catch (Exception e) { logger.error("Fehler beim Einlesen des Opac-Ergebnisses ", e); Helper.setFehlerMeldung("Fehler beim Einlesen des Opac-Ergebnisses ", e); e.printStackTrace(); } }

Target:
public void evaluateOpac() { clearValues(); readProjectConfigs(); try { PrefsInterface myPrefs = serviceManager.getRulesetService().getPreferences(this.template.getRuleset()); this.myRdf = UghImplementation.INSTANCE.createMetsMods(myPrefs); this.myRdf.read(this.metadataFile.getPath()); this.docType = this.myRdf.getDigitalDocument().getLogicalDocStruct().getDocStructType().getName(); fillFieldsFromMetadataFile(this.myRdf); fillFieldsFromConfig(); } catch (PreferencesException | ReadException | RuntimeException e) { Helper.setErrorMessage("Fehler beim Einlesen des Opac-Ergebnisses ", logger, e); } }
Source:
public List<Module> transform(List<Module> modules) { BindingTracingVisitor visitor = new BindingTracingVisitor(); for (Element binding : Elements.getElements(modules)) { LOG.debug("Binding : {}", binding); } return modules; }

Target:
public List<Module> transform(List<Module> modules) { for (Element binding : Elements.getElements(modules)) { LOG.debug("Binding : {}", binding); } return modules; }
Source:
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (args == null) { args = NO_ARGS; } final Thread currentThread = Thread.currentThread(); final ClassLoader origClassLoader = currentThread.getContextClassLoader(); try { ClassLoader pluginClassLoader = Jenkins.getInstance().getPluginManager().getPlugin(Constants.DEPLOYIT_PLUGIN).classLoader; currentThread.setContextClassLoader(pluginClassLoader); return doInvoke(proxy, method, args); } catch (InvocationTargetException e) { throw new DeployitPluginException(e.getCause().getMessage(), e.getCause()); } finally { currentThread.setContextClassLoader(origClassLoader); } }

Target:
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (args == null) { args = NO_ARGS; } final Thread currentThread = Thread.currentThread(); final ClassLoader origClassLoader = currentThread.getContextClassLoader(); try { ClassLoader pluginClassLoader = origClassLoader; if (null != Jenkins.getInstance()) { pluginClassLoader = Jenkins.getInstance().getPluginManager().getPlugin(Constants.DEPLOYIT_PLUGIN).classLoader; } currentThread.setContextClassLoader(pluginClassLoader); return doInvoke(proxy, method, args); } catch (InvocationTargetException e) { if (null != e.getCause()) { throw new DeployitPluginException(e.getCause()); } else { throw new DeployitPluginException(e); } } finally { currentThread.setContextClassLoader(origClassLoader); } }
Source:
public <T extends Action> T getAction(@NonNull Class<T> type) { return ChangeRequestAction.class.equals(type) ? (T)new ChangeRequestAction(){} : null; }

Target:
public <T extends Action> T getAction(@NonNull Class<T> type) { return null; }
Source:
public void addPapyrusTable(Table tableInstance) { getResource().getContents().add(tableInstance); }

Target:
public void addPapyrusTable(Table tableInstance) { if (getResource() != null) { getResource().getContents().add(tableInstance); } }
Source:
private void verifyRegenerateStudentCourseLinks(WebElement studentRow, String originalJoinLink) { if (TestProperties.isDevServer() || TestProperties.INCLUDE_EMAIL_VERIFICATION) { searchPage.verifyStatusMessage("Student's links for this course have been successfully " + "regenerated, and the email has been sent."); } else { searchPage.verifyStatusMessage("Student's links for this course have been successfully " + "regenerated, but the email failed to send."); } String regeneratedJoinLink = searchPage.getStudentJoinLink(studentRow); assertNotEquals(regeneratedJoinLink, originalJoinLink); }

Target:
private void verifyRegenerateStudentCourseLinks(WebElement studentRow, String originalJoinLink) { if (TestProperties.isDevServer() || TestProperties.INCLUDE_EMAIL_VERIFICATION) { searchPage.verifyStatusMessage("Student's links for this course have been successfully " + "regenerated, and the email has been sent."); } String regeneratedJoinLink = searchPage.getStudentJoinLink(studentRow); assertNotEquals(regeneratedJoinLink, originalJoinLink); }
Source:
public boolean isEmpty() { return this.toProcess.isEmpty(); }

Target:
public boolean isEmpty() { synchronized (this.toProcess) { return this.toProcess.isEmpty(); } }
Source:
public final This bindList(String key, List<?> values) { if (values.isEmpty()) { throw new IllegalArgumentException( getClass().getSimpleName() + ".defineList was passed an empty list."); } StringBuilder names = new StringBuilder(); for (int i = 0; i < values.size(); i++) { String name = "__" + key + "_" + i; if (i > 0) { names.append(','); } names.append(':').append(name); bind(name, values.get(i)); } return define(key, names.toString()); }

Target:
public final This bindList(String key, List<?> values) { if (values.isEmpty()) { throw new IllegalArgumentException( getClass().getSimpleName() + ".bindList was called with an empty list."); } StringBuilder names = new StringBuilder(); for (int i = 0; i < values.size(); i++) { String name = "__" + key + "_" + i; if (i > 0) { names.append(','); } names.append(':').append(name); bind(name, values.get(i)); } return define(key, names.toString()); }
Source:
public String getQuestionSpecificEditFormHtml(int questionNumber) { boolean isMinOptionsToBeRankedEnabled = minOptionsToBeRanked != Integer.MIN_VALUE; boolean isMaxOptionsToBeRankedEnabled = maxOptionsToBeRanked != Integer.MIN_VALUE; return Templates.populateTemplate( FormTemplates.RANK_EDIT_RECIPIENTS_FORM, Slots.QUESTION_NUMBER, Integer.toString(questionNumber), Slots.OPTION_RECIPIENT_DISPLAY_NAME, "recipient", Slots.RANK_PARAM_IS_DUPLICATES_ALLOWED, Const.ParamsNames.FEEDBACK_QUESTION_RANKISDUPLICATESALLOWED, Slots.RANK_ARE_DUPLICATES_ALLOWED_CHECKED, isAreDuplicatesAllowed() ? "checked" : "", Slots.RANK_IS_MIN_RECIPIENTS_TO_BE_RANKED_ENABLED, isMinOptionsToBeRankedEnabled ? "checked" : "", Slots.RANK_PARAM_MIN_RECIPIENTS_CHECKBOX, Const.ParamsNames.FEEDBACK_QUESTION_RANKISMINRECIPIENTSTOBERANKEDENABLED, Slots.RANK_PARAM_MIN_RECIPIENTS_TO_BE_RANKED, Const.ParamsNames.FEEDBACK_QUESTION_RANKMINRECIPIENTSTOBERANKED, Slots.RANK_MIN_RECIPIENTS_TO_BE_RANKED, isMinOptionsToBeRankedEnabled ? Integer.toString(minOptionsToBeRanked) : "1", Slots.RANK_IS_MAX_RECIPIENTS_TO_BE_RANKED_ENABLED, isMaxOptionsToBeRankedEnabled ? "checked" : "", Slots.RANK_PARAM_MAX_RECIPIENTS_CHECKBOX, Const.ParamsNames.FEEDBACK_QUESTION_RANKISMAXRECIPIENTSTOBERANKEDENABLED, Slots.RANK_PARAM_MAX_RECIPIENTS_TO_BE_RANKED, Const.ParamsNames.FEEDBACK_QUESTION_RANKMAXRECIPIENTSTOBERANKED, Slots.RANK_MAX_RECIPIENTS_TO_BE_RANKED, isMaxOptionsToBeRankedEnabled ? Integer.toString(maxOptionsToBeRanked) : "1"); }

Target:
public String getQuestionSpecificEditFormHtml(int questionNumber) { boolean isMinOptionsToBeRankedEnabled = minOptionsToBeRanked != Integer.MIN_VALUE; boolean isMaxOptionsToBeRankedEnabled = maxOptionsToBeRanked != Integer.MIN_VALUE; return Templates.populateTemplate( FormTemplates.RANK_EDIT_RECIPIENTS_FORM, Slots.QUESTION_NUMBER, Integer.toString(questionNumber), Slots.OPTION_RECIPIENT_DISPLAY_NAME, "recipient", Slots.RANK_PARAM_IS_DUPLICATES_ALLOWED, Const.ParamsNames.FEEDBACK_QUESTION_RANKISDUPLICATESALLOWED, Slots.RANK_ARE_DUPLICATES_ALLOWED_CHECKED, isAreDuplicatesAllowed() ? "checked" : "", Slots.RANK_PARAM_MIN_RECIPIENTS_CHECKBOX, Const.ParamsNames.FEEDBACK_QUESTION_RANKISMINRECIPIENTSTOBERANKEDENABLED, Slots.RANK_PARAM_MIN_RECIPIENTS_TO_BE_RANKED, Const.ParamsNames.FEEDBACK_QUESTION_RANKMINRECIPIENTSTOBERANKED, Slots.RANK_MIN_RECIPIENTS_TO_BE_RANKED, isMinOptionsToBeRankedEnabled ? Integer.toString(minOptionsToBeRanked) : "1", Slots.RANK_IS_MIN_RECIPIENTS_TO_BE_RANKED_ENABLED, isMinOptionsToBeRankedEnabled ? "checked" : "", Slots.RANK_PARAM_MAX_RECIPIENTS_CHECKBOX, Const.ParamsNames.FEEDBACK_QUESTION_RANKISMAXRECIPIENTSTOBERANKEDENABLED, Slots.RANK_PARAM_MAX_RECIPIENTS_TO_BE_RANKED, Const.ParamsNames.FEEDBACK_QUESTION_RANKMAXRECIPIENTSTOBERANKED, Slots.RANK_MAX_RECIPIENTS_TO_BE_RANKED, isMaxOptionsToBeRankedEnabled ? Integer.toString(maxOptionsToBeRanked) : "1", Slots.RANK_IS_MAX_RECIPIENTS_TO_BE_RANKED_ENABLED, isMaxOptionsToBeRankedEnabled ? "checked" : ""); }
Source:
private void addNewAmbryPartitions(List<Partition> partitions, String resourceName) { if (partitions.isEmpty()) { throw new IllegalArgumentException("Cannot add resource with zero partitions"); } for (Map.Entry<String, HelixAdmin> entry : adminForDc.entrySet()) { String dcName = entry.getKey(); HelixAdmin dcAdmin = entry.getValue(); AutoModeISBuilder resourceISBuilder = new AutoModeISBuilder(resourceName); int numReplicas = 0; resourceISBuilder.setStateModel("LeaderStandby"); for (Partition partition : partitions) { String partitionName = Long.toString(partition.getId()); boolean sealed = partition.getPartitionState().equals(PartitionState.READ_ONLY); List<ReplicaId> replicaList = getReplicasInDc(partition, dcName); numReplicas = replicaList.size(); String[] instances = updateInstancesAndGetInstanceNames(dcAdmin, partitionName, replicaList, sealed); resourceISBuilder.assignPreferenceList(partitionName, instances); } resourceISBuilder.setNumReplica(numReplicas); IdealState idealState = resourceISBuilder.build(); dcAdmin.addResource(clusterName, resourceName, idealState); } }

Target:
private void addNewAmbryPartitions(List<Partition> partitions, String resourceName) { if (partitions.isEmpty()) { throw new IllegalArgumentException("Cannot add resource with zero partitions"); } for (Map.Entry<String, HelixAdmin> entry : adminForDc.entrySet()) { String dcName = entry.getKey(); HelixAdmin dcAdmin = entry.getValue(); AutoModeISBuilder resourceISBuilder = new AutoModeISBuilder(resourceName); int numReplicas = 0; resourceISBuilder.setStateModel(LeaderStandbySMD.name); for (Partition partition : partitions) { String partitionName = Long.toString(partition.getId()); boolean sealed = partition.getPartitionState().equals(PartitionState.READ_ONLY); List<ReplicaId> replicaList = getReplicasInDc(partition, dcName); numReplicas = replicaList.size(); String[] instances = updateInstancesAndGetInstanceNames(dcAdmin, partitionName, replicaList, sealed); Collections.shuffle(Arrays.asList(instances)); resourceISBuilder.assignPreferenceList(partitionName, instances); } resourceISBuilder.setNumReplica(numReplicas); IdealState idealState = resourceISBuilder.build(); dcAdmin.addResource(clusterName, resourceName, idealState); } }
Source:
public List<Scope> loadAllScopes(String tenantDomain) throws DataLoadingException { String scopesEp = APIConstants.SubscriptionValidationResources.SCOPES; List<Scope> scopes = new ArrayList<>(); String responseString; try { responseString = invokeService(scopesEp, tenantDomain); } catch (IOException e) { String msg = "Error while executing the http client " + scopesEp; log.error(msg, e); throw new DataLoadingException(msg, e); } if (responseString != null && !responseString.isEmpty()) { scopes = (new Gson().fromJson(responseString, ScopesList.class)).getList(); } return scopes; }

Target:
public List<Scope> loadAllScopes(String tenantDomain) throws DataLoadingException { String scopesEp = APIConstants.SubscriptionValidationResources.SCOPES; List<Scope> scopes = new ArrayList<>(); String responseString; try { responseString = invokeService(scopesEp, tenantDomain); } catch (IOException e) { String msg = "Error while executing the HTTP client " + scopesEp; log.error(msg, e); throw new DataLoadingException(msg, e); } if (responseString != null && !responseString.isEmpty()) { scopes = new Gson().fromJson(responseString, ScopesList.class).getList(); } return scopes; }
Source:
public void copyInto(final WireFeed feed, final SyndFeed syndFeed) { final Channel channel = (Channel) feed; super.copyInto(channel, syndFeed); syndFeed.setLanguage(channel.getLanguage()); syndFeed.setCopyright(channel.getCopyright()); syndFeed.setDocs(channel.getDocs()); syndFeed.setManagingEditor(channel.getManagingEditor()); syndFeed.setWebMaster(channel.getWebMaster()); syndFeed.setGenerator(channel.getGenerator()); final Date pubDate = channel.getPubDate(); if (pubDate != null) { syndFeed.setPublishedDate(pubDate); } else if (channel.getLastBuildDate() != null) { syndFeed.setPublishedDate(channel.getLastBuildDate()); } final String author = channel.getManagingEditor(); if (author != null) { final List<String> creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators(); if (!creators.contains(author)) { final Set<String> s = new LinkedHashSet<String>(); s.addAll(creators); s.add(author); creators.clear(); creators.addAll(s); } } final List<Item> items = channel.getItems(); if (items != null) { syndFeed.setEntries(createSyndEntries(items, syndFeed.isPreservingWireFeed())); } }

Target:
public void copyInto(final WireFeed feed, final SyndFeed syndFeed) { final Channel channel = (Channel) feed; super.copyInto(channel, syndFeed); syndFeed.setLanguage(channel.getLanguage()); syndFeed.setCopyright(channel.getCopyright()); syndFeed.setDocs(channel.getDocs()); syndFeed.setManagingEditor(channel.getManagingEditor()); syndFeed.setWebMaster(channel.getWebMaster()); syndFeed.setGenerator(channel.getGenerator()); final Date pubDate = channel.getPubDate(); if (pubDate != null) { syndFeed.setPublishedDate(pubDate); } else if (channel.getLastBuildDate() != null) { syndFeed.setPublishedDate(channel.getLastBuildDate()); } final String author = channel.getManagingEditor(); if (author != null) { final List<String> creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators(); if (!creators.contains(author)) { final Set<String> s = new LinkedHashSet<String>(); s.addAll(creators); s.add(author); creators.clear(); creators.addAll(s); } } }
Source:
private void revokeGithubOauthToken() { if (testGroupsToExclude == null || testGroupsToExclude.contains(TestGroup.GITHUB.toLowerCase())) { return; } try { gitHubClientService.deleteAllGrants(gitHubUsername, gitHubPassword); } catch (Exception e) { LOG.warn("There was an error of revoking the github oauth token.", e); } }

Target:
private void revokeGithubOauthToken() { if (excludedGroups == null || excludedGroups.contains(TestGroup.GITHUB)) { return; } try { gitHubClientService.deleteAllGrants(gitHubUsername, gitHubPassword); } catch (Exception e) { LOG.warn("There was an error of revoking the github oauth token.", e); } }
Source:
public Subtitle parse(InputStream inputStream, String inputEncoding, long startTimeUs) throws IOException { DataInputStream in = new DataInputStream(inputStream); String text = in.readUTF(); text = (text == null) ? "" : text; Log.i(TAG,"parse(" + text + "," + startTimeUs + ")" ); SubtitleData cue = new SubtitleData(); cue.setSubtitleText(text); cue.setStartTimePos(startTimeUs); mSubtitleList.add(cue); Collections.sort(mSubtitleList, new Comparator<SubtitleData>() { @Override public int compare(SubtitleData o1 , SubtitleData o2) { if (o1.getStartTimePos() < o2.getStartTimePos()) return -1; if (o1.getStartTimePos() > o2.getStartTimePos()) return 1; return 0; } }); TextSubtitle textSubtitle = new TextSubtitle(mSubtitleList); return textSubtitle; }

Target:
public Subtitle parse(InputStream inputStream, String inputEncoding, long startTimeUs) throws IOException { DataInputStream in = new DataInputStream(inputStream); String text = in.readUTF(); text = (text == null) ? "" : text; SubtitleData cue = new SubtitleData(startTimeUs, text); if (subtitleList.size() > 0) { long lastTimeUs = subtitleList.get(subtitleList.size() - 1).startTimePosUs; if (startTimeUs < lastTimeUs) { subtitleList.clear(); } while (subtitleList.size() > MAX_SUBTITLE_COUNT) { subtitleList.remove(0); } } subtitleList.add(cue); Collections.sort(subtitleList, new Comparator<SubtitleData>() { @Override public int compare(SubtitleData o1 , SubtitleData o2) { if (o1.startTimePosUs < o2.startTimePosUs) return -1; if (o1.startTimePosUs > o2.startTimePosUs) return 1; return 0; } }); return new TextSubtitle(subtitleList); }
Source:
public void next() { if (iter.hasNext()) { try { Handler<DeliveryContext> handler = iter.next(); if (handler != null) { handler.handle(this); } else { next(); } } catch (Throwable t) { log.error("Failure in interceptor", t); } } else { boolean local = true; if (message instanceof ClusteredMessage) { ClusteredMessage cmsg = (ClusteredMessage)message; if (cmsg.isFromWire()) { local = false; } } try { if (metrics != null) { metrics.beginHandleMessage(metric, local); } VertxTracer tracer = handlerContext.tracer(); if (tracer != null && !src) { List<Map.Entry<String, String>> tags = Collections.singletonList(new AbstractMap.SimpleEntry<>("peer.service", message.address)); Object trace = tracer.receiveRequest(context, message, message.isSend() ? "send" : "publish", message.headers, tags); handler.handle(message); tracer.sendResponse(context, null, trace, null, Collections.emptyList()); } else { handler.handle(message); } if (metrics != null) { metrics.endHandleMessage(metric, null); } } catch (Exception e) { log.error("Failed to handleMessage. address: " + message.address(), e); if (metrics != null) { metrics.endHandleMessage(metric, e); } context.reportException(e); } } }

Target:
public void next() { if (iter.hasNext()) { try { Handler<DeliveryContext> handler = iter.next(); if (handler != null) { handler.handle(this); } else { next(); } } catch (Throwable t) { log.error("Failure in interceptor", t); } } else { boolean local = true; if (message instanceof ClusteredMessage) { ClusteredMessage cmsg = (ClusteredMessage)message; if (cmsg.isFromWire()) { local = false; } } try { if (metrics != null) { metrics.beginHandleMessage(metric, local); } VertxTracer tracer = handlerContext.tracer(); if (tracer != null && !src) { Object trace = tracer.receiveRequest(context, message, message.isSend() ? "send" : "publish", message.headers, MessageTagExtractor.INSTANCE); handler.handle(message); tracer.sendResponse(context, null, trace, null, TagExtractor.empty()); } else { handler.handle(message); } if (metrics != null) { metrics.endHandleMessage(metric, null); } } catch (Exception e) { log.error("Failed to handleMessage. address: " + message.address(), e); if (metrics != null) { metrics.endHandleMessage(metric, e); } context.reportException(e); } } }
Source:
private void sendAndReceive(HttpMessage msg) throws HttpException, IOException { if (this.getDelayInMs() > 0) { try { Thread.sleep(this.getDelayInMs()); } catch (InterruptedException e) { } } if (parent != null) { httpSender.sendAndReceive(msg, parent.getRedirectRequestConfig()); requestCount++; parent.notifyNewMessage(msg); } }

Target:
private void sendAndReceive(HttpMessage msg) throws HttpException, IOException { if (this.getDelayInMs() > 0) { try { Thread.sleep(this.getDelayInMs()); } catch (InterruptedException e) { } } httpSender.sendAndReceive(msg, parent.getRedirectRequestConfig()); requestCount++; parent.notifyNewMessage(msg); }