auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>boolean requiresBracketWithSimpleAlgorithm(ProductionReference outer, ProductionReference leftCapture, ProductionReference rightCapture, ProductionReference inner) { boolean priority = isPriorityWrong(outer, inner, getPosition(inner, outer)); boolean inversePriority; EnumSet<Fixity> fixity = getFixity(inner, outer); EnumSet<Fixity> innerFixity = getFixity(inner); <START> Tag parentLabel = new Tag(outer.production().klabel().get().name()); <END> Tag localLabel = new Tag(inner.production().klabel().get().name()); if (parentLabel.equals(localLabel) && m.attributesFor().apply(inner.production().klabel().get()).contains(Attribute.ASSOCIATIVE_KEY)) return false; if (inner instanceof Constant) return false; if (fixity.size() == 0) return false; if (priority) return true; if (inner.production().isSyntacticSubsort()) return false; if (innerFixity.contains(Fixity.BARE_RIGHT) && rightCapture != null) { inversePriority = isPriorityWrong(inner, rightCapture, inner.production().items().size() - 1); EnumSet<Fixity> rightCaptureFixity = getFixity(rightCapture); if (!inversePriority && rightCaptureFixity.contains(Fixity.BARE_LEFT)) { return true; } } if (innerFixity.contains(Fixity.BARE_LEFT) && leftCapture != null) { inversePriority = isPriorityWrong(inner, leftCapture, 0); EnumSet<Fixity> leftCaptureFixity = getFixity(leftCapture); if (!inversePriority && leftCaptureFixity.contains(Fixity.BARE_RIGHT)) { return true; } } return false; }</code><technical_language>this work necessarily outer klabels. I want is: if (inner.production().klabel().equals(outer.production().klabel()) && inner.production().klabel().isDefined() && m.attributesFor().apply(inner.production().klabel().get()).containss(Attribute.ASSOCIATIVE_KEY))</technical_language>

Target:
boolean requiresBracketWithSimpleAlgorithm(ProductionReference outer, ProductionReference leftCapture, ProductionReference rightCapture, ProductionReference inner) { boolean priority = isPriorityWrong(outer, inner, getPosition(inner, outer)); boolean inversePriority; EnumSet<Fixity> fixity = getFixity(inner, outer); EnumSet<Fixity> innerFixity = getFixity(inner); if (inner.production().klabel().equals(outer.production().klabel()) && inner.production().klabel().isDefined() && m.attributesFor().apply(inner.production().klabel().get()).contains(Attribute.ASSOCIATIVE_KEY)) return false; if (inner instanceof Constant) return false; if (fixity.size() == 0) return false; if (priority) return true; if (inner.production().isSyntacticSubsort()) return false; if (innerFixity.contains(Fixity.BARE_RIGHT) && rightCapture != null) { inversePriority = isPriorityWrong(inner, rightCapture, inner.production().items().size() - 1); EnumSet<Fixity> rightCaptureFixity = getFixity(rightCapture); if (!inversePriority && rightCaptureFixity.contains(Fixity.BARE_LEFT)) { return true; } } if (innerFixity.contains(Fixity.BARE_LEFT) && leftCapture != null) { inversePriority = isPriorityWrong(inner, leftCapture, 0); EnumSet<Fixity> leftCaptureFixity = getFixity(leftCapture); if (!inversePriority && leftCaptureFixity.contains(Fixity.BARE_RIGHT)) { return true; } } return false; }
Source:
<code>public final void run(final int iteration) { posNum = 0; negNum = 0; final Set<LongRange> ranges = workloadQuota.get(dataType); <START> if (ranges == null) { <END> LOG.log(Level.INFO, "No {0} type data assigned to this task", dataType); return; } for (final LongRange range : ranges) { final Map<?, Row> rows = memoryStore.getElasticStore().getRange(dataType, range.getMinimumLong(), range.getMaximumLong()); for (final Row row : rows.values()) { final double output = row.getOutput(); final double predict = model.predict(row.getFeature()); if (output * predict > 0) { posNum++; } else { negNum++; } } for (final Row row : rows.values()) { final double output = row.getOutput(); final Vector input = row.getFeature(); final Vector gradient = loss.gradient(input, model.predict(input), output).plus(regularization.gradient(model)); model.setParameters(model.getParameters().minus(gradient.times(stepSize))); } } }</code><technical_language>This null check removed get(dataType) is changed return empty set. (But need check getAll() only)</technical_language>

Target:
public final void run(final int iteration) { posNum = 0; negNum = 0; final Map<?, Row> rows = workloadPartition.getAllData(dataType); for (final Row row : rows.values()) { final double output = row.getOutput(); final double predict = model.predict(row.getFeature()); if (output * predict > 0) { posNum++; } else { negNum++; } } for (final Row row : rows.values()) { final double output = row.getOutput(); final Vector input = row.getFeature(); final Vector gradient = loss.gradient(input, model.predict(input), output).plus(regularization.gradient(model)); model.setParameters(model.getParameters().minus(gradient.times(stepSize))); } }
Source:
<code>protected synchronized void process(ComplexEventChunk<StreamEvent> streamEventChunk, Processor nextProcessor, StreamEventCloner streamEventCloner) { if(numberOfPrameters ==2){ <START> processFor2Prameters(streamEventChunk,nextProcessor,streamEventCloner); <END> } else if(numberOfPrameters == 3){ processFor3Prameters(streamEventChunk,nextProcessor,streamEventCloner); } }</code><technical_language>Minudika, a boolean flag (isStartTimeEnabled something) calls method time.. need "else if" well</technical_language>

Target:
protected synchronized void process(ComplexEventChunk<StreamEvent> streamEventChunk, Processor nextProcessor, StreamEventCloner streamEventCloner) { if (!isStartTimeEnabled) { processWithoutStartTime(streamEventChunk, nextProcessor, streamEventCloner); } else { processWithStartTime(streamEventChunk, nextProcessor, streamEventCloner); } }
Source:
<code>public void moveToRecycleBin(FeedbackSessionAttributes sessionToDelete) { int rowId = getFeedbackSessionRowId(sessionToDelete.getCourseId(), sessionToDelete.getFeedbackSessionName()); clickAndConfirm(browser.driver.findElement(By.id("btn-soft-delete-" + rowId))); <START> ThreadHelper.waitFor(1000); <END> }</code><technical_language>waits for</technical_language>

