auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Server createHttpServerInstance(int port) throws IOException { Server webServer = new Server(port); Handler[] handlerList = new Handler[6]; <START> ContextHandler contextHandlerForScreen = new ContextHandler(); <END> contextHandlerForScreen.setContextPath("/getscreen/"); contextHandlerForScreen.setHandler(new ConsoleProxyThumbnailHandler()); handlerList[0] = contextHandlerForScreen; ContextHandler contextHandlerForResources = new ContextHandler(); contextHandlerForScreen.setContextPath("/resource/"); contextHandlerForScreen.setHandler(new ConsoleProxyResourceHandler()); handlerList[1] = contextHandlerForResources; ContextHandler contextHandlerForAjax = new ContextHandler(); contextHandlerForAjax.setContextPath("/ajax/"); contextHandlerForAjax.setHandler(new ConsoleProxyAjaxHandler()); handlerList[2] = contextHandlerForAjax; ContextHandler contextHandlerForAjaxImage = new ContextHandler(); contextHandlerForAjaxImage.setContextPath("/ajaximg/"); contextHandlerForAjaxImage.setHandler(new ConsoleProxyAjaxImageHandler()); handlerList[3] = contextHandlerForAjaxImage; ContextHandler contextHandlerForNoVnc = new ContextHandler(); contextHandlerForNoVnc.setContextPath("/novnc/"); contextHandlerForNoVnc.setHandler(new NoVncConsoleHandler()); handlerList[4] = contextHandlerForNoVnc; ContextHandler contextHandlerForWebSockify = new ContextHandler(); contextHandlerForWebSockify.setContextPath("/websockify/"); contextHandlerForWebSockify.setHandler(new WebSocketHandlerForNovnc()); handlerList[5] = contextHandlerForWebSockify; ContextHandlerCollection contexts = new ContextHandlerCollection(); contexts.setHandlers(handlerList); webServer.setHandler(contexts); return webServer; }</code><technical_language>Move ContextHandlers startupHttpMain function</technical_language>

Target:
public Server createHttpServerInstance(int port) throws IOException { Server webServer = new Server(port); return webServer; }
Source:
<code>public void testLinkage3_Bug299482() throws Exception { fOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_LINKAGE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE); <START> } <END></code><technical_language>assertFormatterResult(); is lost here</technical_language>

Target:
public void testLinkage3_Bug299482() throws Exception { fOptions.put(DefaultCodeFormatterConstants.FORMATTER_BRACE_POSITION_FOR_LINKAGE_DECLARATION, DefaultCodeFormatterConstants.NEXT_LINE); assertFormatterResult(); }
Source:
<code>public DataFormatChooserValues() { super( DataFormat.AVRO, DataFormat.DELIMITED, DataFormat.EXCEL, DataFormat.JSON, DataFormat.LOG, DataFormat.PROTOBUF, DataFormat.SDC_JSON, DataFormat.TEXT, DataFormat.WHOLE_FILE, DataFormat.XML, <START> DataFormat.SAS <END> ); }</code><technical_language>here, making HDFS Directory origin</technical_language>

Target:
public DataFormatChooserValues() { super( DataFormat.AVRO, DataFormat.DELIMITED, DataFormat.EXCEL, DataFormat.JSON, DataFormat.LOG, DataFormat.PROTOBUF, DataFormat.SDC_JSON, DataFormat.TEXT, DataFormat.WHOLE_FILE, DataFormat.XML ); }
Source:
<code>public void onMatch(RelOptRuleCall call) { final Filter filter = call.rel(0); final Project project = call.rel(1); if (RexOver.containsOver(project.getProjects(), null)) { return; } RexNode newCondition = RelOptUtil.pushPastProject(filter.getCondition(), project); final RelBuilder relBuilder = call.builder(); RelNode newFilterRel; if (copyFilter) { final RelNode input = project.getInput(); final RelTraitSet traitSet = filter.getTraitSet() .replaceIfs(RelCollationTraitDef.INSTANCE, () -> Collections.singletonList( input.getTraitSet().getTrait(RelCollationTraitDef.INSTANCE))) .replaceIfs(RelDistributionTraitDef.INSTANCE, () -> Collections.singletonList( input.getTraitSet().getTrait(RelDistributionTraitDef.INSTANCE))); newCondition = simplifyFilterCondition(newCondition, call); newFilterRel = filter.copy(traitSet, input, newCondition); } else { newFilterRel = relBuilder.push(project.getInput()).filter(newCondition).build(); } RelNode newProjRel = copyProject ? project.copy(project.getTraitSet(), newFilterRel, project.getProjects(), project.getRowType()) : relBuilder.push(newFilterRel) .project(project.getProjects(), project.getRowType().getFieldNames()) .build(); if (newCondition.isAlwaysFalse() && newFilterRel.getInputs().stream() .map(RelOptUtil::getVariablesUsed) .allMatch(Collection::isEmpty)) { <START> newProjRel = relBuilder.push(newProjRel).empty().build(); <END> } call.transformTo(newProjRel); }</code><technical_language>I thought lines</technical_language>

