auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean verifySignature(Signature signature, String providedSignature) { try { if (signature.verify(Hex.decodeHex(providedSignature.toCharArray()))) { return true; } } catch (SignatureException|DecoderException ignore) { } try { if (signature.verify(Base64.getDecoder().decode(providedSignature))) { return true; } <START> } catch (SignatureException ignore) { <END> } return false; }</code><technical_language>IllegalStateException here</technical_language>

Target:
private boolean verifySignature(Signature signature, String providedSignature) { try { if (signature.verify(Hex.decodeHex(providedSignature.toCharArray()))) { return true; } } catch (SignatureException|DecoderException ignore) { } try { if (signature.verify(Base64.getDecoder().decode(providedSignature))) { return true; } } catch (SignatureException|IllegalArgumentException ignore) { } return false; }
Source:
<code>public int minimumCoinBottomUp(int total, int coins[]){ int T[] = new int[total + 1]; int R[] = new int[total + 1]; T[0] = 0; for(int i=1; i <= total; i++){ T[i] = Integer.MAX_VALUE-1; R[i] = -1; } for(int j=0; j < coins.length; j++){ <START> for(int i=coins[j]; i <= total; i++){ <END> if (T[i - coins[j]] + 1 < T[i]) { T[i] = 1 + T[i - coins[j]]; R[i] = j; } } } printCoinCombination(R, coins); return T[total]; }</code><technical_language>This change is equivalent existing code if coins[j] contains 0</technical_language>

Target:
public int minimumCoinBottomUp(int total, int coins[]){ int T[] = new int[total + 1]; int R[] = new int[total + 1]; T[0] = 0; for(int i=1; i <= total; i++){ T[i] = Integer.MAX_VALUE-1; R[i] = -1; } for(int j=0; j < coins.length; j++){ int i=( (coins[j] > 0) ? coins[j] : 1); for(; i <= total; i++){ if (T[i - coins[j]] + 1 < T[i]) { T[i] = 1 + T[i - coins[j]]; R[i] = j; } } } printCoinCombination(R, coins); return T[total]; }
Source:
<code>private void ensureProperCacheState(AdvancedCache<KIn, VIn> cache) throws NullPointerException, IllegalStateException { if (cache.getStatus() != ComponentStatus.RUNNING) throw new IllegalStateException("Invalid cache state " + cache.getStatus()); <START> if (cache.getRpcManager() != null && cache.getDistributionManager() == null) { <END> throw new IllegalStateException("Cache mode should be DIST or REPL, rather than " + cache.getCacheConfiguration().clustering().cacheModeString()); } }</code><technical_language>is this correct? if REPL, rpc manager is non-null distribution manager is null, right</technical_language>

Target:
private void ensureProperCacheState(AdvancedCache<KIn, VIn> cache) throws NullPointerException, IllegalStateException { if (cache.getStatus() != ComponentStatus.RUNNING) throw log.invalidCacheState(cache.getStats().toString()); if (cache.getRpcManager() != null && cache.getDistributionManager() == null) { throw log.requireDistOrReplCache(cache.getCacheConfiguration().clustering().cacheModeString()); } }
Source:
<code>public void execute(final String[] args) throws Exception { if (args.length == 0) { Main.printUsage(); System.exit(1); } String jarFileName = args[0]; String candidateMainClass = args.length > 1 ? args[1] : null; Class<?> mainClass = null; JarFile f = null; <START> try { <END> f = new JarFile(jarFileName); mainClass = Main.loadClassFromJar(args, f, Main.getClassLoader()); } catch (IOException ioe) { System.out.println("File " + jarFileName + " could not be found or read."); System.exit(1); } catch (ClassNotFoundException cnfe) { System.out.println("Classname " + (candidateMainClass != null ? candidateMainClass : "in JAR manifest") + " not found. Please make sure you use the wholly qualified package name."); System.exit(1); } finally { if (f != null) { f.close(); } } String[] newArgs = Main.stripArgs(args, mainClass.getName().equals(candidateMainClass) ? 2 : 1); Main.execMainClass(mainClass, newArgs); }</code><technical_language>try-with-resources</technical_language>

Target:
public void execute(final String[] args) throws Exception { if (args.length == 0) { Main.printUsage(); System.exit(1); } String jarFileName = args[0]; String candidateMainClass = args.length > 1 ? args[1] : null; Class<?> mainClass = null; try (JarFile f = new JarFile(jarFileName)) { mainClass = Main.loadClassFromJar(args, f, Main.getClassLoader()); } catch (IOException ioe) { System.out.println("File " + jarFileName + " could not be found or read."); System.exit(1); } catch (ClassNotFoundException cnfe) { System.out.println("Classname " + (candidateMainClass != null ? candidateMainClass : "in JAR manifest") + " not found. Please make sure you use the wholly qualified package name."); System.exit(1); } String[] newArgs = Main.stripArgs(args, mainClass.getName().equals(candidateMainClass) ? 2 : 1); Main.execMainClass(mainClass, newArgs); }
Source:
<code>public void reindex(EntityMetadata md) throws IOException { Map<String, String> fieldMap = Translator.getCaseInsensitiveIndexes(md.getEntityInfo().getIndexes().getIndexes()) .collect(Collectors.toMap( i -> i.getField().toString(), i -> Translator.getHiddenForField(i.getField()).toString())); <START> populateHiddenFields(md.getEntityInfo(), fieldMap); <END> }</code><technical_language>do this if case insensitive indexes</technical_language>

Target:
public void reindex(EntityMetadata md) throws IOException { Map<String, String> fieldMap = Translator.getCaseInsensitiveIndexes(md.getEntityInfo().getIndexes().getIndexes()).collect(Collectors.toMap(i -> i.getField().toString(), i -> Translator.getHiddenForField(i.getField()).toString())); if (!fieldMap.keySet().isEmpty()) { populateHiddenFields(md.getEntityInfo(), fieldMap); } }
Source:
<code>protected Label getLabel() { <START> Label label = new Label("Use filters to restrict the number of jobs currently displayed.<br>Be aware that <b> using multiple filters on the same criteria</b> (id, priority,..) lead in most cases to <b>only consider your last filter</b>."); <END> label.setHeight(20); return label; }</code><technical_language>aware <b> multiple filters criteria</b> (id, priority,..) leads, in cases, <b>only consider filter</b>. Orth</technical_language>

