auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>Moment getDateInInput(){ <START> return moment(getInputBind().value, "HH:mm:ss"); <END> }</code><technical_language>Please TIME_FORMAT instead of "HH:mm:ss"</technical_language>

Target:
Moment getDateInInput() { return moment(getInputBind().value, TIME_FORMAT); }
Source:
<code>protected void initPlayback(@NonNull final PlayQueue queue, @Player.RepeatMode final int repeatMode, final float playbackSpeed, final float playbackPitch, final boolean playbackSkipSilence, final boolean playOnReady, final boolean isMuted) { destroyPlayer(); initPlayer(playOnReady); setRepeatMode(repeatMode); setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence); playQueue = queue; playQueue.init(); if (playbackManager != null) playbackManager.dispose(); playbackManager = new MediaSourceManager(this, playQueue); if (playQueueAdapter != null) playQueueAdapter.dispose(); playQueueAdapter = new PlayQueueAdapter(context, playQueue); <START> if (isMuted) simpleExoPlayer.setVolume(0); <END> }</code><technical_language>volume is maximum, removed this line: <LINK_0> suggestion simpleExoPlayer.setVolume(isMuted ? 0 : 1);</technical_language>

Target:
protected void initPlayback(@NonNull final PlayQueue queue, @Player.RepeatMode final int repeatMode, final float playbackSpeed, final float playbackPitch, final boolean playbackSkipSilence, final boolean playOnReady, final boolean isMuted) { destroyPlayer(); initPlayer(playOnReady); setRepeatMode(repeatMode); setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence); playQueue = queue; playQueue.init(); if (playbackManager != null) playbackManager.dispose(); playbackManager = new MediaSourceManager(this, playQueue); if (playQueueAdapter != null) playQueueAdapter.dispose(); playQueueAdapter = new PlayQueueAdapter(context, playQueue); simpleExoPlayer.setVolume(isMuted ? 0 : 1); }
Source:
<code>public void testGeneratedClassName() { PageFunctionCompiler functionCompiler = new PageFunctionCompiler(createTestMetadataManager(), 0); String planNodeId = "7"; String stageId = "20170707_223500_67496_zguwn.2"; String classSuffix = stageId + "_" + planNodeId; Supplier<PageProjection> projectionSupplier = functionCompiler.compileProjection(ADD_10_EXPRESSION, Optional.of(classSuffix)); PageProjection projection = projectionSupplier.get(); PageProjectionOutput pageProjectionOutput = projection.project(SESSION, new DriverYieldSignal(), createLongBlockPage(0), SelectedPositions.positionsRange(0, 1)); <START> System.out.println(pageProjectionOutput.getClass().getSimpleName()); <END> assertTrue(pageProjectionOutput.getClass().getSimpleName().startsWith("PageProjectionOutput_" + stageId.replace('.', '_') + "_" + planNodeId)); }</code><technical_language>remove this line</technical_language>

Target:
public void testGeneratedClassName() { PageFunctionCompiler functionCompiler = new PageFunctionCompiler(createTestMetadataManager(), 0); String planNodeId = "7"; String stageId = "20170707_223500_67496_zguwn.2"; String classSuffix = stageId + "_" + planNodeId; Supplier<PageProjection> projectionSupplier = functionCompiler.compileProjection(ADD_10_EXPRESSION, Optional.of(classSuffix)); PageProjection projection = projectionSupplier.get(); PageProjectionOutput pageProjectionOutput = projection.project(SESSION, new DriverYieldSignal(), createLongBlockPage(0), SelectedPositions.positionsRange(0, 1)); assertTrue(pageProjectionOutput.getClass().getSimpleName().startsWith("PageProjectionOutput_" + stageId.replace('.', '_') + "_" + planNodeId)); }
Source:
<code>private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig, ClusterConfig clusterConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = capacityMap.get(partitionName); if (partitionCapacity == null) { partitionCapacity = capacityMap.get(ResourceConfig.DEFAULT_PARTITION_KEY); } if (partitionCapacity == null) { LOG.warn("The capacity usage of the specified partition is not configured in the Resource" <START> + " Config {}. No default partition capacity is configured neither. Will proceed with" <END> + " empty capacity configuration.", partitionName, resourceConfig.getResourceName()); partitionCapacity = new HashMap<>(); } List<String> requiredCapacityKeys = clusterConfig.getInstanceCapacityKeys(); partitionCapacity.keySet().retainAll(requiredCapacityKeys); for (String capacityKey : requiredCapacityKeys) { partitionCapacity.putIfAbsent(capacityKey, 0); } return partitionCapacity; }</code><technical_language>></technical_language>

Target:
private Map<String, Integer> fetchCapacityUsage(String partitionName, ResourceConfig resourceConfig, ClusterConfig clusterConfig) { Map<String, Map<String, Integer>> capacityMap; try { capacityMap = resourceConfig.getPartitionCapacityMap(); } catch (IOException ex) { throw new IllegalArgumentException( "Invalid partition capacity configuration of resource: " + resourceConfig .getResourceName(), ex); } Map<String, Integer> partitionCapacity = capacityMap.get(partitionName); if (partitionCapacity == null) { partitionCapacity = capacityMap.get(ResourceConfig.DEFAULT_PARTITION_KEY); } if (partitionCapacity == null) { LOG.warn("The capacity usage of the specified partition is not configured in the Resource" + " Config {}. No default partition capacity is configured either. Will proceed with" + " empty capacity configuration.", partitionName, resourceConfig.getResourceName()); partitionCapacity = new HashMap<>(); } List<String> requiredCapacityKeys = clusterConfig.getInstanceCapacityKeys(); partitionCapacity.keySet().retainAll(requiredCapacityKeys); for (String capacityKey : requiredCapacityKeys) { partitionCapacity.putIfAbsent(capacityKey, 0); } return partitionCapacity; }
Source:
<code>public void createMergewithMergeRevision_validation_valid() throws Exception { PullRequestSCMRevision prRevision = new PullRequestSCMRevision( prMerge, "8f1314fc3c8284d8c6d5886d473db98f2126071c", "c0e024f89969b976da165eecaa71e09dc60c3da1", "38814ca33833ff5583624c29f305be9133f27a40"); assertThat(prRevision.toString(), is("c0e024f89969b976da165eecaa71e09dc60c3da1+8f1314fc3c8284d8c6d5886d473db98f2126071c (38814ca33833ff5583624c29f305be9133f27a40)")); <START> prRevision.validateMergeHash(repo); <END> }</code><technical_language>suggestion try { prRevision.validateMergeHash(repo); } catch (AbortException e) { fail("Validation succeed, but: " + e.getMessage()) } If validation fails is written reported error instead of a failure</technical_language>

