auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void createOneUnAuthenticatedTest() throws Exception { context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context) .withName("My commynity") .build(); EPerson eperson1 = EPersonBuilder.createEPerson(context) .withEmail("eperson1@mail.com") .withPassword("qwerty01") .build(); context.restoreAuthSystemState(); ObjectMapper mapper = new ObjectMapper(); ResourcePolicyRest resourcePolicyRest = new ResourcePolicyRest(); resourcePolicyRest.setPolicyType(ResourcePolicy.TYPE_SUBMISSION); resourcePolicyRest.setAction(Constants.actionText[Constants.ADMIN]); getClient().perform(post("/api/authz/resourcepolicies") .content(mapper.writeValueAsBytes(resourcePolicyRest)) .param("resource", community.getID().toString()) .param("eperson", eperson1.getID().toString()) .contentType(contentType)) <START> .andExpect(status().isUnauthorized()); <END> }</code><technical_language>double check. a search admin verify policy created</technical_language>

Target:
public void createOneUnAuthenticatedTest() throws Exception { context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context) .withName("My commynity") .build(); EPerson eperson1 = EPersonBuilder.createEPerson(context) .withEmail("eperson1@mail.com") .withPassword("qwerty01") .build(); context.restoreAuthSystemState(); ObjectMapper mapper = new ObjectMapper(); ResourcePolicyRest resourcePolicyRest = new ResourcePolicyRest(); resourcePolicyRest.setPolicyType(ResourcePolicy.TYPE_SUBMISSION); resourcePolicyRest.setAction(Constants.actionText[Constants.ADMIN]); getClient().perform(post("/api/authz/resourcepolicies") .content(mapper.writeValueAsBytes(resourcePolicyRest)) .param("resource", community.getID().toString()) .param("eperson", eperson1.getID().toString()) .contentType(contentType)) .andExpect(status().isUnauthorized()); String authToken = getAuthToken(admin.getEmail(), password); getClient(authToken).perform(get("/api/authz/resourcepolicies/search/resource") .param("uuid", community.getID().toString()) .param("action", "ADMIN")) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$._links.self.href", Matchers.containsString("api/authz/resourcepolicies/search/resource"))) .andExpect(jsonPath("$.page.totalElements", is(0))); }
Source:
<code>public void testBindInteger(final boolean fireUntilHalt) throws InterruptedException { final String drl = "import org.drools.compiler.oopath.*;\n" + "global java.util.List list\n" + "\n" + "rule R when\n" + " Adult( $age: /age )\n" + "then\n" + " list.add( $age );\n" + "end\n"; final KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); if (fireUntilHalt) { <START> new Thread(ksession::fireUntilHalt).start(); <END> } final List<String> list = new ArrayList<>(); ksession.setGlobal( "list", list ); final Man bob = new Man( "Bob", 40 ); ksession.insert(bob); if (fireUntilHalt) { try { while (list.size() < 1) { Thread.sleep(100); } } finally { ksession.halt(); } } else { ksession.fireAllRules(); assertEquals( 1, list.size() ); } assertTrue( list.contains( 40 ) ); }</code><technical_language>Executors.newSingleThreadExecutor() get result Future object end of test a potential exception get unnoticed</technical_language>

Target:
public void testBindInteger(final boolean fireUntilHalt) throws InterruptedException, ExecutionException { final String drl = "import org.drools.compiler.oopath.model.*;\n" + "global java.util.List list\n" + "\n" + "rule R when\n" + " Adult( $age: /age )\n" + "then\n" + " list.add( $age );\n" + "end\n"; final KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); Future fireUntilHaltFuture = null; if (fireUntilHalt) { fireUntilHaltFuture = startFireUntilHaltThread(ksession); } final List<Integer> list = new ArrayList<>(); ksession.setGlobal( "list", list ); final Man bob = new Man( "Bob", 40 ); ksession.insert(bob); if (fireUntilHalt) { waitForResultAndStopFireUntilHalt(list, ksession, fireUntilHaltFuture); } else { ksession.fireAllRules(); Assertions.assertThat(list).hasSize(1); } Assertions.assertThat(list).contains(40); }
Source:
<code>public String getFilterName() { <START> return getClass().getName(); <END> }</code><technical_language>Is filter name</technical_language>

Target:
public String getFilterName() { return CheCorsFilter.class.getName(); }
Source:
<code>private List<Contentlet> convertToFileAssets( final User user, final boolean respectFrontendRoles, final List<Map<String, Object>> queryResults) throws DotDataException { <START> final List<Contentlet> files = new ArrayList<>(); <END> for (final Map<String, Object> fileInfo : queryResults) { final String contentId = (String) fileInfo.get("inode"); try { final Contentlet file = APILocator.getContentletAPI().find(contentId, user, respectFrontendRoles); files.add(file); } catch (DotSecurityException e) { Logger.debug(FileAssetFactoryImpl.class, e.getMessage()); } } return files; }</code><technical_language>Immutable</technical_language>

Target:
private List<Contentlet> convertToFileAssets( final User user, final boolean respectFrontendRoles, final List<Map<String, Object>> queryResults) throws DotDataException { final ImmutableList.Builder builder = new ImmutableList.Builder(); for (final Map<String, Object> fileInfo : queryResults) { final String contentId = (String) fileInfo.get("inode"); try { final Contentlet file = APILocator.getContentletAPI().find(contentId, user, respectFrontendRoles); builder.add(file); } catch (DotSecurityException e) { Logger.debug(FileAssetFactoryImpl.class, e.getMessage()); } } return builder.build(); }
Source:
<code>private void signInAndFetchBlogListWPOrg() { startProgress(getString(R.string.signing_in)); String url = EditTextUtils.getText(mUrlEditText).trim(); <START> url = url.replace("\n", "").replace("\r", ""); <END> mDispatcher.dispatch(AuthenticationActionBuilder.newDiscoverEndpointAction(url)); }</code><technical_language>I calls consolidated replace("\r|\n", "") safely</technical_language>

Target:
private void signInAndFetchBlogListWPOrg() { startProgress(getString(R.string.signing_in)); String url = EditTextUtils.getText(mUrlEditText).trim(); url = url.replaceAll("\r|\n", ""); mDispatcher.dispatch(AuthenticationActionBuilder.newDiscoverEndpointAction(url)); }
Source:
<code><START> protected UploadModule getModule() { <END> if (this.module == null) { this.module = getDescriptor().getModule(); } return this.module; }</code><technical_language>this synchronized prevent race conditions</technical_language>

