auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void determineResult() { if (m_forEverySite || m_responses.isEmpty()) { return; } ResponseResult leaderResponse = m_responses.remove(m_leaderHSID); assert (leaderResponse != null); m_responseHashes = leaderResponse.hashes; m_lastResponse = leaderResponse.message; int pos = -1; for (Iterator<Map.Entry<Long, ResponseResult>> it = m_responses.entrySet().iterator(); it.hasNext();) { Map.Entry<Long, ResponseResult> entry = it.next(); if (!m_replicas.contains(entry.getKey())) { it.remove(); continue; } ResponseResult res = entry.getValue(); if (leaderResponse.success != entry.getValue().success) { <START> tmLog.error(String.format(FAIL_MSG, getStoredProcedureName())); <END> logRelevantMismatchInformation("HASH MISMATCH", res.hashes, res.message, pos); m_allMatched = false; m_misMatchedReplicas.add(entry.getKey()); } else if ((pos = DeterminismHash.compareHashes(leaderResponse.hashes, res.hashes)) >= 0) { tmLog.error(String.format(MISMATCH_MSG, getStoredProcedureName())); logRelevantMismatchInformation("HASH MISMATCH", res.hashes, res.message, pos); m_allMatched = false; m_misMatchedReplicas.add(entry.getKey()); } } }</code><technical_language>If leader disagrees other replicas multiple error logs message, I print suppress rest of them</technical_language>

Target:
private void determineResult() { if (m_forMPEverySiteSysProc || m_responses.isEmpty()) { return; } ResponseResult leaderResponse = m_responses.remove(m_leaderHSID); assert (leaderResponse != null); m_responseHashes = leaderResponse.hashes; m_lastResponse = leaderResponse.message; int pos = -1; for (Iterator<Map.Entry<Long, ResponseResult>> it = m_responses.entrySet().iterator(); it.hasNext();) { Map.Entry<Long, ResponseResult> entry = it.next(); if (!m_replicas.contains(entry.getKey())) { it.remove(); continue; } ResponseResult res = entry.getValue(); if (leaderResponse.success != entry.getValue().success) { if (!m_allMatched) { tmLog.error(String.format(FAIL_MSG, getStoredProcedureName())); logRelevantMismatchInformation("HASH MISMATCH", res.hashes, res.message, pos); m_allMatched = false; } m_misMatchedReplicas.add(entry.getKey()); } else if ((pos = DeterminismHash.compareHashes(leaderResponse.hashes, res.hashes)) >= 0) { if (!m_allMatched) { tmLog.error(String.format(MISMATCH_MSG, getStoredProcedureName())); logRelevantMismatchInformation("HASH MISMATCH", res.hashes, res.message, pos); } m_allMatched = false; m_misMatchedReplicas.add(entry.getKey()); } } }
Source:
<code>public Document toDocument(AggregationOperationContext context) { Document projections = new Document(); <START> ReflectionUtils.doWithFields(type, it -> projections.append(it.getName(), 1)); <END> return context.getMappedObject(projections, type); }</code><technical_language>differentiate rely meta-model. want property accessors instead hand in a projection interface</technical_language>