Target:
protected Label getLabel() { Label label = new Label("Use filters to restrict the number of jobs currently displayed.<br>Be aware that <b> using \"Match all\" with multiple filters on the same criteria</b> (id, priority,..) leads, in most cases, to <b>only consider your last filter</b>."); label.setHeight(20); return label; }
Source:
<code>private void handleKeyAlreadyExistsException( long commitTs, KeyAlreadyExistsException ex, LockToken commitLocksToken) { try { if (wasCommitSuccessful(commitTs)) { return; } Set<LockToken> expiredLocks = refreshCommitAndImmutableTsLocks(commitLocksToken); if (!expiredLocks.isEmpty()) { throw new TransactionLockTimeoutException("Our commit was already rolled back at commit time" + " because our locks timed out. startTs: " + getStartTimestamp() + ". " + getExpiredLocksErrorString(commitLocksToken, expiredLocks), ex); } else { <START> log.warn("Potential bug: Someone tried to roll back our transaction but" <END> + " our locks were still valid; this is not allowed." + " Held immutable timestamp lock: " + immutableTimestampLock + "; held commit locks: " + commitLocksToken); } } catch (TransactionFailedException e1) { throw e1; } catch (Exception e1) { log.error("Failed to determine if we can retry this transaction. startTs: {}", SafeArg.of("startTs", getStartTimestamp()), e1); } String msg = "Our commit was already rolled back at commit time." + " Locking should prevent this from happening, but our locks may have timed out." + " startTs: " + getStartTimestamp(); throw new TransactionCommitFailedException(msg, ex); }</code><technical_language>Also, update log - try roll back, did</technical_language>

Target:
private void handleKeyAlreadyExistsException( long commitTs, KeyAlreadyExistsException ex, LockToken commitLocksToken) { try { if (wasCommitSuccessful(commitTs)) { return; } Set<LockToken> expiredLocks = refreshCommitAndImmutableTsLocks(commitLocksToken); if (!expiredLocks.isEmpty()) { throw new TransactionLockTimeoutException("Our commit was already rolled back at commit time" + " because our locks timed out. startTs: " + getStartTimestamp() + ". " + getExpiredLocksErrorString(commitLocksToken, expiredLocks), ex); } else { log.warn("Possible bug: Someone rolled back our transaction but" + " our locks were still valid; Atlas code is not allowed to do this, though others can.", SafeArg.of("immutableTimestampLock", immutableTimestampLock), SafeArg.of("commitLocksToken", commitLocksToken)); } } catch (TransactionFailedException e1) { throw e1; } catch (Exception e1) { log.error("Failed to determine if we can retry this transaction. startTs: {}", SafeArg.of("startTs", getStartTimestamp()), e1); } String msg = "Our commit was already rolled back at commit time." + " Locking should prevent this from happening, but our locks may have timed out." + " startTs: " + getStartTimestamp(); throw new TransactionCommitFailedException(msg, ex); }
Source:
<code>public void onStart(Stage stage) { area = new CodeArea(); area.appendText("some example\n text to go here\n across a couple of \n lines...."); StateManager stateManager = mock(StateManager.class); when(stateManager.activeSearchQueryProperty()).thenReturn(OptionalObjectProperty.empty()); <START> Globals.prefs = mock(JabRefPreferences.class); <END> KeyBindingRepository keyBindingRepository = new KeyBindingRepository(Collections.emptyList(), Collections.emptyList()); when(Globals.prefs.getKeyBindingRepository()).thenReturn(keyBindingRepository); ImportFormatPreferences importFormatPreferences = mock(ImportFormatPreferences.class); when(importFormatPreferences.getFieldContentParserPreferences()) .thenReturn(mock(FieldContentParserPreferences.class)); sourceTab = new SourceTab(new BibDatabaseContext(), new CountingUndoManager(), new LatexFieldFormatterPreferences(), importFormatPreferences, new DummyFileUpdateMonitor(), mock(DialogService.class), stateManager); pane = new TabPane( new Tab("main area", area), new Tab("other tab", new Label("some text")), sourceTab ); scene = new Scene(pane); this.stage = stage; stage.setScene(scene); stage.setWidth(400); stage.setHeight(400); stage.show(); pane.getSelectionModel().select(0); }</code><technical_language>Is complicated extract preferences replace Globals.prefs constructor arguments</technical_language>

Target:
public void onStart(Stage stage) { area = new CodeArea(); area.appendText("some example\n text to go here\n across a couple of \n lines...."); StateManager stateManager = mock(StateManager.class); when(stateManager.activeSearchQueryProperty()).thenReturn(OptionalObjectProperty.empty()); KeyBindingRepository keyBindingRepository = new KeyBindingRepository(Collections.emptyList(), Collections.emptyList()); ImportFormatPreferences importFormatPreferences = mock(ImportFormatPreferences.class); when(importFormatPreferences.getFieldContentParserPreferences()) .thenReturn(mock(FieldContentParserPreferences.class)); sourceTab = new SourceTab(new BibDatabaseContext(), new CountingUndoManager(), new LatexFieldFormatterPreferences(), importFormatPreferences, new DummyFileUpdateMonitor(), mock(DialogService.class), stateManager, keyBindingRepository); pane = new TabPane( new Tab("main area", area), new Tab("other tab", new Label("some text")), sourceTab ); scene = new Scene(pane); this.stage = stage; stage.setScene(scene); stage.setWidth(400); stage.setHeight(400); stage.show(); pane.getSelectionModel().select(0); }
Source:
<code>private Method find(final BeanInfo info) { Method foundMethod = null; <START> boolean found = false; <END> for (PropertyDescriptor descr : info.getPropertyDescriptors()) { if (descr.getName().equals(this.property) && (descr.getReadMethod() != null)) { foundMethod = descr.getReadMethod(); found = true; break; } } if (!found) { for (MethodDescriptor descr : info.getMethodDescriptors()) { if (descr.getName().equals(this.property) && (descr.getMethod().getParameterTypes().length == 0)) { foundMethod = descr.getMethod(); found = true; break; } } } if (found) { return foundMethod; } else { throw new IllegalArgumentException( String.format( "Object should have a getter for property '%s'", this.property ) ); } }</code><technical_language>variables? of type Method. If null - means found</technical_language>

