auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public XmlValidatorManager(Props props) { String validatorDirPath = props.getString(VALIDATOR_PLUGIN_DIR, DEFAULT_VALIDATOR_DIR); File validatorDir = new File(validatorDirPath); <START> if (!validatorDir.canRead() || !validatorDir.isDirectory()) { <END> throw new ValidatorManagerException("Validator directory " + validatorDirPath + " does not exist or is not a direcotry."); } List<URL> resources = new ArrayList<URL>(); try { logger.info("Adding validator resources."); for (File f : validatorDir.listFiles()) { if (f.getName().endsWith(".jar")) { resources.add(f.toURI().toURL()); logger.debug("adding to classpath " + f.toURI().toURL()); } } } catch (MalformedURLException e) { throw new ValidatorManagerException(e); } validatorLoader = new URLClassLoader(resources.toArray(new URL[resources.size()])); try { loadValidators(props, logger); } catch (Exception e) { logger.error("Cannot load all the validaotors."); throw new ValidatorManagerException(e); } }</code><technical_language>Do need check fi.exists()</technical_language>

Target:
public XmlValidatorManager(Props props) { String validatorDirPath = props.getString(VALIDATOR_PLUGIN_DIR, DEFAULT_VALIDATOR_DIR); File validatorDir = new File(validatorDirPath); if (!validatorDir.canRead() || !validatorDir.isDirectory()) { throw new ValidatorManagerException("Validator directory " + validatorDirPath + " does not exist or is not a directory."); } List<URL> resources = new ArrayList<URL>(); try { logger.info("Adding validator resources."); for (File f : validatorDir.listFiles()) { if (f.getName().endsWith(".jar")) { resources.add(f.toURI().toURL()); logger.debug("adding to classpath " + f.toURI().toURL()); } } } catch (MalformedURLException e) { throw new ValidatorManagerException(e); } validatorLoader = new URLClassLoader(resources.toArray(new URL[resources.size()])); try { loadValidators(props, logger); } catch (Exception e) { logger.error("Cannot load all the validators."); throw new ValidatorManagerException(e); } }
Source:
<code>private void convertRequireForAlreadyConverted(ModuleImport moduleImport) { String originalPath = moduleImport.requiredNamespace.replace(alreadyConvertedPrefix + ".", "").replace(".", "/"); String referencedFile = pathUtil.getImportPath(moduleImport.originalImportNode.getSourceFileName(), originalPath); Node importSpec = IR.empty(); Node requireLHS = moduleImport.originalImportNode.getFirstChild(); if (moduleImport.isDestructuringImport) { importSpec = new Node(Token.IMPORT_SPECS); for (String fullLocalName : moduleImport.fullLocalNames) { importSpec.addChildToBack(IR.name(fullLocalName)); } <START> } else if (requireLHS != null && requireLHS.isName()) { <END> importSpec = Node.newString(Token.IMPORT_STAR, moduleImport.fullLocalNames.get(0)); } Node importNode = new Node(Token.IMPORT, IR.empty(), importSpec, Node.newString(referencedFile)); nodeComments.replaceWithComment(moduleImport.originalImportNode, importNode); compiler.reportChangeToEnclosingScope(importNode); }</code><technical_language>moduleImport a method for this - 'isFullModuleImport'</technical_language>