Target:
public void onMatch(RelOptRuleCall call) { final Filter filter = call.rel(0); final Project project = call.rel(1); if (RexOver.containsOver(project.getProjects(), null)) { return; } RexNode newCondition = RelOptUtil.pushPastProject(filter.getCondition(), project); final RelBuilder relBuilder = call.builder(); RelNode newFilterRel; if (copyFilter) { final RelNode input = project.getInput(); final RelTraitSet traitSet = filter.getTraitSet() .replaceIfs(RelCollationTraitDef.INSTANCE, () -> Collections.singletonList( input.getTraitSet().getTrait(RelCollationTraitDef.INSTANCE))) .replaceIfs(RelDistributionTraitDef.INSTANCE, () -> Collections.singletonList( input.getTraitSet().getTrait(RelDistributionTraitDef.INSTANCE))); newCondition = RexUtil.removeNullabilityCast(relBuilder.getTypeFactory(), newCondition); newFilterRel = filter.copy(traitSet, input, newCondition); } else { newFilterRel = relBuilder.push(project.getInput()).filter(newCondition).build(); } RelNode newProjRel = copyProject ? project.copy(project.getTraitSet(), newFilterRel, project.getProjects(), project.getRowType()) : relBuilder.push(newFilterRel) .project(project.getProjects(), project.getRowType().getFieldNames()) .build(); call.transformTo(newProjRel); }
Source:
<code>private void checkForNonResponsiveHosts(final ConfirmationModel confirmModel) { startProgress(null); Frontend.RunQuery(VdcQueryType.GetHostsByClusterId, new IdQueryParameters(((VDSGroup) getSelectedItem()).getId()), new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { ClusterListModel model = (ClusterListModel) target; ArrayList<VDS> hosts = null; if (returnValue instanceof ArrayList) { hosts = (ArrayList<VDS>) returnValue; } else if (returnValue instanceof VdcQueryReturnValue && ((VdcQueryReturnValue) returnValue).getReturnValue() instanceof ArrayList) { hosts = (ArrayList<VDS>) ((VdcQueryReturnValue) returnValue).getReturnValue(); } else { throw new IllegalArgumentException("The return value should be ArrayList<VDS> or VdcQueryReturnValue with return value ArrayList<VDS>"); } <START> boolean result = false; <END> for (VDS host : hosts) { if (VDSStatus.NonResponsive == host.getStatus()) { result = true; break; } } if (result) { confirmModel.setMessage(ConstantsManager.getInstance() .getConstants() .youAreAboutChangeClusterCompatibilityVersionNonResponsiveHostsMsg()); } else { confirmModel.setMessage(ConstantsManager.getInstance() .getConstants() .youAreAboutChangeClusterCompatibilityVersionMsg()); } model.stopProgress(); } })); }</code><technical_language>I some more descriptive name result - "foundNonResponsiveHost"</technical_language>

Target:
private void checkForNonResponsiveHosts(final ConfirmationModel confirmModel) { startProgress(null); Frontend.RunQuery(VdcQueryType.GetHostsByClusterId, new IdQueryParameters(((VDSGroup) getSelectedItem()).getId()), new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { ClusterListModel model = (ClusterListModel) target; ArrayList<VDS> hosts = null; if (returnValue instanceof ArrayList) { hosts = (ArrayList<VDS>) returnValue; } else if (returnValue instanceof VdcQueryReturnValue && ((VdcQueryReturnValue) returnValue).getReturnValue() instanceof ArrayList) { hosts = (ArrayList<VDS>) ((VdcQueryReturnValue) returnValue).getReturnValue(); } boolean foundNRHosts = false; if (hosts != null) { for (VDS host : hosts) { if (VDSStatus.NonResponsive == host.getStatus()) { foundNRHosts = true; break; } } } if (foundNRHosts) { confirmModel.setMessage(ConstantsManager.getInstance() .getConstants() .youAreAboutChangeClusterCompatibilityVersionNonResponsiveHostsMsg()); } else { confirmModel.setMessage(ConstantsManager.getInstance() .getConstants() .youAreAboutChangeClusterCompatibilityVersionMsg()); } model.stopProgress(); } })); }
Source:
<code>public void readAndValidateClasspathConfigs(String filePath) throws ProcessingException, IOException { this.setConfigDir(DynamicConfigHelpers.formatFilePath(formatClassPath(filePath))); ClassLoader classLoader = DynamicConfigValidator.class.getClassLoader(); URL url = classLoader.getResource(this.configDir); if (url == null) { throw new IllegalStateException("Model Configs Directory doesn't exists"); } URL jar = DynamicConfigValidator.class.getProtectionDomain().getCodeSource().getLocation(); <START> Path jarFile = Paths.get(jar.toString().substring("file:".length())); <END> FileSystem fs = FileSystems.newFileSystem(jarFile, null); this.readVariableConfig(fs); this.readSecurityConfig(fs); this.readTableConfig(fs); }</code><technical_language>"file:" a static variable</technical_language>

Target:
public void readAndValidateClasspathConfigs(String filePath) throws IOException { this.setConfigDir(DynamicConfigHelpers.formatFilePath(formatClassPath(filePath))); ClassLoader classLoader = DynamicConfigValidator.class.getClassLoader(); URL url = classLoader.getResource(this.configDir); if (url == null) { throw new IllegalStateException("Model Configs Directory doesn't exists"); } FileSystem fs = null; try { URL jar = DynamicConfigValidator.class.getProtectionDomain().getCodeSource().getLocation(); Path jarFile = Paths.get(jar.toString().substring(FILE_PREFIX_LENGTH)); fs = FileSystems.newFileSystem(jarFile, null); this.readVariableConfig(fs); this.readSecurityConfig(fs); this.readTableConfig(fs); } finally { fs.close(); } }
Source:
<code>public boolean deregisterOutgoingRelationships(Long src, String relationshipType, Class endNodeType) { Iterator<Mappable> iterator = registeredRelationships.iterator(); List<Mappable> candidatesForDeletion = new ArrayList<>(); while (iterator.hasNext()) { Mappable mappedRelationship = iterator.next(); if (mappedRelationship.getStartNodeId() == src && mappedRelationship.getRelationshipType().equals(relationshipType) && endNodeType.equals(mappedRelationship.getEndNodeType())) { candidatesForDeletion.add(mappedRelationship); iterator.remove(); } } <START> boolean notInGraphAtAll = candidatesForDeletion.size() == 0; <END> return notInGraphAtAll || handleDeletionCandidates(candidatesForDeletion); }</code><technical_language>suggestion boolean notInGraphAtAll = candidatesForDeletion.isEmpty();</technical_language>

Target:
public boolean deregisterOutgoingRelationships(Long src, String relationshipType, Class endNodeType) { return deregisterRelationshipsImpl(src, relationshipType, endNodeType, Mappable::getStartNodeId, Mappable::getEndNodeType); }
Source:
<code>public void testEditShouldCallUpdateOnProject() throws ProjectNotFoundException { ProjectForm form = mock(ProjectForm.class); BindingResult binding = mock(BindingResult.class); String view = projectController.edit(PROJECT_NAME, form, binding); assertEquals("redirect:/projects", view); verify(projectService).update(PROJECT_NAME, form); <START> ; <END> }</code><technical_language>;</technical_language>

Target:
public void testEditShouldCallUpdateOnProject() throws ProjectNotFoundException { ProjectForm form = mock(ProjectForm.class); BindingResult binding = mock(BindingResult.class); String view = projectController.edit(PROJECT_NAME, form, binding); assertEquals("redirect:/projects", view); verify(projectService).update(PROJECT_NAME, form); }
Source:
<code>public void activityCompilesWithRegularDrawable() { <START> addManifestProcessorParameter(ContextCompatDrawableTest.class, "AndroidManifestForDrawable.xml"); <END> CompileResult result = compileFiles(ActivityWithDrawable.class); File generatedFile = toGeneratedFile(ActivityWithDrawable.class); assertCompilationSuccessful(result); assertGeneratedClassMatches(generatedFile, DRAWABLE_SIGNATURE); }</code><technical_language>move this line setUp test methods</technical_language>