Target:
private Method find(final BeanInfo info) { Method found = null; for (PropertyDescriptor descr : info.getPropertyDescriptors()) { if (descr.getName().equals(this.property) && (descr.getReadMethod() != null)) { found = descr.getReadMethod(); break; } } if (found == null) { for (MethodDescriptor descr : info.getMethodDescriptors()) { if (descr.getName().equals(this.property) && (descr.getMethod().getParameterTypes().length == 0)) { found = descr.getMethod(); break; } } } if (found == null) { throw new IllegalArgumentException( String.format( "Object should have a getter for property '%s'", this.property ) ); } return found; }
Source:
<code>public void putTicket(ImageTicket ticket) { BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest( "PUT", TICKETS_URI + ticket.getId(), HttpVersion.HTTP_1_1); StringEntity entity = new StringEntity(ImageTicketHelper.toJson(ticket), StandardCharsets.UTF_8); request.setEntity(entity); request.setHeader("content-length", <START> String.valueOf(request.getEntity().getContentLength())); <END> HttpEntity response = executeRequest(request); consumeEntity(response); }</code><technical_language>entity</technical_language>

Target:
public void putTicket(ImageTicket ticket) { BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest( "PUT", TICKETS_URI + ticket.getId(), HttpVersion.HTTP_1_1); StringEntity entity = new StringEntity(new Gson().toJson(ticket.toDict()), StandardCharsets.UTF_8); request.setEntity(entity); request.setHeader("content-length", String.valueOf(entity.getContentLength())); HttpEntity response = executeRequest(request); consumeResponse(response); }
Source:
<code>private void showTotalTime(final TimeAcctAllocation alloc) { final TimeAcctAward a = alloc.getSum(); ui.getTotalAwardLabel() .setText(nf_dec.format(a.getTotalHours())); ui.getProgramAwardLabel().setText(nf_dec.format(a.getProgramHours())); <START> ui.getPartnerAwardLabel().setText(nf_dec.format(a.getPartnerHours())); <END> }</code><technical_language>Is a reason show trailing zeros? I avoid that</technical_language>

Target:
private void showTotalTime(final TimeAcctAllocation alloc) { final TimeAcctAward a = alloc.getSum(); ui.getTotalAwardLabel() .setText(nf.format(a.getTotalHours())); ui.getProgramAwardLabel().setText(nf.format(a.getProgramHours())); ui.getPartnerAwardLabel().setText(nf.format(a.getPartnerHours())); }
Source:
<code>private void injectAgent() { LOG.info("pre injection"); <START> String rootOfClass = ClassRootFinder.findClassRootOfClass(IdeaPatcher.class).substring(1); <END> LOG.info("Injector use rootOfClass: " + rootOfClass); try { LiveInjector liveInjector = new LiveInjector(); liveInjector.inject(rootOfClass, true); } catch (Exception ex) { LOG.error("Error agent injection", ex); } LOG.info("post injection"); }</code><technical_language>removing initial character? This is partialy responsible for test failures *nix I believe. is output for Windows</technical_language>

Target:
private void injectAgent() { LOG.info("Starting injection of IntelliJ-Patch"); LiveInjector liveInjector = new LiveInjector(); if (!liveInjector.isSupportedEnvironment()) { LOG.warn("Unsupported environment - agent injection only works on a sun-derived 1.6 or higher VM\""); return; } String agentSourceFile = ClassRootFinder.findClassRootOfClass(IdeaPatcher.class); LOG.info("Injector use agentSourceFile: " + agentSourceFile); if (!liveInjector.isInjectable(agentSourceFile)) { LOG.warn("Unable to inject Lombok Idea Patcher Agent as agent source is not valid"); return; } final BuildNumber currentBuild = ApplicationInfo.getInstance().getBuild(); Map<String, String> options = new HashMap<String, String>(); options.put("ideaBuild", currentBuild.asStringWithoutProductCode()); try { liveInjector.inject(agentSourceFile, options); } catch (Exception ex) { LOG.error("Error injecting Lombok Agent", ex); } }
Source:
<code>public Api getApi() { <START> if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) return null; <END> return new Api(this); }</code><technical_language>suggestion if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) { return null; }</technical_language>

Target:
public Api getApi() { if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) { return null; } return new Api(this); }
Source:
<code>public SSLEngine wrapSslEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer) { if (JettyAlpnSslEngineSubstitution.isAvailable()) { return isServer ? (SSLEngine) (Object) JettyAlpnSslEngineSubstitution.newServerEngine(engine, applicationNegotiator) : (SSLEngine) (Object) JettyAlpnSslEngineSubstitution.newClientEngine(engine, applicationNegotiator); } <START> throw new RuntimeException("Unable to wrap SSLEngine of type " + engine.getClass().getName()); <END> }</code><technical_language>IllegalStateException ...</technical_language>

Target:
public SSLEngine wrapSslEngine(SSLEngine engine, ByteBufAllocator alloc, JdkApplicationProtocolNegotiator applicationNegotiator, boolean isServer) { if (JettyAlpnSslEngineSubstitution.isAvailable()) { return isServer ? (SSLEngine) (Object) JettyAlpnSslEngineSubstitution.newServerEngine(engine, applicationNegotiator) : (SSLEngine) (Object) JettyAlpnSslEngineSubstitution.newClientEngine(engine, applicationNegotiator); } throw new IllegalStateException("Unable to wrap SSLEngine of type " + engine.getClass().getName()); }
Source:
<code>public Boolean deleteCourse(String courseId) throws IOException { Map<String,String> postParams = new HashMap<>(); postParams.put("event", "delete"); String createdUrl = buildCanvasUrl("courses/" + courseId, Collections.emptyMap()); Response response = canvasMessenger.deleteFromCanvas(oauthToken, createdUrl, postParams); LOG.debug("response "+ response.toString()); if (response.getErrorHappened() || response.getResponseCode() != 200) { LOG.debug("Failed to delete course, error message: " + response.toString()); return false; } Optional<Delete> responseParsed = responseParser.parseToObject(Delete.class, response); <START> if(responseParsed.isPresent()) { <END> return responseParsed.get().getDelete(); } return false; }</code><technical_language>want optional.map().orElse() optional.ifPresent()</technical_language>