Target:
protected synchronized UploadModule getModule() { if (this.module == null) { return getDescriptor().getModule(); } return this.module; }
Source:
<code>public final Object asyncInvokeNext(InvocationContext ctx, VisitableCommand command, CompletionStage<?> delay) { <START> if (delay == null || CompletionStages.isComplete(delay)) { <END> return invokeNext(ctx, command); } return asyncValue(delay).thenApply(ctx, command, invokeNextFunction); }</code><technical_language>a bit superfluous treat null completedNull(), avoid null CompletionStage values</technical_language>

Target:
public final Object asyncInvokeNext(InvocationContext ctx, VisitableCommand command, CompletionStage<?> delay) { if (delay == null || CompletionStages.isCompletedSuccessfully(delay)) { return invokeNext(ctx, command); } return asyncValue(delay).thenApply(ctx, command, invokeNextFunction); }
Source:
<code>CommonFilesSearchNode(CommonFilesMetaData metaData) { super(Children.create(new CommonFilesChildren(metaData), true), Lookups.singleton(metaData)); <START> children = this.getChildren(); <END> }</code><technical_language>need it</technical_language>

Target:
CommonFilesSearchNode(CommonFilesMetaData metaData) { super(Children.create(new CommonFilesChildren(metaData), true), Lookups.singleton(metaData)); }
Source:
<code>public void testInteropReadEncryptedParquetFiles() throws IOException { <START> Path rootPath = new Path("submodules/parquet-testing/data"); <END> LOG.info("======== testInteropReadEncryptedParquetFiles ========", rootPath.toString()); byte[] AADPrefix = AAD_PREFIX_STRING.getBytes(StandardCharsets.UTF_8); Map<DecryptionConfiguration, FileDecryptionProperties> decryptionPropertiesMap = getDecryptionConfigurations(AADPrefix); testReadEncryptedParquetFiles(rootPath, decryptionPropertiesMap); }</code><technical_language>I do experience git submodules this solution work default machine (while working in Travis). do (maven magic?) ensure files submodule test is executed</technical_language>

Target:
public void testInteropReadEncryptedParquetFiles() throws IOException { Path rootPath = new Path(PARQUET_TESTING_PATH); LOG.info("======== testInteropReadEncryptedParquetFiles ========", rootPath.toString()); byte[] AADPrefix = AAD_PREFIX_STRING.getBytes(StandardCharsets.UTF_8); testInteropReadEncryptedParquetFiles(rootPath, true , LINEAR_DATA); }
Source:
<code>public ConnectorPageSource createPageSource(ConnectorTransactionHandle transaction, ConnectorSession session, ConnectorSplit split, List<ColumnHandle> columns) { List<HiveColumnHandle> hiveColumns = columns.stream() .map(HiveColumnHandle.class::cast) .collect(toList()); HiveSplit hiveSplit = (HiveSplit) split; Path path = new Path(hiveSplit.getPath()); Configuration configuration = new Configuration(hdfsEnvironment.getConfiguration(new HdfsContext(session, hiveSplit.getDatabase(), hiveSplit.getTable()), path)); <START> configuration.setBoolean(S3_SELECT_PUSHDOWN_ENABLED, hiveSplit.isS3SelectPushdownEnabled()); <END> Optional<ConnectorPageSource> pageSource = createHivePageSource( cursorProviders, pageSourceFactories, configuration, session, path, hiveSplit.getBucketNumber(), hiveSplit.getStart(), hiveSplit.getLength(), hiveSplit.getFileSize(), hiveSplit.getSchema(), hiveSplit.getEffectivePredicate(), hiveColumns, hiveSplit.getPartitionKeys(), hiveStorageTimeZone, typeManager, hiveSplit.getColumnCoercions(), hiveSplit.getBucketConversion()); if (pageSource.isPresent()) { return pageSource.get(); } throw new RuntimeException("Could not find a file reader for split " + hiveSplit); }</code><technical_language>want Hadoop Configuration for Hadoop APIs, this effectively creates hidden state. Instead, this is code, add a parameter HiveRecordCursorProvider</technical_language>

Target:
public ConnectorPageSource createPageSource(ConnectorTransactionHandle transaction, ConnectorSession session, ConnectorSplit split, List<ColumnHandle> columns) { List<HiveColumnHandle> hiveColumns = columns.stream() .map(HiveColumnHandle.class::cast) .collect(toList()); HiveSplit hiveSplit = (HiveSplit) split; Path path = new Path(hiveSplit.getPath()); Configuration configuration = hdfsEnvironment.getConfiguration(new HdfsContext(session, hiveSplit.getDatabase(), hiveSplit.getTable()), path); Optional<ConnectorPageSource> pageSource = createHivePageSource( cursorProviders, pageSourceFactories, configuration, session, path, hiveSplit.getBucketNumber(), hiveSplit.getStart(), hiveSplit.getLength(), hiveSplit.getFileSize(), hiveSplit.getSchema(), hiveSplit.getEffectivePredicate(), hiveColumns, hiveSplit.getPartitionKeys(), hiveStorageTimeZone, typeManager, hiveSplit.getColumnCoercions(), hiveSplit.getBucketConversion(), hiveSplit.isS3SelectPushdownEnabled()); if (pageSource.isPresent()) { return pageSource.get(); } throw new RuntimeException("Could not find a file reader for split " + hiveSplit); }
Source:
<code>public void testItValidatesMaxSizeOfPhotoShareByMessage() throws MalformedURLException { SharePhotoContent sharePhotoContent = <START> new SharePhotoContent.Builder().addPhoto(buildSharePhoto("<LINK_2>")) <END> .addPhoto(buildSharePhoto("<LINK_5>")) .addPhoto(buildSharePhoto("<LINK_6>")) .addPhoto(buildSharePhoto("<LINK_1>")) .addPhoto(buildSharePhoto("<LINK_0>")) .addPhoto(buildSharePhoto("<LINK_3>")) .addPhoto(buildSharePhoto("<LINK_4>")) .build(); ShareContentValidation.validateForMessage(sharePhotoContent); }</code><technical_language>put addPhoto next line</technical_language>