Target:
public Document toDocument(AggregationOperationContext context) { Document projections = new Document(); Fields fields = context.getFields(type); fields.asList().forEach(it -> projections.append(it.getName(), 1)); return context.getMappedObject(projections, type); }
Source:
<code>public void execute() throws MojoExecutionException, MojoFailureException { if ( expression == null && !settings.isInteractiveMode() ) { getLog().error("Maven is configured to NOT interact with the user for input. " + "This Mojo requires that 'interactiveMode' in your settings file is flag to 'true'."); return; } validateParameters(); if ( StringUtils.isNotEmpty( artifact ) ) { Artifact artifactObj = getArtifact( artifact ); try { project = getMavenProject( artifactObj ); } catch ( ProjectBuildingException e ) { throw new MojoExecutionException( "Unable to get the POM for the artifact '" + artifact + "'. Verify the artifact parameter." ); } } if ( expression == null ) { while ( true ) { <START> System.out.println( "Enter the Maven expression i.e. ${project.groupId} or 0 to exit?:" ); <END> try { String userExpression = inputHandler.readLine(); if ( userExpression == null || userExpression.toLowerCase( Locale.ENGLISH ).equals( "0" ) ) { break; } handleResponse( userExpression ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to read from standard input.", e ); } } } else { handleResponse( "${" + expression + "}" ); } }</code><technical_language>is supposed print println. ugly line break</technical_language>

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if ( expression == null && !settings.isInteractiveMode() ) { getLog().error( "Maven is configured to NOT interact with the user for input. " + "This Mojo requires that 'interactiveMode' in your settings file is flag to 'true'." ); return; } validateParameters(); if ( StringUtils.isNotEmpty( artifact ) ) { Artifact artifactObj = getArtifact( artifact ); try { project = getMavenProject( artifactObj ); } catch ( ProjectBuildingException e ) { throw new MojoExecutionException( "Unable to get the POM for the artifact '" + artifact + "'. Verify the artifact parameter." ); } } if ( expression == null ) { while ( true ) { System.out.print( "Enter the Maven expression i.e. ${project.groupId} or 0 to exit?: " ); try { String userExpression = inputHandler.readLine(); if ( userExpression == null || userExpression.toLowerCase( Locale.ENGLISH ).equals( "0" ) ) { break; } handleResponse( userExpression ); } catch ( IOException e ) { throw new MojoExecutionException( "Unable to read from standard input.", e ); } } } else { handleResponse( "${" + expression + "}" ); } }
Source:
<code>private void preloadDataSet(){ preloadedDataSet = load(iter.next()); totalOutcomes = preloadedDataSet.getLabels().size(1); inputColumns = preloadedDataSet.getFeatureMatrix().size(1); <START> batch = preloadedDataSet.numExamples(); <END> }</code><technical_language>Need careful here. assume classification problems. -1 (last dimension) instead</technical_language>

Target:
private void preloadDataSet(){ preloadedDataSet = load(iter.next()); totalOutcomes = preloadedDataSet.getLabels().size(1); inputColumns = preloadedDataSet.getFeatureMatrix().size(1); }
Source:
<code>private static boolean hasServerError(final HttpResponse response) { <START> return Response.Status.fromStatusCode(response.getStatusCode()) == Response.Status.INTERNAL_SERVER_ERROR; <END> }</code><technical_language>just: return response.getStatusCode() >= 500? need build other objects here</technical_language>

Target:
private static boolean hasServerError(final HttpResponse response) { return response.getStatusCode() >= 500; }
Source:
<code>private void verifyGetters(IndexValue value, String logSegmentName, long size, long offset, boolean isDeleted, long expiresAtMs, long originalMessageOffset, long operationTimeInMs, short serviceId, short containerId) { assertEquals("Size is not as expected", size, value.getSize()); assertEquals("Offset is not as expected", new Offset(logSegmentName, offset), value.getOffset()); assertEquals("Delete status not as expected", isDeleted, value.isFlagSet(IndexValue.Flags.Delete_Index)); <START> if (version == 0) { <END> assertEquals("ExpiresAtMs not as expected", expiresAtMs, value.getExpiresAtMs()); assertEquals("Operation time mismatch", Utils.Infinite_Time, value.getOperationTimeInMs()); assertEquals("ServiceId mismatch ", IndexValue.SERVICE_CONTAINER_ID_DEFAULT_VALUE, value.getServiceId()); assertEquals("ContainerId mismatch ", IndexValue.SERVICE_CONTAINER_ID_DEFAULT_VALUE, value.getContainerId()); } else { assertEquals("ExpiresAtMs not as expected", expiresAtMs != Utils.Infinite_Time ? (expiresAtMs / Time.MsPerSec) * Time.MsPerSec : Utils.Infinite_Time, value.getExpiresAtMs()); assertEquals("Operation time mismatch", operationTimeInMs != Utils.Infinite_Time ? (operationTimeInMs / Time.MsPerSec) * Time.MsPerSec : Utils.Infinite_Time, value.getOperationTimeInMs()); assertEquals("ServiceId mismatch ", serviceId, value.getServiceId()); assertEquals("ContainerId mismatch ", containerId, value.getContainerId()); } assertEquals("Original message offset not as expected", originalMessageOffset, value.getOriginalMessageOffset()); }</code><technical_language>actually, is if-else here? caller passed expiresAtMs, operationTimeInMs, containerId serviceId check. passing, this check right</technical_language>

Target:
private void verifyGetters(IndexValue value, String logSegmentName, long size, long offset, boolean isDeleted, long expiresAtMs, long originalMessageOffset, long operationTimeInMs, short serviceId, short containerId) { assertEquals("Size is not as expected", size, value.getSize()); assertEquals("Offset is not as expected", new Offset(logSegmentName, offset), value.getOffset()); assertEquals("Delete status not as expected", isDeleted, value.isFlagSet(IndexValue.Flags.Delete_Index)); assertEquals("ExpiresAtMs not as expected", expiresAtMs, value.getExpiresAtMs()); assertEquals("Operation time mismatch", operationTimeInMs, value.getOperationTimeInMs()); assertEquals("ServiceId mismatch ", serviceId, value.getServiceId()); assertEquals("ContainerId mismatch ", containerId, value.getContainerId()); assertEquals("Original message offset not as expected", originalMessageOffset, value.getOriginalMessageOffset()); }
Source:
<code>public int getLoaderQueueSize() { <START> return verifyPositive(LOADER_QUEUE_SIZE_PROP, getInt(LOADER_QUEUE_SIZE_PROP, LOADER_QUEUE_SIZE_DEFAULT)); <END> }</code><technical_language>I noticed of prop names duplicated, LOADER_QUEUE_SIZE_PROP is appears this line. I thought of another do this. do following. java public int getLoaderQueueSize() { return getPositiveInt(LOADER_QUEUE_SIZE_PROP, LOADER_QUEUE_SIZE_DEFAULT); } getPositiveInt() do needed validation a setPositiveInt() is fine. I line a duplicated prop names same, hard eyes. I of this alternative I compared manually compared of prop names</technical_language>

Target:
public int getLoaderQueueSize() { return getPositiveInt(LOADER_QUEUE_SIZE_PROP, LOADER_QUEUE_SIZE_DEFAULT); }
Source:
<code>public void tick(WorkloadExecutionStatus status, WorkloadAdjuster adjuster) { log.debug("Going to perform tick with status {}", status); tickCount ++; totalSamples = status.getTotalSamples(); int avgSamplesPerTick = totalSamples / tickCount; int samplesLeft = samplesCount - samplesSubmitted; if (samplesLeft <= 0) { return; } if (status.getTotalSamples() < samplesSubmitted / 2) { return; } Set<NodeId> nodes = status.getNodes(); int threads = threadCount / nodes.size(); int residue = threadCount % nodes.size(); int samplesToAdd = (samplesLeft <= SAMPLES_COUNT_SPLITTING_FACTOR || samplesLeft < avgSamplesPerTick * 1.5) ? samplesLeft : samplesLeft / SAMPLES_COUNT_SPLITTING_FACTOR; int s = 0; for (NodeId node : nodes) { int submittedSamplesCount = submittedConfigurations.get(node) != null ? submittedConfigurations.get(node).getSamples() : 0; int curThreads = threads + residue; residue = 0; int samples = submittedSamplesCount; if (samplesToAdd < nodes.size()) { samples += samplesToAdd; samplesToAdd = 0; } else { <START> samples += Math.round(samplesToAdd * (curThreads)/ threadCount); <END> } WorkloadConfiguration workloadConfiguration = WorkloadConfiguration.with(curThreads, delay, samples); adjuster.adjustConfiguration(node, workloadConfiguration); s += samples; submittedConfigurations.put(node, workloadConfiguration); } samplesSubmitted = s; }</code><technical_language>evaluations integers, 2 problems: Math.round is unnecessary loss of precision. Try this benchmark: public static void main(String[] args) { int samplesToAdd = 1, curThreads =1 , threadCount = 3; int = samplesToAdd * (curThreads)/ threadCount; System.out.println("value = " + value); }</technical_language>

Target:
public void tick(WorkloadExecutionStatus status, WorkloadAdjuster adjuster) { log.debug("Going to perform tick with status {}", status); tickCount ++; totalSamples = status.getTotalSamples(); int avgSamplesPerTick = totalSamples / tickCount; int samplesLeft = samplesCount - samplesSubmitted; if (samplesLeft <= 0) { return; } if (status.getTotalSamples() < samplesSubmitted / 2) { return; } Set<NodeId> nodes = status.getNodes(); int threads = threadCount / nodes.size(); int residue = threadCount % nodes.size(); int samplesToAdd = (samplesLeft <= SAMPLES_COUNT_SPLITTING_FACTOR || samplesLeft < avgSamplesPerTick * 1.5) ? samplesLeft : samplesLeft / SAMPLES_COUNT_SPLITTING_FACTOR; int s = 0; for (NodeId node : nodes) { int submittedSamplesCount = submittedConfigurations.get(node) != null ? submittedConfigurations.get(node).getSamples() : 0; int curThreads = threads; if (residue > 0) { threads += residue--; } int samples = submittedSamplesCount; if (samplesToAdd < nodes.size()) { samples += samplesToAdd; samplesToAdd = 0; } else { samples += Math.round((double) samplesToAdd * curThreads / threadCount); } WorkloadConfiguration workloadConfiguration = WorkloadConfiguration.with(curThreads, delay, samples); adjuster.adjustConfiguration(node, workloadConfiguration); s += samples; submittedConfigurations.put(node, workloadConfiguration); } samplesSubmitted = s; }
Source:
<code>protected void ExecuteIrsBrokerCommand() { uuidReturn = getIrsProxy().moveImage(getParameters().getStoragePoolId().toString(), getParameters().getStorageDomainId().toString(), getParameters().getDstDomainId().toString(), getParameters().getImageGroupId().toString(), getParameters().getVmId().toString(), getParameters().getOp().getValue(), <START> (Boolean.valueOf(getParameters().getPostZero())).toString().toLowerCase(), <END> (Boolean.valueOf(getParameters().getForce())).toString().toLowerCase()); ProceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.mUuid); getVDSReturnValue().setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.moveImage, getParameters().getStoragePoolId())); }</code><technical_language>Instead of Boolean.valueOf(boolean).toString(), String.valueOf(boolean)</technical_language>

Target:
protected void ExecuteIrsBrokerCommand() { uuidReturn = getIrsProxy().moveImage(getParameters().getStoragePoolId().toString(), getParameters().getStorageDomainId().toString(), getParameters().getDstDomainId().toString(), getParameters().getImageGroupId().toString(), getParameters().getVmId().toString(), getParameters().getOp().getValue(), String.valueOf(getParameters().getPostZero()).toLowerCase(), String.valueOf(getParameters().getForce()).toLowerCase()); ProceedProxyReturnValue(); Guid taskID = new Guid(uuidReturn.mUuid); getVDSReturnValue().setCreationInfo( new AsyncTaskCreationInfo(taskID, AsyncTaskType.moveImage, getParameters().getStoragePoolId())); }
Source:
<code>private Map<String, RerankerContext> buildRerankerContextMap() throws IOException { Map<String, RerankerContext> queryContextMap = new HashMap<>(); IndexSearcher searcher = new IndexSearcher(reader); for (String qid : qrels.getQids()) { LOG.debug(String.format("Constructing context for QID: %s", qid)); String queryText = topics.get(qid).get("title"); Query q = null; q = parseQuery(queryText); List<String> queryTokens = AnalyzerUtils.tokenize(queryAnalyzer, queryText); <START> RerankerContext<String> context = new RerankerContext<>(searcher, q, <END> qid, queryText, queryTokens, getTermVectorField(), null, null); queryContextMap.put(qid, context); } LOG.debug("Completed constructing context for all qrels"); return queryContextMap; }</code><technical_language>I need <K> instead of <String>? do deal Integer query ids? if <K> eliminate warning</technical_language>

Target:
private Map<String, RerankerContext<K>> buildRerankerContextMap() throws IOException { Map<String, RerankerContext<K>> queryContextMap = new HashMap<>(); IndexSearcher searcher = new IndexSearcher(reader); for (String qid : qrels.getQids()) { LOG.debug(String.format("Constructing context for QID: %s", qid)); String queryText = topics.get((K)qid).get("title"); Query q = null; q = parseQuery(queryText); List<String> queryTokens = AnalyzerUtils.tokenize(queryAnalyzer, queryText); RerankerContext<K> context = new RerankerContext<>(searcher, (K)qid, q, queryText, queryTokens, null, null); queryContextMap.put(qid, context); } LOG.debug("Completed constructing context for all qrels"); return queryContextMap; }
Source:
<code>private void releaseGlobalLock() { <START> if (threadCount.decrementAndGet() <= 0 || System.nanoTime() >= nextFinish) { <END> globalSync.release(); onGlobalLock = false; } }</code><technical_language>thread locking reentrant lock, unlock nextFinish time</technical_language>

Target:
private void releaseGlobalLock() throws IgniteCheckedException { assert lock.isHeldByCurrentThread(); if (threadCnt.decrementAndGet() <= 0 || System.nanoTime() >= nextFinish) { globalSync.release(); isGloballyLocked = false; } }
Source:
<code>private boolean isExistingUsername0(ByteBuffer username) { <START> if(disabledUsers.contains(username)) <END> return false; return credentials.containsValue(ByteBuffers.encodeAsHex(username)); }</code><technical_language>add { if statement. style guide</technical_language>

Target:
private boolean isExistingUsername0(ByteBuffer username) { return credentials.containsValue(ByteBuffers.encodeAsHex(username)); }
Source:
<code>public ValidationResult networkNotUsedByRunningVms() { final List<String> runningVmNames = new ArrayList<>(); final List<VDS> hostsForNetwork = vdsDao.getAllForNetwork(network.getId()); for (VDS host : hostsForNetwork) { <START> final Version maxSupportedVersion = Collections.max(host.getSupportedClusterVersionsSet()); <END> if (!FeatureSupported.changeNetworkUnderBridgeInUseSupported(maxSupportedVersion)) { final List<String> activeVmsUsingNetworkOnHost = vmInterfaceManager.findActiveVmsUsingNetworks( host.getId(), Collections.singleton(network.getName())); runningVmNames.addAll(activeVmsUsingNetworkOnHost); } } return networkNotUsed(runningVmNames, EngineMessage.VAR__ENTITIES__VMS, EngineMessage.VAR__ENTITIES__VM); }</code><technical_language>is preferred here: eagerly allow host support this feature allow modifying vm network, check cluster compatibility version assure clusters, is a mix of hosts (i.e. cluster 3.5 3.5 3.6 hosts), hosts supports not. suggest check host.getVdsGroupComptabilityVersion()</technical_language>

Target:
public ValidationResult networkNotUsedByRunningVms() { List<VM> runningVms = new ArrayList<>(); List<VmNetworkInterface> vnics = vmNetworkInterfaceDao.getAllForNetwork(network.getId()); Map<Guid, List<VmNetworkInterface>> vnicsByVmId = Entities.vmInterfacesByVmId(vnics); for (VM vm : getVms()) { if (vm.isRunningOrPaused()) { for (VmNetworkInterface nic : vnicsByVmId.get(vm.getId())) { if (VmNetworkCanBeUpdatedPredicate.getInstance().eval(nic)) { runningVms.add(vm); break; } } } } final List<VM> runningVmNotSupportNetworkChange = LinqUtils.filter(runningVms, new Predicate<VM>() { final Map<Guid, Version> clusterVersions = new HashMap<>(); @Override public boolean eval(VM vm) { final Guid clusterId = vm.getVdsGroupId(); Version clusterVersion = clusterVersions.get(clusterId); if (clusterVersion == null) { final VDSGroup cluster = vdsGroupDao.get(clusterId); clusterVersion = cluster.getCompatibilityVersion(); clusterVersions.put(clusterId, clusterVersion); } return !FeatureSupported.changeNetworkUsedByVmSupported(clusterVersion); } }); return networkNotUsed(runningVmNotSupportNetworkChange, EngineMessage.VAR__ENTITIES__VMS, EngineMessage.VAR__ENTITIES__VM); }
Source:
<code>private void initToolbar(final Toolbar toolbar) { if (DEBUG) { Log.d(TAG, "initToolbar() called with: toolbar = [" + toolbar + "]"); } <START> boolean isLight = ThemeHelper.isLightThemeSelected(getActivity()); <END> toolbar.setTitle(R.string.download_dialog_title); toolbar.setNavigationIcon( ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_arrow_back)); toolbar.inflateMenu(R.menu.dialog_url); toolbar.setNavigationOnClickListener(v -> getDialog().dismiss()); toolbar.setNavigationContentDescription(R.string.cancel); okButton = toolbar.findViewById(R.id.okay); okButton.setEnabled(false); toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.okay) { prepareSelectedDownload(); if (getActivity() instanceof RouterActivity) { getActivity().finish(); } return true; } return false; }); }</code><technical_language>var is unused now. suggestion</technical_language>