Target:
private void convertRequireForAlreadyConverted(ModuleImport moduleImport) { String originalPath = moduleImport.requiredNamespace.replace(alreadyConvertedPrefix + ".", "").replace(".", "/"); String referencedFile = pathUtil.getImportPath(moduleImport.originalImportNode.getSourceFileName(), originalPath); Node importSpec = IR.empty(); if (moduleImport.isDestructuringImport) { importSpec = new Node(Token.IMPORT_SPECS); for (String fullLocalName : moduleImport.fullLocalNames) { importSpec.addChildToBack(IR.name(fullLocalName)); } } else if (moduleImport.isFullModuleImport()) { importSpec = Node.newString(Token.IMPORT_STAR, moduleImport.fullLocalNames.get(0)); } Node importNode = new Node(Token.IMPORT, IR.empty(), importSpec, Node.newString(referencedFile)); nodeComments.replaceWithComment(moduleImport.originalImportNode, importNode); compiler.reportChangeToEnclosingScope(importNode); }
Source:
<code>protected Op checkTableIds(final TableId...expectedTables) { return new Op() { @Override public void execute() { List<TableId> expectedTableIds = new ArrayList<>(); for (TableId expectedTable: expectedTables) { expectedTableIds.add(expectedTable); } assertEquals(expectedTableIds, tableMonitorThread.tables()); } <START> }; <END> }</code><technical_language>a lambda here: protected Op checkTableIds(final TableId...expectedTables) { return ()-> { List<TableId> expectedTableIds = Arrays.asList(expectedTables); assertEquals(expectedTableIds, tableMonitorThread.tables()); }; Also, this check verifies IDs in order. Is sufficient? Finally, this return a lamba in place? place this method is called, immediately calling execute(). a helper method performs assertion? protected void checkTableIds(final TableId...expectedTables) { List<TableId> expectedTableIds = Arrays.asList(expectedTables); assertEquals(expectedTableIds, tableMonitorThread.tables()); }</technical_language>

Target:
protected void checkTableIds(final TableId...expectedTables) { assertEquals(Arrays.asList(expectedTables), tableMonitorThread.tables()); }
Source:
<code>public Tracker build(){ if (trackerClass == null) { throw new IllegalStateException("No tracker class found or defined"); } try { Constructor<? extends Tracker> c = trackerClass.getDeclaredConstructor(TrackerBuilder.class); return c.newInstance(this); } catch (NoSuchMethodException e) { <START> throw new IllegalStateException("Can’t create tracker", e); <END> } catch (InvocationTargetException e) { throw new IllegalStateException("Can’t create tracker", e); } catch (InstantiationException e) { throw new IllegalStateException("Can’t create tracker", e); } catch (IllegalAccessException e) { throw new IllegalStateException("Can’t create tracker", e); } }</code><technical_language>Single static string somewhere</technical_language>

Target:
public Tracker build(){ if (trackerClass == null) { throw new IllegalStateException("No tracker class found or defined"); } String err = "Can’t create tracker"; try { Constructor<? extends Tracker> c = trackerClass.getDeclaredConstructor(TrackerBuilder.class); return c.newInstance(this); } catch (NoSuchMethodException e) { throw new IllegalStateException(err, e); } catch (InvocationTargetException e) { throw new IllegalStateException(err, e); } catch (InstantiationException e) { throw new IllegalStateException(err, e); } catch (IllegalAccessException e) { throw new IllegalStateException(err, e); } }
Source:
<code>public HttpContent readChunk(ChannelHandlerContext ctx) { long chunkDispenseStartTime = System.currentTimeMillis(); logger.trace("Servicing request for next chunk on channel {}", ctx.channel()); HttpContent content = null; Chunk chunk = chunksToWrite.poll(); if (chunk != null) { chunk.onDequeue(); ByteBuf buf = Unpooled.wrappedBuffer(chunk.buffer); chunksAwaitingCallback.add(chunk); <START> if (contentLength != -1 && chunk.writeCompleteThreshold >= contentLength) { <END> content = new DefaultLastHttpContent(buf); sentLastChunk = true; } else { content = new DefaultHttpContent(buf); } } else if (allChunksWritten() && !sentLastChunk) { sentLastChunk = true; content = LastHttpContent.EMPTY_LAST_CONTENT; logger.trace("Last chunk was sent on channel {}", ctx.channel()); } nettyMetrics.chunkDispenseTimeInMs.update(System.currentTimeMillis() - chunkDispenseStartTime); return content; }</code><technical_language>do making isLastChunk a property of Chunk (which figure out in constructor)</technical_language>

Target:
public HttpContent readChunk(ChannelHandlerContext ctx) { long chunkDispenseStartTime = System.currentTimeMillis(); logger.trace("Servicing request for next chunk on channel {}", ctx.channel()); HttpContent content = null; Chunk chunk = chunksToWrite.poll(); if (chunk != null) { chunk.onDequeue(); ByteBuf buf = Unpooled.wrappedBuffer(chunk.buffer); chunksAwaitingCallback.add(chunk); if (chunk.isLast) { content = new DefaultLastHttpContent(buf); sentLastChunk = true; } else { content = new DefaultHttpContent(buf); } } else if (allChunksWritten() && !sentLastChunk) { sentLastChunk = true; content = LastHttpContent.EMPTY_LAST_CONTENT; logger.trace("Last chunk was sent on channel {}", ctx.channel()); } nettyMetrics.chunkDispenseTimeInMs.update(System.currentTimeMillis() - chunkDispenseStartTime); return content; }
Source:
<code>public ChooseDeviceDialogFixture <START> runApp(@NotNull <END> String appName) throws ClassNotFoundException { runApplication("Run", appName); return ChooseDeviceDialogFixture.find(this, robot, AndroidBundle.message("choose.device.dialog.title")); }</code><technical_language>Add a method "findChooseDeviceDialog" returns a ChooseDeviceDialogFixture</technical_language>

Target:
public void runApp(@NotNull String appName) throws ClassNotFoundException { runApplication("Run", appName); }
Source:
<code>public void testRefreshInterval() throws Exception { H2DaoProvider daoProvider = setup("selectors"); H2ResourceGroupsDao dao = daoProvider.get(); dao.createResourceGroupsTable(); dao.createSelectorsTable(); dao.insertResourceGroup(1, "global", "100%", 100, 100, 100, null, null, null, null, null, null, null, null, ENVIRONMENT); DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager( (poolId, listener) -> {}, new DbResourceGroupConfig().setMaxRefreshInterval(Duration.valueOf("1ms")), daoProvider.get(), ENVIRONMENT); <START> manager.start(); <END> Thread.sleep(1000); dao.dropSelectorsTable(); Thread.sleep(2000); try { manager.getSelectors(); fail("Expected unavailable configuration exception"); } catch (Exception e) { assertEquals(e.getMessage(), "Selectors could not be fetched from database"); } try { manager.getRootGroups(); fail("Expected unavailable configuration exception"); } catch (Exception e) { assertEquals(e.getMessage(), "Root groups could not be fetched from database"); } manager.destroy(); }</code><technical_language>In this test I guess do is: 1) schedule thread load config start() 2) drop selectors table 3) wait for thread reload config sleeps of I this test is flaky, configuration loading thread get scheduled in next 3+ seconds (and reload config, selectors is empty point) this test fail. Instead of relying config loader thread depending sleeps, I do: DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager( (poolId, listener) -> {}, new DbResourceGroupConfig().setMaxRefreshInterval(Duration.valueOf("1ms")), daoProvider.get(), ENVIRONMENT); // constructor load config dao.dropSelectorsTable(); // reload config manager.load(); //asserts ..</technical_language>

Target:
public void testRefreshInterval() { H2DaoProvider daoProvider = setup("selectors"); H2ResourceGroupsDao dao = daoProvider.get(); dao.createResourceGroupsTable(); dao.createSelectorsTable(); dao.insertResourceGroup(1, "global", "100%", 100, 100, 100, null, null, null, null, null, null, null, null, ENVIRONMENT); DbResourceGroupConfigurationManager manager = new DbResourceGroupConfigurationManager( (poolId, listener) -> {}, new DbResourceGroupConfig().setMaxRefreshInterval(Duration.valueOf("1ms")), daoProvider.get(), ENVIRONMENT); dao.dropSelectorsTable(); manager.load(); try { manager.getSelectors(); fail("Expected unavailable configuration exception"); } catch (Exception e) { assertEquals(e.getMessage(), "Selectors cannot be fetched from database"); } try { manager.getRootGroups(); fail("Expected unavailable configuration exception"); } catch (Exception e) { assertEquals(e.getMessage(), "Root groups cannot be fetched from database"); } manager.destroy(); }
Source:
<code>private boolean obtainLock() { boolean success = RedisLockRegistry.this.redisTemplate.execute(RedisLockRegistry.this.obtainLockScript, <START> Collections.<Object>singletonList(constructLockKey()), RedisLockRegistry.this.clientId, <END> String.valueOf(RedisLockRegistry.this.expireAfter)); if (success) { this.lockedAt = System.currentTimeMillis(); } return success; }</code><technical_language>I call constructLockKey() in ctor. is logical RedisLock instance is tied Registry equal other instance in registry if keys same. I equals() impl here</technical_language>