Target:
public void testItValidatesMaxSizeOfPhotoShareByMessage() { SharePhotoContent sharePhotoContent = new SharePhotoContent.Builder() .addPhoto(buildSharePhoto("<LINK_2>")) .addPhoto(buildSharePhoto("<LINK_5>")) .addPhoto(buildSharePhoto("<LINK_6>")) .addPhoto(buildSharePhoto("<LINK_1>")) .addPhoto(buildSharePhoto("<LINK_0>")) .addPhoto(buildSharePhoto("<LINK_3>")) .addPhoto(buildSharePhoto("<LINK_4>")) .build(); ShareContentValidation.validateForMessage(sharePhotoContent); }
Source:
<code>public void validateTrip(Trip trip, Route route, List<StopTime> stopTimes, List<Stop> stops) { double maxSpeedKph = getMaxSpeedKph(route); int beginIndex = 0; while (missingBothTimes(stopTimes.get(beginIndex))) { beginIndex++; if (beginIndex == stopTimes.size()) return; } StopTime prevStopTime = stopTimes.get(beginIndex); Stop prevStop = stops.get(beginIndex); double distanceMeters = 0; for (int i = beginIndex + 1; i < stopTimes.size(); i++) { StopTime currStopTime = stopTimes.get(i); Stop currStop = stops.get(i); distanceMeters += fastDistance(currStop.stop_lat, currStop.stop_lon, prevStop.stop_lat, prevStop.stop_lon); if (missingBothTimes(currStopTime)) { continue; } if (currStopTime.departure_time < currStopTime.arrival_time) { registerError(currStopTime, DEPARTURE_BEFORE_ARRIVAL); } boolean bothTravelTimesRounded = areTravelTimesRounded(prevStopTime); double travelTimeSeconds = currStopTime.arrival_time - prevStopTime.departure_time; if (bothTravelTimesRounded && travelTimeSeconds == 0) <START> travelTimeSeconds += 60; <END> if (checkDistanceAndTime(distanceMeters, travelTimeSeconds, currStopTime)) { double kph = (distanceMeters / 1000D) / (travelTimeSeconds / 60D / 60D); if (kph < MIN_SPEED_KPH) { registerError(currStopTime, TRAVEL_TOO_SLOW, String.format("%2.1f km/h", kph)); } else if (kph > maxSpeedKph) { registerError(currStopTime, TRAVEL_TOO_FAST, String.format("%2.1f km/h", kph)); } } distanceMeters = 0; prevStopTime = currStopTime; prevStop = currStop; } }</code><technical_language>Please put brackets conditional bodies line break</technical_language>

Target:
public void validateTrip(Trip trip, Route route, List<StopTime> stopTimes, List<Stop> stops) { double maxSpeedKph = getMaxSpeedKph(route); int beginIndex = 0; while (missingBothTimes(stopTimes.get(beginIndex))) { beginIndex++; if (beginIndex == stopTimes.size()) return; } StopTime prevStopTime = stopTimes.get(beginIndex); Stop prevStop = stops.get(beginIndex); double distanceMeters = 0; for (int i = beginIndex + 1; i < stopTimes.size(); i++) { StopTime currStopTime = stopTimes.get(i); Stop currStop = stops.get(i); distanceMeters += fastDistance(currStop.stop_lat, currStop.stop_lon, prevStop.stop_lat, prevStop.stop_lon); if (missingBothTimes(currStopTime)) { continue; } if (currStopTime.departure_time < currStopTime.arrival_time) { registerError(currStopTime, DEPARTURE_BEFORE_ARRIVAL); } boolean bothTravelTimesRounded = areTravelTimesRounded(prevStopTime); double travelTimeSeconds = currStopTime.arrival_time - prevStopTime.departure_time; if (bothTravelTimesRounded && travelTimeSeconds == 0) { travelTimeSeconds += 60; } if (checkDistanceAndTime(distanceMeters, travelTimeSeconds, currStopTime)) { double kph = (distanceMeters / 1000D) / (travelTimeSeconds / 60D / 60D); if (kph < MIN_SPEED_KPH) { registerError(currStopTime, TRAVEL_TOO_SLOW, String.format("%2.1f km/h", kph)); } else if (kph > maxSpeedKph) { registerError(currStopTime, TRAVEL_TOO_FAST, String.format("%2.1f km/h", kph)); } } distanceMeters = 0; prevStopTime = currStopTime; prevStop = currStop; } }
Source:
<code>void start() { bossGroup = EventLoopGroups.newEventLoopGroup(1); EventLoopGroup workerGroup = CommonPools.workerGroup(); ServerBootstrap b = new ServerBootstrap(); channel = b.group(bossGroup, workerGroup) .channel(EventLoopGroups.serverChannelType(bossGroup)) .childHandler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) { ch.pipeline().addLast(new ScribeInboundHandler(scribe)); } }) <START> .childOption(ChannelOption.AUTO_READ, true) <END> .childOption(ChannelOption.SO_KEEPALIVE, true) .bind(port) .syncUninterruptibly() .channel(); }</code><technical_language>AUTO_READ is default, i.e. need set</technical_language>

Target:
void start() { bossGroup = EventLoopGroups.newEventLoopGroup(1); EventLoopGroup workerGroup = CommonPools.workerGroup(); ServerBootstrap b = new ServerBootstrap(); try { channel = b.group(bossGroup, workerGroup) .channel(EventLoopGroups.serverChannelType(bossGroup)) .childHandler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) { ch.pipeline().addLast(new ScribeInboundHandler(scribe)); } }) .childOption(ChannelOption.SO_BACKLOG, 1024) .bind(port) .syncUninterruptibly() .channel(); } catch (Throwable t) { throw new RuntimeException("Could not start scribe server.", t); } }
Source:
<code><START> protected void applyUndoRecordUnsafe(SMRRecord record) { <END> log.trace("Undo[{}] of {}@{} ({})", this, record.getSMRMethod(), Address.isAddress(record.getGlobalAddress()) ? record.getGlobalAddress() : "OPT", record.getUndoRecord()); IUndoFunction<T> undoFunction = undoFunctionMap.get(record.getSMRMethod()); if (undoFunction != null) { undoFunction.doUndo(object, record.getUndoRecord(), record.getSMRArguments()); return; } else if (resetSet.contains(record.getSMRMethod())) { object = (T) record.getUndoRecord(); record.clearUndoRecord(); return; } throw new RuntimeException("Unknown undo record in undo log"); }</code><technical_language>wanna derivation in future</technical_language>