Target:
private void initToolbar(final Toolbar toolbar) { if (DEBUG) { Log.d(TAG, "initToolbar() called with: toolbar = [" + toolbar + "]"); } toolbar.setTitle(R.string.download_dialog_title); toolbar.setNavigationIcon( ThemeHelper.resolveResourceIdFromAttr(requireContext(), R.attr.ic_arrow_back)); toolbar.inflateMenu(R.menu.dialog_url); toolbar.setNavigationOnClickListener(v -> requireDialog().dismiss()); toolbar.setNavigationContentDescription(R.string.cancel); okButton = toolbar.findViewById(R.id.okay); okButton.setEnabled(false); toolbar.setOnMenuItemClickListener(item -> { if (item.getItemId() == R.id.okay) { prepareSelectedDownload(); if (getActivity() instanceof RouterActivity) { getActivity().finish(); } return true; } return false; }); }
Source:
<code>public ScriptDebugFrame(final Script script, final int lineNumber, final int type) { <START> fScript = new Script(script.getTitle(), script.getCommand()); <END> fLineNumber = lineNumber; fType = type; }</code><technical_language>a copy constructor here: new Script(script);</technical_language>

Target:
public ScriptDebugFrame(final Script script, final int lineNumber, final int type) { fScript = script.clone(); fLineNumber = lineNumber; fType = type; }
Source:
<code>public List<TopicNameWithMetrics> queryTopicsMetrics(Query<TopicNameWithMetrics> query) { List<Topic> filteredNames = query.filterNames(getAllTopics()) <START> .collect(Collectors.toList()); <END> return query.filter(getTopicsMetrics(filteredNames)) .collect(toList()); }</code><technical_language>Method toList is imported. import Collectors</technical_language>