Target:
private boolean obtainLock() { boolean success = RedisLockRegistry.this.redisTemplate.execute(RedisLockRegistry.this.obtainLockScript, Collections.singletonList(this.lockKey), RedisLockRegistry.this.clientId, String.valueOf(RedisLockRegistry.this.expireAfter)); if (success) { this.lockedAt = System.currentTimeMillis(); } return success; }
Source:
<code>private void init() { try { if (hasPropertyAndNotNull("manual_output")) { manualOutput = Boolean.valueOf(getProperty("manual_output")); } if (hasPropertyAndNotNull("greeting")) { greeting = getProperty("greeting"); } catPath = getProperty("cat"); echoPath = getProperty("echo"); } catch (Exception e) { e.printStackTrace(); <START> System.exit(1); <END> } }</code><technical_language>Also, System.exit. throw a RuntimeException</technical_language>

Target:
private void init() { try { if (hasPropertyAndNotNull("manual_output")) { manualOutput = Boolean.valueOf(getProperty("manual_output")); } if (hasPropertyAndNotNull("greeting")) { greeting = getProperty("greeting"); } catPath = getProperty("cat"); echoPath = getProperty("echo"); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } }
Source:
<code>public void invalidateAllWords() { <START> lintManager_.relintAfterDelay(-1); <END> }</code><technical_language>name this special clear calling -1 does</technical_language>

Target:
public void invalidateAllWords() { lintManager_.relintAfterDelay(LintManager.DEFAULT_LINT_DELAY); }
Source:
<code>public static void prepareAggregations( List<AggregatorFactory> aggFactories, List<PostAggregator> postAggs ) { Preconditions.checkNotNull(aggFactories, "aggregations cannot be null"); final Map<String, AggregatorFactory> aggsFactoryMap = Maps.newHashMap(); for (AggregatorFactory aggFactory : aggFactories) { Preconditions.checkArgument(!aggsFactoryMap.containsKey(aggFactory.getName()), "[%s] already defined", aggFactory.getName()); aggsFactoryMap.put(aggFactory.getName(), aggFactory); } if (postAggs != null && !postAggs.isEmpty()) { final Set<String> combinedAggNames = Sets.newHashSet(aggsFactoryMap.keySet()); for (final PostAggregator postAgg : postAggs) { final Set<String> dependencies = postAgg.getDependentFields(); final Set<String> missing = Sets.difference(dependencies, combinedAggNames); Preconditions.checkArgument( missing.isEmpty(), "Missing fields [%s] for postAggregator [%s]", missing, postAgg.getName() ); Preconditions.checkArgument(combinedAggNames.add(postAgg.getName()), "[%s] already defined", postAgg.getName()); <START> if (postAgg instanceof HasDependentAggFactories) { <END> HasDependentAggFactories richPostAgg = (HasDependentAggFactories)postAgg; richPostAgg.setDependentAggFactories(Maps.filterKeys(aggsFactoryMap, new Predicate<String>() { @Override public boolean apply(@Nullable String input) { return postAgg.getDependentFields().contains(input); } })); } } } }</code><technical_language>this work a dependent post agg is Arithmetic post aggregator. need a inject aggregators instead of instanceOf</technical_language>

Target:
public static List<PostAggregator> prepareAggregations( List<AggregatorFactory> aggFactories, List<PostAggregator> postAggs ) { Preconditions.checkNotNull(aggFactories, "aggregations cannot be null"); final Map<String, AggregatorFactory> aggsFactoryMap = Maps.newHashMap(); for (AggregatorFactory aggFactory : aggFactories) { Preconditions.checkArgument(!aggsFactoryMap.containsKey(aggFactory.getName()), "[%s] already defined", aggFactory.getName()); aggsFactoryMap.put(aggFactory.getName(), aggFactory); } if (postAggs != null && !postAggs.isEmpty()) { final Set<String> combinedAggNames = Sets.newHashSet(aggsFactoryMap.keySet()); List<PostAggregator> decorated = Lists.newArrayListWithExpectedSize(postAggs.size()); for (final PostAggregator postAgg : postAggs) { final Set<String> dependencies = postAgg.getDependentFields(); final Set<String> missing = Sets.difference(dependencies, combinedAggNames); Preconditions.checkArgument( missing.isEmpty(), "Missing fields [%s] for postAggregator [%s]", missing, postAgg.getName() ); Preconditions.checkArgument(combinedAggNames.add(postAgg.getName()), "[%s] already defined", postAgg.getName()); decorated.add(postAgg.decorate(aggsFactoryMap)); } return decorated; } return postAggs; }
Source:
<code>public GroupRest getItemReadGroup(@Nullable HttpServletRequest request, UUID collectionId, @Nullable Pageable optionalPageable, Projection projection) { try { Context context = obtainContext(); Collection collection = collectionService.find(context, collectionId); if (collection == null) { throw new ResourceNotFoundException("No such collection: " + collectionId); } List<Group> itemGroups = authorizeService .getAuthorizedGroups(context, collection, Constants.DEFAULT_ITEM_READ); if (itemGroups == null || itemGroups.isEmpty()) { return null; } Group itemReadGroup = itemGroups.get(0); <START> if (!authorizeService.isAdmin(context) && !authorizeService.authorizeActionBoolean(context, collection, <END> Constants.ADMIN, true)) { throw new AccessDeniedException("The current user was not allowed to retrieve the itemReadGroup for" + " collection: " + collectionId); } if (itemReadGroup == null) { return null; } return converter.toRest(itemReadGroup, projection); } catch (SQLException e) { throw new RuntimeException(e); } }</code><technical_language>here, move this up. want check permissions closer top of method</technical_language>