Target:
private void applyUndoRecordUnsafe(SMRRecord record) { log.trace("Undo[{}] of {}@{} ({})", this, record.getSMRMethod(), Address.isAddress(record.getGlobalAddress()) ? record.getGlobalAddress() : "OPT", record.getUndoRecord()); IUndoFunction<T> undoFunction = undoFunctionMap.get(record.getSMRMethod()); if (undoFunction != null) { undoFunction.doUndo(object, record.getUndoRecord(), record.getSMRArguments()); return; } else if (resetSet.contains(record.getSMRMethod())) { object = (T) record.getUndoRecord(); record.clearUndoRecord(); return; } throw new RuntimeException("Unknown undo record in undo log"); }
Source:
<code>protected boolean doHandleRequest(final Request request) { FileItemWrap value = getRequestValue(request); FileItemWrap current = getValue(); boolean changed = value != null || current != null; if (changed) { resetValidationState(); boolean validFileType; if (isSetFileTypes()) { validFileType = FileValidationUtil.validateFileType(value, getFileTypes()); addFileTypeValidation(validFileType, InternalMessages.DEFAULT_VALIDATION_ERROR_FILE_WRONG_TYPE, getFileTypes().toArray(new Object[getFileTypes().size()])); } else { validFileType = true; } boolean validFileSize; if (isSetFileSize()) { validFileSize = FileValidationUtil.validateFileSize(value, getMaxFileSize()); addFileSizeValidation(validFileSize, InternalMessages.DEFAULT_VALIDATION_ERROR_FILE_WRONG_SIZE, Util.readableFileSize(value.getSize()), Util.readableFileSize(getMaxFileSize())); } else { validFileSize = true; } if (validFileSize && validFileType) { setData(value); <START> } else { <END> changed = false; } } return changed; }</code><technical_language>If a file previously loaded, this need cleared (ie set null) return "true" changed</technical_language>

Target:
protected boolean doHandleRequest(final Request request) { FileItemWrap value = getRequestValue(request); FileItemWrap current = getValue(); boolean changed = value != null || current != null; if (changed) { resetValidationState(); final FileWidgetModel sharedModel = getComponentModel(); if (hasFileTypes()) { boolean validFileType = FileUtil.validateFileType(value, getFileTypes()); if (sharedModel.validFileType != validFileType) { final FileWidgetModel userModel = getOrCreateComponentModel(); userModel.validFileType = validFileType; } } if (hasMaxFileSize()) { boolean validFileSize = FileUtil.validateFileSize(value, getMaxFileSize()); if (sharedModel.validFileSize != validFileSize) { final FileWidgetModel userModel = getOrCreateComponentModel(); userModel.validFileSize = validFileSize; } } if (isFileSizeValid() && isFileTypeValid()) { setData(value); } else if (current == null) { changed = false; } else { changed = true; setData(null); } } return changed; }
Source:
<code>public DeviceResource<WatchDog> getDeviceSubResource(String id) { <START> return inject(new BackendWatchdogResource(new Guid(), this, <END> updateType, getUpdateParametersProvider(), getRequiredUpdateFields())); }</code><technical_language>do pass 'new Guid()' ?, passing asGuidOr404(id) collection item accessible, error if try access watchdog ... GET .../watchdogs/xxx</technical_language>

Target:
public DeviceResource<WatchDog> getDeviceSubResource(String id) { return inject(new BackendWatchdogResource(asGuidOr404(id), this, updateType, getUpdateParametersProvider(), getRequiredUpdateFields())); }
Source:
<code><START> public <P, R> R accept(RealmEventVisitor<P, R> visitor, P param) throws RealmUnavailableException { <END> return visitor.handleUnknownEvent(this, param); }</code><technical_language>I this API change implies realms examine realm events, which, while possibly true, is unnecessarily constraining. In opinion, visitor implementations consume exceptions, else a generic exception type in type declaration. Thoughts</technical_language>

Target:
public <P, R> R accept(RealmEventVisitor<P, R> visitor, P param) { return visitor.handleUnknownEvent(this, param); }
Source:
<code>public void doPatchsetCreatedHook(final Change change, final PatchSet patchSet) { final PatchSetCreatedEvent event = new PatchSetCreatedEvent(); event.project = change.getProject().get(); event.branch = change.getDest().getShortName(); event.change = change.getKey().get(); event.commit = patchSet.getRevision().get(); event.patchSet = Integer.toString(patchSet.getPatchSetId()); for (ChangeListenerHolder holder : listeners.values()) { <START> if (!isVisibleTo(change, holder.user)) continue; <END> holder.listener.onPatchsetCreated(event); } final List<String> args = new ArrayList<String>(); args.add(patchsetCreatedHook.getAbsolutePath()); args.add("--change"); args.add(event.change); args.add("--project"); args.add(event.project); args.add("--branch"); args.add(event.branch); args.add("--commit"); args.add(event.commit); args.add("--patchset"); args.add(event.patchSet); runHook(getRepo(change), args); }</code><technical_language>Style-nit: braces a conditional put continue next line. Yes, longer. rewrite instead as: if (visibleTo(change, holder.user)) { holder.listener.onPatchsetCreated(event); }</technical_language>