Target:
public List<TopicNameWithMetrics> queryTopicsMetrics(Query<TopicNameWithMetrics> query) { List<Topic> filteredNames = query.filterNames(getAllTopics()) .collect(toList()); return query.filter(getTopicsMetrics(filteredNames)) .collect(toList()); }
Source:
<code>public List<SdxClusterResponse> list(String envName) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); List<SdxCluster> sdxClusters = sdxService.listSdx(userCrn, envName); return sdxClusters.stream() .map(sdxCluster -> { SdxClusterResponse sdxClusterResponse = sdxClusterConverter.sdxClusterToResponse(sdxCluster); <START> sdxService.setAdditionalClusterResponseFields(sdxClusterResponse, sdxCluster); <END> return sdxClusterResponse; }).collect(Collectors.toList()); }</code><technical_language>a fan of this change. This performance impact get information one. Listing quick. need find a more economic get this data, some ideas: - get a list of environments match envCrn get Provider based that. - store this in SdxCluster model in database this change worry this out of sync - infer Provider some other data SdxCluster Model. need of a this a batch call, infer Data form elsewhere</technical_language>

Target:
public List<SdxClusterResponse> list(String envName) { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); List<SdxCluster> sdxClusters = sdxService.listSdx(userCrn, envName); return sdxClusters.stream() .map(sdx -> sdxClusterConverter.sdxClusterToResponse(sdx)) .collect(Collectors.toList()); }
Source:
<code>public String getWebSocketKey() { <START> if(secWebsocketKeyField.getText() == null || secWebsocketKeyField.getText().equals("")) { <END> return null; }else{ return secWebsocketKeyField.getText(); } }</code><technical_language>getText().isEmpty()</technical_language>