Target:
public GroupRest getItemReadGroup(@Nullable HttpServletRequest request, UUID collectionId, @Nullable Pageable optionalPageable, Projection projection) { try { Context context = obtainContext(); Collection collection = collectionService.find(context, collectionId); if (collection == null) { throw new ResourceNotFoundException("No such collection: " + collectionId); } try { AuthorizeUtil.authorizeManageDefaultReadGroup(context, collection); } catch (AuthorizeException e) { throw new AccessDeniedException("The current user was not allowed to retrieve the itemReadGroup for" + " collection: " + collectionId); } List<Group> itemGroups = authorizeService .getAuthorizedGroups(context, collection, Constants.DEFAULT_ITEM_READ); if (itemGroups == null || itemGroups.isEmpty()) { return null; } Group itemReadGroup = itemGroups.get(0); if (itemReadGroup == null) { return null; } return converter.toRest(itemReadGroup, projection); } catch (SQLException e) { throw new RuntimeException(e); } }
Source:
<code>public void onSuccess(T t) { <START> ObservableSource<? extends R> p; <END> try { p = ObjectHelper.requireNonNull(mapper.apply(t), "The mapper returned a null Publisher"); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); downstream.onError(ex); return; } p.subscribe(this); }</code><technical_language>o</technical_language>

Target:
public void onSuccess(T t) { ObservableSource<? extends R> o; try { o = ObjectHelper.requireNonNull(mapper.apply(t), "The mapper returned a null Publisher"); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); downstream.onError(ex); return; } o.subscribe(this); }
Source:
<code>private void buildTryStatement(TryStatementTree tryStatementTree) { currentBlock = createBlock(currentBlock); BlockTree finallyBlockTree = tryStatementTree.finallyBlock(); if (finallyBlockTree != null) { build(finallyBlockTree); } Block finallyOrEndBlock = currentBlock; Block beforeFinally = createBlock(currentBlock); List<Block> catches = new ArrayList<>(); for (CatchTree catchTree : tryStatementTree.catches()) { currentBlock = createBlock(finallyOrEndBlock); build(catchTree.block()); catches.add(currentBlock); } currentBlock = beforeFinally; build(tryStatementTree.block()); <START> for (Block catchBlocks : catches) { <END> currentBlock.addSuccessor(catchBlocks); } build((List<? extends Tree>) tryStatementTree.resources()); currentBlock = createBlock(currentBlock); currentBlock.elements.add(tryStatementTree); }</code><technical_language>catchBlock</technical_language>

Target:
private void buildTryStatement(TryStatementTree tryStatementTree) { currentBlock = createBlock(currentBlock); BlockTree finallyBlockTree = tryStatementTree.finallyBlock(); if (finallyBlockTree != null) { build(finallyBlockTree); } Block finallyOrEndBlock = currentBlock; Block beforeFinally = createBlock(currentBlock); List<Block> catches = new ArrayList<>(); for (CatchTree catchTree : tryStatementTree.catches()) { currentBlock = createBlock(finallyOrEndBlock); build(catchTree.block()); catches.add(currentBlock); } currentBlock = beforeFinally; build(tryStatementTree.block()); for (Block catchBlock : catches) { currentBlock.addSuccessor(catchBlock); } build((List<? extends Tree>) tryStatementTree.resources()); currentBlock = createBlock(currentBlock); currentBlock.elements.add(tryStatementTree); }
Source:
<code>public boolean addPersistableNetworkPayload(PersistableNetworkPayload payload, @Nullable NodeAddress sender, boolean isDataOwner, boolean allowBroadcast, boolean reBroadcast, boolean checkDate) { log.trace("addPersistableNetworkPayload payload={}", payload); if (!payload.verifyHashSize()) { log.warn("We got a hash exceeding our permitted size"); <START> return false; <END> } ByteArray hashAsByteArray = new ByteArray(payload.getHash()); boolean payloadHashAlreadyInStore = getAppendOnlyDataStoreMap().containsKey(hashAsByteArray); if (payloadHashAlreadyInStore && !reBroadcast) { log.trace("We have that payload already in our map."); return false; } if (checkDate && payload instanceof DateTolerantPayload && !((DateTolerantPayload) payload).isDateInTolerance((clock))) { log.warn("Publish date of payload is not matching our current time and outside of our tolerance.\n" + "Payload={}; now={}", payload.toString(), new Date()); return false; } if (!payloadHashAlreadyInStore) { appendOnlyDataStoreService.put(hashAsByteArray, payload); appendOnlyDataStoreListeners.forEach(e -> e.onAdded(payload)); } if (allowBroadcast) broadcaster.broadcast(new AddPersistableNetworkPayloadMessage(payload), sender, null, isDataOwner); return true; }</code><technical_language>I do check for exceeding, if hash size is expected</technical_language>

Target:
public boolean addPersistableNetworkPayload(PersistableNetworkPayload payload, @Nullable NodeAddress sender, boolean isDataOwner, boolean allowBroadcast, boolean reBroadcast, boolean checkDate) { log.trace("addPersistableNetworkPayload payload={}", payload); if (!payload.verifyHashSize()) { log.warn("addPersistableNetworkPayload failed due to unexpected hash size"); return false; } ByteArray hashAsByteArray = new ByteArray(payload.getHash()); boolean payloadHashAlreadyInStore = getAppendOnlyDataStoreMap().containsKey(hashAsByteArray); if (payloadHashAlreadyInStore && !reBroadcast) { log.trace("addPersistableNetworkPayload failed due to duplicate payload"); return false; } if (checkDate && payload instanceof DateTolerantPayload && !((DateTolerantPayload) payload).isDateInTolerance((clock))) { log.warn("addPersistableNetworkPayload failed due to payload time outside tolerance.\n" + "Payload={}; now={}", payload.toString(), new Date()); return false; } if (!payloadHashAlreadyInStore) { appendOnlyDataStoreService.put(hashAsByteArray, payload); appendOnlyDataStoreListeners.forEach(e -> e.onAdded(payload)); } if (allowBroadcast) broadcaster.broadcast(new AddPersistableNetworkPayloadMessage(payload), sender, null, isDataOwner); return true; }
Source:
<code>public long totalEventsInPartition(final Timeline timeline, final String partitionString) { final Timeline.StoragePosition positions = timeline.getLatestPosition(); if (positions == null) { <START> throw new InvalidCursorOperation(InvalidCursorOperation.Reason.PARTITION_NOT_FOUND); <END> } final int partition = Integer.valueOf(partitionString); final Timeline.KafkaStoragePosition kafkaPositions = (Timeline.KafkaStoragePosition) positions; final List<Long> offsets = kafkaPositions.getOffsets(); if (offsets.size() - 1 < partition) { throw new InvalidCursorOperation(InvalidCursorOperation.Reason.PARTITION_NOT_FOUND); } else { return offsets.get(partition); } }</code><technical_language>do throw this kind of exception? I understand situation timeline.getLatestPosition() == null means current timeline is "active"</technical_language>