Target:
public void activityCompilesWithRegularDrawable() { CompileResult result = compileFiles(ActivityWithDrawable.class); File generatedFile = toGeneratedFile(ActivityWithDrawable.class); assertCompilationSuccessful(result); assertGeneratedClassMatches(generatedFile, DRAWABLE_SIGNATURE); }
Source:
<code>private void logContext(RelationshipOp operation, Environment environment) { List<?> children = (environment.field.getSelectionSet() != null) ? (List) environment.field.getSelectionSet().getChildren() : new ArrayList<>(); List<String> fieldName = new ArrayList<String>(); if (children.size() > 0) { children.stream().forEach(i -> { if (i.getClass().equals(Field.class)) { fieldName.add(((Field) i).getName()); } else { fieldName.add(((FragmentSpread) i).getName()); } }); } <START> String requestedFields = environment.field.getName() + fieldName.toString(); <END> GraphQLType parent = environment.parentType; if (log.isDebugEnabled()) { log.debug("{} fields with parent {}<{}>", operation, requestedFields, EntityDictionary.getSimpleName(parent.getClass()), parent.getName()); } }</code><technical_language>this like? is space - example log line</technical_language>

Target:
private void logContext(RelationshipOp operation, Environment environment) { List<?> children = (environment.field.getSelectionSet() != null) ? (List) environment.field.getSelectionSet().getChildren() : new ArrayList<>(); List<String> fieldName = new ArrayList<String>(); if (children.size() > 0) { children.stream().forEach(i -> { if (i.getClass().equals(Field.class)) { fieldName.add(((Field) i).getName()); } else if (i.getClass().equals(FragmentSpread.class)) { fieldName.add(((FragmentSpread) i).getName()); } else { log.debug("A new type of Selection, other than Field and FragmentSpread was encountered, {}", i.getClass()); } }); } String requestedFields = environment.field.getName() + fieldName.toString(); GraphQLType parent = environment.parentType; if (log.isDebugEnabled()) { log.debug("{} fields with parent {}<{}>", operation, requestedFields, EntityDictionary.getSimpleName(parent.getClass()), parent.getName()); } }
Source:
<code>private void handleRotatedLogs(@Nonnull final String gcLogFileLocation, Container result) { File gcLogFile = new File(gcLogFileLocation); String regex = gcLogFile.getName().replaceAll("%[pt]", ".*") + ".*"; final Pattern gcLogFilesPattern = Pattern.compile(regex); File parentDirectory = gcLogFile.getParentFile(); if (parentDirectory == null || !parentDirectory.exists()) { LOGGER.warning("[Support Bundle] " + parentDirectory + " does not exist, cannot collect gc logging files."); return; } File[] gcLogs = parentDirectory.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return gcLogFilesPattern.matcher(name).matches(); } }); if (gcLogs == null || gcLogs.length == 0) { LOGGER.warning("No GC logging files found, although the VM argument was found. This is probably a bug."); return; } LOGGER.finest("Found " + gcLogs.length + " matching files in " + parentDirectory.getAbsolutePath()); for (File gcLog : gcLogs) { <START> if (GCLOGS_RETENTION_DAYS <= 0 || (gcLog.lastModified() > (System.currentTimeMillis() - TimeUnit.DAYS.toMillis(GCLOGS_RETENTION_DAYS)))) { <END> LOGGER.finest("Adding '" + gcLog.getName() + "' file"); result.add(new UnfilteredFileContent(GCLOGS_BUNDLE_ROOT + "{0}", new String[]{gcLog.getName()}, gcLog)); } } }</code><technical_language>do do if do rotate some giant file 40 MB is continuing written to. Is a break file here</technical_language>

Target:
private void handleRotatedLogs(@Nonnull final String gcLogFileLocation, Container result) { File gcLogFile = new File(gcLogFileLocation); String regex = gcLogFile.getName().replaceAll("%[pt]", ".*") + ".*"; final Pattern gcLogFilesPattern = Pattern.compile(regex); File parentDirectory = gcLogFile.getParentFile(); if (parentDirectory == null || !parentDirectory.exists()) { LOGGER.warning("[Support Bundle] " + parentDirectory + " does not exist, cannot collect gc logging files."); return; } File[] gcLogs = parentDirectory.listFiles((dir, name) -> gcLogFilesPattern.matcher(name).matches()); if (gcLogs == null || gcLogs.length == 0) { LOGGER.warning("No GC logging files found, although the VM argument was found. This is probably a bug."); return; } LOGGER.finest("Found " + gcLogs.length + " matching files in " + parentDirectory.getAbsolutePath()); for (File gcLog : gcLogs) { if (shouldConsiderFile(gcLog)) { LOGGER.finest("Adding '" + gcLog.getName() + "' file"); result.add(new UnfilteredFileContent(GCLOGS_BUNDLE_ROOT + "{0}", new String[]{gcLog.getName()}, gcLog)); } } }
Source:
<code>protected void onResume() { super.onResume(); Log.d(TAG, "onResumed called."); mWebView.onResume(); mWebView.resumeTimers(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); Log.d(TAG,"display_options_units: "+prefs.getString("display_options_units", "0")); int sgv = (Integer) mTextSGV.getTag(R.string.display_sgv); int direction = (Integer) mTextSGV.getTag(R.string.display_trend); if (sgv != -1) { mTextSGV.setText(getSGVStringByUnit(sgv, Constants.TREND_ARROW_VALUES.values()[direction])); } currentUnits = prefs.getString("display_options_units", "0").equals("0") ? 1 : Constants.MG_DL_TO_MMOL_L; <START> boolean isLogritmic = prefs.getString("display_verticle_axis", "0").equals("0") ? true : false; <END> mWebView.loadUrl("javascript:updateUnits(" + Boolean.toString(currentUnits == Constants.MG_DL_TO_MMOL_L) +"," + Boolean.toString(isLogritmic) + ","+ prefs.getString("display_low_range", "80") + "," + prefs.getString("display_high_range", "180") + ")"); mHandler.post(updateTimeAgo); }</code><technical_language>isLogritmic isLogarithmic</technical_language>