Target:
public String getWebSocketKey() { if(webSocketKeyField.getText().isEmpty()) { return null; }else{ return webSocketKeyField.getText(); } }
Source:
<code>public List<Link> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { List<Link> result = new ArrayList<Link>(); String relation; Link link; while (!JsonToken.END_OBJECT.equals(jp.nextToken())) { if (!JsonToken.FIELD_NAME.equals(jp.getCurrentToken())) { throw new JsonParseException("Expected relation name", jp.getCurrentLocation()); } <START> relation = jp.getText(); <END> if (JsonToken.START_ARRAY.equals(jp.nextToken())) { while (!JsonToken.END_ARRAY.equals(jp.nextToken())) { link = jp.readValueAs(Link.class); result.add(link); } } else { link = jp.readValueAs(Link.class); result.add(link); } } return result; }</code><technical_language>effect here? store forward</technical_language>

Target:
public List<Link> deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { List<Link> result = new ArrayList<Link>(); String relation; Link link; while (!JsonToken.END_OBJECT.equals(jp.nextToken())) { if (!JsonToken.FIELD_NAME.equals(jp.getCurrentToken())) { throw new JsonParseException("Expected relation name", jp.getCurrentLocation()); } relation = jp.getText(); if (JsonToken.START_ARRAY.equals(jp.nextToken())) { while (!JsonToken.END_ARRAY.equals(jp.nextToken())) { link = jp.readValueAs(Link.class); link = new Link(link.getHref(), relation); result.add(link); } } else { link = jp.readValueAs(Link.class); link = new Link(link.getHref(), relation); result.add(link); } } return result; }
Source:
<code>private boolean createFyberInterstitialListener() { if (mInterstitialSpot == null || false == (mInterstitialSpot.getSelectedUnitController() instanceof InneractiveFullscreenUnitController)) { return false; } InneractiveFullscreenUnitController controller = (InneractiveFullscreenUnitController)mInterstitialSpot.getSelectedUnitController(); <START> InneractiveFullscreenAdEventsListener interstitalListener = new InneractiveFullscreenAdEventsListenerAdapter() { <END> @Override public void onAdImpression(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdOpened(FyberMediationAdapter.this); } @Override public void onAdClicked(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdClicked(FyberMediationAdapter.this); } @Override public void onAdDismissed(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdClosed(FyberMediationAdapter.this); } @Override public void onAdWillOpenExternalApp(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdLeftApplication(FyberMediationAdapter.this); } }; controller.setEventsListener(interstitalListener); return true; }</code><technical_language>nit: Spelling interstitalListener -> interstitialListener</technical_language>

Target:
private InneractiveFullscreenAdEventsListener createFyberInterstitialListener() { if (mInterstitialSpot == null || !(mInterstitialSpot.getSelectedUnitController() instanceof InneractiveFullscreenUnitController)) { return null; } InneractiveFullscreenUnitController controller = (InneractiveFullscreenUnitController)mInterstitialSpot.getSelectedUnitController(); InneractiveFullscreenAdEventsListener interstitialListener = new InneractiveFullscreenAdEventsListenerAdapter() { @Override public void onAdImpression(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdOpened(FyberMediationAdapter.this); } @Override public void onAdClicked(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdClicked(FyberMediationAdapter.this); } @Override public void onAdDismissed(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdClosed(FyberMediationAdapter.this); } @Override public void onAdWillOpenExternalApp(InneractiveAdSpot adSpot) { mMediationInterstitialListener.onAdLeftApplication(FyberMediationAdapter.this); } }; controller.setEventsListener(interstitialListener); return interstitialListener; }
Source:
<code>public void awaitCompletion() { setPhase(WorkPhase.RUNNING); logger.trace("exec running endpoint={} work={}", getEndpointPath(), getCallContext().getWorkUnit()); if(threadCount == 1) <START> processOutput(getCallContext()); <END> else { for (int i = 0; i < threadCount; i++) { BulkCallableImpl bulkCallableImpl = new BulkCallableImpl(this); try { bulkCallableImpl.submit(bulkCallableImpl); getCallerThreadPoolExecutor().awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS); } catch(Throwable throwable) { throw new RuntimeException("Error occurred while awaiting termination ", throwable); } } } }</code><technical_language>handle * simple case of a single call context single thread * case of multiple call contexts multiple threads need deal case multiple call contexts a single thread</technical_language>

Target:
public void awaitCompletion() { setPhase(WorkPhase.RUNNING); logger.trace("exec running endpoint={} work={}", getEndpointPath(), getCallContext().getWorkUnit()); if(getCallContext() != null) processOutput(); else if(getCallContextQueue() != null && !getCallContextQueue().isEmpty()){ try { for (int i = 0; i < getThreadCount(); i++) { BulkCallableImpl bulkCallableImpl = new BulkCallableImpl(this); submitTask(bulkCallableImpl); } getCallerThreadPoolExecutor().awaitTermination(); } catch(Throwable throwable) { throw new RuntimeException("Error occurred while awaiting termination ", throwable); } } else { throw new IllegalArgumentException("Cannot process output without Callcontext."); } }
Source:
<code>private MessageBuffer getNextBuffer() throws IOException { MessageBuffer next = in.next(); if (next == null) { throw new MessageInsufficientBufferException(); } <START> totalReadBytes += buffer.size(); <END> return next; }</code><technical_language>Check if buffer is null</technical_language>

Target:
private MessageBuffer getNextBuffer() throws IOException { MessageBuffer next = in.next(); if (next == null) { throw new MessageInsufficientBufferException(); } assert (buffer != null); totalReadBytes += buffer.size(); return next; }
Source:
<code>public final CacheEntry wrapEntryForReading(InvocationContext ctx, Object key, boolean isOwner) { if (!isOwner && !isL1Enabled) { <START> return null; <END> } CacheEntry cacheEntry = getFromContext(ctx, key); if (cacheEntry == null) { cacheEntry = getFromContainer(key, isOwner, false); if (cacheEntry != null) { if (useRepeatableRead) { cacheEntry = createWrappedEntry(key, cacheEntry, ctx, false); } ctx.putLookedUpEntry(key, cacheEntry); } } if (trace) { log.tracef("Wrap %s for read. Entry=%s", toStr(key), cacheEntry); } return cacheEntry; }</code><technical_language>return entry in context</technical_language>