Target:
public void moveToRecycleBin(FeedbackSessionAttributes sessionToDelete) { int rowId = getFeedbackSessionRowId(sessionToDelete.getCourseId(), sessionToDelete.getFeedbackSessionName()); clickAndConfirm(browser.driver.findElement(By.id("btn-soft-delete-" + rowId))); waitUntilAnimationFinish(); }
Source:
<code>public void releaseConsumerFor(Channel channel, boolean cancelConsumer, String message) { SimpleConsumer consumer = this.inUseConsumerChannels.remove(channel); if (consumer != null && cancelConsumer) { <START> this.logger.error("Consumer canceled by client" + consumer); <END> consumer.cancelConsumer("Consumer " + this + " canceled due to " + message); } }</code><technical_language>is purpose of this error()? simple debug() is enough? whitespace "client" word</technical_language>

Target:
public void releaseConsumerFor(Channel channel, boolean cancelConsumer, String message) { SimpleConsumer consumer = this.inUseConsumerChannels.remove(channel); if (consumer != null && cancelConsumer) { Assert.isTrue(message != null, "A 'message' is required when 'cancelConsumer' is 'true'"); consumer.cancelConsumer("Consumer " + this + " canceled due to " + message); } }
Source:
<code>private void doTransfers (RaptorState state) { final int walkSpeedMillimetersPerSecond = (int) (request.walkSpeed * 1000); final int maxWalkMillimeters = walkSpeedMillimetersPerSecond * (request.maxWalkTime * SECONDS_PER_MINUTE); for (int stop = state.nonTransferStopsUpdated.nextSetBit(0); <START> stop > -1; <END> stop = state.nonTransferStopsUpdated.nextSetBit(stop + 1) ) { TIntList transfersFromStop = transit.transfersForStop.get(stop); if (transfersFromStop != null) { for (int i = 0; i < transfersFromStop.size(); i += 2) { int targetStop = transfersFromStop.get(i); int distanceToTargetStopMillimeters = transfersFromStop.get(i + 1); if (distanceToTargetStopMillimeters < maxWalkMillimeters) { int walkTimeToTargetStopSeconds = distanceToTargetStopMillimeters / walkSpeedMillimetersPerSecond; checkState(walkTimeToTargetStopSeconds >= 0, "Transfer walk time must be positive."); int timeAtTargetStop = state.bestNonTransferTimes[stop] + walkTimeToTargetStopSeconds; state.setTimeAtStop(targetStop, timeAtTargetStop, -1, stop, 0, 0, true); } } } } }</code><technical_language>suggestion stop >= 0;</technical_language>

Target:
private void doTransfers (RaptorState state) { final int walkSpeedMillimetersPerSecond = (int) (request.walkSpeed * 1000); final int maxWalkMillimeters = walkSpeedMillimetersPerSecond * (request.maxWalkTime * SECONDS_PER_MINUTE); for (int stop = state.nonTransferStopsUpdated.nextSetBit(0); stop >= 0; stop = state.nonTransferStopsUpdated.nextSetBit(stop + 1) ) { TIntList transfersFromStop = transit.transfersForStop.get(stop); if (transfersFromStop != null) { for (int i = 0; i < transfersFromStop.size(); i += 2) { int targetStop = transfersFromStop.get(i); int distanceToTargetStopMillimeters = transfersFromStop.get(i + 1); if (distanceToTargetStopMillimeters < maxWalkMillimeters) { int walkTimeToTargetStopSeconds = distanceToTargetStopMillimeters / walkSpeedMillimetersPerSecond; checkState(walkTimeToTargetStopSeconds >= 0, "Transfer walk time must be positive."); int timeAtTargetStop = state.bestNonTransferTimes[stop] + walkTimeToTargetStopSeconds; state.setTimeAtStop(targetStop, timeAtTargetStop, -1, stop, 0, 0, true); } } } } }
Source:
<code>protected String createPassFile(String value) throws IOException { File temp = File.createTempFile("ovirt", ".tmp"); String filePath = temp.getAbsolutePath(); BufferedWriter out = new BufferedWriter(new FileWriter(temp)); out.write(value); <START> out.close(); <END> if (new File("/usr/bin/chmod").exists()) { Runtime.getRuntime().exec("/usr/bin/chmod " + filePath); } return filePath; }</code><technical_language>Please move write down, is performed if file created permissions changed</technical_language>

Target:
protected String createPassFile(String value) throws IOException { File temp = File.createTempFile("ovirt", ".tmp"); String filePath = temp.getAbsolutePath(); temp.setReadable(true, true); temp.setWritable(true, true); temp.setExecutable(false); BufferedWriter out = new BufferedWriter(new FileWriter(temp)); out.write(value); out.close(); return filePath; }
Source:
<code>public void verifyDeleteViaVideoNotPresent() { addVideoViaAjax(VideoContent.youtubeVideoURL2); refreshPage(); <START> refreshPage(); <END> deleteVideo(); verifyNotificationMessage(); Assertion.assertNotEquals(VideoContent.youtubeVideoURL2name, getNewestVideoTitle()); PageObjectLogging.log("verifyDeleteVideoNotPresent", "verify video " + VideoContent.youtubeVideoURL2name + " was deleted", true); }</code><technical_language>try waitForElementByElement a header element page is loaded delete video</technical_language>