Target:
public Boolean deleteCourse(String courseId) throws IOException { Map<String,String> postParams = new HashMap<>(); postParams.put("event", "delete"); String createdUrl = buildCanvasUrl("courses/" + courseId, Collections.emptyMap()); Response response = canvasMessenger.deleteFromCanvas(oauthToken, createdUrl, postParams); LOG.debug("response "+ response.toString()); if (response.getErrorHappened() || response.getResponseCode() != 200) { LOG.debug("Failed to delete course, error message: " + response.toString()); return false; } Optional<Delete> responseParsed = responseParser.parseToObject(Delete.class, response); return responseParsed.map(r -> r.getDelete()).orElse(false); }
Source:
<code>private Iterable<NameKey> scan() { if (matchPrefix != null) { return projectCache.byName(matchPrefix); } else if (type == FilterType.PARENT_CANDIDATES) { SortedSet<Project.NameKey> parents = new TreeSet<Project.NameKey>(); for (NameKey pName : projectCache.all()) { ProjectState e = projectCache.get(pName); if (e == null) { continue; } ProjectState parentState = e.getParentState(); if (parentState != null <START> && !parents.contains(parentState.getProject().getNameKey())) { <END> ProjectControl parentCtrl = parentState.controlFor(currentUser); if (parentCtrl.isVisible() || parentCtrl.isOwner()) { parents.add(parentState.getProject().getNameKey()); } } } return parents; } else { return projectCache.all(); } }</code><technical_language>I need 2 loops here. is, checks duplicated parent rejected. Or, a rejected set</technical_language>

Target:
private Iterable<NameKey> scan() { if (matchPrefix != null) { return projectCache.byName(matchPrefix); } else { return projectCache.all(); } }
Source:
<code>private void handlePutRequest(Request request) throws IOException { try { PutRequest putRequest = PutRequest.readFrom(new DataInputStream(request.getInputStream())); MessageFormatInputStream stream = new MessageFormatInputStream(new BlobId(putRequest.getBlobId()), putRequest.getBlobProperties(), putRequest.getUsermetadata(), putRequest.getData(), putRequest.getBlobProperties().getBlobSize()); MessageInfo info = new MessageInfo(new BlobId(putRequest.getBlobId()), stream.getSize(), putRequest.getBlobProperties().getTimeToLive()); ArrayList<MessageInfo> infoList = new ArrayList<MessageInfo>(); infoList.add(info); MessageFormatWriteSet writeset = new MessageFormatWriteSet(stream, infoList); blobStore.put(writeset); <START> PutResponse response = new PutResponse(putRequest.getCorrelationId(), putRequest.getClientId(), (short)0); <END> requestResponseChannel.sendResponse(response, request); } catch (StoreException e) { } catch (Exception e) { } }</code><technical_language>0 is a magic constant. I this No_Error some such. offer interface PutResponse require ErrorCode passed in (i.e., implicitly sets No_Error). error codes, interface is Enum type a native short</technical_language>

Target:
private void handlePutRequest(Request request) throws IOException { try { PutRequest putRequest = PutRequest.readFrom(new DataInputStream(request.getInputStream())); MessageFormatInputStream stream = new PutMessageFormatInputStream(putRequest.getBlobId(), putRequest.getBlobProperties(), putRequest.getUsermetadata(), putRequest.getData(), putRequest.getBlobProperties().getBlobSize()); MessageInfo info = new MessageInfo(putRequest.getBlobId(), stream.getSize(), putRequest.getBlobProperties().getTimeToLiveInMs()); ArrayList<MessageInfo> infoList = new ArrayList<MessageInfo>(); infoList.add(info); MessageFormatWriteSet writeset = new MessageFormatWriteSet(stream, infoList); blobStore.put(writeset); PutResponse response = new PutResponse(putRequest.getCorrelationId(), putRequest.getClientId(), (short)0); requestResponseChannel.sendResponse(response, request); } catch (StoreException e) { } catch (Exception e) { } }
Source:
<code>protected boolean parseHeader(ParsableByteArray data) throws UnsupportedFormatException { if (!hasParsedAudioDataHeader) { int header = data.readUnsignedByte(); audioFormat = (header >> 4) & 0x0F; int sampleRateIndex = (header >> 2) & 0x03; int encodingSize = header & 0x01; if (sampleRateIndex < 0 || sampleRateIndex >= AUDIO_SAMPLING_RATE_TABLE.length) { throw new UnsupportedFormatException("Invalid sample rate index: " + sampleRateIndex); } if (audioFormat == AUDIO_FORMAT_ALAW || audioFormat == AUDIO_FORMAT_ULAW) { String type = (audioFormat == AUDIO_FORMAT_ALAW) ? MimeTypes.AUDIO_ALAW : MimeTypes.AUDIO_ULAW; int encoding = (encodingSize == 1) ? C.ENCODING_PCM_16BIT : C.ENCODING_PCM_8BIT; <START> int minSize = AudioTrack.getMinBufferSize(8000, AudioFormat.CHANNEL_OUT_MONO, encoding); <END> Format format = Format.createAudioSampleFormat(null, type, null, minSize * 4, minSize, 1, 8000, encoding, null, null, 0, null); output.format(format); hasOutputFormat = true; hasParsedAudioDataHeader = true; } else if (audioFormat != AUDIO_FORMAT_AAC ) { throw new UnsupportedFormatException("Audio format not supported: " + audioFormat); } hasParsedAudioDataHeader = true; } else { data.skipBytes(1); } return true; }</code><technical_language>I this is right do here. This is supposed maximum size of a sample, is unrelated large AudioTrack buffer needs be. Based L103/L104, maximum sample size maximum size of a tag payload. Is bounded in FLV? a bit 2^24, is big setting here. If so, fine leave set Format.NO_VALUE is done for AAC case</technical_language>