Target:
public final void wrapEntryForReading(InvocationContext ctx, Object key, boolean isOwner) { if (!isOwner && !isL1Enabled) { return; } CacheEntry cacheEntry = getFromContext(ctx, key); if (cacheEntry == null) { cacheEntry = getFromContainer(key, isOwner, false); if (cacheEntry != null) { if (useRepeatableRead) { cacheEntry = createWrappedEntry(key, cacheEntry); } ctx.putLookedUpEntry(key, cacheEntry); } } if (trace) { log.tracef("Wrap %s for read. Entry=%s", toStr(key), cacheEntry); } }
Source:
<code>public String publishToFacebook(byte[] inputBytes, String type, String fileName, String message, String videoTitle) { <START> JsonObject response; <END> List<Parameter> parameters = Lists.newArrayList(); if (type.equals("photo")) { type = "photos"; parameters.add(Parameter.with("message", message)); } else if (type.equals("video")) { type = "videos"; parameters.add(Parameter.with("description", message)); parameters.add(Parameter.with("title", videoTitle)); } else { return null; } try { response = client.publish("me/" + type, JsonObject.class, BinaryAttachment.with(fileName, inputBytes), parameters.toArray(new Parameter[parameters.size()])); } catch (FacebookException e) { return null; } return response.toString(); }</code><technical_language>declare this variable closer (i.e. right try block line 123)</technical_language>

Target:
public String publishToFacebook(byte[] inputBytes, String type, String fileName, String message, String videoTitle) { List<Parameter> parameters = Lists.newArrayList(); if (type.equals("photo")) { parameters.add(Parameter.with("message", message)); } else { parameters.add(Parameter.with("description", message)); parameters.add(Parameter.with("title", videoTitle)); } JsonObject response; try { response = client.publish("me/" + type + "s", JsonObject.class, BinaryAttachment.with(fileName, inputBytes), parameters.toArray(new Parameter[parameters.size()])); } catch (FacebookException e) { return null; } return response.toString(); }
Source:
<code>public User getBlockedUser(Process process) { User result = null; if (MetadatenSperrung.isLocked(process.getId())) { String userID = this.msp.getLockBenutzer(process.getId()); try { result = serviceManager.getUserService().getById(Integer.valueOf(userID)); } catch (Exception e) { <START> logger.error(e.getMessage(), e); <END> Helper.setFehlerMeldung(Helper.getTranslation("userNotFound"), e); } } return result; }</code><technical_language>setErrorMessage</technical_language>

Target:
public User getBlockedUser(Process process) { User result = null; if (MetadatenSperrung.isLocked(process.getId())) { String userID = this.msp.getLockBenutzer(process.getId()); try { result = serviceManager.getUserService().getById(Integer.valueOf(userID)); } catch (DAOException | RuntimeException e) { Helper.setErrorMessage(Helper.getTranslation("userNotFound"), logger, e); } } return result; }
Source:
<code>private void invokeSyncOperation(InvokeContext context, EhcacheSyncMessage message) throws ClusterException { switch (message.getMessageType()) { case DATA: EhcacheDataSyncMessage dataSyncMessage = (EhcacheDataSyncMessage) message; ServerSideServerStore store = stateService.getStore(storeIdentifier); dataSyncMessage.getChainMap().entrySet().forEach(entry -> { store.put(entry.getKey(), entry.getValue()); }); break; case STATE_REPO: EhcacheStateRepoSyncMessage stateRepoSyncMessage = (EhcacheStateRepoSyncMessage) message; stateService.getStateRepositoryManager().processSyncMessage(stateRepoSyncMessage); break; case MESSAGE_TRACKER: EhcacheMessageTrackerMessage messageTrackerMessage = (EhcacheMessageTrackerMessage) message; if (messageTrackerMessage.getSegmentId() != EhcacheMessageTrackerMessage.UNKNOWN_SEGMENT) { <START> messageTrackerMessage.getTrackedMessages().entrySet().forEach(entry -> <END> messageHandler.loadTrackedResponsesForSegment(messageTrackerMessage.getSegmentId(), context.makeClientSourceId(entry.getKey()), entry.getValue()) ); } else { messageTrackerMessage.getTrackedMessages().entrySet().forEach(entry -> messageHandler.loadOnSync(context.makeClientSourceId(entry.getKey()), entry.getValue()) ); } break; default: throw new AssertionError("Unsupported Sync operation " + message.getMessageType()); } }</code><technical_language>need do entrySet(), do getTrackerdMessages().forEach</technical_language>

Target:
private void invokeSyncOperation(InvokeContext context, EhcacheSyncMessage message) throws ClusterException { switch (message.getMessageType()) { case DATA: EhcacheDataSyncMessage dataSyncMessage = (EhcacheDataSyncMessage) message; ServerSideServerStore store = stateService.getStore(storeIdentifier); dataSyncMessage.getChainMap().forEach(store::put); break; case STATE_REPO: EhcacheStateRepoSyncMessage stateRepoSyncMessage = (EhcacheStateRepoSyncMessage) message; stateService.getStateRepositoryManager().processSyncMessage(stateRepoSyncMessage); break; case MESSAGE_TRACKER: EhcacheMessageTrackerMessage messageTrackerMessage = (EhcacheMessageTrackerMessage) message; if (messageTrackerMessage.getSegmentId() != EhcacheMessageTrackerMessage.UNKNOWN_SEGMENT) { messageTrackerMessage.getTrackedMessages().forEach((key, value) -> messageHandler.loadTrackedResponsesForSegment(messageTrackerMessage.getSegmentId(), context.makeClientSourceId(key), value)); } else { messageTrackerMessage.getTrackedMessages().forEach((key, value) -> messageHandler.loadOnSync(context.makeClientSourceId(key), value)); } break; default: throw new AssertionError("Unsupported Sync operation " + message.getMessageType()); } }
Source:
<code>private void updateActionAvailability() { NetworkView network = getEntity(); <START> getNewCommand().setIsExecutionAllowed(network != null && network.isExternal()); <END> getRemoveCommand().setIsExecutionAllowed((getSelectedItems() != null && getSelectedItems().size() > 0)); }</code><technical_language>I thought subtab supposed visible if network external?... this check inline getEntity()</technical_language>