Target:
protected void onResume() { super.onResume(); Log.d(TAG, "onResumed called."); mWebView.onResume(); mWebView.resumeTimers(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); Log.d(TAG,"display_options_units: "+prefs.getString("display_options_units", "0")); int sgv = (Integer) mTextSGV.getTag(R.string.display_sgv); int direction = (Integer) mTextSGV.getTag(R.string.display_trend); if (sgv != -1) { mTextSGV.setText(getSGVStringByUnit(sgv, Constants.TREND_ARROW_VALUES.values()[direction])); } currentUnits = prefs.getString("display_options_units", "0").equals("0") ? 1 : Constants.MG_DL_TO_MMOL_L; boolean isLogarithmic = prefs.getString("display_verticle_axis", "0").equals("0") ? true : false; mWebView.loadUrl("javascript:updateUnits(" + Boolean.toString(currentUnits == Constants.MG_DL_TO_MMOL_L) +"," + Boolean.toString(isLogarithmic) + ","+ prefs.getString("display_low_range", "80") + "," + prefs.getString("display_high_range", "180") + ")"); mHandler.post(updateTimeAgo); }
Source:
<code>private SynchronizationTestUpdater(final Clock clock) { this.clock = clock; <START> this.counterMap = new HashMap<>(); <END> }</code><technical_language>this map a ConcurrentMap</technical_language>

Target:
private SynchronizationTestUpdater(final Clock clock) { this.clock = clock; this.beforeMsgCounterMap = new HashMap<>(); this.afterMsgCounterMap = new HashMap<>(); }
Source:
<code>public void testCustomPathHandler() throws Throwable { final String contents = "Some content for testing\n"; final String encoding = "utf-8"; WebViewAssetLoader.PathHandler assetsHandler = new WebViewAssetLoader.PathHandler("appassets.androidplatform.net", "/notused/", true) { @Override public InputStream handle(Uri url) { return null; } }; WebViewAssetLoader.PathHandler resourcesHandler = new WebViewAssetLoader.PathHandler("appassets.androidplatform.net", "/test/", true) { @Override public InputStream handle(Uri url) { try { return new ByteArrayInputStream(contents.getBytes(encoding)); } catch (UnsupportedEncodingException e) { Log.e(TAG, "exception when creating response", e); } return null; } }; WebViewAssetLoader assetLoader = (new WebViewAssetLoader.Builder(new MockContext())) .buildForTest(assetsHandler, resourcesHandler); WebResourceResponse response = assetLoader.shouldInterceptRequest("<LINK_1>"); Assert.assertNotNull("didn't match the exact registered URL", response); Assert.assertEquals(contents, readAsString(response.getData(), encoding)); Assert.assertNull("opened <START> \"<LINK_0>\" that <END> isn't registered - should return null", assetLoader.shouldInterceptRequest("<LINK_0>")); }</code><technical_language>duplicate URL. opened unregistered URL String url = "<LINK_0>" assertNull("opened " + url + " registered...", shouldInterceptRequest(url));</technical_language>

Target:
public void testCustomPathHandler() throws Throwable { final String contents = "Some content for testing\n"; final String encoding = "utf-8"; WebViewAssetLoader.PathHandler assetsHandler = new WebViewAssetLoader.PathHandler("appassets.androidplatform.net", "/notused/", true) { @Override public InputStream handle(Uri url) { return null; } }; WebViewAssetLoader.PathHandler resourcesHandler = new WebViewAssetLoader.PathHandler("appassets.androidplatform.net", "/test/", true) { @Override public InputStream handle(Uri url) { try { return new ByteArrayInputStream(contents.getBytes(encoding)); } catch (UnsupportedEncodingException e) { Log.e(TAG, "exception when creating response", e); } return null; } }; WebViewAssetLoader assetLoader = (new WebViewAssetLoader.Builder(new MockContext())) .buildForTest(assetsHandler, resourcesHandler); WebResourceResponse response = assetLoader.shouldInterceptRequest("<LINK_1>"); Assert.assertNotNull("didn't match the exact registered URL", response); Assert.assertEquals(contents, readAsString(response.getData(), encoding)); Assert.assertNull("opened a non-registered URL - should return null", assetLoader.shouldInterceptRequest("<LINK_0>")); }
Source:
<code>public List<Object> getSortedObjects() { <START> Set<Object> sorted = newSetFromMap(new LinkedHashMap<>(objectCount)); <END> for (List<Object> bucket : buckets) { if (bucket != null) { sorted.addAll(bucket); } } return new ArrayList<>(sorted); }</code><technical_language>point of this</technical_language>

Target:
public List<Object> getSortedObjects() { List<Object> sorted = new ArrayList<>(objectCount); for (List<Object> bucket : buckets) { if (bucket != null) { sorted.addAll(bucket); } } return sorted; }
Source:
<code>private Set<String> validateCreateUserFromInvitationRequest(final CreateUserFromInvitationRequest request) { Set<String> validationErrors = new HashSet<String>(); if (request.getUser().getSubjectName().length() > getMaxLength("subjectName")) { <START> validationErrors.add(errorMessageUtil.getMessage("user.subjectName.maxlength", "subjectName")); <END> } if (request.getUser().getFullName().length() > getMaxLength("fullName")) { validationErrors.add(errorMessageUtil.getMessage("user.fullName.maxlength", "fullName")); } if (request.getUser().getFriendlyName().length() > getMaxLength("friendlyName")) { validationErrors.add(errorMessageUtil.getMessage("user.friendlyName.maxlength", "friendlyName")); } if (request.getUser().getTitle().length() > getMaxLength("title")) { validationErrors.add(errorMessageUtil.getMessage("user.title.maxlength", "title")); } if (request.getUser().getEmail().length() > getMaxLength("email")) { validationErrors.add(errorMessageUtil.getMessage("user.email.maxlength", "email")); } if (request.getUser().getPhoneNumber().length() > getMaxLength("phoneNumber")) { validationErrors.add(errorMessageUtil.getMessage("user.phoneNumber.maxlength", "phoneNumber")); } return validationErrors; }</code><technical_language>pass in a number for parameter, instead of a string</technical_language>