Target:
protected boolean parseHeader(ParsableByteArray data) throws UnsupportedFormatException { if (!hasParsedAudioDataHeader) { int header = data.readUnsignedByte(); audioFormat = (header >> 4) & 0x0F; int sampleRateIndex = (header >> 2) & 0x03; int encodingSize = header & 0x01; if (sampleRateIndex < 0 || sampleRateIndex >= AUDIO_SAMPLING_RATE_TABLE.length) { throw new UnsupportedFormatException("Invalid sample rate index: " + sampleRateIndex); } if (audioFormat == AUDIO_FORMAT_ALAW || audioFormat == AUDIO_FORMAT_ULAW) { String type = (audioFormat == AUDIO_FORMAT_ALAW) ? MimeTypes.AUDIO_ALAW : MimeTypes.AUDIO_ULAW; int encoding = (encodingSize == 1) ? C.ENCODING_PCM_16BIT : C.ENCODING_PCM_8BIT; Format format = Format.createAudioSampleFormat(null, type, null, Format.NO_VALUE, Format.NO_VALUE, 1, 8000, encoding, null, null, 0, null); output.format(format); hasOutputFormat = true; } else if (audioFormat != AUDIO_FORMAT_AAC ) { throw new UnsupportedFormatException("Audio format not supported: " + audioFormat); } hasParsedAudioDataHeader = true; } else { data.skipBytes(1); } return true; }
Source:
<code>private static SortedSet<MediaType> parse(final String text) { final SortedSet<MediaType> list = new TreeSet<>(); <START> final String[] parts = new UncheckedText( <END> new Lowered(text) ).asString().split(","); for (final String name : parts) { if (!name.isEmpty()) { list.add(new MediaType(name)); } } return list; }</code><technical_language>@fanifieiev please, Split (Text) cactoos leave a puzzle</technical_language>

Target:
private static SortedSet<MediaType> parse(final String text) { final SortedSet<MediaType> list = new TreeSet<>(); final Iterable<Text> parts = new Split( new UncheckedText(new Lowered(text)), "," ); for (final Text part : parts) { final String name = new UncheckedText(part).asString(); if (!name.isEmpty()) { list.add(new MediaType(name)); } } return list; }
Source:
<code>private void traverseNodesForDynamicFiltering(List<PlanNode> nodes) { for (PlanNode node : nodes) { <START> if (node instanceof JoinNode) { <END> JoinNode joinNode = (JoinNode) node; for (TaskId task : allTasks) { dynamicFilterService.registerTask(stateMachine.getSession().getQueryId().toString(), joinNode.getId().toString(), stateMachine.getStageId().getId(), task.getId()); } } traverseNodesForDynamicFiltering(node.getSources()); } }</code><technical_language>do this planing phase? Right plan built</technical_language>

Target:
private void traverseNodesForDynamicFiltering(List<PlanNode> nodes) { for (PlanNode node : nodes) { if (node instanceof JoinNode) { JoinNode joinNode = (JoinNode) node; dynamicFilterService.registerTasks(joinNode.getId().toString(), allTasks); } traverseNodesForDynamicFiltering(node.getSources()); } }
Source:
<code>public void increaseCapacity() { if (!credential.equals(pool.getPrefillCredential())) return; int created = 1; boolean create = true; while (create && !pool.isFull()) { if (pool.isShutdown()) { return; } int currentSize = listeners.size(); create = pool.getCapacity().getIncrementer() .shouldCreate(currentSize, pool.getConfiguration().getMaxSize(), created); if (create) { try { ConnectionListener cl = pool.createConnectionListener(credential, this); if (Tracer.isEnabled()) Tracer.createConnectionListener(pool.getConfiguration().getId(), this, cl, cl.getManagedConnection(), false, false, true, Tracer.isRecordCallstacks() ? new Throwable("CALLSTACK") : null); boolean added = false; if (listeners.size() < pool.getConfiguration().getMaxSize()) { if (log.isTraceEnabled()) <START> log.trace("Capacity fill: cl=" + cl); <END> listeners.add(cl); created++; added = true; } if (!added) { if (Tracer.isEnabled()) Tracer.destroyConnectionListener(pool.getConfiguration().getId(), this, cl, false, false, true, false, false, false, true, Tracer.isRecordCallstacks() ? new Throwable("CALLSTACK") : null); pool.destroyConnectionListener(cl); return; } } catch (ResourceException re) { log.unableFillPool(re); return; } } } }</code><technical_language>this message added another class in other logging messages were</technical_language>

Target:
public void increaseCapacity() { if (!credential.equals(pool.getPrefillCredential())) return; int created = 1; boolean create = true; while (create && !pool.isFull()) { if (pool.isShutdown()) { return; } int currentSize = listeners.size(); create = pool.getCapacity().getIncrementer() .shouldCreate(currentSize, pool.getConfiguration().getMaxSize(), created); if (create) { try { ConnectionListener cl = pool.createConnectionListener(credential, this); if (Tracer.isEnabled()) Tracer.createConnectionListener(pool.getConfiguration().getId(), this, cl, cl.getManagedConnection(), false, false, true, Tracer.isRecordCallstacks() ? new Throwable("CALLSTACK") : null); boolean added = false; if (listeners.size() < pool.getConfiguration().getMaxSize()) { if (log.isTraceEnabled()) log.trace("Capacity fill: cl=" + cl); listeners.add(cl); created++; added = true; } if (!added) { if (Tracer.isEnabled()) Tracer.destroyConnectionListener(pool.getConfiguration().getId(), this, cl, false, false, true, false, false, false, true, Tracer.isRecordCallstacks() ? new Throwable("CALLSTACK") : null); pool.destroyConnectionListener(cl); return; } } catch (ResourceException re) { log.unableFillPool(pool.getConfiguration().getId(), re); return; } } } }
Source:
<code>public IReconcilingStrategy getReconcilingStrategy(String contentType) { if(fReconcilers.size() == 1) { return fReconcilers.get(0).getReconcilingStrategy(contentType); } List<IReconcilingStrategy> strategies = new ArrayList<>(); for (IReconciler iReconciler : fReconcilers) { IReconcilingStrategy strategy = iReconciler.getReconcilingStrategy(contentType); if(strategy != null) { strategies.add(strategy); } } <START> return new CompositeReconcilerStrategy(strategies); <END> }</code><technical_language>I size of strategies list matters more here. get rid of check lines 66-68 check strategies is empty return null, if size if return single one, compose them</technical_language>