Target:
private void updateActionAvailability() { getRemoveCommand().setIsExecutionAllowed((getSelectedItems() != null && getSelectedItems().size() > 0)); }
Source:
<code>public void updateTopic(Topic topic) { groupService.checkGroupExists(topic.getName().getGroupName()); Topic retrieved = getTopicDetails(topic.getName()); Topic modified = Patch.apply(retrieved, topic); if (!retrieved.equals(modified)) { <START> if (Topic.ContentType.AVRO == topic.getContentType() || !isNullOrEmpty(modified.getMessageSchema())) { <END> schemaValidatorProvider.provide(topic.getContentType()).check(modified.getMessageSchema()); } if (retrieved.getRetentionTime() != modified.getRetentionTime()) { multiDCAwareService.manageTopic(brokerTopicManagement -> brokerTopicManagement.updateTopic(topic.getName(), modified.getRetentionTime()) ); } topicRepository.updateTopic(modified); } }</code><technical_language>explicitly ask Topic if validated..</technical_language>

Target:
public void updateTopic(Topic topic) { groupService.checkGroupExists(topic.getName().getGroupName()); Topic retrieved = getTopicDetails(topic.getName()); Topic modified = Patch.apply(retrieved, topic); if (!retrieved.equals(modified)) { if (topic.isSchemaValidationRequired()) { schemaValidatorProvider.provide(topic.getContentType()).check(modified.getMessageSchema()); } if (retrieved.getRetentionTime() != modified.getRetentionTime()) { multiDCAwareService.manageTopic(brokerTopicManagement -> brokerTopicManagement.updateTopic(topic.getName(), modified.getRetentionTime()) ); } topicRepository.updateTopic(modified); } }
Source:
<code>private void restore(File root, File buRoot, Set<File> unrestorable) { File[] children = buRoot.listFiles(); if (children == null) { unrestorable.add(buRoot); return; } for (File <START> children1 : <END> children) { File bu = new File(buRoot, children1.getName()); File target = new File(root, bu.getName()); if (bu.isDirectory()) { if (!target.exists() && !target.mkdir()) { unrestorable.add(bu); continue; } else if (target.exists() && !target.isDirectory()) { target.delete(); if (!target.mkdir()) { unrestorable.add(bu); continue; } } restore(target, bu, unrestorable); } else { if (bu.getName().equals(dummyName)) { restoreCounter++; continue; } if (target.exists()) fullyDelete(target); if (!bu.renameTo(target)) { try { Util.copyStream(new FileInputStream(bu), true, new FileOutputStream(target), true); restoreCounter++; } catch (FileNotFoundException e) { unrestorable.add(bu); continue; } catch (IOException e) { unrestorable.add(bu); continue; } if (!bu.delete()) { logWarning(NLS.bind(Messages.BackupStore_can_not_delete_tmp_file, bu.getAbsolutePath())); } } else restoreCounter++; } } }</code><technical_language>child</technical_language>

Target:
private void restore(File root, File buRoot, Set<File> unrestorable) { File[] children = buRoot.listFiles(); if (children == null) { unrestorable.add(buRoot); return; } for (File child : children) { File bu = new File(buRoot, child.getName()); File target = new File(root, bu.getName()); if (bu.isDirectory()) { if (!target.exists() && !target.mkdir()) { unrestorable.add(bu); continue; } else if (target.exists() && !target.isDirectory()) { target.delete(); if (!target.mkdir()) { unrestorable.add(bu); continue; } } restore(target, bu, unrestorable); } else { if (bu.getName().equals(dummyName)) { restoreCounter++; continue; } if (target.exists()) fullyDelete(target); if (!bu.renameTo(target)) { try { Util.copyStream(new FileInputStream(bu), true, new FileOutputStream(target), true); restoreCounter++; } catch (FileNotFoundException e) { unrestorable.add(bu); continue; } catch (IOException e) { unrestorable.add(bu); continue; } if (!bu.delete()) { logWarning(NLS.bind(Messages.BackupStore_can_not_delete_tmp_file, bu.getAbsolutePath())); } } else restoreCounter++; } } }
Source:
<code>public void testRemoveClientScope() { <START> ClientScopeRepresentation templateRep = new ClientScopeRepresentation(); <END> templateRep.setName("scope1"); String template1Id = createClientScope(templateRep); List<ClientScopeRepresentation> clientScopes = clientScopes().findAll(); Assert.assertTrue(getClientScopeNames(clientScopes).contains("scope1")); templateRep = new ClientScopeRepresentation(); templateRep.setName("scope2"); String template2Id = createClientScope(templateRep); clientScopes = clientScopes().findAll(); Assert.assertTrue(getClientScopeNames(clientScopes).contains("scope2")); removeClientScope(template1Id); clientScopes = clientScopes().findAll(); Assert.assertFalse(getClientScopeNames(clientScopes).contains("scope1")); Assert.assertTrue(getClientScopeNames(clientScopes).contains("scope2")); removeClientScope(template2Id); clientScopes = clientScopes().findAll(); Assert.assertFalse(getClientScopeNames(clientScopes).contains("scope1")); Assert.assertFalse(getClientScopeNames(clientScopes).contains("scope2")); }</code><technical_language>rename variable: scopeRep</technical_language>

Target:
public void testRemoveClientScope() { ClientScopeRepresentation scopeRep = new ClientScopeRepresentation(); scopeRep.setName("scope1"); String scope1Id = createClientScope(scopeRep); List<ClientScopeRepresentation> clientScopes = clientScopes().findAll(); Assert.assertTrue(getClientScopeNames(clientScopes).contains("scope1")); scopeRep = new ClientScopeRepresentation(); scopeRep.setName("scope2"); String scope2Id = createClientScope(scopeRep); clientScopes = clientScopes().findAll(); Assert.assertTrue(getClientScopeNames(clientScopes).contains("scope2")); removeClientScope(scope1Id); clientScopes = clientScopes().findAll(); Assert.assertFalse(getClientScopeNames(clientScopes).contains("scope1")); Assert.assertTrue(getClientScopeNames(clientScopes).contains("scope2")); removeClientScope(scope2Id); clientScopes = clientScopes().findAll(); Assert.assertFalse(getClientScopeNames(clientScopes).contains("scope1")); Assert.assertFalse(getClientScopeNames(clientScopes).contains("scope2")); }
Source:
<code>public static void copyLabels(ReviewDb db, LabelTypes labelTypes, Iterable<PatchSetApproval> sourceApprovals, PatchSet.Id source, PatchSet dest, boolean trivialRebase) throws OrmException { List<PatchSetApproval> copied = Lists.newArrayList(); List<String> labelsCopiedForTrivialRebase = Lists.newArrayList(); for (PatchSetApproval a : sourceApprovals) { if (source.equals(a.getPatchSetId())) { LabelType type = labelTypes.byLabel(a.getLabelId()); if (type == null) { continue; } else if (type.isCopyMinScore() && type.isMaxNegative(a)) { copied.add(new PatchSetApproval(dest.getId(), a)); } else if (type.isCopyMaxScore() && type.isMaxPositive(a)) { copied.add(new PatchSetApproval(dest.getId(), a)); } else if (type.isCopyAllScoresOnTrivialRebase() && trivialRebase) { labelsCopiedForTrivialRebase.add(type.getName()); copied.add(new PatchSetApproval(dest.getId(), a)); } } } if (!labelsCopiedForTrivialRebase.isEmpty()) { ChangeMessage cmsg = new ChangeMessage(new ChangeMessage.Key(dest.getId().getParentKey(), ChangeUtil.messageUUID(db)), dest.getUploader(), dest.getId()); cmsg.setMessage("Patch Set " + dest + ": Label" + (labelsCopiedForTrivialRebase.size() > 1 ? "s" : "") + " " + StringUtils.join(labelsCopiedForTrivialRebase, ", ") + " copied for trivial rebase"); <START> db.changeMessages().beginTransaction(cmsg.getKey()); <END> db.changeMessages().insert(Collections.singleton(cmsg)); } db.patchSetApprovals().insert(copied); }</code><technical_language>This is incorrect usage, if in a transaction (which this be), if commit rollback</technical_language>