Target:
private Set<String> validateCreateUserFromInvitationRequest(final CreateUserFromInvitationRequest request) { Set<String> validationErrors = new HashSet<String>(); if (request.getUser().getSubjectName().length() > getMaxLength("subjectName")) { validationErrors.add(errorMessageUtil.getMessage("user.subjectName.maxlength", getMaxLength("subjectName"))); } if (request.getUser().getFullName().length() > getMaxLength("fullName")) { validationErrors.add(errorMessageUtil.getMessage("user.fullName.maxlength", getMaxLength("fullName"))); } if (request.getUser().getFriendlyName().length() > getMaxLength("friendlyName")) { validationErrors.add(errorMessageUtil.getMessage("user.friendlyName.maxlength", getMaxLength("friendlyName"))); } if (request.getUser().getTitle().length() > getMaxLength("title")) { validationErrors.add(errorMessageUtil.getMessage("user.title.maxlength", getMaxLength("title"))); } if (request.getUser().getEmail().length() > getMaxLength("email")) { validationErrors.add(errorMessageUtil.getMessage("user.email.maxlength", getMaxLength("email"))); } if (request.getUser().getPhoneNumber().length() > getMaxLength("phoneNumber")) { validationErrors.add(errorMessageUtil.getMessage("user.phoneNumber.maxlength", getMaxLength("phoneNumber"))); } return validationErrors; }
Source:
<code>public LinkedHashMap<String, Integer> getDimensionOrder() { <START> return dimensionOrder; <END> }</code><technical_language>synchronize dimensionOrder, return a copy? (dimensionOrder is a thread safe map)</technical_language>

Target:
public List<String> getDimensionOrder() { synchronized (dimensionDescs) { return ImmutableList.copyOf(dimensionDescs.keySet()); } }
Source:
<code>private byte[] encryptBlockCipher(byte[] compressedFragment) throws GeneralSecurityException { if (session == null) { throw new IllegalStateException("DTLS session must be set on record"); } else if (compressedFragment == null) { throw new NullPointerException("Compressed fragment must not be null"); } DTLSConnectionState writeState = session.getWriteState(); DatagramWriter plaintext = new DatagramWriter(); plaintext.writeBytes(compressedFragment); plaintext.writeBytes(getBlockCipherMac(writeState, compressedFragment)); int ciphertextLength = compressedFragment.length + writeState.getMacLength() + 1; int blocksize = writeState.getRecordIvLength(); int smallestMultipleOfBlocksize = blocksize; while ( smallestMultipleOfBlocksize <= ciphertextLength) { smallestMultipleOfBlocksize += blocksize; } int paddingLength = smallestMultipleOfBlocksize - ciphertextLength; <START> <END> byte[] padding = new byte[paddingLength + 1]; Arrays.fill(padding, (byte) paddingLength); plaintext.writeBytes(padding); Cipher blockCipher = writeState.getCipherSuite().getCipher(); blockCipher.init(Cipher.ENCRYPT_MODE, writeState.getEncryptionKey()); DatagramWriter result = new DatagramWriter(); result.writeBytes(blockCipher.getIV()); result.writeBytes(blockCipher.doFinal(plaintext.toByteArray())); return result.toByteArray(); }</code><technical_language>a bug</technical_language>

Target:
private byte[] encryptBlockCipher(byte[] compressedFragment) throws GeneralSecurityException { if (session == null) { throw new IllegalStateException("DTLS session must be set on record"); } else if (compressedFragment == null) { throw new NullPointerException("Compressed fragment must not be null"); } DTLSConnectionState writeState = session.getWriteState(); DatagramWriter plaintext = new DatagramWriter(); plaintext.writeBytes(compressedFragment); plaintext.writeBytes(getBlockCipherMac(writeState, compressedFragment)); int ciphertextLength = compressedFragment.length + writeState.getMacLength() + 1; int blocksize = writeState.getRecordIvLength(); int paddingLength = ciphertextLength % blocksize; if (0 < paddingLength) { paddingLength = blocksize - paddingLength; } byte[] padding = new byte[paddingLength + 1]; Arrays.fill(padding, (byte) paddingLength); plaintext.writeBytes(padding); Cipher blockCipher = writeState.getCipherSuite().getCipher(); blockCipher.init(Cipher.ENCRYPT_MODE, writeState.getEncryptionKey()); DatagramWriter result = new DatagramWriter(); result.writeBytes(blockCipher.getIV()); result.writeBytes(blockCipher.doFinal(plaintext.toByteArray())); return result.toByteArray(); }
Source:
<code>AzureCheckpointManager(AzureConfig azureConfig) { storageConnectionString = azureConfig.getAzureConnect(); azureClient = new AzureClient(storageConnectionString); <START> } <END></code><technical_language>group statics non-statics</technical_language>

Target:
AzureCheckpointManager(AzureConfig azureConfig) { storageConnectionString = azureConfig.getAzureConnectionString(); azureClient = new AzureClient(storageConnectionString); }
Source:
<code>private BeanDefinition beanFromRequest(JolokiaListRequest pJmxReq, String providerAndDomain) { List<String> pathParts = pJmxReq.getPathParts(); if(pathParts != null && pathParts.size() == 2 && providerAndDomain.equals( pathParts.get(0))) { final String beanAndName = pathParts.get(1); <START> if(beanAndName.startsWith("name=")) { <END> final String beanName=beanAndName.substring(5); return getAsConfigurableApplicationContext().getBeanFactory().getMergedBeanDefinition(beanName); } } return null; }</code><technical_language>beanAndName.toLowerCase().startsWith("name=")</technical_language>

Target:
private BeanDefinition beanFromRequest(JolokiaListRequest pJmxReq, String providerAndDomain) { List<String> pathParts = pJmxReq.getPathParts(); if(pathParts != null && pathParts.size() == 2 && providerAndDomain.equals( pathParts.get(0))) { final String beanAndName = pathParts.get(1); if(beanAndName.toLowerCase().startsWith(NAME_PREFIX)) { final String beanName=beanAndName.substring(NAME_PREFIX.length()); return getAsConfigurableApplicationContext().getBeanFactory().getMergedBeanDefinition(beanName); } } return null; }
Source:
<code>synchronized void sendErrorToListeners(String error) { try { <START> <END> for (LIRCEventListener listener : listeners) { listener.errorOccured(error); } } catch (Exception e) { logger.error("Error invoking event listener", e); } }</code><technical_language>blank line</technical_language>