Target:
public long totalEventsInPartition(final Timeline timeline, final String partitionString) throws InvalidCursorOperation { try { final Timeline.StoragePosition positions = timeline.getLatestPosition(); if (positions == null) { final Optional<PartitionStatistics> statsO = loadPartitionStatistics(timeline, partitionString); return statsO.map(stats -> numberOfEventsBeforeCursor(stats.getLast()) + 1).orElseThrow( MyNakadiRuntimeException1::new ); } final int partition = KafkaCursor.toKafkaPartition(partitionString); final Timeline.KafkaStoragePosition kafkaPositions = (Timeline.KafkaStoragePosition) positions; final List<Long> offsets = kafkaPositions.getOffsets(); if (offsets.size() - 1 < partition) { throw new InvalidCursorOperation(InvalidCursorOperation.Reason.PARTITION_NOT_FOUND); } else { return offsets.get(partition) + 1; } } catch (final ServiceUnavailableException e) { throw new MyNakadiRuntimeException1("Problem calculating partition statistics", e); } }
Source:
<code>private InternalDriver createDriver( URI uri, SecurityPlan securityPlan, BoltServerAddress address, ConnectionPool connectionPool, EventExecutorGroup eventExecutorGroup, RoutingSettings routingSettings, RetryLogic retryLogic, MetricsProvider metricsProvider, Config config ) { try { String scheme = uri.getScheme().toLowerCase(); <START> if ( isRoutingScheme( scheme ) ) { return createRoutingDriver( securityPlan, address, connectionPool, eventExecutorGroup, routingSettings, retryLogic, metricsProvider, config ); } else if ( !isRoutingScheme( scheme ) ) { assertNoRoutingContext( uri, routingSettings ); return createDirectDriver( securityPlan, address, connectionPool, retryLogic, metricsProvider, config ); } throw new ClientException( format( "Unsupported URI scheme: %s", scheme ) ); <END> } catch ( Throwable driverError ) { closeConnectionPoolAndSuppressError( connectionPool, driverError ); throw driverError; } }</code><technical_language>haha. I fooled lines :D If-else good enough validated scheme Scheme.validateScheme( uri.getScheme() );. if( isRoutingScheme(scheme) ){...} else {...}</technical_language>

Target:
private InternalDriver createDriver( URI uri, SecurityPlan securityPlan, BoltServerAddress address, ConnectionPool connectionPool, EventExecutorGroup eventExecutorGroup, RoutingSettings routingSettings, RetryLogic retryLogic, MetricsProvider metricsProvider, Config config ) { try { String scheme = uri.getScheme().toLowerCase(); if ( isRoutingScheme( scheme ) ) { return createRoutingDriver( securityPlan, address, connectionPool, eventExecutorGroup, routingSettings, retryLogic, metricsProvider, config ); } else { assertNoRoutingContext( uri, routingSettings ); return createDirectDriver( securityPlan, address, connectionPool, retryLogic, metricsProvider, config ); } } catch ( Throwable driverError ) { closeConnectionPoolAndSuppressError( connectionPool, driverError ); throw driverError; } }
Source:
<code>public Schema getOutputSchema(GetSchemaRequest request) { try { return getOutputSchema(request.inputSchemas); } catch (IllegalArgumentException e) { <START> throw new BadRequestException(e.getMessage()); <END> } }</code><technical_language>I send e BadRequestException. do that? way, root stacktrace lost</technical_language>

Target:
public Schema getOutputSchema(GetSchemaRequest request) { try { return getOutputSchema(request.inputSchemas); } catch (IllegalArgumentException e) { if (!duplicateFields.isEmpty()) { throw new BadRequestException(GSON.toJson(duplicateFields.asMap())); } else { throw new BadRequestException(e.getMessage()); } } }
Source:
<code>public boolean routeVendorEdit(PaymentWorksVendor paymentWorksVendor) { boolean isRouted = false; PaymentWorksVendorUpdateConversionUtil paymentWorksVendorUpdateConversionUtil = new PaymentWorksVendorUpdateConversionUtil(); String vendorNumberList = paymentWorksVendor.getVendorNumberList(); List<String> vendorNumbers = Arrays.asList(vendorNumberList.split("\\s*,\\s*")); StringBuffer documentNumbers = new StringBuffer(""); for (String vendorNumber : vendorNumbers) { VendorDetail oldVendor = vendorService.getVendorDetail(vendorNumber); VendorDetail newVendor = (VendorDetail) ObjectUtils.deepCopy(oldVendor); if (!paymentWorksVendorUpdateConversionUtil.duplicateFieldsOnVendor(newVendor, paymentWorksVendor)) { isRouted = processNonDuplicateVendorDetail(paymentWorksVendor, documentNumbers, oldVendor, newVendor); } else { GlobalVariables.getMessageMap().putError("vendorDetail", KFSKeyConstants.ERROR_CUSTOM, "Duplicate vendor update detected"); isRouted = false; } } if (documentNumbers.length() > 0) { paymentWorksVendor.setDocumentNumberList(documentNumbers.toString().substring(0, documentNumbers.length() - 1)); } <START> return isRouted; <END> }</code><technical_language>this is looping vendor numbers, this return false for isRouted if vendor fails route if others do route - I understanding correctly, if is desired logic</technical_language>