Target:
public static void copyLabels(ReviewDb db, LabelTypes labelTypes, Iterable<PatchSetApproval> sourceApprovals, PatchSet.Id source, PatchSet dest, boolean trivialRebase) throws OrmException { List<PatchSetApproval> copied = Lists.newArrayList(); for (PatchSetApproval a : sourceApprovals) { if (source.equals(a.getPatchSetId())) { LabelType type = labelTypes.byLabel(a.getLabelId()); if (type == null) { continue; } else if (type.isCopyMinScore() && type.isMaxNegative(a)) { copied.add(new PatchSetApproval(dest.getId(), a)); } else if (type.isCopyMaxScore() && type.isMaxPositive(a)) { copied.add(new PatchSetApproval(dest.getId(), a)); } else if (type.isCopyAllScoresOnTrivialRebase() && trivialRebase) { copied.add(new PatchSetApproval(dest.getId(), a)); } } } db.patchSetApprovals().insert(copied); }
Source:
<code>public Filter springSecurityFilterChain() throws Exception { boolean hasConfigurers = webSecurityConfigurers != null && !webSecurityConfigurers.isEmpty(); boolean hasFilterChain = !securityFilterChains.isEmpty(); if (hasConfigurers && hasFilterChain) { throw new IllegalStateException( <START> "Found WebSecurityConfigurerAdapter as well as SecurityFilterChain." + <END> "Please select just one."); } if (!hasConfigurers && !hasFilterChain) { WebSecurityConfigurerAdapter adapter = objectObjectPostProcessor .postProcess(new WebSecurityConfigurerAdapter() { }); webSecurity.apply(adapter); } for (SecurityFilterChain securityFilterChain : securityFilterChains) { webSecurity.addSecurityFilterChain(securityFilterChain); for (Filter filter : securityFilterChain.getFilters()) { if (filter instanceof FilterSecurityInterceptor) { webSecurity.securityInterceptor((FilterSecurityInterceptor) filter); break; } } } return webSecurity.build(); }</code><technical_language>Is a reason limit other</technical_language>

Target:
public Filter springSecurityFilterChain() throws Exception { boolean hasConfigurers = webSecurityConfigurers != null && !webSecurityConfigurers.isEmpty(); boolean hasFilterChain = !securityFilterChains.isEmpty(); if (hasConfigurers && hasFilterChain) { throw new IllegalStateException( "Found WebSecurityConfigurerAdapter as well as SecurityFilterChain." + "Please select just one."); } if (!hasConfigurers && !hasFilterChain) { WebSecurityConfigurerAdapter adapter = objectObjectPostProcessor .postProcess(new WebSecurityConfigurerAdapter() { }); webSecurity.apply(adapter); } for (SecurityFilterChain securityFilterChain : securityFilterChains) { webSecurity.addSecurityFilterChainBuilder(() -> securityFilterChain); for (Filter filter : securityFilterChain.getFilters()) { if (filter instanceof FilterSecurityInterceptor) { webSecurity.securityInterceptor((FilterSecurityInterceptor) filter); break; } } } return webSecurity.build(); }
Source:
<code>if (logger.isTraceEnabled()) { CLIENT_STATS = new MetricRegistry(); final Slf4jReporter reporter = Slf4jReporter.forRegistry(CLIENT_STATS) .outputTo(logger) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); <START> reporter.start(1, TimeUnit.MINUTES); <END> }</code><technical_language>this configurable</technical_language>

Target:
if (logger.isTraceEnabled()) { enable(); final Slf4jReporter reporter = Slf4jReporter.forRegistry(getClientStats()) .outputTo(logger) .convertRatesTo(TimeUnit.SECONDS) .convertDurationsTo(TimeUnit.MILLISECONDS) .build(); reporter.start(1, TimeUnit.MINUTES); }
Source:
<code>private static TypeUrl ofTypeUrl(String typeUrl) { final String[] parts = typeUrlSeparatorPattern.split(typeUrl); if (parts.length != 2 || parts[0].trim() <START> .isEmpty() || parts[1].trim() <END> .isEmpty()) { throw new IllegalArgumentException( new InvalidProtocolBufferException("Invalid Protobuf type URL encountered: " + typeUrl)); } return create(parts[0], parts[1]); }</code><technical_language>conditions other: if (parts.length != 2 || parts[0].trim() .isEmpty() || parts[1].trim() .isEmpty()) {</technical_language>

Target:
private static TypeUrl ofTypeUrl(String typeUrl) { final String[] parts = typeUrlSeparatorPattern.split(typeUrl); if (parts.length != 2) { throw malformedTypeUrl(typeUrl); } final String prefix = parts[0].trim(); if (prefix.isEmpty()) { throw malformedTypeUrl(typeUrl); } final String typeName = parts[1].trim(); if (typeName.isEmpty()) { throw malformedTypeUrl(typeUrl); } return create(prefix, typeName); }