Target:
public void doPatchsetCreatedHook(final Change change, final PatchSet patchSet) { final PatchSetCreatedEvent event = new PatchSetCreatedEvent(); event.project = change.getProject().get(); event.branch = change.getDest().getShortName(); event.change = change.getKey().get(); event.commit = patchSet.getRevision().get(); event.patchSet = Integer.toString(patchSet.getPatchSetId()); for (ChangeListenerHolder holder : listeners.values()) { if (isVisibleTo(change, holder.user)) { holder.listener.onChangeEvent(event); } } final List<String> args = new ArrayList<String>(); args.add(patchsetCreatedHook.getAbsolutePath()); args.add("--change"); args.add(event.change); args.add("--project"); args.add(event.project); args.add("--branch"); args.add(event.branch); args.add("--commit"); args.add(event.commit); args.add("--patchset"); args.add(event.patchSet); runHook(getRepo(change), args); }
Source:
<code>public IPropertyDescriptor[] getPropertyDescriptors() { Map<String, String> envVariables = getTraceProperties(); if (envVariables != null && !envVariables.isEmpty()) { <START> ArrayList<IPropertyDescriptor> propertyDescriptorList = new ArrayList<IPropertyDescriptor>(); <END> for (Map.Entry<String, String> varName : envVariables.entrySet()) { ReadOnlyTextPropertyDescriptor descriptor = new ReadOnlyTextPropertyDescriptor(varName.getKey(), varName.getKey()); descriptor.setCategory(sfTracePropertiesCategory); propertyDescriptorList.add(descriptor); } propertyDescriptorList.addAll(Arrays.asList(sfDescriptors)); IPropertyDescriptor array[] = new IPropertyDescriptor[propertyDescriptorList.size()]; return Arrays.copyOf(propertyDescriptorList.toArray(array), propertyDescriptorList.size()); } return Arrays.copyOf(sfDescriptors, sfDescriptors.length); }</code><technical_language>declared List, matter</technical_language>

Target:
public IPropertyDescriptor[] getPropertyDescriptors() { Map<String, String> envVariables = getTraceProperties(); if (!envVariables.isEmpty()) { IPropertyDescriptor[] propertyDescriptorArray = new IPropertyDescriptor[envVariables.size()+sfDescriptors.length]; int index =0; for (Map.Entry<String, String> varName : envVariables.entrySet()) { ReadOnlyTextPropertyDescriptor descriptor = new ReadOnlyTextPropertyDescriptor(varName.getKey(), varName.getKey()); descriptor.setCategory(sfTracePropertiesCategory); propertyDescriptorArray[index] = descriptor; index++; } for(int i=0; i<sfDescriptors.length; i++) { propertyDescriptorArray[index] = sfDescriptors[i]; index++; } return propertyDescriptorArray; } return Arrays.copyOf(sfDescriptors, sfDescriptors.length); }
Source:
<code>public static String patternToString(List<LockPatternView.Cell> pattern) { if (pattern == null) { return ""; } final int patternSize = pattern.size(); byte[] res = new byte[patternSize]; for (int i = 0; i < patternSize; i++) { LockPatternView.Cell cell = pattern.get(i); res[i] = (byte) (cell.getRow() * 3 + cell.getColumn()); } <START> try { <END> return new String(res, CHARSET); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Internal error", e); } }</code><technical_language>Do mind moving this a private method this method more readable? toUtf8Bytesin SimpleCrypto</technical_language>

Target:
public static String patternToString(List<LockPatternView.Cell> pattern) { if (pattern == null) { return ""; } final int patternSize = pattern.size(); byte[] res = new byte[patternSize]; for (int i = 0; i < patternSize; i++) { LockPatternView.Cell cell = pattern.get(i); res[i] = (byte) (cell.getRow() * 3 + cell.getColumn()); } return getString(res); }
Source:
<code>private void checkStatus(StatusCode status) throws IOException { logger.debug("result status code: {}", status); if (status == null) { <START> throw new NoSuchElementException(message.errorNullResult()); <END> } if (!status.isGood()) { throw new IOException(message.errorBadResultStatus() + status); } }</code><technical_language>Is specific reason of choosing NoSuchElementException NPE</technical_language>

Target:
private void checkStatus(StatusCode status) throws IOException { logger.debug("result status code: {}", status); if (status == null) { throw new NullPointerException(message.errorNullResult()); } if (!status.isGood()) { throw new IOException(message.errorBadResultStatus() + status); } }
Source:
<code>} catch (IOException e) { <START> Activator.getDefault().logInfo("Cannot read the file from URL due to "+e.getMessage()); END> }</code><technical_language>logError(String, Throwable)</technical_language>

Target:
} catch (IOException e) { Activator.getDefault().logError("Cannot read the file from URL due to ", e); }
Source:
<code>public boolean isValid(JsonNode value) { <START> if (value.isTextual() && (value.textValue() != null && !value.textValue().isEmpty())) { <END> return true; } return false; }</code><technical_language>org.apache.commons.lang3.StringUtils.isNotEmpty(value.textValue()) ?</technical_language>

Target:
public boolean isValid(JsonNode value) { if (value.isTextual() && StringUtils.isNotBlank(value.textValue())) { return true; } return false; }
Source:
<code>public void downloadBlob(HttpServletRequest request, HttpServletResponse response, String key, String reason) throws IOException { TransientStore ts = Framework.getService(TransientStoreService.class).getStore(STORE_NAME); if (!ts.exists(key)) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } List<Blob> blobs = ts.getBlobs(key); if (blobs == null || blobs.isEmpty()) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; } if (blobs.size() > 1) { throw new IllegalArgumentException("multipart download not yet implemented"); } if (ts.getParameter(key, ERROR) != null) { response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, <START> ((Throwable) ts.getParameter(key, ERROR)).getMessage()); <END> } else if (ts.isCompleted(key)) { try { Blob blob = blobs.get(0); downloadBlob(request, response, null, null, blob, blob.getFilename(), reason); } finally { ts.remove(key); } } else { response.setStatus(HttpServletResponse.SC_ACCEPTED); } }</code><technical_language>call ts.getParameter(key, ERROR) twice, put in a local variable. some redundancy downloadBlob downloadBlobStatus, some factored</technical_language>

Target:
public void downloadBlob(HttpServletRequest request, HttpServletResponse response, String key, String reason) throws IOException { this.downloadBlob(request, response, key, reason, false); }
Source:
<code>public <RetType> RetType submit(TaskAction<RetType> taskAction) { try { byte[] dataToSend = jsonMapper.writeValueAsBytes(taskAction); <START> final String response = httpClient.post(getServiceUri().toURL()) <END> .setContent("application/json", dataToSend) .go(new ToStringResponseHandler(Charsets.UTF_8)) .get(); if(response.equals("")) { return null; } else { return jsonMapper.readValue(response, taskAction.getReturnTypeReference()); } } catch (Exception e) { throw Throwables.propagate(e); } }</code><technical_language>I figured including a token communicate coordinator verify guy is working working it. guessing need a token ensure behavior there</technical_language>