Target:
public boolean routeVendorEdit(PaymentWorksVendor paymentWorksVendor) { boolean routed = false; PaymentWorksVendorUpdateConversionUtil paymentWorksVendorUpdateConversionUtil = new PaymentWorksVendorUpdateConversionUtil(); String vendorNumberList = paymentWorksVendor.getVendorNumberList(); List<String> vendorNumbers = Arrays.asList(vendorNumberList.split("\\s*,\\s*")); StringBuffer documentNumbers = new StringBuffer(""); for (String vendorNumber : vendorNumbers) { VendorDetail oldVendor = vendorService.getVendorDetail(vendorNumber); VendorDetail newVendor = (VendorDetail) ObjectUtils.deepCopy(oldVendor); if (!paymentWorksVendorUpdateConversionUtil.duplicateFieldsOnVendor(newVendor, paymentWorksVendor)) { routed = processNonDuplicateVendorDetail(paymentWorksVendor, documentNumbers, oldVendor, newVendor); } else { GlobalVariables.getMessageMap().putError("vendorDetail", KFSKeyConstants.ERROR_CUSTOM, "Duplicate vendor update detected"); routed = false; } } if (documentNumbers.length() > 0) { paymentWorksVendor.setDocumentNumberList(documentNumbers.toString().substring(0, documentNumbers.length() - 1)); } return routed; }
Source:
<code>private JSONObject gatherBuildMetadata(final Run run, @Nonnull final TaskListener listener) { EnvVars envVars = null; try { envVars = run.getEnvironment(listener); } catch (IOException e) { logger.severe(e.getMessage()); } catch (InterruptedException e) { logger.severe(e.getMessage()); } long starttime = run.getStartTimeInMillis() / DatadogBuildListener.THOUSAND_LONG; double duration = run.getDuration() / DatadogBuildListener.THOUSAND_DOUBLE; long endtime = starttime + (long) duration; JSONObject builddata = new JSONObject(); builddata.put("starttime", starttime); builddata.put("duration", duration); builddata.put("timestamp", endtime); builddata.put("result", run.getResult().toString()); builddata.put("number", run.number); builddata.put("job", run.getParent().getDisplayName()); builddata.put("hostname", getHostname(envVars)); builddata.put("buildurl", envVars.get("BUILD_URL")); builddata.put("node", envVars.get("NODE_NAME")); <START> <END> if ( envVars.get("GIT_BRANCH") != null ) { builddata.put("branch", envVars.get("GIT_BRANCH")); } else if ( envVars.get("CVS_BRANCH") != null ) { builddata.put("branch", envVars.get("CVS_BRANCH")); } return builddata; }</code><technical_language>tab</technical_language>

Target:
private JSONObject gatherBuildMetadata(final Run run, @Nonnull final TaskListener listener) { EnvVars envVars = null; try { envVars = run.getEnvironment(listener); } catch (IOException e) { logger.severe(e.getMessage()); } catch (InterruptedException e) { logger.severe(e.getMessage()); } long starttime = run.getStartTimeInMillis() / DatadogBuildListener.THOUSAND_LONG; double duration = run.getDuration() / DatadogBuildListener.THOUSAND_DOUBLE; long endtime = starttime + (long) duration; JSONObject builddata = new JSONObject(); builddata.put("starttime", starttime); builddata.put("duration", duration); builddata.put("timestamp", endtime); builddata.put("result", run.getResult().toString()); builddata.put("number", run.number); builddata.put("job", run.getParent().getDisplayName()); builddata.put("hostname", DatadogUtilities.getHostname(envVars)); builddata.put("buildurl", envVars.get("BUILD_URL")); builddata.put("node", envVars.get("NODE_NAME")); if ( envVars.get("GIT_BRANCH") != null ) { builddata.put("branch", envVars.get("GIT_BRANCH")); } else if ( envVars.get("CVS_BRANCH") != null ) { builddata.put("branch", envVars.get("CVS_BRANCH")); } return builddata; }
Source:
<code>public void testNotAllInputsReferenced() throws Exception { tester().assertThat(new PruneAggregationSourceColumns()) <START> .on(p -> buildAggregation(p, Predicates.alwaysTrue())) <END> .matches( aggregation( ImmutableList.of(ImmutableList.of("key")), ImmutableMap.of( Optional.of("avg"), functionCall("avg", ImmutableList.of("input"))), ImmutableMap.of(), Optional.empty(), SINGLE, strictProject( ImmutableMap.of( "input", expression("input"), "key", expression("key"), "keyHash", expression("keyHash"), "mask", expression("mask")), values("input", "key", "keyHash", "mask", "unused")))); }</code><technical_language>static import</technical_language>

Target:
public void testNotAllInputsReferenced() throws Exception { tester().assertThat(new PruneAggregationSourceColumns()) .on(p -> buildAggregation(p, alwaysTrue())) .matches( aggregation( ImmutableList.of(ImmutableList.of("key")), ImmutableMap.of( Optional.of("avg"), functionCall("avg", ImmutableList.of("input"))), ImmutableMap.of(), Optional.empty(), SINGLE, strictProject( ImmutableMap.of( "input", expression("input"), "key", expression("key"), "keyHash", expression("keyHash"), "mask", expression("mask")), values("input", "key", "keyHash", "mask", "unused")))); }
Source:
<code>@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { double rowCount = mq.getRowCount(this); if (!isNonCorrelatedSemiJoin()) { switch (joinType) { case RIGHT: rowCount = RelMdUtil.addEpsilon(rowCount); break; default: if (RelNodes.COMPARATOR.compare(left, right) > 0) { rowCount = RelMdUtil.addEpsilon(rowCount); } } } final double rightRowCount = right.estimateRowCount(mq); final double leftRowCount = left.estimateRowCount(mq); if (Double.isInfinite(leftRowCount)) { rowCount = leftRowCount; } else { rowCount += Util.nLogN(leftRowCount); } if (Double.isInfinite(rightRowCount)) { rowCount = rightRowCount; } else { rowCount += rightRowCount; } <START> if (isNonCorrelatedSemiJoin()) { <END> return planner.getCostFactory().makeCost(rowCount, 0, 0).multiplyBy(.01d); } else { return planner.getCostFactory().makeCost(rowCount, 0, 0); } }</code><technical_language>Do need check is correlated not? is correlated, right</technical_language>