Target:
public IReconcilingStrategy getReconcilingStrategy(String contentType) { List<IReconcilingStrategy> strategies = new ArrayList<>(); for (IReconciler iReconciler : fReconcilers) { IReconcilingStrategy strategy = iReconciler.getReconcilingStrategy(contentType); if(strategy != null) { strategies.add(strategy); } } if(strategies.size() == 1) { return strategies.get(0); } return new CompositeReconcilerStrategy(strategies); }
Source:
<code>public void processStandbyChange(TopologyDescriptor newConfig) { if (newConfig.getTopologyConfigId() != topologyDescriptor.getTopologyConfigId()) { log.error("Detected changes in the topology. The new topology descriptor doesn't have the same " + "siteConfigId as the current one {}", newConfig, topologyDescriptor); return; } Map<String, ClusterDescriptor> newStandbys = newConfig.getStandbyClusters(); Map<String, ClusterDescriptor> currentStandbys = topologyDescriptor.getStandbyClusters(); newStandbys.keySet().retainAll(currentStandbys.keySet()); Set<String> standbysToRemove = currentStandbys.keySet(); standbysToRemove.removeAll(newStandbys.keySet()); for (String siteID : standbysToRemove) { stopLogReplicationRuntime(siteID); topologyDescriptor.removeStandbySite(siteID); } <START> for (String clusterId : newConfig.getStandbyClusters().keySet()) { <END> if (runtimeToRemoteCluster.get(clusterId) == null) { ClusterDescriptor clusterInfo = newConfig.getStandbyClusters().get(clusterId); topologyDescriptor.addStandbySite(clusterInfo); startLogReplicationRuntime(clusterInfo); } } }</code><technical_language>I wondering if works expected. currentStandbys.keySet() = [2, 3, 4] newStandbys.keySet() = [1, 2, 3]. 1 added 4 removed. do retainAll newStandbys line 207, this newStandbys.keySet() = [2, 3] 1 (a new standby is in current config is in new config) left out</technical_language>

Target:
public void processStandbyChange(TopologyDescriptor newConfig) { if (newConfig.getTopologyConfigId() != topology.getTopologyConfigId()) { log.error("Detected changes in the topology. The new topology descriptor doesn't have the same " + "siteConfigId as the current one {}", newConfig, topology); return; } Map<String, ClusterDescriptor> newStandbys = newConfig.getStandbyClusters(); Map<String, ClusterDescriptor> currentStandbys = topology.getStandbyClusters(); newStandbys.keySet().retainAll(currentStandbys.keySet()); Set<String> standbysToRemove = currentStandbys.keySet(); standbysToRemove.removeAll(newStandbys.keySet()); for (String siteID : standbysToRemove) { stopLogReplicationRuntime(siteID); topology.removeStandbySite(siteID); } for (String clusterId : newConfig.getStandbyClusters().keySet()) { if (runtimeToRemoteCluster.get(clusterId) == null) { ClusterDescriptor clusterInfo = newConfig.getStandbyClusters().get(clusterId); topology.addStandbySite(clusterInfo); startLogReplicationRuntime(clusterInfo); } } }
Source:
<code>public void setup() throws InjectionException { final Configuration conf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(Parameters.MiniBatches.class, Integer.toString(miniBatchesPerEpoch)) .build(); final Injector injector = Tang.Factory.getTang().newInjector(conf); mockMemoryStore = mock(MemoryStore.class); injector.bindVolatileInstance(MemoryStore.class, mockMemoryStore); <START> doAnswer(invocation -> { <END> return values; }).when(mockMemoryStore).getAll(); doAnswer(invocation -> { final Integer id = invocation.getArgumentAt(0, Integer.class); final Pair<Integer, Integer> pair = new Pair<>(id, values.get(id)); return pair; }).when(mockMemoryStore).get(anyObject()); trainingDataSplitter = injector.getInstance(TrainingDataSplitter.class); }</code><technical_language>doAnswer(invocation -> values).when(mockMemoryStore).getAll(); when(mockMemoryStore.getAll()).thenReturn((Map) values);</technical_language>

Target:
public void setup() throws InjectionException { final Configuration conf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(Parameters.MiniBatches.class, Integer.toString(MINI_BATCHES_PER_EPOCH)) .build(); final Injector injector = Tang.Factory.getTang().newInjector(conf); mockMemoryStore = mock(MemoryStore.class); injector.bindVolatileInstance(MemoryStore.class, mockMemoryStore); doAnswer(invocation -> values).when(mockMemoryStore).getAll(); doAnswer(invocation -> { final Integer id = invocation.getArgumentAt(0, Integer.class); final Pair<Integer, Integer> pair = new Pair<>(id, values.get(id)); return pair; }).when(mockMemoryStore).get(anyObject()); trainingDataSplitter = injector.getInstance(TrainingDataSplitter.class); }
Source:
<code>public void testReplaceInvalidEmptyStringMacAddressesWithNullDoNotTouchNullValues() { VmNetworkInterface mock = createMockedVmNetworkInterfaceWithMacAddress(null); underTest.replaceInvalidEmptyStringMacAddressesWithNull(singletonList(mock)); verify(mock, <START> Mockito.never()).setMacAddress(Mockito.any()); <END> }</code><technical_language>please add static import for Mockito functions (that for places)</technical_language>

Target:
public void testReplaceInvalidEmptyStringMacAddressesWithNullDoNotTouchNullValues() { when(mock.getMacAddress()).thenReturn(null); underTest.replaceInvalidEmptyStringMacAddressesWithNull(singletonList(mock)); verify(mock, Mockito.never()).setMacAddress(Mockito.any()); }
Source:
<code>private void deleteCommand(@NotNull final String wsId, @NotNull final String commandName, @NotNull AsyncCallback<WorkspaceDto> callback) { String url = null; try { url = baseHttpUrl + '/' + wsId + "/command/" + URLEncoder.encode(commandName, "UTF-8"); } catch (UnsupportedEncodingException ignored) { <START> } <END> asyncRequestFactory.createDeleteRequest(url) .header(ACCEPT, APPLICATION_JSON) .loader(loaderFactory.newLoader("Deleting command...")) .send(newCallback(callback, dtoUnmarshallerFactory.newUnmarshaller(WorkspaceDto.class))); }</code><technical_language>silent catch is good url is null create exceptions</technical_language>