Target:
public void createMergewithMergeRevision_validation_valid() throws Exception { PullRequestSCMRevision prRevision = new PullRequestSCMRevision( prMerge, "8f1314fc3c8284d8c6d5886d473db98f2126071c", "c0e024f89969b976da165eecaa71e09dc60c3da1", "38814ca33833ff5583624c29f305be9133f27a40"); assertThat(prRevision.toString(), is("c0e024f89969b976da165eecaa71e09dc60c3da1+8f1314fc3c8284d8c6d5886d473db98f2126071c (38814ca33833ff5583624c29f305be9133f27a40)")); try { prRevision.validateMergeHash(repo); } catch (AbortException e) { fail("Validation should succeed, but: " + e.getMessage()); } }
Source:
<code>private ReadResponse getLongPollReadResponse() { if (!shouldReadEntry() && readRequest.hasTimeOut()) { if (logger.isTraceEnabled()) { logger.trace("Waiting For LAC Update {}", previousLAC); } final Stopwatch startTimeSw = Stopwatch.createStarted(); final boolean watched; try { watched = requestProcessor.bookie.waitForLastAddConfirmedUpdate(ledgerId, previousLAC, this); } catch (Bookie.NoLedgerException e) { logger.info("No ledger found while longpoll reading ledger {}, previous lac = {}.", ledgerId, previousLAC); return buildErrorResponse(StatusCode.ENOLEDGER, startTimeSw); } catch (IOException ioe) { logger.error("IOException while longpoll reading ledger {}, previous lac = : ", ledgerId, previousLAC, ioe); return buildErrorResponse(StatusCode.EIO, startTimeSw); } registerSuccessfulEvent(requestProcessor.getRequestStats().getLongPollPreWaitStats(), startTimeSw); lastPhaseStartTime.reset().start(); if (watched) { if (logger.isTraceEnabled()) { logger.trace("Waiting For LAC Update {}: Timeout {}", previousLAC, readRequest.getTimeOut()); } synchronized (this) { expirationTimerTask = requestTimer.newTimeout(timeout -> { <START> requestProcessor.bookie.cancelWaitForLastAddConfirmedUpdate(ledgerId, this); <END> LongPollReadEntryProcessorV3.this.scheduleDeferredRead(true); }, readRequest.getTimeOut(), TimeUnit.MILLISECONDS); } return null; } } return getReadResponse(); }</code><technical_language>this is core of fix,</technical_language>

Target:
private ReadResponse getLongPollReadResponse() { if (!shouldReadEntry() && readRequest.hasTimeOut()) { if (logger.isTraceEnabled()) { logger.trace("Waiting For LAC Update {}", previousLAC); } final Stopwatch startTimeSw = Stopwatch.createStarted(); final boolean watched; try { watched = requestProcessor.getBookie().waitForLastAddConfirmedUpdate(ledgerId, previousLAC, this); } catch (Bookie.NoLedgerException e) { logger.info("No ledger found while longpoll reading ledger {}, previous lac = {}.", ledgerId, previousLAC); return buildErrorResponse(StatusCode.ENOLEDGER, startTimeSw); } catch (IOException ioe) { logger.error("IOException while longpoll reading ledger {}, previous lac = : ", ledgerId, previousLAC, ioe); return buildErrorResponse(StatusCode.EIO, startTimeSw); } registerSuccessfulEvent(requestProcessor.getRequestStats().getLongPollPreWaitStats(), startTimeSw); lastPhaseStartTime.reset().start(); if (watched) { if (logger.isTraceEnabled()) { logger.trace("Waiting For LAC Update {}: Timeout {}", previousLAC, readRequest.getTimeOut()); } synchronized (this) { expirationTimerTask = requestTimer.newTimeout(timeout -> { requestProcessor.getBookie().cancelWaitForLastAddConfirmedUpdate(ledgerId, this); LongPollReadEntryProcessorV3.this.scheduleDeferredRead(true); }, readRequest.getTimeOut(), TimeUnit.MILLISECONDS); } return null; } } return getReadResponse(); }
Source:
<code>private Artifact getLinkedArtifact(LinkTargetType linkTargetType) throws RuleErrorException { String maybePicName = label.getName() + linkedArtifactNameSuffix; <START> if(featureConfiguration.isEnabled(CppRuleClasses.TARGETS_WINDOWS) <END> && linkTargetType == LinkTargetType.NODEPS_DYNAMIC_LIBRARY) { maybePicName += linkedDLLNameSuffix; } if (linkTargetType.picness() == Picness.PIC) { maybePicName = CppHelper.getArtifactNameForCategory( ruleErrorConsumer, ccToolchain, ArtifactCategory.PIC_FILE, maybePicName); } String linkedName = CppHelper.getArtifactNameForCategory( ruleErrorConsumer, ccToolchain, linkTargetType.getLinkerOutput(), maybePicName); PathFragment artifactFragment = PathFragment.create(label.getName()).getParentDirectory().getRelative(linkedName); return CppHelper.getLinkedArtifact( label, actionConstructionContext, configuration, linkTargetType, linkedArtifactNameSuffix, artifactFragment); }</code><technical_language>This necessary if set linkedArtifactNameSuffix in CcLibrary</technical_language>