Target:
public void verifyDeleteViaVideoNotPresent() { addVideoViaAjax(VideoContent.youtubeVideoURL2); refreshUntilElementOnPage(newestVideo2, refreshLimit); deleteVideo(); verifyNotificationMessage(); Assertion.assertNotEquals(VideoContent.youtubeVideoURL2name, getNewestVideoTitle()); PageObjectLogging.log("verifyDeleteVideoNotPresent", "verify video " + VideoContent.youtubeVideoURL2name + " was deleted", true); }
Source:
<code>public void onClick(DuNativeAd duNativeAd) { if (mNativeListener != null) { DuAdMediation.d(TAG, "Dap NativeAd clicked."); <START> mNativeListener.onAdClicked(mAdapter); <END> } }</code><technical_language>onAdOpened() onAdLeftApplication() callbacks missing for Native Ads. Please [this](<LINK_0> existing adapter for implementation</technical_language>

Target:
public void onClick(DuNativeAd duNativeAd) { if (mNativeListener != null) { DuAdMediation.d(TAG, "Dap NativeAd clicked."); mNativeListener.onAdClicked(mAdapter); mNativeListener.onAdOpened(mAdapter); mNativeListener.onAdLeftApplication(mAdapter); } }
Source:
<code>public void testRemovePrefixToDs3ObjectsList() throws IOException, SignatureException { final List<Ds3Object> ds3ObjectList = Lists.newArrayList(new Ds3Object("foo/bar"), new Ds3Object("foo/baz")); final Ds3ClientHelpers helper = Ds3ClientHelpers.wrap(buildDs3ClientForBulk()); final Iterable<Ds3Object> modifiedDs3ObjectList = helper.removePrefixFromDs3ObjectsList(ds3ObjectList, "foo/"); boolean foundBar = false; boolean foundBaz = false; <START> for (Ds3Object obj : modifiedDs3ObjectList) { <END> if (obj.getName().equals("bar")) { foundBar = true; } else if (obj.getName().equals("baz")) { foundBaz = true; } } assertTrue(foundBar); assertTrue(foundBaz); }</code><technical_language>missing final</technical_language>

Target:
public void testRemovePrefixToDs3ObjectsList() throws IOException, SignatureException { final List<Ds3Object> ds3ObjectList = Lists.newArrayList(new Ds3Object("foo/bar"), new Ds3Object("foo/baz")); final Ds3ClientHelpers helper = Ds3ClientHelpers.wrap(buildDs3ClientForBulk()); final Iterable<Ds3Object> modifiedDs3ObjectList = helper.removePrefixFromDs3ObjectsList(ds3ObjectList, "foo/"); boolean foundBar = false; boolean foundBaz = false; for (final Ds3Object obj : modifiedDs3ObjectList) { if (obj.getName().equals("bar")) { foundBar = true; } else if (obj.getName().equals("baz")) { foundBaz = true; } } assertTrue(foundBar); assertTrue(foundBaz); }
Source:
<code><START> public void setHeartbeat(final int heartbeat) throws IOException { <END> this.client.getConfig().put( LuaCommand.HEARTBEAT.toString(), heartbeat); }</code><technical_language>This needs set queue-specific heartbeat. this materialize as: java private String getHeartbeatConfigName() { return this.name + "-heartbeat"; } public void getHeartbeat() throws IOException { // of getHeartbeatConfigName } public void setHeartbeat(final int heartbeat) throws IOException { // of getHeartbeatConfigName }</technical_language>

Target:
public void setHeartbeat(final int heartbeat) throws IOException { this.client.getConfig().put( this.getHeartbeatConfigName(), heartbeat); }
Source:
<code>public void initWithHosts(Map<Host, HostConnectionPool<CL>> hPools) { List<HostToken> allHostTokens = tokenSupplier.getTokens(hPools.keySet()); Map<HostToken, HostConnectionPool<CL>> tokenPoolMap = new HashMap<HostToken, HostConnectionPool<CL>>(); for (HostToken hToken : allHostTokens) { hostTokens.put(hToken.getHost(), hToken); tokenPoolMap.put(hToken, hPools.get(hToken.getHost())); } Set<String> remoteDCs = new HashSet<String>(); this.hashtag = hPools.keySet().iterator().next().getHashtag(); for (Host host : hPools.keySet()) { String dc = host.getRack(); if (localRack != null && !localRack.isEmpty() && dc != null && !dc.isEmpty() && !localRack.equals(dc)) { remoteDCs.add(dc); } <START> if(this.hashtag != null) { <END> String hashtagNew = host.getHashtag(); if (!this.hashtag.equals(hashtagNew)){ throw new RuntimeException("Hashtags are different across hosts"); } this.hashtag = hashtagNew; } } Map<HostToken, HostConnectionPool<CL>> localPools = getHostPoolsForDC(tokenPoolMap, localRack); localSelector.initWithHosts(localPools); if (localSelector.isTokenAware() && localRack != null) { replicationFactor.set(calculateReplicationFactor(allHostTokens)); } for (String dc : remoteDCs) { Map<HostToken, HostConnectionPool<CL>> dcPools = getHostPoolsForDC(tokenPoolMap, dc); HostSelectionStrategy<CL> remoteSelector = selectorFactory.vendPoolSelectionStrategy(); remoteSelector.initWithHosts(dcPools); remoteDCSelectors.put(dc, remoteSelector); } remoteDCNames.swapWithList(remoteDCSelectors.keySet()); topology.set(getTokenPoolTopology()); }</code><technical_language>negative test case for hashtags</technical_language>

Target:
public void initWithHosts(Map<Host, HostConnectionPool<CL>> hPools) { List<HostToken> allHostTokens = tokenSupplier.getTokens(hPools.keySet()); Map<HostToken, HostConnectionPool<CL>> tokenPoolMap = new HashMap<HostToken, HostConnectionPool<CL>>(); for (HostToken hToken : allHostTokens) { hostTokens.put(hToken.getHost(), hToken); tokenPoolMap.put(hToken, hPools.get(hToken.getHost())); } Set<String> remoteRacks = new HashSet<String>(); for (Host host : hPools.keySet()) { String rack = host.getRack(); if (localRack != null && !localRack.isEmpty() && rack != null && !rack.isEmpty() && !localRack.equals(rack)) { remoteRacks.add(rack); } } Map<HostToken, HostConnectionPool<CL>> localPools = getHostPoolsForDC(tokenPoolMap, localRack); localSelector.initWithHosts(localPools); if (localSelector.isTokenAware() && localRack != null) { replicationFactor.set(calculateReplicationFactor(allHostTokens)); } for (String rack : remoteRacks) { Map<HostToken, HostConnectionPool<CL>> dcPools = getHostPoolsForDC(tokenPoolMap, rack); HostSelectionStrategy<CL> remoteSelector = selectorFactory.vendPoolSelectionStrategy(); remoteSelector.initWithHosts(dcPools); remoteRackSelectors.put(rack, remoteSelector); } remoteDCNames.swapWithList(remoteRackSelectors.keySet()); topology.set(getTokenPoolTopology()); }
Source:
<code>public void testAddOlderBlock() { CachedBlockQueue queue = new CachedBlockQueue(10000L, 1000L); CachedBlock cb1 = new CachedBlock(5000L, "cb1", 3L); cb1.recordSize(new AtomicLong(5000L)); CachedBlock cb2 = new CachedBlock(5000, "cb2", 2L); cb2.recordSize(new AtomicLong(5000L)); CachedBlock cb3 = new CachedBlock(5000, "cb3", 1L); cb3.recordSize(new AtomicLong(5000L)); assertTrue(queue.add(cb1)); <START> assertTrue(queue.add(cb2)); <END> assertTrue(queue.add(cb3)); assertEquals(2, queue.size()); }</code><technical_language>test a bit stronger java assertEquals(2, queue.size()); assertEquals(List.of("cb3", "cb2"), queue.getBlocks().stream().map(cb -> cb.getName()).collect(toList()));</technical_language>

Target:
public void testAddOlderBlock() { CachedBlockQueue queue = new CachedBlockQueue(10000L, 1000L); CachedBlock cb1 = new CachedBlock(5000L, "cb1", 3L); CachedBlock cb2 = new CachedBlock(5000, "cb2", 2L); CachedBlock cb3 = new CachedBlock(5000, "cb3", 1L); assertTrue(queue.add(cb1)); assertTrue(queue.add(cb2)); assertTrue(queue.add(cb3)); assertEquals(Arrays.asList("cb3", "cb2"), queue.getBlocks().stream().map(cb -> cb.getName()).collect(Collectors.toList())); assertEquals(2, queue.size()); }
Source:
<code>public void should_not_call_listener_when_verify_was_called_incorrectly() { VerificationListener listener = mock(VerificationListener.class); <START> framework().addListener(listener); <END> Foo foo = null; try { verify(foo).doSomething(""); fail("Exception expected."); } catch (Exception e) { verify(listener, never()).onVerification(any(VerificationEvent.class)); } }</code><technical_language>reordering</technical_language>

Target:
public void should_not_call_listener_when_verify_was_called_incorrectly() { Foo foo = null; VerificationListener mockListener = mock(VerificationListener.class); framework().addListener(mockListener); try { verify(foo).doSomething(""); fail("Exception expected."); } catch (Exception e) { verify(mockListener, never()).onVerification(any(VerificationEvent.class)); } }
Source:
<code>public final void close() throws SQLException { if (delegate != ClosedConnection.CLOSED_CONNECTION) { leakTask.cancel(); <START> closeStatements(); <END> try { if (isCommitStateDirty) { if (!poolEntry.isAutoCommit) { delegate.rollback(); lastAccess = clockSource.currentTime(); LOGGER.debug("{} - Executed rollback on connection due to dirty commit state on close().", poolEntry.parentPool, delegate); } } if (isConnectionStateDirty) { poolEntry.resetConnectionState(); lastAccess = clockSource.currentTime(); } delegate.clearWarnings(); } catch (SQLException e) { if (!poolEntry.evict) { throw checkException(e); } } finally { delegate = ClosedConnection.CLOSED_CONNECTION; poolEntry.releaseConnection(lastAccess); } } }</code><technical_language>this move? If closeStatements() throws a RuntimeException, some subclass of it, finally executed, resulting in connection released pool</technical_language>

Target:
public final void close() throws SQLException { if (delegate != ClosedConnection.CLOSED_CONNECTION) { leakTask.cancel(); try { closeStatements(); if (isCommitStateDirty) { if (!poolEntry.isAutoCommit) { delegate.rollback(); lastAccess = clockSource.currentTime(); LOGGER.debug("{} - Executed rollback on connection due to dirty commit state on close().", poolEntry.parentPool, delegate); } } if (isConnectionStateDirty) { poolEntry.resetConnectionState(); lastAccess = clockSource.currentTime(); } delegate.clearWarnings(); } catch (SQLException e) { if (!poolEntry.evict) { throw checkException(e); } } finally { delegate = ClosedConnection.CLOSED_CONNECTION; poolEntry.releaseConnection(lastAccess); } } }
Source:
<code><START> Long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { <END> if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggType)) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(runId); int d = c.get(Calendar.DAY_OF_WEEK); long weekTimestamp = runId - (d - 1) * Constants.MILLIS_ONE_DAY; weekTimestamp = weekTimestamp - weekTimestamp % Constants.MILLIS_ONE_DAY; return weekTimestamp; } return 0L; }</code><technical_language>suggest Long -> long for reason above</technical_language>