Target:
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { double rowCount = mq.getRowCount(this); if (!isSemiJoin()) { switch (joinType) { case RIGHT: rowCount = RelMdUtil.addEpsilon(rowCount); break; default: if (RelNodes.COMPARATOR.compare(left, right) > 0) { rowCount = RelMdUtil.addEpsilon(rowCount); } } } final double rightRowCount = right.estimateRowCount(mq); final double leftRowCount = left.estimateRowCount(mq); if (Double.isInfinite(leftRowCount)) { rowCount = leftRowCount; } else { rowCount += Util.nLogN(leftRowCount); } if (Double.isInfinite(rightRowCount)) { rowCount = rightRowCount; } else { rowCount += rightRowCount; } if (isSemiJoin()) { return planner.getCostFactory().makeCost(rowCount, 0, 0).multiplyBy(.01d); } else { return planner.getCostFactory().makeCost(rowCount, 0, 0); } }
Source:
<code><START> public static String getHasConditionsFromRequest(HttpServletRequest request) throws IOException { <END> String ret = null; if (request.getParameter(FEATUREMAPHASH_REQPARAM) != null) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; ret == null && i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getName().equals(FEATUREMAP_REQPARAM) && cookie.getValue() != null) { ret = URLDecoder.decode(cookie.getValue(), "US-ASCII"); break; } } } if (ret == null) { if (log.isLoggable(Level.WARNING)) { StringBuffer url = request.getRequestURL(); if (url != null) { url.append("?").append(request.getQueryString()).toString(); log.warning(MessageFormat.format( Messages.AbstractHttpTransport_0, new Object[]{url, request.getHeader("User-Agent")})); } } } } else ret = request.getParameter(FEATUREMAP_REQPARAM); return ret; }</code><technical_language>this changed protected public</technical_language>

Target:
protected static String getHasConditionsFromRequest(HttpServletRequest request) throws IOException { String ret = null; if (request.getParameter(FEATUREMAPHASH_REQPARAM) != null) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; ret == null && i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getName().equals(FEATUREMAP_REQPARAM) && cookie.getValue() != null) { ret = URLDecoder.decode(cookie.getValue(), "US-ASCII"); break; } } } if (ret == null) { if (log.isLoggable(Level.WARNING)) { StringBuffer url = request.getRequestURL(); if (url != null) { url.append("?").append(request.getQueryString()).toString(); log.warning(MessageFormat.format( Messages.AbstractHttpTransport_0, new Object[]{url, request.getHeader("User-Agent")})); } } } } else ret = request.getParameter(FEATUREMAP_REQPARAM); return ret; }
Source:
<code>public SavedHttpAttachment(String name, Map<String,Object> attachmentData, URI attachmentURI) throws IOException { super(name, (String)attachmentData.get("content_type"), Attachment.getEncodingFromString((String)attachmentData.get("encoding"))); Number length; String data = (String)attachmentData.get("data"); if(data != null){ byte[] dataArray = data.getBytes(); InputStream is = Base64InputStreamFactory.get(new ByteArrayInputStream(dataArray)); this.data = IOUtils.toByteArray(is); length = this.data.length; } else { length = (Number)attachmentData.get("length"); } this.attachmentURI = attachmentURI; <START> this.size = length.intValue(); <END> }</code><technical_language>Is declare size long longValue()? store sizes longs in places I appreciate users >4GB attachments asking for trouble</technical_language>

Target:
public SavedHttpAttachment(String name, Map<String,Object> attachmentData, URI attachmentURI) throws IOException { super(name, (String)attachmentData.get("content_type"), Attachment.getEncodingFromString((String)attachmentData.get("encoding"))); Number length; String data = (String)attachmentData.get("data"); if(data != null){ byte[] dataArray = data.getBytes(); InputStream is = Base64InputStreamFactory.get(new ByteArrayInputStream(dataArray)); this.data = IOUtils.toByteArray(is); length = this.data.length; } else { length = (Number)attachmentData.get("length"); } this.attachmentURI = attachmentURI; this.size = length.longValue(); }
Source:
<code>public void deregisterStatsSourcesFor(StatsSelector selector, long siteId) { assert selector != null; final NonBlockingHashMap<Long, NonBlockingHashSet<StatsSource>> siteIdToStatsSources = registeredStatsSources.get(selector); assert siteIdToStatsSources != null; <START> NonBlockingHashSet<StatsSource> statsSources = siteIdToStatsSources.get(siteId); <END> if (statsSources != null) { siteIdToStatsSources.remove(siteId); } }</code><technical_language>call siteIdToStatsSources.remove(siteId) directly</technical_language>

Target:
public void deregisterStatsSourcesFor(StatsSelector selector, long siteId) { assert selector != null; final NonBlockingHashMap<Long, NonBlockingHashSet<StatsSource>> siteIdToStatsSources = registeredStatsSources.get(selector); if (siteIdToStatsSources != null) { siteIdToStatsSources.remove(siteId); } }
Source:
<code>public long getTimeoutMonitorIntervalSec() { return getLong(TIMEOUT_MONITOR_INTERVAL_SEC, <START> Math.max(Math.min(getAddEntryTimeout(), getReadEntryTimeout()) / 2, 1)); <END> }</code><technical_language>This setting is for quorum timeout. I calculation of default changed, no</technical_language>

Target:
public long getTimeoutMonitorIntervalSec() { int minTimeout = Math.min(Math.min(getAddEntryQuorumTimeout(), getAddEntryTimeout()), getReadEntryTimeout()); return getLong(TIMEOUT_MONITOR_INTERVAL_SEC, Math.max(minTimeout / 2, 1)); }
Source:
<code>public ParquetMetadataConverter(Configuration conf) { <START> this.useSignedStringMinMax = conf.getBoolean("parquet.strings.use-signed-order", false); <END> }</code><technical_language>ParquetMetadataConverter(boolean useSignedStringMinMax) instead pull reading configuration other config parameters</technical_language>

Target:
public ParquetMetadataConverter(Configuration conf) { this(conf.getBoolean("parquet.strings.signed-min-max.enabled", false)); }
Source:
<code>public AudioPlayerWithEvents(IPlayer player, Context context) { this.player = player; <START> this.duckable = ClassUtils.getIfAvailable(player, IDuckable.class); <END> this.context = context; this.externalControlClient = new SoundStreamExternalControlClient(this.context); hasFocus = false; }</code><technical_language>I this does. Googleing give java Spring framework</technical_language>