Target:
private Artifact getLinkedArtifact(LinkTargetType linkTargetType) throws RuleErrorException { String maybePicName = label.getName() + linkedArtifactNameSuffix; if (linkTargetType.picness() == Picness.PIC) { maybePicName = CppHelper.getArtifactNameForCategory( ruleErrorConsumer, ccToolchain, ArtifactCategory.PIC_FILE, maybePicName); } String linkedName = maybePicName + (linkTargetType == LinkTargetType.NODEPS_DYNAMIC_LIBRARY ? linkedDLLNameSuffix : ""); linkedName = CppHelper.getArtifactNameForCategory( ruleErrorConsumer, ccToolchain, linkTargetType.getLinkerOutput(), linkedName); PathFragment artifactFragment = PathFragment.create(label.getName()).getParentDirectory().getRelative(linkedName); return CppHelper.getLinkedArtifact( label, actionConstructionContext, configuration, linkTargetType, linkedArtifactNameSuffix, artifactFragment); }
Source:
<code>public synchronized void addMissingReferencePointsToUser(User user) { <START> List<String> referencePoints = new ArrayList<String>(); <END> for (String referencePoint : idToReferencePointMapping.keySet()) { referencePoints.add(referencePoint); } this.referencePointsOfUsers.put(user, referencePoints); }</code><technical_language>Loop replaced passing collection CTOR: suggestion List<String> referencePoints = new ArrayList<>(idToReferencePointMapping.keySet());</technical_language>

Target:
public synchronized void addMissingReferencePointsToUser(User user) { List<String> referencePoints = new ArrayList(idToReferencePointMapping.keySet()); this.referencePointsOfUsers.put(user, referencePoints); }
Source:
<code>public void requestBannerAd(final Context context, final MediationBannerListener mediationBannerListener, Bundle bundle, AdSize adSize, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { initializeFromBundle(context, bundle); String spotId = bundle.getString(FyberMediationAdapter.KEY_SPOT_ID); if (TextUtils.isEmpty(spotId)) { mediationBannerListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INVALID_REQUEST); Log.w(TAG, "Cannot render banner ad. Please define a valid spot id on the AdMob console"); return; } mMediationBannerListener = mediationBannerListener; mBannerSpot = InneractiveAdSpotManager.get().createSpot(); mBannerSpot.setMediationName(MEDIATOR_NAME); InneractiveAdViewUnitController controller = new InneractiveAdViewUnitController(); mBannerSpot.addUnitController(controller); InneractiveAdRequest request = new InneractiveAdRequest(spotId); mBannerWrapperView = new RelativeLayout(context); InneractiveAdSpot.RequestListener requestListener = createFyberBannerAdListener(mBannerSpot, mMediationBannerListener); <START> if (requestListener != null) { <END> mBannerSpot.requestAd(request); } else { mediationBannerListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INTERNAL_ERROR); } }</code><technical_language>Is for this listener return null</technical_language>

Target:
public void requestBannerAd(final Context context, final MediationBannerListener mediationBannerListener, Bundle bundle, AdSize adSize, MediationAdRequest mediationAdRequest, Bundle mediationExtras) { initializeFromBundle(context, bundle); String spotId = bundle.getString(FyberMediationAdapter.KEY_SPOT_ID); if (TextUtils.isEmpty(spotId)) { mediationBannerListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INVALID_REQUEST); Log.w(TAG, "Cannot render banner ad. Please define a valid spot id on the AdMob UI"); return; } mBannerSpot = InneractiveAdSpotManager.get().createSpot(); mBannerSpot.setMediationName(MEDIATOR_NAME); InneractiveAdViewUnitController controller = new InneractiveAdViewUnitController(); mBannerSpot.addUnitController(controller); InneractiveAdRequest request = new InneractiveAdRequest(spotId); mBannerWrapperView = new RelativeLayout(context); InneractiveAdSpot.RequestListener requestListener = createFyberBannerAdListener(mediationBannerListener); mBannerSpot.setRequestListener(requestListener); mBannerSpot.requestAd(request); }
Source:
<code>public void init() { Bundle arguments = InstrumentationRegistry.getArguments(); testUser = arguments.getString("TEST_USER"); testUser2 = arguments.getString("TEST_USER2"); testPassword = arguments.getString("TEST_PASSWORD"); testPassword2 = arguments.getString("TEST_PASSWORD2"); testServerURL = arguments.getString("TEST_SERVER_URL"); trusted = Integer.parseInt(arguments.getString("TRUSTED")); <START> switch (trusted) { <END> case (1): servertype = ServerType.HTTP; break; case (2): servertype = ServerType.HTTPS_NON_SECURE; break; case (3): servertype = ServerType.HTTPS_SECURE; break; case (4): servertype = ServerType.REDIRECTED_NON_SECURE; break; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); try { if (!uiDevice.isScreenOn()) { uiDevice.wakeUp(); } } catch (RemoteException e) { e.printStackTrace(); } } }</code><technical_language>I move this logic get enum int a static method in enum, similar method fromValue here: <LINK_0> read servertype here, other place, servertype = ServerType.fromValue(Integer.parseInt(arguments.getString("TRUSTED"))); field trusted needed anymore</technical_language>