Target:
long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggType)) { Calendar c = Calendar.getInstance(); c.setTimeInMillis(runId); int d = c.get(Calendar.DAY_OF_WEEK); long weekTimestamp = runId - (d - 1) * Constants.MILLIS_ONE_DAY; weekTimestamp = weekTimestamp - weekTimestamp % Constants.MILLIS_ONE_DAY; return weekTimestamp; } return 0L; }
Source:
<code>public IRubyObject update(final ThreadContext context, final IRubyObject arg, IRubyObject buffer) { <START> final Ruby runtime = context.runtime; <END> if ( isDebug(runtime) ) dumpVars( runtime.getOut(), "update()" ); checkCipherNotNull(runtime); checkAuthTag(runtime); final ByteList data = arg.asString().getByteList(); final int length = data.getRealSize(); if ( length == 0 ) { throw runtime.newArgumentError("data must not be empty"); } if ( ! cipherInited ) doInitCipher(runtime); final ByteList str; try { updateAuthData(runtime); final byte[] in = data.getUnsafeBytes(); final int offset = data.begin(); final byte[] out = cipher.update(in, offset, length); if ( out != null ) { str = new ByteList(out, false); if ( realIV != null ) { if ( encryptMode ) setLastIVIfNeeded( out ); else setLastIVIfNeeded( in, offset, length ); } processedDataBytes += length; } else { str = new ByteList(ByteList.NULL_ARRAY); } } catch (Exception e) { debugStackTrace( runtime, e ); throw newCipherError(runtime, e); } if( buffer == null ) { return RubyString.newString(runtime, str); } else { return ((RubyString) buffer).replace(RubyString.newString(runtime, str)); } }</code><technical_language>a @JRubyMethod buffer Ruby type. need do TypeConverter.checkStringType</technical_language>