Target:
public synchronized void sendErrorToListeners(String error) { try { for (LIRCEventListener listener : listeners) { listener.errorOccured(error); } } catch (Exception e) { logger.error("Error invoking event listener", e); } }
Source:
<code>private void waitOrThrow(Throwable t, int nTry) throws IOException { final boolean isConnectionReset = isConnectionReset(t); if (isConnectionReset || retryCondition.apply(t)) { if (isConnectionReset) { try { <START> startOffset += delegate.getCount(); <END> delegate.close(); } catch (IOException e) { } } try { RetryUtils.awaitNextRetry(t, null, nTry + 1, maxRetry, false); if (isConnectionReset) { log.info("retrying from offset[%d]", startOffset); delegate = new CountingInputStream(objectOpenFunction.open(object, startOffset)); } } catch (InterruptedException | IOException e) { t.addSuppressed(e); throwAsIOException(t); } } else { throwAsIOException(t); } }</code><technical_language>exception in getCount() ignored</technical_language>

Target:
private void waitOrThrow(Throwable t, int nTry) throws IOException { final boolean isConnectionReset = isConnectionReset(t); if (isConnectionReset || retryCondition.apply(t)) { if (isConnectionReset) { startOffset += delegate.getCount(); try { delegate.close(); } catch (IOException e) { log.warn(e, "Error while closing the delegate input stream"); } } try { RetryUtils.awaitNextRetry(t, null, nTry + 1, maxRetry, false); if (isConnectionReset) { log.info("retrying from offset[%d]", startOffset); delegate = new CountingInputStream(objectOpenFunction.open(object, startOffset)); } } catch (InterruptedException | IOException e) { t.addSuppressed(e); throwAsIOException(t); } } else { throwAsIOException(t); } }
Source:
<code>public ISchedulingRule getSchedulingRule() { <START> return RuleUtil.getRuleForContainers(Collections.<IPath> emptySet()); <END> }</code><technical_language>return null</technical_language>

Target:
public ISchedulingRule getSchedulingRule() { return null; }
Source:
<code>public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { throw new NotEnoughArgumentsException(); } user.setDisplayNick(); final String message = _("helpOp", user.getDisplayName(), Util.stripFormat(getFinalArg(args, 0))); logger.log(Level.INFO, message); for (Player onlinePlayer : server.getOnlinePlayers()) { final User player = ess.getUser(onlinePlayer); if (!player.isAuthorized("essentials.helpop.receive")) { continue; } <START> if (player.isBusy() && !user.isAuthorized("essentals.busy.bypass")) <END> { continue; } player.sendMessage(message); } }</code><technical_language>essentals > essentials, if wondering</technical_language>

Target:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length < 1) { throw new NotEnoughArgumentsException(); } user.setDisplayNick(); final String message = _("helpOp", user.getDisplayName(), Util.stripFormat(getFinalArg(args, 0))); logger.log(Level.INFO, message); for (Player onlinePlayer : server.getOnlinePlayers()) { final User player = ess.getUser(onlinePlayer); if (!player.isAuthorized("essentials.helpop.receive")) { continue; } if (player.isBusy() && !user.isAuthorized("essentials.busy.bypass")) { continue; } player.sendMessage(message); } }
Source:
<code>public static Collection<VdsNetworkInterface> findAllInterfaceBondNameIsEmpty(List<VdsNetworkInterface> items) { return where(items, new IPredicate<VdsNetworkInterface>() { @Override public boolean match(VdsNetworkInterface i) { return <START> !StringHelper.isNullOrEmpty(i.getBondName()); <END> } }); }</code><technical_language>This method return interfaces empty bond name, remove negation</technical_language>

Target:
public static Collection<VdsNetworkInterface> findAllInterfaceBondNameIsEmpty(List<VdsNetworkInterface> items) { return where(items, new IPredicate<VdsNetworkInterface>() { @Override public boolean match(VdsNetworkInterface i) { return StringHelper.isNullOrEmpty(i.getBondName()); } }); }
Source:
<code>public CopyRatioData(final SegmentedGenome segmentedGenome) { <START> if (segmentedGenome.getGenome().getTargets().targetCount() == 0) { <END> throw new IllegalArgumentException("Cannot construct CopyRatioData with no target-coverage data."); } final TargetCollection<ReadCountRecord.SingleSampleRecord> targetCoverages = segmentedGenome.getGenome().getTargets(); final List<Double> coverages = segmentedGenome.getSegments().stream() .flatMap(s -> targetCoverages.targets(s).stream()) .map(ReadCountRecord.SingleSampleRecord::getCount) .collect(Collectors.toList()); numTargetsPerSegment = segmentedGenome.getSegments().stream() .map(s -> targetCoverages.targets(s).size()) .collect(Collectors.toList()); numSegments = numTargetsPerSegment.size(); numTargets = coverages.size(); coverageMin = Collections.min(coverages); coverageMax = Collections.max(coverages); coverageRange = coverageMax - coverageMin; int startTarget = 0; for (int segment = 0; segment < numSegments; segment++) { startTargetsPerSegment.add(startTarget); final int numTargetsInSegment = numTargetsPerSegment.get(segment); coveragesPerSegment.add(coverages.subList(startTarget, startTarget + numTargetsInSegment)); startTarget += numTargetsInSegment; } }</code><technical_language>Consider GATK public method Utils.validateArg(segmentedGenome.getGenome().getTargets().targetCount() > 0, "Cannot construct CopyRatioData target-coverage data.")</technical_language>

Target:
public CopyRatioData(final SegmentedGenome segmentedGenome) { final TargetCollection<ReadCountRecord.SingleSampleRecord> targetCoverages = segmentedGenome.getGenome().getTargets(); Utils.validateArg(targetCoverages.targetCount() > 0, "Cannot construct CopyRatioData with no target-coverage data."); final List<SimpleInterval> segments = segmentedGenome.getSegments(); numSegments = segments.size(); final List<Double> coverages = segments.stream() .flatMap(s -> targetCoverages.targets(s).stream()) .map(ReadCountRecord.SingleSampleRecord::getCount) .collect(Collectors.toList()); numTargets = coverages.size(); coverageMin = Collections.min(coverages); coverageMax = Collections.max(coverages); int targetIndex = 0; for (final SimpleInterval segment : segments) { final List<ReadCountRecord.SingleSampleRecord> targetCoveragesInSegment = targetCoverages.targets(segment); final List<IndexedCoverage> indexedCoveragesInSegment = new ArrayList<>(); for (final ReadCountRecord.SingleSampleRecord targetCoverage : targetCoveragesInSegment) { final double coverage = targetCoverage.getCount(); indexedCoveragesInSegment.add(new IndexedCoverage(coverage, targetIndex++)); } indexedCoveragesPerSegment.add(indexedCoveragesInSegment); } }
Source:
<code>private Map<String, Integer> collateAnswerFrequency(List<FeedbackResponseAttributes> responses) { Map<String, Integer> answerFrequency = new LinkedHashMap<>(); for (String option : mcqChoices) { answerFrequency.put(option, 0); } if (otherEnabled) { answerFrequency.put("Other", 0); } for (FeedbackResponseAttributes response : responses) { String answerString = response.getResponseDetails().getAnswerString(); boolean isOtherOptionAnswer = <START> ((FeedbackMcqResponseDetails) response.getResponseDetails()).isOtherOptionAnswer(); <END> String key = isOtherOptionAnswer ? "Other" : answerString; answerFrequency.put(key, answerFrequency.getOrDefault(key, 0) + 1); } return answerFrequency; }</code><technical_language>extract out re-use variable response.getResponseDetails()</technical_language>