Target:
public void init() { Bundle arguments = InstrumentationRegistry.getArguments(); testUser = arguments.getString("TEST_USER"); testUser2 = arguments.getString("TEST_USER2"); testPassword = arguments.getString("TEST_PASSWORD"); testPassword2 = arguments.getString("TEST_PASSWORD2"); testServerURL = arguments.getString("TEST_SERVER_URL"); servertype = ServerType.fromValue(Integer.parseInt(arguments.getString("TRUSTED"))); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); try { if (!uiDevice.isScreenOn()) { uiDevice.wakeUp(); } } catch (RemoteException e) { e.printStackTrace(); } } }
Source:
<code>public Double interpolate(final Interpolator1DDataBundle data, final Double value) { Validate.notNull(value, "value"); Validate.notNull(data, "data bundle"); InterpolationBoundedValues boundedValues = data.getBoundedValues(value); Double x1 = boundedValues.getLowerBoundKey(); Double y1 = boundedValues.getLowerBoundValue(); if (boundedValues.getLowerBoundIndex() == data.size() - 1) { return y1; } Double x2 = boundedValues.getHigherBoundKey(); Double y2 = boundedValues.getHigherBoundValue(); double xDiffInv = 1.0 / (x2 - x1); double a = Math.pow(y1 / y2, x1 * xDiffInv) * y1; double b = Math.log(y2 / y1) * xDiffInv; return a * Math.exp(b * value); <START> } <END></code><technical_language>Final result written (without computing intermediary values: return y1 \* Math.pow(y2 / y1, (value - x1) \* xDiffInv); (remove lines 55 56). This save log exp computation. firstDerivative getNodeSensitivityForValue adapted also</technical_language>

Target:
public Double interpolate(final Interpolator1DDataBundle data, final Double value) { Validate.notNull(value, "value"); Validate.notNull(data, "data bundle"); InterpolationBoundedValues boundedValues = data.getBoundedValues(value); Double x1 = boundedValues.getLowerBoundKey(); Double y1 = boundedValues.getLowerBoundValue(); if (boundedValues.getLowerBoundIndex() == data.size() - 1) { return y1; } Double x2 = boundedValues.getHigherBoundKey(); Double y2 = boundedValues.getHigherBoundValue(); return Math.pow(y2 / y1, (value - x1) / (x2 - x1)) * y1; }
Source:
<code>EmCatch(final Action act, final String usr, final String pass, final String hst, final int prt, final long prd) { this.action = act; this.user = usr; this.password = pass; this.host = hst; this.port = prt; final Thread monitor = new Thread( new Runnable() { @Override public void run() { long period = prd; while (true) { try { EmCatch.this.check(); TimeUnit.SECONDS.sleep(period); period = prd; <START> } catch (final InterruptedException | MessagingException ex) { <END> Logger.error(this, "%[exception]s", ex); if (period < MAX_SLEEP_TIME) { period = period * 2; } } } } } ); monitor.setDaemon(true); monitor.start(); }</code><technical_language>@erimerturk catch for InterruptedException separate in opinion. In case I thread stop</technical_language>

Target:
EmCatch(final Action act, final String usr, final String pass, final String hst, final int prt, final long prd) { this.action = act; this.user = usr; this.password = pass; this.host = hst; this.port = prt; this.period = prd; final Thread monitor = new Thread( new Runnable() { @Override public void run() { EmCatch.this.mainLoop(); } } ); monitor.setDaemon(true); monitor.start(); }
Source:
<code>public AggregatorFactory getCombiningFactory() <START> { <END> return new SketchMergeAggregatorFactory(name, name, size, shouldFinalize, true); }</code><technical_language>This fixing a bug in datasketches, is right</technical_language>

Target:
public AggregatorFactory getCombiningFactory() { return new SketchMergeAggregatorFactory(name, name, size, shouldFinalize, false); }
Source:
<code><START> public int getEstimatedRetainedSizeInBytes() <END> { return INSTANCE_SIZE; }</code><technical_language>account for size of hiveTypeName</technical_language>

Target:
public int getEstimatedRetainedSizeInBytes() { return INSTANCE_SIZE + hiveTypeName.getEstimatedSizeInBytes(); }
Source:
<code>protected ClientAuthenticationCustomCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) { ClientAuthenticationCustomCodec.RequestParameters parameters = ClientAuthenticationCustomCodec .decodeRequest(clientMessage); String uuid = parameters.uuid; String ownerUuid = parameters.ownerUuid; if (uuid != null && uuid.length() > 0) { principal = new ClientPrincipal(uuid, ownerUuid); } credentials = serializationService.toObject(parameters.credentials); clientSerializationVersion = parameters.serializationVersion; if (parameters.clientHazelcastVersionExist) { clientVersion = parameters.clientHazelcastVersion; } if (parameters.clientNameExist) { clientName = parameters.clientName; } <START> if (parameters.labelsExist) { <END> Set<String> set = new HashSet<String>(); for (String label : parameters.labels) { set.add(label); } labels = Collections.unmodifiableSet(set); } return parameters; }</code><technical_language>replace iteration labels = Collections.unmodifiableSet(new HashSet<String>(parameters.labels));</technical_language>

Target:
protected ClientAuthenticationCustomCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) { ClientAuthenticationCustomCodec.RequestParameters parameters = ClientAuthenticationCustomCodec .decodeRequest(clientMessage); String uuid = parameters.uuid; String ownerUuid = parameters.ownerUuid; if (uuid != null && uuid.length() > 0) { principal = new ClientPrincipal(uuid, ownerUuid); } credentials = serializationService.toObject(parameters.credentials); clientSerializationVersion = parameters.serializationVersion; if (parameters.clientHazelcastVersionExist) { clientVersion = parameters.clientHazelcastVersion; } if (parameters.clientNameExist) { clientName = parameters.clientName; } if (parameters.labelsExist) { labels = Collections.unmodifiableSet(new HashSet<String>(parameters.labels)); } return parameters; }
Source:
<code>public void shouldFailWhenNewProcessorJoinsWithSameIdAsExistingProcessor() throws InterruptedException { publishKafkaEvents(inputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[0]); CountDownLatch kafkaEventsConsumedLatch = new CountDownLatch(NUM_KAFKA_EVENTS); CountDownLatch processedMessagesLatch1 = new CountDownLatch(1); CountDownLatch processedMessagesLatch2 = new CountDownLatch(1); StreamApplication streamApp1 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, processedMessagesLatch1, null, kafkaEventsConsumedLatch); StreamApplication streamApp2 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, processedMessagesLatch2, null, kafkaEventsConsumedLatch); applicationRunner1.run(streamApp1); applicationRunner2.run(streamApp2); processedMessagesLatch1.await(); processedMessagesLatch2.await(); LocalApplicationRunner applicationRunner3 = new LocalApplicationRunner(new MapConfig(applicationConfig2)); publishKafkaEvents(inputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[2]); kafkaEventsConsumedLatch = new CountDownLatch(NUM_KAFKA_EVENTS); StreamApplication streamApp3 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, null, null, kafkaEventsConsumedLatch); <START> expectedException.expect(Exception.class); <END> applicationRunner3.run(streamApp3); }</code><technical_language>expect a more specific exception here</technical_language>