Target:
public IRubyObject update(final ThreadContext context, final IRubyObject arg, IRubyObject buffer) { final Ruby runtime = context.runtime; if ( isDebug(runtime) ) dumpVars( runtime.getOut(), "update()" ); checkCipherNotNull(runtime); checkAuthTag(runtime); final ByteList data = arg.asString().getByteList(); final int length = data.getRealSize(); if ( length == 0 ) { throw runtime.newArgumentError("data must not be empty"); } if ( ! cipherInited ) doInitCipher(runtime); final ByteList str; try { updateAuthData(runtime); final byte[] in = data.getUnsafeBytes(); final int offset = data.begin(); final byte[] out = cipher.update(in, offset, length); if ( out != null ) { str = new ByteList(out, false); if ( realIV != null ) { if ( encryptMode ) setLastIVIfNeeded( out ); else setLastIVIfNeeded( in, offset, length ); } processedDataBytes += length; } else { str = new ByteList(ByteList.NULL_ARRAY); } } catch (Exception e) { debugStackTrace( runtime, e ); throw newCipherError(runtime, e); } if( buffer == null ) { return RubyString.newString(runtime, str); } else { buffer = TypeConverter.convertToType(buffer, context.runtime.getString(), "to_str", true); return ((RubyString) buffer).replace(RubyString.newString(runtime, str)); } }
Source:
<code>public void mergeUpdatePidFromNitro( HttpServletResponse response, @PathVariable("pid") String pid ) throws IOException { Set<Item> mergedItems; try { Iterable<List<Item>> items = contentAdapter .fetchEpisodes(ProgrammesQuery.builder() .withPid(pid) .withMixins(ANCESTOR_TITLES, CONTRIBUTIONS, IMAGES, GENRE_GROUPINGS) .withPageSize(1) .build()); <START> mergedItems = localOrRemoteNitroFetcher.resolveItemsForMerge(items).getAll(); <END> } catch (NitroException e) { log.error("Failed to get Nitro item {}", pid, e); writeServerErrorWithStack(response, e); return; } if (mergedItems.isEmpty()) { log.error("No items found in Nitro for pid {}", pid); response.setStatus(HttpStatusCode.NOT_FOUND.code()); response.setContentLength(0); return; } createOrUpdateItems(response, pid, mergedItems.iterator()); }</code><technical_language>new method LocalOrRemoteNitroFetcher is pointless</technical_language>

Target:
public void mergeUpdatePidFromNitro( HttpServletResponse response, @PathVariable("pid") String pid ) throws IOException { Item item; try { Iterable<List<Item>> itemListIterable = contentAdapter .fetchEpisodes(ProgrammesQuery.builder() .withPid(pid) .withMixins(ANCESTOR_TITLES, CONTRIBUTIONS, IMAGES, GENRE_GROUPINGS) .withPageSize(1) .build()); Iterable<Item> allItems = Iterables.concat(itemListIterable); item = Iterables.getOnlyElement(localOrRemoteNitroFetcher.resolveItems(allItems).getAll()); } catch (NoSuchElementException e) { log.error("No items found in Nitro for pid {}", pid); response.setStatus(HttpStatusCode.NOT_FOUND.code()); response.setContentLength(0); return; } catch (NitroException e) { log.error("Failed to get Nitro item {}", pid, e); writeServerErrorWithStack(response, e); return; } createOrUpdateItem(response, pid, item); }
Source:
<code>private static boolean canCreateBlockCompresedIndexedFastaSequence(final Path path) { try { <START> return IOUtil.isBlockCompressed(path) && Files.exists(GZIIndex.resolveIndexNameForBgzipFile(path)); <END> } catch (IOException e) { return false; } }</code><technical_language>this altered 2 parameter version</technical_language>

Target:
private static boolean canCreateBlockCompresedIndexedFastaSequence(final Path path) { try { return IOUtil.isBlockCompressed(path, true) && Files.exists(GZIIndex.resolveIndexNameForBgzipFile(path)); } catch (IOException e) { return false; } }
Source:
<code>protected boolean showMoveUpButton() { return <START> true; <END> }</code><technical_language>show 'MoveUp' button default</technical_language>

Target:
protected boolean showMoveUpButton() { return false; }
Source:
<code>public ExampleScript[] examples() throws ConfigCompileException { return new ExampleScript[]{ new ExampleScript("Basic usage", "char_is_uppercase('a')"), <START> new ExampleScript("", "char_is_uppercase('D')"),}; <END> }</code><technical_language>need "Basic usage"</technical_language>

Target:
public ExampleScript[] examples() throws ConfigCompileException { return new ExampleScript[]{ new ExampleScript("Basic usage", "char_is_uppercase('a')"), new ExampleScript("Basic usage", "char_is_uppercase('D')"),}; }
Source:
<code>public void close() throws IOException { try { lock.lockInterruptibly(); try { if (!close) { if (err != null) { len = 0; flush = false; } close = true; execute(); } } finally { lock.unlock(); } copier.join(); <START> } catch (InterruptedException e) { <END> throw interrupted(e); } }</code><technical_language>dst copier in this case? try-with-resources style try close() again, retry close prevent leaking</technical_language>

Target:
public void close() throws IOException { if (!copier.isShutdown()) { try { execute(new Callable<Void>() { @Override public Void call() throws IOException { dst.close(); return null; } }); } finally { copier.shutdown(); } } }
Source:
<code>public void addFunction( final String name, final String description, final String outputType, final Boolean isMultiValued, final String binary) throws DbException { if (!isValid()) { connect(); } String tableName = MyriaConstants.PYUDF_RELATION.toString(MyriaConstants.STORAGE_SYSTEM_POSTGRESQL); StringBuilder sb = new StringBuilder(); sb.append("DELETE FROM "); sb.append(tableName); sb.append(" where function_name='"); sb.append(name); sb.append("'"); String sql = sb.toString(); accessMethod.execute(sql); pyFunctions.putString(0, name); pyFunctions.putString(1, description); pyFunctions.putString(2, outputType); pyFunctions.putBoolean(3, isMultiValued); pyFunctions.putString(4, binary); accessMethod.tupleBatchInsert(MyriaConstants.PYUDF_RELATION, pyFunctions.popAny()); <START> return; <END> }</code><technical_language>delete</technical_language>