Target:
private void deleteCommand(@NotNull final String wsId, @NotNull final String commandName, @NotNull AsyncCallback<WorkspaceDto> callback) { final String url = baseHttpUrl + '/' + wsId + "/command/" + URL.encodePathSegment(commandName); asyncRequestFactory.createDeleteRequest(url) .header(ACCEPT, APPLICATION_JSON) .loader(loaderFactory.newLoader("Deleting command...")) .send(newCallback(callback, dtoUnmarshallerFactory.newUnmarshaller(WorkspaceDto.class))); }
Source:
<code>private void validateJob(JobKey key) throws SchedulerException { JobDetail detail = scheduler.getJobDetail(key); if (detail == null) { throw new MotechSchedulerException(String.format("Job doesn't exist:\n %s\n %s", key.getName(), key.getGroup())); } JobDataMap map = detail.getJobDataMap(); <START> if (map != null && map.get(EVENT_METADATA) != null && !(Boolean) ((Map<String, Object>) map.get(EVENT_METADATA)).get(UI_DEFINED)) { <END> throw new MotechSchedulerException(String.format("Job is not ui defined:\n %s\n %s", key.getName(), key.getGroup())); } }</code><technical_language>please getBooleanValue, simplify code a bit</technical_language>

Target:
private void validateJob(JobKey key) throws SchedulerException { JobDetail detail = scheduler.getJobDetail(key); if (detail == null) { throw new MotechSchedulerException(String.format("Job doesn't exist:\n %s\n %s", key.getName(), key.getGroup())); } JobDataMap map = detail.getJobDataMap(); if (map != null && !isJobUIDefined(map)) { throw new MotechSchedulerException(String.format("Job is not ui defined:\n %s\n %s", key.getName(), key.getGroup())); } }
Source:
<code>private String getApplicationName(final CloudTrailEvent event, String instanceId) { AmazonEC2Client ec2Client = cachingClientProvider.getClient(AmazonEC2Client.class, event.getEventData().getUserIdentity().getAccountId(), Region.getRegion(Regions.fromName(event.getEventData().getAwsRegion()))); DescribeInstanceAttributeRequest describeInstanceAttributeRequest = new DescribeInstanceAttributeRequest(); describeInstanceAttributeRequest.setInstanceId(instanceId); describeInstanceAttributeRequest.setAttribute("userData"); DescribeInstanceAttributeResult describeInstanceAttributeResult; try { describeInstanceAttributeResult = ec2Client.describeInstanceAttribute(describeInstanceAttributeRequest); } catch (AmazonServiceException e) { LOG.error(e.getMessage()); return null; } String userData = describeInstanceAttributeResult.getInstanceAttribute().getUserData(); byte[] bytesUserData = Base64.decode(userData); String decodedUserData = new String(bytesUserData); Matcher matcher = pattern.matcher(decodedUserData); if (!matcher.find()) { <START> LOG.error("No application_id defined for this instance {}, " + <END> "please change the userData configuration for this instance and add this information.", instanceId); } try { return matcher.group(2); } catch (IndexOutOfBoundsException e) { LOG.error("No application_id defined for this instance {}, " + "please change the userData configuration for this instance and add this information.", instanceId); return null; } }</code><technical_language>violationstore.save("msg");</technical_language>

Target:
private String getApplicationName(final CloudTrailEvent event, String instanceId) { AmazonEC2Client ec2Client = cachingClientProvider.getClient(AmazonEC2Client.class, event.getEventData().getUserIdentity().getAccountId(), Region.getRegion(Regions.fromName(event.getEventData().getAwsRegion()))); DescribeInstanceAttributeRequest describeInstanceAttributeRequest = new DescribeInstanceAttributeRequest(); describeInstanceAttributeRequest.setInstanceId(instanceId); describeInstanceAttributeRequest.setAttribute("userData"); DescribeInstanceAttributeResult describeInstanceAttributeResult; try { describeInstanceAttributeResult = ec2Client.describeInstanceAttribute(describeInstanceAttributeRequest); } catch (AmazonServiceException e) { LOG.error(e.getMessage()); violationStore.save(format("InstanceId: %s doesn't have any userData.",instanceId)); return null; } String userData = describeInstanceAttributeResult.getInstanceAttribute().getUserData(); byte[] bytesUserData = Base64.decode(userData); String decodedUserData = new String(bytesUserData); Matcher matcher = pattern.matcher(decodedUserData); if (!matcher.find()) { violationStore.save(format("No application_id defined for this instance %s, " + "please change the userData configuration for this instance and add this information.", instanceId)); } try { return matcher.group(2); } catch (IndexOutOfBoundsException e) { violationStore.save(format("No application_id defined for this instance %s, " + "please change the userData configuration for this instance and add this information.", instanceId)); return null; } }
Source:
<code>private void addAdapterDeclaration(final Element parentElement, final AdapterDeclaration adapterDecl) { Element <START> adatperElement = <END> createElement(LibraryElementTags.ADAPTER_DECLARATION_ELEMENT); setNameTypeCommentAttribute(adatperElement, adapterDecl, adapterDecl.getType()); if (null != adapterDecl.getAdapterFB()) { exportXandY(adapterDecl.getAdapterFB(), adatperElement); } parentElement.appendChild(adatperElement); }</code><technical_language>spelling</technical_language>

Target:
private void addAdapterDeclaration(final Element parentElement, final AdapterDeclaration adapterDecl) { Element adapterElement = createElement(LibraryElementTags.ADAPTER_DECLARATION_ELEMENT); setNameTypeCommentAttribute(adapterElement, adapterDecl, adapterDecl.getType()); if (null != adapterDecl.getAdapterFB()) { exportXandY(adapterDecl.getAdapterFB(), adapterElement); } parentElement.appendChild(adapterElement); }
Source:
<code>public List<RecoveryStatus> getLogSorts() { List<RecoveryStatus> result = new ArrayList<>(); synchronized (currentWork) { for (Entry<String,LogProcessor> entries : currentWork.entrySet()) { RecoveryStatus status = new RecoveryStatus(); status.name = entries.getKey(); try { double progress = entries.getValue().getBytesCopied() / walBlockSize; <START> status.progress = Math.max(progress, 99.0); <END> } catch (IOException ex) { log.warn("Error getting bytes read"); } status.runtime = (int) entries.getValue().getSortTime(); result.add(status); } return result; } }</code><technical_language>I this status permanently 99%. I want Math.min(progress, 99.9)</technical_language>