Target:
private Map<String, Integer> collateAnswerFrequency(List<FeedbackResponseAttributes> responses) { Map<String, Integer> answerFrequency = new LinkedHashMap<>(); for (String option : mcqChoices) { answerFrequency.put(option, 0); } if (otherEnabled) { answerFrequency.put("Other", 0); } for (FeedbackResponseAttributes response : responses) { FeedbackResponseDetails responseDetails = response.getResponseDetails(); boolean isOtherOptionAnswer = ((FeedbackMcqResponseDetails) responseDetails).isOtherOptionAnswer(); String key = isOtherOptionAnswer ? "Other" : responseDetails.getAnswerString(); answerFrequency.put(key, answerFrequency.getOrDefault(key, 0) + 1); } return answerFrequency; }
Source:
<code>public void doCreateAccount() { new AMCreateAccountInfoTask() { @Override public void onCatch(Throwable caught) { <START> L.e("AMCreateAccountInfoTask failed: " + caught.getMessage()); <END> } @Override public void onFinish(AMCreateAccountInfoResult result) { if (result.getEnabled()) { L.i("Creating account with AuthManager"); captchaHandler.handleCaptcha(new CaptchaResult(result.getCaptchaId()), true); } else { L.i("Creating account with legacy API"); doLegacyCreateAccount(); } } }.execute(); }</code><technical_language>L.e(caught)</technical_language>

Target:
public void doCreateAccount() { new AMCreateAccountInfoTask() { @Override public void onCatch(Throwable caught) { L.e(caught); } @Override public void onFinish(AMCreateAccountInfoResult result) { if (result.getEnabled()) { L.i("Creating account with AuthManager"); captchaHandler.handleCaptcha(new CaptchaResult(result.getCaptchaId()), true); } else { L.i("Creating account with legacy API"); doLegacyCreateAccount(); } } }.execute(); }
Source:
<code><START> public void initialize() throws InternalErrorException, PrivilegeException { <END> this.extSourcesManagerBl.initialize(this.getPerunSession()); }</code><technical_language>do Privilege Exception</technical_language>

Target:
public void initialize() throws InternalErrorException { this.extSourcesManagerBl.initialize(this.getPerunSession()); this.auditer.initialize(); }
Source:
<code>public CompletableFuture<Void> visitGetKeysInGroupCommand(InvocationContext ctx, GetKeysInGroupCommand command) throws Throwable { final String groupName = command.getGroupName(); final boolean isOwner = groupManager.isOwner(groupName); updateTopologyId(command); final int commandTopologyId = command.getTopologyId(); if (ctx.isOriginLocal()) { return ctx.forkInvocation(command, (ctx1, command1, rv, throwable) -> { boolean shouldRetry; if (throwable != null) { Throwable ce = throwable; while (ce instanceof RemoteException) { ce = ce.getCause(); } shouldRetry = ce instanceof OutdatedTopologyException || ce instanceof SuspectException; } else { shouldRetry = isOwner && currentTopologyId() != commandTopologyId; } if (shouldRetry) { return retryVisitGetKeysInGroupCommand(ctx, command, commandTopologyId); } if (throwable != null) { throw throwable; } else { return ctx.shortCircuit(rv); } }); } else { ctx.onReturn((ctx1, command1, rv, throwable) -> { if (isOwner && currentTopologyId() != commandTopologyId) { throw new OutdatedTopologyException( "Cache topology changed while the command was executing: expected " + commandTopologyId + ", got " + currentTopologyId()); } return null; }); <START> return ctx.continueInvocation(); <END> } }</code><technical_language>needed onReturn() returns CONTINUE_INVOCATION</technical_language>

Target:
public CompletableFuture<Void> visitGetKeysInGroupCommand(InvocationContext ctx, GetKeysInGroupCommand command) throws Throwable { final String groupName = command.getGroupName(); final boolean isOwner = groupManager.isOwner(groupName); updateTopologyId(command); final int commandTopologyId = command.getTopologyId(); if (ctx.isOriginLocal()) { return ctx.forkInvocation(command, (rCtx, rCommand, rv, throwable) -> { boolean shouldRetry; if (throwable != null) { Throwable ce = throwable; while (ce instanceof RemoteException) { ce = ce.getCause(); } shouldRetry = ce instanceof OutdatedTopologyException || ce instanceof SuspectException; } else { shouldRetry = isOwner && currentTopologyId() != commandTopologyId; } if (shouldRetry) { return retryVisitGetKeysInGroupCommand(ctx, command, commandTopologyId); } if (throwable != null) { throw throwable; } else { return ctx.shortCircuit(rv); } }); } else { return ctx.onReturn((rCtx, rCommand, rv, throwable) -> { if (isOwner && currentTopologyId() != commandTopologyId) { throw new OutdatedTopologyException( "Cache topology changed while the command was executing: expected " + commandTopologyId + ", got " + currentTopologyId()); } return null; }); } }
Source:
<code>public LoginPage() { setStatelessHint(true); setVersioned(false); add(form = new LoginForm("loginForm")); signInBtn = new Button("signInBtn", new ResourceModel("signIn")); <START> tooManyUsersLabel = new MultiLineLabel("usersLabel", new ResourceModel("tooManyUsers")); <END> tooManyUsersLabel.setVisible(false); form.add(signInBtn); form.add(tooManyUsersLabel); checkUsersLimit(); redirectIfAlreadyLoggedIn(); if (userRepository.list().isEmpty()) { User admin = new User(); admin.setUsername(ADMIN_DEFAULT_USERNAME); admin.setPassword(ADMIN_DEFAULT_PASSWORD); admin.setEnabled(true); admin.setRoles(EnumSet.of(Role.ROLE_ADMIN, Role.ROLE_USER)); userRepository.create(admin); String msg = "No user accounts have been found. An admin account has been created: " + ADMIN_DEFAULT_USERNAME + "/" + ADMIN_DEFAULT_PASSWORD; warn(msg); } }</code><technical_language>refer resources keys HTML <wicket:label key="tooManyUsers"/>. class for label a simple WebMarkupContainer</technical_language>