Target:
public <RetType> RetType submit(TaskAction<RetType> taskAction) { try { byte[] dataToSend = jsonMapper.writeValueAsBytes(taskAction); final String response = httpClient.post(getServiceUri().toURL()) .setContent("application/json", dataToSend) .go(new ToStringResponseHandler(Charsets.UTF_8)) .get(); final Map<String, Object> responseDict = jsonMapper.readValue( response, new TypeReference<Map<String, Object>>() ); return jsonMapper.convertValue(responseDict.get("result"), taskAction.getReturnTypeReference()); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code>private static void waitForService(final ServiceController<?> controller) throws OperationFailedException { try { final CountDownLatch latch = new CountDownLatch(1); final LifecycleListener listener = new LifecycleListener() { @Override public void handleEvent(ServiceController<?> controller, LifecycleEvent event) { latch.countDown(); } }; controller.addListener(listener); latch.await(); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); throw SecurityLogger.ROOT_LOGGER.interruptedWaitingForSecurityDomain(controller.getName().getSimpleName()); } catch (final Throwable ignored) if (controller.getState() != ServiceController.State.UP) { <START> throw SecurityLogger.ROOT_LOGGER.requiredSecurityDomainServiceNotAvailable(controller.getName().getSimpleName()); <END> } }</code><technical_language>lifecycle listener removed in a finally block</technical_language>

Target:
private static void waitForService(final ServiceController<?> controller) throws OperationFailedException { try { final CountDownLatch latch = new CountDownLatch(1); final LifecycleListener listener = new LifecycleListener() { @Override public void handleEvent(ServiceController<?> controller, LifecycleEvent event) { latch.countDown(); controller.removeListener(this); } }; controller.addListener(listener); latch.await(100, TimeUnit.MILLISECONDS); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); throw SecurityLogger.ROOT_LOGGER.interruptedWaitingForSecurityDomain(controller.getName().getSimpleName()); } catch (final Throwable ignored) if (controller.getState() != ServiceController.State.UP) { throw SecurityLogger.ROOT_LOGGER.requiredSecurityDomainServiceNotAvailable(controller.getName().getSimpleName()); } }
Source:
<code>private Indexes(InternalSerializationService serializationService, IndexCopyBehavior copyBehavior) { this.serializationService = serializationService; this.indexProvider = new DefaultIndexProvider(); this.extractors = Extractors.empty(); this.global = true; this.copyBehavior = copyBehavior; this.queryableEntriesAreCached = false; this.queryContextProvider = new GlobalQueryContextProvider(); <START> this.stats = InternalIndexesStats.EMPTY; <END> }</code><technical_language>constructor share some code</technical_language>

Target:
private Indexes(InternalSerializationService serializationService, IndexCopyBehavior copyBehavior) { this.serializationService = serializationService; this.indexProvider = new DefaultIndexProvider(); this.extractors = Extractors.empty(); this.global = true; this.copyBehavior = copyBehavior; this.queryableEntriesAreCached = false; this.queryContextProvider = new GlobalQueryContextProvider(); this.stats = IndexesStats.EMPTY; }
Source:
<code>public static HttpsURLConnection createConnection(final String urlPath, final boolean multiPart) { try { final URL url = new URL(SERVER_URL + "/" + urlPath); final HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setSSLSocketFactory(SimlarSSLSocketFactory.getInstance()); connection.setDoInput(true); connection.setDoOutput(true); connection.setUseCaches(false); connection.setRequestMethod("POST"); if (multiPart) { connection.setRequestProperty("Connection", "Keep-Alive"); connection.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + DATA_BOUNDARY); } else { connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); } Lg.v("created connection for: ", urlPath); return connection; } catch (final MalformedURLException e) { Lg.ex(e, "MalformedURLException"); <START> } catch (final ProtocolException e) { <END> Lg.ex(e, "ProtocolException"); } catch (final IOException e) { Lg.ex(e, "IOException while creating connection"); } Lg.e("failed to create connection for: ", urlPath); return null; }</code><technical_language>} catch (final MalformedURLException | ProtocolException | IOException e) { Lg.ex(e, "Failed create connection for", urlPath);</technical_language>

Target:
public static HttpsURLConnection createConnection(final String urlPath, final boolean multiPart) { try { final URL url = new URL(SERVER_URL + "/" + urlPath); final HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setSSLSocketFactory(SimlarSSLSocketFactory.getInstance()); connection.setDoInput(true); connection.setDoOutput(true); connection.setUseCaches(false); connection.setRequestMethod("POST"); if (multiPart) { connection.setRequestProperty("Connection", "Keep-Alive"); connection.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + DATA_BOUNDARY); } else { connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); } Lg.v("created connection for: ", urlPath); return connection; } catch (final IOException e) { Lg.ex(e); } Lg.e("failed to create connection for: ", urlPath); return null; }
Source:
<code><START> @Override protected void onKernalStart0() { <END> metricsUpdateTask = ctx.timeout().schedule(new MetricsUpdater(), METRICS_UPDATE_FREQ, METRICS_UPDATE_FREQ); }</code><technical_language>this change</technical_language>

Target:
@Override protected void onKernalStart0() throws IgniteCheckedException { metricsUpdateTask = ctx.timeout().schedule(new MetricsUpdater(), METRICS_UPDATE_FREQ, METRICS_UPDATE_FREQ); }
Source:
<code>public void connect() { <START> disconnect(); END> _zkclient = createZkClient(); _zkclient.subscribeStateChanges(getOrCreateStateChangeListener()); _leaderElectionListener = new ZkLeaderElectionListener(); _instanceName = createLiveInstanceNode(); LOG.info("Coordinator instance " + _instanceName + " is online"); _assignmentList = new ZkBackedTaskListProvider(_cluster, _instanceName); onBecomeFollower(); joinLeaderElection(); LOG.info("Instance " + _instanceName + " is ready."); }</code><technical_language>remove this? this leads a bunch of hosts leaders due metrics, extremely difficult debug for people familiar issues symptoms of this change. oncall debug this thinking multiple leaders, don't</technical_language>