Target:
public List<RecoveryStatus> getLogSorts() { List<RecoveryStatus> result = new ArrayList<>(); synchronized (currentWork) { for (Entry<String,LogProcessor> entries : currentWork.entrySet()) { RecoveryStatus status = new RecoveryStatus(); status.name = entries.getKey(); try { double progress = entries.getValue().getBytesCopied() / walBlockSize; status.progress = Math.min(progress, 99.9); } catch (IOException ex) { log.warn("Error getting bytes read"); } status.runtime = (int) entries.getValue().getSortTime(); result.add(status); } return result; } }
Source:
<code>public boolean navigatePreviousComponent() { boolean ret = false; int index = pager.getCurrentItem(); if (index > 0) { PageViewStateCallback curView = (PageViewStateCallback) pagerAdapter.instantiateItem(pager, index); if (curView != null) curView.onPageDisappear(); pager.setCurrentItem(index - 1); ret = true; } <START> <END> return ret; }</code><technical_language>remove of empty lines in this method (navigateNextComponent)</technical_language>

Target:
public void navigatePreviousComponent() { int index = pager.getCurrentItem(); if (index > 0) { PageViewStateCallback curView = (PageViewStateCallback) pagerAdapter.instantiateItem(pager, index); if (curView != null) curView.onPageDisappear(); pager.setCurrentItem(index - 1); } }
Source:
<code>public ValidationResult isSnapshotStatusOK(Snapshot snapshot) { Snapshot snap = snapshotDao.get(snapshot.getId()); <START> if (snap != null && snap.getStatus() != SnapshotStatus.OK) { <END> return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_INVALID_SNAPSHOT_STATUS, String.format("$SnapshotStatus %1$s", snap.getStatus())); } return ValidationResult.VALID; }</code><technical_language>For reusability, worth extracting this logic a generic method a SnapshotStatus. I.e. 'vmNotInStatus' 'vmNotDuringSnapshot/vmNotInPreview' methods</technical_language>

Target:
public ValidationResult isSnapshotStatusOK(Snapshot snapshot) { return isSnapshotInStatus(snapshot, SnapshotStatus.OK, EngineMessage.ACTION_TYPE_FAILED_INVALID_SNAPSHOT_STATUS); }
Source:
<code>public void handlePut(RestRequest restRequest, RestResponseChannel restResponseChannel) { ThrowingConsumer<RequestPath> routingAction = requestPath -> { if (requestPath.matchesOperation(Operations.UPDATE_TTL)) { ttlUpdateHandler.handle(restRequest, restResponseChannel, (r, e) -> { if (e instanceof RouterException && ((RouterException) e).getErrorCode() == RouterErrorCode.BlobUpdateNotAllowed) { restResponseChannel.setHeader(Headers.ALLOW, TTL_UPDATE_REJECTED_ALLOW_HEADER_VALUE); } submitResponse(restRequest, restResponseChannel, null, e); }); } else if (requestPath.matchesOperation(Operations.UNDELETE) && frontendConfig.enableUndelete) { undeleteHandler.handle(restRequest, restResponseChannel, (r, e) -> { if (e instanceof RouterException) { e = new RestServiceException(e.getMessage(), <START> RestServiceErrorCode.getRestServiceErrorCode(((RouterException) e).getErrorCode()), true); <END> } submitResponse(restRequest, restResponseChannel, null, e); }); } else { throw new RestServiceException("Unrecognized operation: " + requestPath.getOperationOrBlobId(false), RestServiceErrorCode.BadRequest); } }; preProcessAndRouteRequest(restRequest, restResponseChannel, frontendMetrics.putPreProcessingMetrics, routingAction); }</code><technical_language>sorry, I realize setting this option a failure reason needs creates a lot of duplicate code. a solution a request-level internal key set true request allowed receive error info (for exception type). approach in this PR work, though</technical_language>

Target:
public void handlePut(RestRequest restRequest, RestResponseChannel restResponseChannel) { ThrowingConsumer<RequestPath> routingAction = requestPath -> { if (requestPath.matchesOperation(Operations.UPDATE_TTL)) { ttlUpdateHandler.handle(restRequest, restResponseChannel, (r, e) -> { if (e instanceof RouterException && ((RouterException) e).getErrorCode() == RouterErrorCode.BlobUpdateNotAllowed) { restResponseChannel.setHeader(Headers.ALLOW, TTL_UPDATE_REJECTED_ALLOW_HEADER_VALUE); } submitResponse(restRequest, restResponseChannel, null, e); }); } else if (requestPath.matchesOperation(Operations.UNDELETE) && frontendConfig.enableUndelete) { restRequest.setArg(SEND_FAILURE_REASON, Boolean.TRUE); undeleteHandler.handle(restRequest, restResponseChannel, (r, e) -> { submitResponse(restRequest, restResponseChannel, null, e); }); } else { throw new RestServiceException("Unrecognized operation: " + requestPath.getOperationOrBlobId(false), RestServiceErrorCode.BadRequest); } }; preProcessAndRouteRequest(restRequest, restResponseChannel, frontendMetrics.putPreProcessingMetrics, routingAction); }
Source:
<code>default void mutateBasedOnUserAgent(Entry entry, ManipulateEntry m, ContainerRequestContext containerContext) { try { <START> final List<String> strings = containerContext.getHeaders().get("User-Agent"); <END> strings.forEach(s -> { final String[] split = s.split("/"); if (split[0].equals("Dockstore-CLI")) { com.github.zafarkhaja.semver.Version clientVersion = com.github.zafarkhaja.semver.Version.valueOf(split[1]); com.github.zafarkhaja.semver.Version v16 = com.github.zafarkhaja.semver.Version.valueOf("1.6.0"); if (clientVersion.lessThanOrEqualTo(v16)) { m.manipulate(entry); } } }); } catch (Exception e) { LOG.debug("encountered a user agent that we could not parse, meh", e); } }</code><technical_language>if user-agent is set? this return empty list null</technical_language>

Target:
default void mutateBasedOnUserAgent(Entry entry, ManipulateEntry m, ContainerRequestContext containerContext) { try { final List<String> strings = containerContext.getHeaders().getOrDefault("User-Agent", Lists.newArrayList()); strings.forEach(s -> { final String[] split = s.split("/"); if (split[0].equals("Dockstore-CLI")) { com.github.zafarkhaja.semver.Version clientVersion = com.github.zafarkhaja.semver.Version.valueOf(split[1]); com.github.zafarkhaja.semver.Version v16 = com.github.zafarkhaja.semver.Version.valueOf("1.6.0"); if (clientVersion.lessThanOrEqualTo(v16)) { m.manipulate(entry); } } }); } catch (Exception e) { LOG.debug("encountered a user agent that we could not parse, meh", e); } }