Target:
public AudioPlayerWithEvents(IPlayer player, Context context) { this.player = player; this.duckable = ClassUtils.getIfAvailable(player, IDuckable.class); this.context = context; this.externalControlClient = new SoundStreamExternalControlClient(this.context); this.registered = false; hasFocus = false; }
Source:
<code>private void changeType(int type) { mMppe.setVisibility(View.GONE); mView.findViewById(R.id.l2tp).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_psk).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_user).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_peer).setVisibility(View.GONE); mView.findViewById(R.id.identifier).setVisibility(View.GONE); setUsernamePasswordVisibility(type); <START> if (!isLegacyType(type)) { mView.findViewById(R.id.identifier).setVisibility(View.VISIBLE); } <END> switch (type) { case VpnProfile.TYPE_PPTP: mMppe.setVisibility(View.VISIBLE); break; case VpnProfile.TYPE_L2TP_IPSEC_PSK: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_PSK: case VpnProfile.TYPE_IPSEC_XAUTH_PSK: mView.findViewById(R.id.ipsec_psk).setVisibility(View.VISIBLE); mView.findViewById(R.id.identifier).setVisibility(View.VISIBLE); break; case VpnProfile.TYPE_L2TP_IPSEC_RSA: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_RSA: case VpnProfile.TYPE_IPSEC_XAUTH_RSA: mView.findViewById(R.id.ipsec_user).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS: case VpnProfile.TYPE_IPSEC_HYBRID_RSA: mView.findViewById(R.id.ipsec_peer).setVisibility(View.VISIBLE); break; } configureAdvancedOptionsVisibility(); }</code><technical_language>Leaving Settting folks decide. I do prefer I I feel strongly</technical_language>

Target:
private void changeType(int type) { mMppe.setVisibility(View.GONE); mView.findViewById(R.id.l2tp).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_psk).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_user).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_peer).setVisibility(View.GONE); mView.findViewById(R.id.options_ipsec_identity).setVisibility(View.GONE); setUsernamePasswordVisibility(type); if (!isLegacyType(type)) { mView.findViewById(R.id.options_ipsec_identity).setVisibility(View.VISIBLE); } switch (type) { case VpnProfile.TYPE_PPTP: mMppe.setVisibility(View.VISIBLE); break; case VpnProfile.TYPE_L2TP_IPSEC_PSK: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_PSK: case VpnProfile.TYPE_IPSEC_XAUTH_PSK: mView.findViewById(R.id.ipsec_psk).setVisibility(View.VISIBLE); mView.findViewById(R.id.options_ipsec_identity).setVisibility(View.VISIBLE); break; case VpnProfile.TYPE_L2TP_IPSEC_RSA: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_RSA: case VpnProfile.TYPE_IPSEC_XAUTH_RSA: mView.findViewById(R.id.ipsec_user).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS: case VpnProfile.TYPE_IPSEC_HYBRID_RSA: mView.findViewById(R.id.ipsec_peer).setVisibility(View.VISIBLE); break; } configureAdvancedOptionsVisibility(); }
Source:
<code>public void added(Entity member) { synchronized (mutex) { Optional<Location> location = Iterables.tryFind(member.getLocations(), Predicates.instanceOf(SshMachineLocation.class)); String hostname = member.getAttribute(getConfig(HOSTNAME_SENSOR)); if (location.isPresent() && Strings.isNonBlank(hostname)) { SshMachineLocation machine = (SshMachineLocation) location.get(); String address = machine.getAddress().getHostAddress(); if (!entityLocations.containsKey(machine)) { entityLocations.put(machine, member); addressMappings.putIfAbsent(address, hostname); if (getAttribute(Startable.SERVICE_UP)) { update(); } configure(machine); LOG.info("{} added at location with name {}", new Object[] { member, machine, hostname }); } } else { LOG.warn("added({}) called but entity not ready", member); } <START> } <END> }</code><technical_language>Suggest putting some of this code in driver. Casting SshMachineLocation feels wrong. a BindDnsServerSshDriver.java for that. adding update() driver interface, moving of this code there? get rid of cast BindDnsServerSshDriver. This is a bit similar NginxControllerImpl call driver.update() - NginxControllerImpl do some work driver.getMachine()..</technical_language>

Target:
public void added(Entity member) { synchronized (mutex) { Optional<Location> location = Iterables.tryFind(member.getLocations(), Predicates.instanceOf(SshMachineLocation.class)); String hostname = member.getAttribute(getConfig(HOSTNAME_SENSOR)); if (location.isPresent() && Strings.isNonBlank(hostname)) { SshMachineLocation machine = (SshMachineLocation) location.get(); String address = machine.getAddress().getHostAddress(); if (!entityLocations.containsKey(machine)) { entityLocations.put(machine, member); addressMappings.putIfAbsent(address, hostname); if (getReverseLookupNetwork().contains(new Cidr(address + "/32"))) { String octet = Iterables.get(Splitter.on('.').split(address), 3); reverseMappings.putIfAbsent(hostname, octet); } if (getAttribute(Startable.SERVICE_UP)) { update(); } configure(machine); LOG.info("{} added at location with name {}", new Object[] { member, machine, hostname }); } } } }
Source:
<code>public void testGetResourceBundleNotFound() { when( this.localizationService.getResourceBundle( anyString(), anyString() ) ).thenReturn( null ); Response response = this.endpoint.getResourceBundle( "", "" ); <START> assertNotNull( response ); <END> Status actualStatus = Status.fromStatusCode( response.getStatus() ); assertEquals( Status.NOT_FOUND, actualStatus ); }</code><technical_language>This check is needed</technical_language>

Target:
public void testGetResourceBundleNotFound() { when( this.localizationService.getResourceBundle( anyString(), anyString() ) ).thenReturn( null ); Response response = this.endpoint.getResourceBundle( "", "" ); Status actualStatus = Status.fromStatusCode( response.getStatus() ); assertEquals( Status.NOT_FOUND, actualStatus ); }
Source:
<code>public RoleBasedProjectNamingStrategy(boolean forceExistingJobs) { this.forceExistingJobs = forceExistingJobs; <START> Jenkins.getInstance().setProjectNamingStrategy(this); <END> }</code><technical_language>wrong, AFAIR projectnaming strategy is set core plugins do manual assignment</technical_language>

Target:
public RoleBasedProjectNamingStrategy(boolean forceExistingJobs) { this.forceExistingJobs = forceExistingJobs; }
Source:
<code>public GetConfigurationObjectResponse(final ConfigurationObject configurationObject) { <START> super(); <END> this.configurationObject = configurationObject; }</code><technical_language>Avoid superfluous calls super(); is here</technical_language>

Target:
public GetConfigurationObjectResponse(final ConfigurationObject configurationObject) { this.configurationObject = configurationObject; }