Target:
public void connect() { disconnect(); _zkclient = createZkClient(); _stateChangeListener = new ZkStateChangeListener(); _leaderElectionListener = new ZkLeaderElectionListener(); _instanceName = createLiveInstanceNode(); LOG.info("Coordinator instance " + _instanceName + " is online"); _assignmentList = new ZkBackedTaskListProvider(_cluster, _instanceName); onBecomeFollower(); joinLeaderElection(); LOG.info("Instance " + _instanceName + " is ready."); }
Source:
<code>public void remove(RemoteFile file) throws IOException, JadbException { InputStream s = device.executeShell("rm", "-f", Bash.quote(file.getPath())); Stream.flushRead(s); <START> s.close(); <END> }</code><technical_language>Nice :+1: better, try-with-resource idiom</technical_language>

Target:
public void remove(RemoteFile file) throws IOException, JadbException { try (InputStream stream = device.executeShell("rm", "-f", Bash.quote(file.getPath()))) { Stream.flushRead(stream); } }
Source:
<code>public static EventFiringWebDriver getDriverInstanceForBrowser(String browser, String userAgent) { browserName = browser; <START> switch (browser.toUpperCase()) { <END> case "FF": return getFFInstanceWithUserAgent(userAgent); case "CHROME": return getChromeInstanceWithUserAgent(userAgent); default: throw new RuntimeException( "Bad browser provided. Browser " + browser + " not known" ); } }</code><technical_language>+1: for newest Java switch String syntax ! :)</technical_language>

Target:
public static EventFiringWebDriver getDriverInstanceForBrowser(String browser, String userAgent) { browserName = browser; switch (browser.toUpperCase()) { case "FF": return getFFInstanceWithUserAgent(userAgent); case "CHROME": return getChromeInstanceWithUserAgent(userAgent); default: throw new RuntimeException( "Wrong browser provided. Browser " + browser + " not known" ); } }
Source:
<code>public List<Integer> getAlleleIndices(final Collection<Allele> alleles) { return alleles.stream() .map(this::getAlleleIndex) <START> .collect(Collectors.toCollection(LinkedList::new)); <END> }</code><technical_language>I this a LinkedList? ArrayList of size</technical_language>

Target:
public List<Integer> getAlleleIndices(final Collection<Allele> alleles) { return alleles.stream() .map(this::getAlleleIndex) .collect(Collectors.toCollection(() -> new ArrayList<>(alleles.size()))); }
Source:
<code>public int available() throws IOException { <START> int available = in.available() + (int) (((FSDataInputStream) in).getPos() - mPos); <END> return available > 0 ? available : 0; }</code><technical_language>explain logic here</technical_language>

Target:
public int available() throws IOException { if (mPos != ((FSDataInputStream) in).getPos()) { return 0; } return in.available(); }
Source:
<code>public PipeRunResult doPipe(Message message, IPipeLineSession session) throws PipeRunException { <START> try { try (MessageOutputStream target=MessageOutputStream.getTargetStream(this, session, getNextPipe())) { try (OutputStream out = target.asStream()) { <END> pgpAction.run(message.asInputStream(), out); } return target.getPipeRunResult(); } } catch (Exception e) { throw new PipeRunException(this, "Exception was thrown during PGPPipe execution.", e); } }</code><technical_language>mag 1 try weg</technical_language>

Target:
public PipeRunResult doPipe(Message message, IPipeLineSession session) throws PipeRunException { try (MessageOutputStream target=MessageOutputStream.getTargetStream(this, session, getNextPipe())) { try (OutputStream out = target.asStream()) { pgpAction.run(message.asInputStream(), out); } return target.getPipeRunResult(); } catch (Exception e) { throw new PipeRunException(this, "Exception was thrown during PGPPipe execution.", e); } }
Source:
<code>public Binder build(Annotation annotation) { return new Binder<BindSomething, Something>() { @Override <START> public void bind(SQLStatement q, BindSomething bindSomethingAnnotation, Something arg) <END> { q.bind(bindSomethingAnnotation.value() + ".id", arg.getId()); q.bind(bindSomethingAnnotation.value() + ".name", arg.getName()); } }; }</code><technical_language>Rename bs</technical_language>

Target:
public Binder build(Annotation annotation) { return new Binder<BindSomething, Something>() { @Override public void bind(SQLStatement q, BindSomething bs, Something arg) { q.bind(bs.value() + ".id", arg.getId()); q.bind(bs.value() + ".name", arg.getName()); } }; }
Source:
<code>protected EntityDynamicType(Class<? extends Entity> clazz, AbstractEntity entity) { this.entityClass = clazz; this.entity = entity; <START> String id = entity==null ? clazz.getName() : entity.getId(); <END> effectors.putAll(findEffectors(clazz, entity)); if (LOG.isTraceEnabled()) LOG.trace("Entity effectors: {}", id, Joiner.on(", ").join(effectors.keySet())); sensors.putAll(findSensors(clazz, entity)); if (LOG.isTraceEnabled()) LOG.trace("Entity sensors: {}", id, Joiner.on(", ").join(sensors.keySet())); configKeys.putAll(findConfigKeys(clazz, entity)); if (LOG.isTraceEnabled()) LOG.trace("Entity config keys: {}", id, Joiner.on(", ").join(configKeys.keySet())); refreshSnapshot(); }</code><technical_language>When/why entity null? do this.enitty = checkNotNull(entity, "entity"), fix null is passed in</technical_language>

Target:
private EntityDynamicType(Class<? extends Entity> clazz, AbstractEntity entity) { this.entityClass = clazz; this.entity = entity; String id = entity==null ? clazz.getName() : entity.getId(); effectors.putAll(findEffectors(clazz, entity)); if (LOG.isTraceEnabled()) LOG.trace("Entity effectors: {}", id, Joiner.on(", ").join(effectors.keySet())); sensors.putAll(findSensors(clazz, entity)); if (LOG.isTraceEnabled()) LOG.trace("Entity sensors: {}", id, Joiner.on(", ").join(sensors.keySet())); configKeys.putAll(findConfigKeys(clazz, entity)); if (LOG.isTraceEnabled()) LOG.trace("Entity config keys: {}", id, Joiner.on(", ").join(configKeys.keySet())); refreshSnapshot(); }
Source:
<code>protected boolean doLunsUseConnection(StorageServerConnections connection) { luns = getLunDao().getAllForStorageServerConnection(connection.getid()); <START> return !luns.isEmpty(); <END> }</code><technical_language>protect if (luns != null), in case</technical_language>