Target:
public void addFunction( final String name, final String description, final String outputType, final Boolean isMultiValued, final String binary) throws DbException { if (!isValid()) { connect(); } String tableName = MyriaConstants.PYUDF_RELATION.toString(MyriaConstants.STORAGE_SYSTEM_POSTGRESQL); StringBuilder sb = new StringBuilder(); sb.append("DELETE FROM "); sb.append(tableName); sb.append(" where function_name='"); sb.append(name); sb.append("'"); String sql = sb.toString(); accessMethod.execute(sql); pyFunctions.putString(0, name); pyFunctions.putString(1, description); pyFunctions.putString(2, outputType); pyFunctions.putBoolean(3, isMultiValued); pyFunctions.putString(4, binary); accessMethod.tupleBatchInsert(MyriaConstants.PYUDF_RELATION, pyFunctions.popAny()); }
Source:
<code>public void testNothing() throws CacheAccessException { final ServiceLocator serviceLocator = new ServiceLocator(); try { serviceLocator.startAllServices(new HashMap<Service, ServiceConfiguration<?>>()); } catch (Exception e) { <START> throw new CacheAccessException(e); <END> } final CacheConfiguration<String, String> config = newCacheConfigurationBuilder().buildConfig(String.class, String.class); final Store.Provider service = serviceLocator.findService(Store.Provider.class); Collection<ServiceConfiguration<?>> serviceConfigs = config.getServiceConfigurations(); ServiceConfiguration<?>[] serviceConfigArray = serviceConfigs.toArray(new ServiceConfiguration[serviceConfigs.size()]); final Store<String, String> store = service.createStore(new StoreConfigurationImpl<String, String>(config), serviceConfigArray); @SuppressWarnings("unchecked") final Cache<String, String> cache = new HeapCache<String, String>(mock(CacheConfiguration.class), store, LoggerFactory.getLogger(Ehcache.class + "-" + "CachingTierConfigurationBuilderTest")); assertThat(cache, not(hasKey("key"))); cache.put("key", "value"); assertThat(cache, hasKey("key")); }</code><technical_language>do in test code, change throws clause of test method itself</technical_language>

Target:
public void testNothing() throws Exception { final ServiceLocator serviceLocator = new ServiceLocator(); serviceLocator.startAllServices(new HashMap<Service, ServiceConfiguration<?>>()); final CacheConfiguration<String, String> config = newCacheConfigurationBuilder().buildConfig(String.class, String.class); final Store.Provider service = serviceLocator.findService(Store.Provider.class); Collection<ServiceConfiguration<?>> serviceConfigs = config.getServiceConfigurations(); ServiceConfiguration<?>[] serviceConfigArray = serviceConfigs.toArray(new ServiceConfiguration[serviceConfigs.size()]); final Store<String, String> store = service.createStore(new StoreConfigurationImpl<String, String>(config), serviceConfigArray); @SuppressWarnings("unchecked") final Cache<String, String> cache = new HeapCache<String, String>(mock(CacheConfiguration.class), store, LoggerFactory.getLogger(Ehcache.class + "-" + "CachingTierConfigurationBuilderTest")); assertThat(cache, not(hasKey("key"))); cache.put("key", "value"); assertThat(cache, hasKey("key")); }
Source:
<code>private Supplier<DruidLongPredicate> getLongPredicateSupplier() { return new Supplier<DruidLongPredicate>() { private final Object initLock = new Object(); private DruidLongPredicate predicate; private void initLongValues() { if (predicate != null) { return; } synchronized (initLock) { if (predicate != null) { return; } List<Long> longs = new ArrayList<>(); for (String value : values) { Long longValue = GuavaUtils.tryParseLong(value); if (longValue != null) { longs.add(longValue); } } if (longs.size() > LONG_HASHING_THRESHOLD) { <START> final HashSet<Long> longHashSet = new HashSet<>(longs); <END> predicate = new DruidLongPredicate() { @Override public boolean applyLong(long input) { return longHashSet.contains(input); } }; } else { final long[] longArray; longArray = new long[longs.size()]; for (int i = 0; i < longs.size(); i++) { longArray[i] = longs.get(i).longValue(); } Arrays.sort(longArray); predicate = new DruidLongPredicate() { @Override public boolean applyLong(long input) { return Arrays.binarySearch(longArray, input) >= 0; } }; } } } @Override public DruidLongPredicate get() { initLongValues(); return predicate; } }; }</code><technical_language>Please a specialized primitive HashSet fastutil</technical_language>

Target:
private Supplier<DruidLongPredicate> getLongPredicateSupplier() { return new Supplier<DruidLongPredicate>() { private final Object initLock = new Object(); private DruidLongPredicate predicate; private void initLongValues() { if (predicate != null) { return; } synchronized (initLock) { if (predicate != null) { return; } LongArrayList longs = new LongArrayList(values.size()); for (String value : values) { Long longValue = GuavaUtils.tryParseLong(value); if (longValue != null) { longs.add(longValue); } } if (longs.size() > NUMERIC_HASHING_THRESHOLD) { final LongOpenHashSet longHashSet = new LongOpenHashSet(longs); predicate = new DruidLongPredicate() { @Override public boolean applyLong(long input) { return longHashSet.contains(input); } }; } else { final long[] longArray = longs.toLongArray(); Arrays.sort(longArray); predicate = new DruidLongPredicate() { @Override public boolean applyLong(long input) { return Arrays.binarySearch(longArray, input) >= 0; } }; } } } @Override public DruidLongPredicate get() { initLongValues(); return predicate; } }; }
Source:
<code>public SessionWindowOperator(final String queryId, <START> final String operatorId, <END> final int sessionInterval) { super(queryId, operatorId); this.sessionInterval = sessionInterval; this.latestEventTimestamp = Long.MIN_VALUE; }</code><technical_language>Please align lines</technical_language>

Target:
public SessionWindowOperator(final String queryId, final String operatorId, final int sessionInterval) { super(queryId, operatorId); this.sessionInterval = sessionInterval; currentWindow = null; }
Source:
<code>public JedisPool(final String host) { URI uri = URI.create(host); if (JedisURIHelper.isValid(uri)) { this.internalPool = new GenericObjectPool<Jedis>(new JedisFactory(uri, <START> Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null), new GenericObjectPoolConfig<Jedis>()); <END> } else { this.internalPool = new GenericObjectPool<Jedis>(new JedisFactory(host, Protocol.DEFAULT_PORT, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null, Protocol.DEFAULT_DATABASE, null), new GenericObjectPoolConfig<Jedis>()); } }</code><technical_language>Do changes necessary</technical_language>

Target:
public JedisPool(final String host) { URI uri = URI.create(host); if (JedisURIHelper.isValid(uri)) { this.internalPool = new GenericObjectPool<>(new JedisFactory(uri, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null), new GenericObjectPoolConfig()); } else { this.internalPool = new GenericObjectPool<>(new JedisFactory(host, Protocol.DEFAULT_PORT, Protocol.DEFAULT_TIMEOUT, Protocol.DEFAULT_TIMEOUT, null, Protocol.DEFAULT_DATABASE, null), new GenericObjectPoolConfig()); } }
Source:
<code>public Authentication.Result findAuthenticationResult(URI uri) { requireNonNull(uri, "uri is null"); <START> if (uri.getScheme().equalsIgnoreCase("https")) { <END> return results.getIfPresent(UrlUtil.normalizedUri(uri)); } return null; }</code><technical_language>Flip comparison</technical_language>