Target:
public void shouldFailWhenNewProcessorJoinsWithSameIdAsExistingProcessor() throws InterruptedException { publishKafkaEvents(inputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[0]); CountDownLatch kafkaEventsConsumedLatch = new CountDownLatch(NUM_KAFKA_EVENTS); CountDownLatch processedMessagesLatch1 = new CountDownLatch(1); CountDownLatch processedMessagesLatch2 = new CountDownLatch(1); StreamApplication streamApp1 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, processedMessagesLatch1, null, kafkaEventsConsumedLatch); StreamApplication streamApp2 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, processedMessagesLatch2, null, kafkaEventsConsumedLatch); applicationRunner1.run(streamApp1); applicationRunner2.run(streamApp2); processedMessagesLatch1.await(); processedMessagesLatch2.await(); LocalApplicationRunner applicationRunner3 = new LocalApplicationRunner(new MapConfig(applicationConfig2)); publishKafkaEvents(inputKafkaTopic, NUM_KAFKA_EVENTS, PROCESSOR_IDS[2]); kafkaEventsConsumedLatch = new CountDownLatch(NUM_KAFKA_EVENTS); StreamApplication streamApp3 = new TestStreamApplication(inputKafkaTopic, outputKafkaTopic, null, null, kafkaEventsConsumedLatch); expectedException.expect(SamzaException.class); applicationRunner3.run(streamApp3); }
Source:
<code>private void bootstrap(Content content, BitSet sentAlready) { if (content instanceof Episode) { Episode episode = (Episode) content; ContainerRef brand = episode.getContainerRef(); SeriesRef series = episode.getSeriesRef(); EpisodeRef episodeRef = episode.toRef(); ContentRef partition = ObjectUtils.firstNonNull(brand, series, episodeRef); if (brand != null && ! sentAlready.get(toInt(brand))) { sendMessage(brand, partition); sentAlready.set(toInt(brand)); } if (series != null && ! sentAlready.get(toInt(series))) { sendMessage(series, partition); sentAlready.set(toInt(series)); } sendMessage(episodeRef, partition); <START> sentAlready.set(toInt(episodeRef)); <END> } else if (content instanceof Series) { Series series = (Series) content; BrandRef brand = series.getBrandRef(); SeriesRef seriesRef = series.toRef(); ContentRef partition = ObjectUtils.firstNonNull(brand, seriesRef); if (brand != null && ! sentAlready.get(toInt(brand))) { sendMessage(brand, partition); sentAlready.set(toInt(brand)); } sendMessage(seriesRef, partition); sentAlready.set(toInt(seriesRef)); } else { ContentRef contentRef = content.toRef(); sendMessage(contentRef, contentRef); sentAlready.set(toInt(contentRef)); } }</code><technical_language>check Bloom filter for brands good updated IDs of series episodes. Reduces chance of a false positive</technical_language>

Target:
private void bootstrap(Content content, BitSet sentAlready) { if (content instanceof Episode) { Episode episode = (Episode) content; ContainerRef brand = episode.getContainerRef(); SeriesRef series = episode.getSeriesRef(); EpisodeRef episodeRef = episode.toRef(); ContentRef partition = ObjectUtils.firstNonNull(brand, series, episodeRef); if (brand != null && ! sentAlready.get(toInt(brand))) { sendMessage(brand, partition); sentAlready.set(toInt(brand)); } if (series != null && ! sentAlready.get(toInt(series))) { sendMessage(series, partition); sentAlready.set(toInt(series)); } sendMessage(episodeRef, partition); } else if (content instanceof Series) { Series series = (Series) content; BrandRef brand = series.getBrandRef(); SeriesRef seriesRef = series.toRef(); ContentRef partition = ObjectUtils.firstNonNull(brand, seriesRef); if (brand != null && ! sentAlready.get(toInt(brand))) { sendMessage(brand, partition); sentAlready.set(toInt(brand)); } sendMessage(seriesRef, partition); sentAlready.set(toInt(seriesRef)); } else { ContentRef contentRef = content.toRef(); sendMessage(contentRef, contentRef); sentAlready.set(toInt(contentRef)); } }
Source:
<code>public String onMessage(String message) { CommandScript script = deserialize(message, CommandScript.class); String capability = TARGET_CAPABILITY; <START> boolean hasBPMCommand = script.getCommands().stream().filter(cmd -> cmd instanceof DescriptorCommand).findAny().isPresent(); <END> if (hasBPMCommand) { capability = KieServerConstants.CAPABILITY_BPM; } KieContainerCommandService<?> executor = null; for (KieServerExtension extension : context.getServerExtensions()) { KieContainerCommandService<?> tmp = extension.getAppComponents(KieContainerCommandService.class); if (tmp != null && extension.getImplementedCapability().equalsIgnoreCase(capability)) { executor = tmp; logger.debug("Extension returned command executor with capability {}", extension, executor, extension.getImplementedCapability()); break; } } if (executor == null) { throw new IllegalStateException("No executor found for script execution"); } ServiceResponsesList response = executor.executeScript(script, MarshallingFormat.JSON, null); String reply = serialize(response); return reply; }</code><technical_language>nitpick: simplified script.getCommands().stream().anyMatch(cmd -> cmd instanceof DescriptiorCommand);</technical_language>