Target:
protected boolean doLunsUseConnection(StorageServerConnections connection) { luns = getLunDao().getAllForStorageServerConnection(connection.getid()); return domains != null && !luns.isEmpty(); }
Source:
<code>public FutureResult<ProcessExecutionDetail> executeProcess(ProcessExecution execution) { notNull(execution, "execution"); final ProcessExecutionTask executionTask; try { executionTask = restTemplate.postForObject(execution.getExecutionsUri(), execution, ProcessExecutionTask.class); <START> } catch (GoodDataException | RestClientException e) { <END> throw new GoodDataException("Cannot start execution", e); } if (executionTask == null) { throw new GoodDataException("Cannot find started execution."); } return new FutureResult<>(this, new PollHandler<Void, ProcessExecutionDetail>(executionTask.getPollLink(), Void.class, ProcessExecutionDetail.class) { @Override protected boolean isFinished(ClientHttpResponse response) throws IOException { return HttpStatus.NO_CONTENT.equals(response.getStatusCode()); } @Override protected void handlePollResult(Void pollResult) { ProcessExecutionDetail executionDetail; try { executionDetail = restTemplate.getForObject(executionTask.getDetailLink(), ProcessExecutionDetail.class); } catch (GoodDataException | RestClientException e) { throw new ProcessExecutionException("Execution finished, but cannot get its result.", e, executionTask.getDetailLink()); } if (!executionDetail.isSuccess()) { throw new ProcessExecutionException("Execution was not successful", executionDetail); } else { setResult(executionDetail); } } }); }</code><technical_language>please handle 410 ProcessExecutionException</technical_language>

Target:
public FutureResult<ProcessExecutionDetail> executeProcess(ProcessExecution execution) { notNull(execution, "execution"); ProcessExecutionTask executionTask; try { executionTask = restTemplate.postForObject(execution.getExecutionsUri(), execution, ProcessExecutionTask.class); } catch (GoodDataException | RestClientException e) { throw new ProcessExecutionException("Cannot execute process", e); } if (executionTask == null) { throw new ProcessExecutionException("Cannot find started execution."); } final String detailLink = executionTask.getDetailLink(); return new FutureResult<>(this, new PollHandler<Void, ProcessExecutionDetail>(executionTask.getPollLink(), Void.class, ProcessExecutionDetail.class) { @Override protected boolean isFinished(ClientHttpResponse response) throws IOException { return HttpStatus.NO_CONTENT.equals(response.getStatusCode()); } @Override protected void handlePollResult(Void pollResult) { ProcessExecutionDetail executionDetail; try { executionDetail = restTemplate.getForObject(detailLink, ProcessExecutionDetail.class); } catch (GoodDataException | RestClientException e) { throw new ProcessExecutionException("Execution finished, but cannot get its result.", e, detailLink); } if (!executionDetail.isSuccess()) { throw new ProcessExecutionException("Execution was not successful", executionDetail); } else { setResult(executionDetail); } } }); }
Source:
<code>@Override protected Map<String, ?> run(@Nullable VisorMetricTaskArg arg) throws IgniteException { String name = arg.name(); <START> GridMetricManager mMgr = ignite.context().metric(); <END> for (ReadOnlyMetricRegistry mReg : mMgr) { String mRegName = mReg.name(); if (mRegName.equals(name)) { Map<String, Object> res = new HashMap<>(); mReg.forEach(metric -> res.put(metric.name(), valueOf(metric))); return res; } String mRegPrefix = mRegName + SEPARATOR; if (!name.startsWith(mRegPrefix)) continue; if (mRegPrefix.length() == name.length()) return null; String metricName = name.substring(mRegPrefix.length()); Metric metric = mReg.findMetric(metricName); if (metric != null) return Collections.singletonMap(name, valueOf(metric)); Object val = searchHistogram(metricName, mReg); if (val != null) return Collections.singletonMap(name, val); } return null; }</code><technical_language>mMgr -> mmgr</technical_language>

Target:
@Override protected Map<String, ?> run(@Nullable VisorMetricTaskArg arg) throws IgniteException { String name = arg.name(); GridMetricManager mmgr = ignite.context().metric(); for (ReadOnlyMetricRegistry mreg : mmgr) { String mregName = mreg.name(); if (mregName.equals(name)) { Map<String, Object> res = new HashMap<>(); mreg.forEach(metric -> res.put(metric.name(), valueOf(metric))); return res; } String mregPrefix = mregName + SEPARATOR; if (!name.startsWith(mregPrefix)) continue; if (mregPrefix.length() == name.length()) return null; String metricName = name.substring(mregPrefix.length()); Metric metric = mreg.findMetric(metricName); if (metric != null) return Collections.singletonMap(name, valueOf(metric)); Object val = searchHistogram(metricName, mreg); if (val != null) return Collections.singletonMap(name, val); } return null; }
Source:
<code>public void testCreateDecoratedTwoRequestsToGetDifferentlyDecoratedSamePoolUseSameLock() { DecoratedMacPoolFactory factory = new DecoratedMacPoolFactory(lockedObjectFactorySpy); MacPool decoratedPoolA = factory.createDecoratedPool(poolId, macPool, singletonList(macPoolDecoratorA)); MacPool decoratedPoolB = factory.createDecoratedPool(poolId, macPool, singletonList(macPoolDecoratorB)); assertThat(decoratedPoolA, is(macPoolDecoratorA)); assertThat(decoratedPoolB, is(macPoolDecoratorB)); <START> ArgumentCaptor<ReentrantReadWriteLock> captor1 = ArgumentCaptor.forClass(ReentrantReadWriteLock.class); <END> verify(lockedObjectFactorySpy, times(2)).createLockingInstance(eq(macPool), eq(MacPool.class), any()); }</code><technical_language>captor in anymore</technical_language>

Target:
public void testCreateDecoratedTwoRequestsToGetDifferentlyDecoratedSamePoolUseSameLock() { multipleDecoratorsUsesSameLock(macPoolDecoratorA, macPoolDecoratorB); }