Target:
public Authentication.Result findAuthenticationResult(URI uri) { requireNonNull(uri, "uri is null"); if ("https".equalsIgnoreCase(uri.getScheme())) { return results.getIfPresent(UriUtil.normalizedUri(uri)); } return null; }
Source:
<code>public int compareTo(Duration other) { if (count == 0 && other.count == 0) { return 0; } <START> if (count < 0 && other.count >= 0) { <END> return -1; } if (count >= 0 && other.count < 0) { return 1; } if (unit == other.unit) { return Long.compare(count, other.count); } return Long.compare(toNanoseconds(), other.toNanoseconds()); }</code><technical_language>I this is symmetric implementation in Size short circuits necessary? Long#compare() do right</technical_language>

Target:
public int compareTo(Duration other) { if (unit == other.unit) { return Long.compare(count, other.count); } return Long.compare(toNanoseconds(), other.toNanoseconds()); }
Source:
<code>public static OMClientRequest createClientRequest(OMRequest omRequest) { Type cmdType = omRequest.getCmdType(); switch (cmdType) { case CreateVolume: return new OMVolumeCreateRequest(omRequest); case SetVolumeProperty: boolean hasQuota = omRequest.getSetVolumePropertyRequest() .hasQuotaInBytes(); boolean hasOwner = omRequest.getSetVolumePropertyRequest().hasOwnerName(); Preconditions.checkState(hasOwner || hasQuota, "Either Quota or owner " + <START> "shuould be set in the SetVolumeProperty request"); <END> if (omRequest.getSetVolumePropertyRequest().hasQuotaInBytes()) { return new OMVolumeSetQuotaRequest(omRequest); } else if(omRequest.getSetVolumePropertyRequest().hasOwnerName()) { return new OMVolumeSetOwnerRequest(omRequest); } case DeleteVolume: return new OMVolumeDeleteRequest(omRequest); case CreateBucket: return new OMBucketCreateRequest(omRequest); case DeleteBucket: return new OMBucketDeleteRequest(omRequest); case SetBucketProperty: return new OMBucketSetPropertyRequest(omRequest); default: return null; } }</code><technical_language>This Precondition checks of owner of quota is set. check for of set</technical_language>

Target:
public static OMClientRequest createClientRequest(OMRequest omRequest) { Type cmdType = omRequest.getCmdType(); switch (cmdType) { case CreateVolume: return new OMVolumeCreateRequest(omRequest); case SetVolumeProperty: boolean hasQuota = omRequest.getSetVolumePropertyRequest() .hasQuotaInBytes(); boolean hasOwner = omRequest.getSetVolumePropertyRequest().hasOwnerName(); Preconditions.checkState(hasOwner || hasQuota, "Either Quota or owner " + "should be set in the SetVolumeProperty request"); Preconditions.checkState(!(hasOwner && hasQuota), "Either Quota or " + "owner should be set in the SetVolumeProperty request. Should not " + "set both"); if (hasQuota) { return new OMVolumeSetQuotaRequest(omRequest); } else { return new OMVolumeSetOwnerRequest(omRequest); } case DeleteVolume: return new OMVolumeDeleteRequest(omRequest); case CreateBucket: return new OMBucketCreateRequest(omRequest); case DeleteBucket: return new OMBucketDeleteRequest(omRequest); case SetBucketProperty: return new OMBucketSetPropertyRequest(omRequest); default: return null; } }
Source:
<code>@Test public void testSpaceInUrl() { String url = "file:/ final Source foo = Sources.url(url); assertEquals(url + " .file().getAbsolutePath()", <START> "/dir name/test file.json", <END> foo.file().getAbsolutePath().replace('\\', '/')); }</code><technical_language>fails Windows needs drive name this works fine @Test public void testSpaceInUrl() { String url = "file:///dir%20name/test%20file.json"; final Source foo = Sources.url(url); final String expectedPath = "/dir name/test file.json"; final String expected; if (File.separatorChar == '/') { expected = expectedPath; } else { String drive = Paths.get(".").toAbsolutePath().getRoot().toString(); expected = drive.substring(0, drive.length() - 1) + expectedPath; } assertEquals(url + " .file().getAbsolutePath()", expected, foo.file().getAbsolutePath().replace('\\', '/')); }</technical_language>

Target:
@Test public void testSpaceInUrl() { String url = "file:" + ROOT_PREFIX + "dir%20name/test%20file.json"; final Source foo = url(url); assertEquals(url + " .file().getAbsolutePath()", new File(ROOT_PREFIX + "dir name/test file.json").getAbsolutePath(), foo.file().getAbsolutePath()); }
Source:
<code>public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> schedules) throws Exception { <START> if (ApacheServerComponent.getUseBMX()) <END> getBMXValues(report, schedules); else getSNMPValues(report, schedules); }</code><technical_language>static methods - get access parent apache server component resourceContext.getParentResourceComponent()</technical_language>

Target:
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> schedules) throws Exception { if (resourceContext.getParentResourceComponent().getUseBMX()) getBMXValues(report, schedules); else getSNMPValues(report, schedules); }
Source:
<code>public <T> List<T> getList(String filename, int type) { List<T> list = new ArrayList<T>(); BufferedReader br = null; try{ br = new BufferedReader(new InputStreamReader(context.getAssets().open(filename))); while ((line = br.readLine()) != null) { row = line.split(csvSplitBy); if(row.length > 0) { switch (type) { case 0: list.add((T) new Question(Integer.valueOf(row[0]), Integer.valueOf(row[1]), row[2])); break; case 1: list.add((T) new Answer(Integer.valueOf(row[0]), Integer.valueOf(row[1]), row[2], Integer.valueOf(row[3]), Integer.valueOf(row[4]))); break; case 2: list.add((T) new Scenario(Integer.valueOf(row[0]), row[1], row[2], row[3], Integer.valueOf(row[4]), Integer.valueOf(row[5]), 0, Integer.valueOf(row[6]), 0)); break; case 3: list.add((T) new Clothes(Integer.valueOf(row[0]), row[1], Integer.valueOf(row[2]), 0)); break; case 4: list.add((T) new Hair(Integer.valueOf(row[0]), row[1], Integer.valueOf(row[2]), 0)); break; case 5: list.add((T) new Accessory(Integer.valueOf(row[0]), row[1], Integer.valueOf(row[2]), 0)); <START> <END> } } } } catch (IOException e) { Log.e(TAG, e.toString()); } finally { try { if (br != null) { br.close(); } } catch (IOException e) { Log.e(TAG, e.toString()); } } return list; }</code><technical_language>Add default statement</technical_language>