Target:
public String onMessage(String message) { CommandScript script = deserialize(message, CommandScript.class); String capability = TARGET_CAPABILITY; boolean hasBPMCommand = script.getCommands().stream().anyMatch(cmd -> cmd instanceof DescriptorCommand); if (hasBPMCommand) { capability = KieServerConstants.CAPABILITY_BPM; } KieContainerCommandService<?> executor = null; for (KieServerExtension extension : context.getServerExtensions()) { KieContainerCommandService<?> tmp = extension.getAppComponents(KieContainerCommandService.class); if (tmp != null && extension.getImplementedCapability().equalsIgnoreCase(capability)) { executor = tmp; logger.debug("Extension returned command executor with capability {}", extension, executor, extension.getImplementedCapability()); break; } } if (executor == null) { throw new IllegalStateException("No executor found for script execution"); } ServiceResponsesList response = executor.executeScript(script, MarshallingFormat.JSON, null); String reply = serialize(response); return reply; }
Source:
<code>public CandidateGroup generateCandidateGroup(PerunSession perunSession, Map<String,String> groupSubjectData, ExtSource source) throws InternalErrorException { if(groupSubjectData == null || groupSubjectData.isEmpty()) throw new InternalErrorException(" Group subject data can't be null or empty, at least group name has to exists."); CandidateGroup candidateGroup = new CandidateGroup(); candidateGroup.setExtSource(source); candidateGroup.asGroup().setName(groupSubjectData.get("groupName")); if(candidateGroup.asGroup().getName() != null) { <START> Matcher name = namePattern.matcher(candidateGroup.asGroup().getName()); <END> if(!name.matches()) throw new InternalErrorException("Group subject data has to contains valid group name!"); } else { throw new InternalErrorException("group name cannot be null in Group subject data!"); } candidateGroup.setParentGroupName(groupSubjectData.get("parentGroupName")); candidateGroup.asGroup().setDescription(groupSubjectData.get("description")); return candidateGroup; }</code><technical_language>this "name" pattern is name pattern for groups? for user name in this class</technical_language>

Target:
public CandidateGroup generateCandidateGroup(PerunSession perunSession, Map<String,String> groupSubjectData, ExtSource source) throws InternalErrorException { if(groupSubjectData == null) throw new InternalErrorException("Group subject data cannot be null."); if(groupSubjectData.isEmpty()) throw new InternalErrorException("Group subject data cannot be empty, at least group name has to exists."); if(source == null) throw new InternalErrorException("ExtSource cannot be null while generating CandidateGroup"); CandidateGroup candidateGroup = new CandidateGroup(); candidateGroup.setExtSource(source); candidateGroup.asGroup().setName(groupSubjectData.get(GroupsManagerBlImpl.GROUP_NAME)); if(candidateGroup.asGroup().getName() != null) { Matcher name = groupNamePattern.matcher(candidateGroup.asGroup().getName()); if(!name.matches()) throw new InternalErrorException("Group subject data has to contains valid group name!"); } else { throw new InternalErrorException("group name cannot be null in Group subject data!"); } candidateGroup.setParentGroupName(groupSubjectData.get(GroupsManagerBlImpl.PARENT_GROUP_NAME)); candidateGroup.asGroup().setDescription(groupSubjectData.get(GroupsManagerBlImpl.GROUP_DESCRIPTION)); return candidateGroup; }
Source:
<code>public String author() { try { <START> return new JdkRequest(URI.create(this.url)) <END> .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON) .method(Request.GET).fetch().as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(JsonResponse.class) .json() .readObject() .getJsonObject("author") .getString("name"); } catch (IOException ex) { throw new IllegalStateException(ex); } }</code><technical_language>need do this, this.url is enough</technical_language>