Target:
public LoginPage() { setStatelessHint(true); setVersioned(false); add(form = new LoginForm("loginForm")); signInBtn = new Button("signInBtn"); signInBtn.add(LambdaBehavior.enabledWhen(() -> !isTooManyUsers())); tooManyUsersLabel = new WebMarkupContainer("usersLabel"); tooManyUsersLabel.add(LambdaBehavior.visibleWhen(this::isTooManyUsers)); form.add(signInBtn); form.add(tooManyUsersLabel); form.add(LambdaBehavior.enabledWhen(() -> !isTooManyUsers())); redirectIfAlreadyLoggedIn(); if (userRepository.list().isEmpty()) { User admin = new User(); admin.setUsername(ADMIN_DEFAULT_USERNAME); admin.setPassword(ADMIN_DEFAULT_PASSWORD); admin.setEnabled(true); admin.setRoles(EnumSet.of(Role.ROLE_ADMIN, Role.ROLE_USER)); userRepository.create(admin); String msg = "No user accounts have been found. An admin account has been created: " + ADMIN_DEFAULT_USERNAME + "/" + ADMIN_DEFAULT_PASSWORD; warn(msg); } }
Source:
<code>@Test public void testRelShuttleForLogicalTableModify() { String sql = "insert into emp select * from emp"; LogicalTableModify rel = (LogicalTableModify) tester.convertSqlToRel(sql).rel; List<RelNode> rels = new ArrayList<>(); final RelShuttleImpl visitor = new RelShuttleImpl() { @Override public RelNode visit(LogicalTableModify modify) { rels.add(modify); <START> return super.visit(modify); <END> } }; visitor.visit(rel); assertThat(rels.size(), is(1)); assertThat(rels.get(0), isA(LogicalTableModify.class)); }</code><technical_language>For this test equivalent, i right</technical_language>

Target:
@Test public void testRelShuttleForLogicalTableModify() { final String sql = "insert into emp select * from emp"; final LogicalTableModify rel = (LogicalTableModify) tester.convertSqlToRel(sql).rel; final List<RelNode> rels = new ArrayList<>(); final RelShuttleImpl visitor = new RelShuttleImpl() { @Override public RelNode visit(LogicalTableModify modify) { RelNode visitedRel = super.visit(modify); rels.add(visitedRel); return visitedRel; } }; visitor.visit(rel); assertThat(rels.size(), is(1)); assertThat(rels.get(0), isA(LogicalTableModify.class)); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append("RassXmlAwardEntry: [proposalNumber: ").append(proposalNumber); sb.append(", status:").append(status); sb.append(", projectTitle:").append(projectTitle); sb.append(", startDate:").append(startDate); sb.append(", stopDate:").append(stopDate); sb.append(", directCostAmount:").append(directCostAmount); sb.append(", indirectCostAMount:").append(indirectCostAMount); sb.append(", totalAMount:").append(totalAMount); sb.append(", grantNumber:").append(grantNumber); sb.append(", grantDescription:").append(grantDescription); sb.append(", federalPassThrough:").append(federalPassThrough); sb.append(", federalPassThroughAgencyNumber:").append(federalPassThroughAgencyNumber); sb.append(", cfdaNumber:").append(cfdaNumber); sb.append(", organizationCode:").append(organizationCode); sb.append(", costShareRequiredString:").append(costShareRequiredString); sb.append(", finalReportDueDate:").append(finalReportDueDate); if (CollectionUtils.isNotEmpty(principalAndCoPrincipalInvestigators)) { for (RassXMLAwardPiCoPiEntry pi : principalAndCoPrincipalInvestigators) { sb.append(KFSConstants.SQUARE_BRACKET_LEFT).append(pi.toString()).append(KFSConstants.SQUARE_BRACKET_RIGHT); } } else { <START> sb.append(KFSConstants.SQUARE_BRACKET_LEFT).append("NO INVESTIGATIORS").append(KFSConstants.SQUARE_BRACKET_RIGHT); <END> } sb.append(KFSConstants.SQUARE_BRACKET_RIGHT); return sb.toString(); }</code><technical_language>Please fix typo in appended message</technical_language>

Target:
public String toString() { return ToStringBuilder.reflectionToString(this); }
Source:
<code>public static ItemStack insertItem(IItemHandler dest, ItemStack stack, boolean simulate) { if (dest == null || stack == null) return stack; <START> for (int i = 0; i < dest.getSlots() && stack != null; i++) <END> { stack = dest.insertItem(i, stack, simulate); } return stack; }</code><technical_language>| size > 0</technical_language>

Target:
public static ItemStack insertItem(IItemHandler dest, ItemStack stack, boolean simulate) { if (dest == null || stack == null) return stack; for (int i = 0; i < dest.getSlots(); i++) { stack = dest.insertItem(i, stack, simulate); if (stack == null || stack.stackSize <= 0) { return null; } } return stack; }
Source:
<code><START> public String toString() { <END> return "Processor" + getCurrentJobCoordinator().getProcessorId(); }</code><technical_language>is toString defined here? Also, is a method is expected for testing. provide benefit other debugging, perhaps? for , stick package private methods opposed public one. please remove this</technical_language>

Target:
public String toString() { return "Processor:" + processorId; }
Source:
<code>public IConditionValueAutoCompleter getFieldValueAutoCompleter(String fieldName) { <START> IConditionValueAutoCompleter retval = null; <END> if (StringHelper.EqOp(fieldName, "TYPE")) { retval = new EnumValueAutoCompleter(VmPoolType.class); } else { } return retval; }</code><technical_language>.. if replace this "TYPE".equals(fieldName) discussed in <LINK_0></technical_language>

Target:
public IConditionValueAutoCompleter getFieldValueAutoCompleter(String fieldName) { IConditionValueAutoCompleter retval = null; if ("TYPE".equals(fieldName)) { retval = new EnumValueAutoCompleter(VmPoolType.class); } return retval; }