Target:
public <T> List<T> getList(String filename, int type) { List<T> list = new ArrayList<T>(); BufferedReader br = null; try{ br = new BufferedReader(new InputStreamReader(context.getAssets().open(filename))); while ((line = br.readLine()) != null) { row = line.split(csvSplitBy); if(row.length > 0) { switch (type) { case 0: list.add((T) new Question(Integer.valueOf(row[0]), Integer.valueOf(row[1]), row[2])); break; case 1: list.add((T) new Answer(Integer.valueOf(row[0]), Integer.valueOf(row[1]), row[2], Integer.valueOf(row[3]), Integer.valueOf(row[4]))); break; case 2: list.add((T) new Scenario(Integer.valueOf(row[0]), row[1], row[2], row[3], Integer.valueOf(row[4]), Integer.valueOf(row[5]), 0, Integer.valueOf(row[6]), 0)); break; case 3: list.add((T) new Clothes(Integer.valueOf(row[0]), row[1], Integer.valueOf(row[2]), 0)); break; case 4: list.add((T) new Hair(Integer.valueOf(row[0]), row[1], Integer.valueOf(row[2]), 0)); break; case 5: list.add((T) new Accessory(Integer.valueOf(row[0]), row[1], Integer.valueOf(row[2]), 0)); break; default: Log.e(TAG, "Invalid file type"); } } } } catch (IOException e) { Log.e(TAG, "IOException while opening the file: "+ filename); } finally { try { if (br != null) { br.close(); } } catch (IOException e) { Log.e(TAG, "IOException while closing the file: "+ filename); } } return list; }
Source:
<code>public NodeMetadata apply(VirtualGuest from) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.getId() + ""); builder.name(from.getHostname()); builder.hostname(from.getHostname() + from.getDomain()); if (from.getDatacenter() != null) { builder.location(from(locations.get()).firstMatch( LocationPredicates.idEquals(from.getDatacenter().getId() + "")).orNull()); } builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getHostname())); <START> builder.hardware(new VirtualGuestToHardware().apply(from)); <END> Image image = virtualGuestToImage.apply(from); if (image != null) { builder.imageId(image.getId()); builder.operatingSystem(image.getOperatingSystem()); } if(from.getPowerState() != null) { builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName())); } if (from.getPrimaryIpAddress() != null) builder.publicAddresses(ImmutableSet.of(from.getPrimaryIpAddress())); if (from.getPrimaryBackendIpAddress() != null) builder.privateAddresses(ImmutableSet.of(from.getPrimaryBackendIpAddress())); if(from.getTagReferences() != null && !from.getTagReferences().isEmpty()) { List<String> tags = Lists.newArrayList(); for (TagReference tagReference : from.getTagReferences()) { if (tagReference != null) { tags.add(tagReference.getTag().getName()); } } builder.tags(tags); } return builder.build(); }</code><technical_language>Inject this function in constructor</technical_language>

Target:
public NodeMetadata apply(VirtualGuest from) { NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.getId() + ""); builder.name(from.getHostname()); builder.hostname(from.getHostname() + from.getDomain()); if (from.getDatacenter() != null) { builder.location(from(locations.get()).firstMatch( LocationPredicates.idEquals(from.getDatacenter().getId() + "")).orNull()); } builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getHostname())); builder.hardware(virtualGuestToHardware.apply(from)); Image image = virtualGuestToImage.apply(from); if (image != null) { builder.imageId(image.getId()); builder.operatingSystem(image.getOperatingSystem()); } if (from.getPowerState() != null) { builder.status(serverStateToNodeStatus.get(from.getPowerState().getKeyName())); } if (from.getPrimaryIpAddress() != null) builder.publicAddresses(ImmutableSet.of(from.getPrimaryIpAddress())); if (from.getPrimaryBackendIpAddress() != null) builder.privateAddresses(ImmutableSet.of(from.getPrimaryBackendIpAddress())); if (from.getTagReferences() != null && !from.getTagReferences().isEmpty()) { List<String> tags = Lists.newArrayList(); for (TagReference tagReference : from.getTagReferences()) { if (tagReference != null) { tags.add(tagReference.getTag().getName()); } } builder.tags(tags); } return builder.build(); }
Source:
<code>public static Map<ZooType,InstantiableModel> select(ZooType zooType, int numLabels, int seed, int iterations) { Map<ZooType,InstantiableModel> netmap = new HashMap<>(); switch(zooType) { case ALL: netmap.putAll(ModelSelector.select(ZooType.CNN, numLabels, seed, iterations)); netmap.putAll(ModelSelector.select(ZooType.RNN, numLabels, seed, iterations)); break; case CNN: netmap.putAll(ModelSelector.select(ZooType.ALEXNET, numLabels, seed, iterations)); netmap.putAll(ModelSelector.select(ZooType.VGG16, numLabels, seed, iterations)); break; case ALEXNET: netmap.put(ZooType.ALEXNET, new AlexNet(numLabels, seed, iterations)); break; case LENET: netmap.put(ZooType.LENET, new LeNet(numLabels, seed, iterations)); break; case INCEPTIONRESNETV1: netmap.put(ZooType.INCEPTIONRESNETV1, new InceptionResNetV1(numLabels, seed, iterations)); break; case FACENETNN4SMALL2: netmap.put(ZooType.FACENETNN4SMALL2, new FaceNetNN4Small2(numLabels, seed, iterations)); break; case VGG16: netmap.put(ZooType.VGG16, new VGG16(numLabels, seed, iterations)); break; default: } if(netmap.size()==0) throw new IllegalArgumentException("Zero models have been selected for benchmarking."); <START> <END> return netmap; }</code><technical_language>Run formatter here</technical_language>

Target:
public static Map<ZooType, ZooModel> select(ZooType zooType, int numLabels, int seed, int iterations) { return select(zooType, numLabels, 123, 1, WorkspaceMode.SEPARATE); }