Target:
public String author() { try { return new JdkRequest(this.url) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(JsonResponse.class) .json() .readObject() .getJsonObject("author") .getString("name"); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
<code>public DirListingMetadata listChildren(final Path path) throws IOException { checkPath(path); LOG.debug("Listing table in region {}: {}", tableName, region, path); return readOp.retry( "listChildren", path.toString(), true, () -> { final QuerySpec spec = new QuerySpec() .withHashKey(pathToParentKeyAttribute(path)) .withConsistentRead(true); final ItemCollection<QueryOutcome> items = table.query(spec); final List<PathMetadata> metas = new ArrayList<>(); for (Item item : items) { DDBPathMetadata meta = itemToPathMetadata(item, username); metas.add(meta); } DDBPathMetadata dirPathMeta = get(path); boolean isAuthoritative = false; if(dirPathMeta != null) { isAuthoritative = dirPathMeta.isAuthoritativeDir(); } LOG.trace("Listing table in region for returning {}", tableName, region, path, metas); if (!metas.isEmpty() && dirPathMeta == null) { <START> LOG.warn("Directory metadata is null, but the list of the " <END> + "directory elements is not empty: {}. This case is handled " + "as the directory is deleted.", metas); return null; } if(metas.isEmpty() && dirPathMeta == null) { return null; } return new DirListingMetadata(path, metas, isAuthoritative, dirPathMeta.getLastUpdated()); }); }</code><technical_language>need review a message sense for db structures. match a troubleshooting doc stack trace</technical_language>

Target:
public DirListingMetadata listChildren(final Path path) throws IOException { checkPath(path); LOG.debug("Listing table in region {}: {}", tableName, region, path); return readOp.retry( "listChildren", path.toString(), true, () -> { final QuerySpec spec = new QuerySpec() .withHashKey(pathToParentKeyAttribute(path)) .withConsistentRead(true); final ItemCollection<QueryOutcome> items = table.query(spec); final List<PathMetadata> metas = new ArrayList<>(); for (Item item : items) { DDBPathMetadata meta = itemToPathMetadata(item, username); metas.add(meta); } DDBPathMetadata dirPathMeta = get(path); return getDirListingMetadataFromDirMetaAndList(path, metas, dirPathMeta); }); }
Source:
<code>public void onUnbind(GraphContainerProvider graphContainerProvider, Map<String, String> props) { <START> if(graphContainerProvider != null) { <END> graphContainerProviders.remove(graphContainerProvider); final ServiceRegistration<GraphContainerProviderRegistration> serviceRegistration = serviceRegistrationMap.remove(graphContainerProvider); if (serviceRegistration != null) { serviceRegistration.unregister(); } } }</code><technical_language>simplified returning immediately if null - save indent block</technical_language>

Target:
public void onUnbind(GraphContainerProvider graphContainerProvider, Map<String, String> props) { if(graphContainerProvider == null) { return; } graphContainerProviders.remove(graphContainerProvider); final ServiceRegistration<GraphContainerProviderRegistration> serviceRegistration = serviceRegistrationMap.remove(graphContainerProvider); if (serviceRegistration != null) { serviceRegistration.unregister(); } }
Source:
<code>public void onFatalError(Throwable throwable) { synchronized (lock) { if (running) { if (throwable instanceof LeaderRetrievalException) { <START> leaderListener.handleError((LeaderRetrievalException) throwable); <END> } else { leaderListener.handleError(new LeaderRetrievalException(throwable)); } } else { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring error notification since the service has been stopped."); } } } }</code><technical_language>lock leaderListener</technical_language>

Target:
public void onFatalError(Throwable throwable) { synchronized (lock) { if (!running) { if (LOG.isDebugEnabled()) { LOG.debug("Ignoring error notification since the service has been stopped."); } return; } if (throwable instanceof LeaderRetrievalException) { leaderListener.handleError((LeaderRetrievalException) throwable); } else { leaderListener.handleError(new LeaderRetrievalException(throwable)); } } }
Source:
<code>public InputStream getErrorStream() { errorStream = provider.getErrorStream(); <START> if (errorStream != null) { <END> errorStream = new FilterInputStream(errorStream) { @Override public int read(byte[] b, int off, int len) throws IOException { int bytes = super.read(b, off, len); byte[] payload = new byte[bytes]; System.arraycopy(b, off, payload, 0, bytes); if (logToStderr) { System.err.println(id + " to LSP4E:" + new String(payload)); } if (logToFile) { log(new String("\n" + id + " to LSP4E:" + payload)); } return bytes; } }; } return errorStream; }</code><technical_language>2 lines, instantiate a new FilterInputStream this method is asked. Instead, generated filtered inputstream stored a field returned if existing</technical_language>

Target:
public InputStream getErrorStream() { if (errorStream != null) { return errorStream; } if (provider.getErrorStream() != null) { errorStream = new FilterInputStream(provider.getErrorStream()) { @Override public int read(byte[] b, int off, int len) throws IOException { int bytes = super.read(b, off, len); byte[] payload = new byte[bytes]; System.arraycopy(b, off, payload, 0, bytes); if (logToStderr) { System.err.println(id + " to LSP4E:" + new String(payload)); } if (logToFile) { log(new String("\n" + id + " to LSP4E:" + payload)); } return bytes; } }; } return errorStream; }
Source:
<code>private HttpRequest createSoapRequest(HttpRequest request) { final String body = request.getPayload().getRawContent().toString(); final Payload payload = Payloads.newStringPayload(SOAP_PREFIX.concat(body).concat(SOAP_SUFFIX)); <START> payload.getContentMetadata().setContentType(MediaType.TEXT_XML); <END> return request.toBuilder().payload(payload).build(); }</code><technical_language>care: _copy_ single field set in binder. avoid manually date, [HttpUtils#copy](<LINK_0> method</technical_language>

Target:
private HttpRequest createSoapRequest(HttpRequest request) { Payload oldPayload = request.getPayload(); ContentMetadata oldMetadata = oldPayload.getContentMetadata(); String body = SOAP_PREFIX.concat(oldPayload.getRawContent().toString()).concat(SOAP_SUFFIX); Payload newPayload = Payloads.newStringPayload(body); HttpUtils.copy(oldMetadata, newPayload.getContentMetadata()); newPayload.getContentMetadata().setContentLength(Long.valueOf(body.length())); return request.toBuilder().payload(newPayload).build(); }
Source:
<code>public final List<String> getPaths(final ResourceResolver resourceResolver, final String path, final String[] nodeTypes) throws RepositoryException { final List<String> collectionPaths = new ArrayList<String>(); final Resource resource = resourceResolver.getResource(path); if (resource == null) { log.warn("Requesting paths for a non-existent Resource [ ]; returning empty results.", path); return Collections.emptyList(); } if (!isWorkflowPackage(resourceResolver, path)) { log.debug("Requesting paths for a non-Resource Collection [ ]; returning provided path.", path); <START> return Arrays.asList(new String[] { path }); <END> } final PageManager pageManager = resourceResolver.adaptTo(PageManager.class); final Page page = pageManager.getContainingPage(path); final Resource contentResource = page == null ? null : page.getContentResource(); if (contentResource != null) { final Node node = contentResource.adaptTo(Node.class); final ResourceCollection resourceCollection = getResourceCollection(node); if (resourceCollection != null) { final List<Node> members = resourceCollection.list(nodeTypes); for (final Node member : members) { collectionPaths.add(member.getPath()); } return collectionPaths; } } return Arrays.asList(new String[]{ path }); }</code><technical_language>@reggie7 bugs in Impl? If this is updating Test work w/ JDK11, a bunch of changes Impl itself? Changing impl explanation is confusing :(</technical_language>

Target:
public final List<String> getPaths(final ResourceResolver resourceResolver, final String path, final String[] nodeTypes) throws RepositoryException { final List<String> collectionPaths = new ArrayList<String>(); final Resource resource = resourceResolver.getResource(path); if (resource == null) { log.warn("Requesting paths for a non-existent Resource [ ]; returning empty results.", path); return Collections.emptyList(); } else if (!isWorkflowPackage(resourceResolver, path)) { log.debug("Requesting paths for a non-Resource Collection [ ]; returning provided path.", path); return Arrays.asList(new String[]{ path }); } else { final PageManager pageManager = resourceResolver.adaptTo(PageManager.class); final Page page = pageManager.getContainingPage(path); if (page != null && page.getContentResource() != null) { final Node node = page.getContentResource().adaptTo(Node.class); final ResourceCollection resourceCollection = getResourceCollection(node); if (resourceCollection != null) { final List<Node> members = resourceCollection.list(nodeTypes); for (final Node member : members) { collectionPaths.add(member.getPath()); } return collectionPaths; } } return Arrays.asList(new String[]{ path }); } }
Source:
<code>public void unsupportedDatabaseTypeIdentified() { <START> IllegalArgumentException thrown = Assertions.assertThrows(IllegalArgumentException.class, <END> () -> new DatabaseInitializer("a2", ds, environmentCreateOnStartup("true"))); assertThat(thrown.getMessage(), CoreMatchers.containsString("No ddl script found")); }</code><technical_language>static import</technical_language>

Target:
public void unsupportedDatabaseTypeIdentified() { IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> new DatabaseInitializer("a2", ds, environmentCreateOnStartup("true"))); assertThat(thrown.getMessage(), containsString("No ddl script found")); }
Source:
<code>public List<PermissionSubject> getPermissionCheckSubjects() { <START> return Collections.singletonList(new PermissionSubject(getParameters().getProfile().getStorageDomainId(), <END> VdcObjectType.Storage, getActionType().getActionGroup())); }</code><technical_language>if profile set NPE here</technical_language>

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { return Collections.singletonList(new PermissionSubject(getParameters().getProfile() != null ? getParameters().getProfile() .getStorageDomainId() : null, VdcObjectType.Storage, getActionType().getActionGroup())); }
Source:
<code>public void dispose() { logger.debug("Disposing MeteoBlue handler."); <START> shuttingDown = true; <END> if (refreshJob != null && !refreshJob.isCancelled()) { refreshJob.cancel(true); refreshJob = null; } }</code><technical_language>I need this flag - cancelling job anyhow, calls done</technical_language>

Target:
public void dispose() { logger.debug("Disposing meteoblue handler."); if (refreshJob != null && !refreshJob.isCancelled()) { refreshJob.cancel(true); refreshJob = null; } }
Source:
<code>public synchronized void skipNextPacket() throws IOException, BadPcapFileException { ByteBuffer pcapPacketHeader; <START> pcapPacketHeader = parseBlockOrPacketHeader(); <END> if (pcapPacketHeader != null) { pcapPacketHeader.position(PcapFileValues.INCLUDED_LENGTH_POSITION); long includedPacketLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); if (getFileChannel().size() - getFileChannel().position() < includedPacketLength) { throw new BadPcapFileException("A packet header is invalid."); } getFileChannel().position(getFileChannel().position() + includedPacketLength); TreeMap<Long, Long> fileIndex = getFileIndex(); fileIndex.put(getCurrentRank(), getFileChannel().position()); setCurrentRank(getCurrentRank() + 1); } }</code><technical_language>easier a generic parseBlock() method, need parse packet header, etc</technical_language>

Target:
public synchronized void skipNextPacket() throws IOException, BadPcapFileException { ByteBuffer pcapPacketHeader; long includedPacketLength; SeekableByteChannel fileChannel = getFileChannel(); if (fileChannel.size() - fileChannel.position() == 0) { return; } if (fileChannel.size() - fileChannel.position() < PcapFileValues.PCAPNG_PACKET_HEADER_SIZE) { return; } pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PCAPNG_PACKET_HEADER_SIZE); pcapPacketHeader.clear(); pcapPacketHeader.order(getByteOrder()); fileChannel.read(pcapPacketHeader); pcapPacketHeader.flip(); int blockType = pcapPacketHeader.getInt(); if (blockType == PcapFileValues.PCAPNG_IDB) { pcapPacketHeader.getInt(); pcapPacketHeader.position(PcapFileValues.INTERFACE_DESCRIPTION_SIZE); long dataLinkType = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getShort()); setDataLinkTypeNg(fInterfaceID, dataLinkType); pcapPacketHeader.getShort(); long snapShotLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); setSnapshotLengthNg(fInterfaceID, snapShotLength); fInterfaceID++; } switch (blockType) { case PcapFileValues.PCAPNG_PB: case PcapFileValues.PCAPNG_EPB: pcapPacketHeader.position(PcapFileValues.PCAPNG_PACKET_CAPTURE_LENGTH_POS); includedPacketLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); if (getFileChannel().size() - getFileChannel().position() < includedPacketLength) { throw new BadPcapFileException("A packet header is invalid."); } getFileChannel().position(getFileChannel().position() + includedPacketLength); TreeMap<Long, Long> fileIndex = getFileIndex(); fileIndex.put(getCurrentRank(), getFileChannel().position()); setCurrentRank(getCurrentRank() + 1); break; default: break; } }
Source:
<code>protected void setClusterCriterias(final String clusterCriterias) { <START> if (StringUtils.isEmpty(clusterCriterias)) { <END> this.clusterCriterias = EMPTY_JSON_ARRAY; } else { this.clusterCriterias = clusterCriterias; } }</code><technical_language>simplify this ternary: this.clusterCriterias = StringUtils.isBlank(clusterCriterias) ? EMPTY_JSON_ARAY : clusterCriterias;</technical_language>

Target:
protected void setClusterCriterias(final String clusterCriterias) { this.clusterCriterias = StringUtils.isBlank(clusterCriterias) ? EMPTY_JSON_ARRAY : clusterCriterias; }
Source:
<code>private void shutdownVpnRunner() { mActiveNetwork = null; mIsRunning = false; resetIkeState(); final ConnectivityManager cm = ConnectivityManager.from(mContext); cm.unregisterNetworkCallback(mNetworkCallback); <START> } <END></code><technical_language>mExecutor.shutdown()</technical_language>

Target:
private void shutdownVpnRunner() { mActiveNetwork = null; mIsRunning = false; resetIkeState(); final ConnectivityManager cm = ConnectivityManager.from(mContext); cm.unregisterNetworkCallback(mNetworkCallback); mExecutor.shutdown(); }
Source:
<code>public URI getUri() { StringBuffer url = request.getRequestURL(); if (request.getQueryString() != null && !request.getQueryString().isEmpty()) { url.append('?').append(request.getQueryString()); } try { return URI.create(URLEncoder.encode(url.toString(), Charset.defaultCharset().name())); <START> } catch (UnsupportedEncodingException uee){ <END> LOGGER.log(Level.WARNING, "Exception encoding string to URL", uee); return URI.create(url.toString()); } }</code><technical_language>Change fine level if this happened happen a lot fill logs</technical_language>

Target:
public URI getUri() { StringBuffer url = request.getRequestURL(); if (request.getQueryString() != null && !request.getQueryString().isEmpty()) { url.append("?").append(request.getQueryString()); } try { return URI.create(url.toString()); } catch (IllegalArgumentException iae) { return URI.create(UriEscaperUtil.escape(url.toString())); } }