auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>ScriptRunner getScriptRunner(String type) { ScriptRunner scriptRunner = scriptRunners.get(type); if (scriptRunner == null) { <START> throw new UnknownScriptTypeException(type); <END> } return scriptRunner; }</code><technical_language>In light of yesterday's discussion, UnknownEntityException</technical_language>

Target:
ScriptRunner getScriptRunner(String type) { ScriptRunner scriptRunner = scriptRunners.get(type); if (scriptRunner == null) { throw new UnknownEntityException(scriptTypeMetaData, type); } return scriptRunner; }
Source:
<code>public SortedSet<Marker> getMarkers(Alloc a) { SortedSet<Marker> ret = a.getMarkers(); <START> ret.removeIf(m -> m.isQcOnly() && !showQcMarkers); <END> return ret; }</code><technical_language>This is more concise. I removeIf. pull showQcMarkers bit out (I do in original code either)</technical_language>

Target:
public SortedSet<Marker> getMarkers(Alloc a) { final SortedSet<Marker> ret = a.getMarkers(); if (!showQcMarkers) ret.removeIf(Marker::isQcOnly); return ret; }
Source:
<code>public CRParseResult responseMessageForParseDirectory(String responseBody) { ErrorCollection errors = new ErrorCollection(); try { ResponseScratch responseMap = parseResponseForMigration(responseBody); ParseDirectoryResponseMessage parseDirectoryResponseMessage; if (responseMap.target_version == null) { errors.addError("Plugin response message", "missing 'target_version' field"); return new CRParseResult(errors); } else { int version = responseMap.target_version; while (version < CURRENT_CONTRACT_VERSION) { <START> responseBody = migrate(responseBody, version + 1); <END> version++; } parseDirectoryResponseMessage = codec.getGson().fromJson(responseBody, ParseDirectoryResponseMessage.class); parseDirectoryResponseMessage.validateResponse(errors); errors.addErrors(parseDirectoryResponseMessage.getPluginErrors()); return new CRParseResult(parseDirectoryResponseMessage.getEnvironments(), parseDirectoryResponseMessage.getPipelines(), errors); } } catch (Exception ex) { StringBuilder builder = new StringBuilder(); builder.append("Unexpected error when handling plugin response").append('\n'); builder.append(ex); errors.addError("runtime", builder.toString()); LOGGER.error(builder.toString(), ex); return new CRParseResult(errors); } }</code><technical_language>works move version++; this one</technical_language>

Target:
public CRParseResult responseMessageForParseDirectory(String responseBody) { ErrorCollection errors = new ErrorCollection(); try { ResponseScratch responseMap = parseResponseForMigration(responseBody); ParseDirectoryResponseMessage parseDirectoryResponseMessage; if (responseMap.target_version == null) { errors.addError("Plugin response message", "missing 'target_version' field"); return new CRParseResult(errors); } else { int version = responseMap.target_version; while (version < CURRENT_CONTRACT_VERSION) { version++; responseBody = migrate(responseBody, version); } parseDirectoryResponseMessage = codec.getGson().fromJson(responseBody, ParseDirectoryResponseMessage.class); parseDirectoryResponseMessage.validateResponse(errors); errors.addErrors(parseDirectoryResponseMessage.getPluginErrors()); return new CRParseResult(parseDirectoryResponseMessage.getEnvironments(), parseDirectoryResponseMessage.getPipelines(), errors); } } catch (Exception ex) { StringBuilder builder = new StringBuilder(); builder.append("Unexpected error when handling plugin response").append('\n'); builder.append(ex); errors.addError("runtime", builder.toString()); LOGGER.error(builder.toString(), ex); return new CRParseResult(errors); } }
Source:
<code>public void testTableNames() throws IOException { String[] goodNames = { "a", "1", "_", "_x", "a-._5x", "_a-._5x", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi", "jklmnopqrstuvwxyz1234567890_-." }; String[] badNames = { "-x", ".x", "a!", "a@", "a#", "a$", "a%", "a^", "a&", "a*", "a(", "a+", "a=", "a~", "a`", "a{", "a[", "a|", "a\\", "a/", "a<", "a,", "a?", "a" + RandomStringUtils.random(10, false, false) }; Admin admin = getConnection().getAdmin(); for (String badName : badNames) { boolean failed = false; try { HTableDescriptor descriptor = new HTableDescriptor(TableName.valueOf(badName)); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); admin.createTable(descriptor); } catch (IllegalArgumentException e) { failed = true; } Assert.assertTrue("Should fail as table name: '" + badName + "'", failed); } for(String goodName : goodNames) { TableName tableName = TableName.valueOf(goodName); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); IOException exception = null; <START> if (!admin.tableExists(tableName)) { <END> try { admin.createTable(descriptor); } catch (IOException e){ exception = e; } } try { admin.disableTable(tableName); admin.deleteTable(tableName); } catch (Exception e) { new Logger(getClass()).warn("Clould not delete table %s", e, tableName); } if (exception != null) { throw exception; } } }</code><technical_language>try finally {}</technical_language>

Target:
public void testTableNames() throws IOException { String[] goodNames = { "a", "1", "_", "_x", "a-._5x", "_a-._5x", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi", "jklmnopqrstuvwxyz1234567890_-." }; String[] badNames = { "-x", ".x", "a!", "a@", "a#", "a$", "a%", "a^", "a&", "a*", "a(", "a+", "a=", "a~", "a`", "a{", "a[", "a|", "a\\", "a/", "a<", "a,", "a?", "a" + RandomStringUtils.random(10, false, false) }; Admin admin = getConnection().getAdmin(); for (String badName : badNames) { boolean failed = false; try { HTableDescriptor descriptor = new HTableDescriptor(TableName.valueOf(badName)); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); admin.createTable(descriptor); } catch (IllegalArgumentException e) { failed = true; } Assert.assertTrue("Should fail as table name: '" + badName + "'", failed); } for(String goodName : goodNames) { TableName tableName = TableName.valueOf(goodName); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); admin.createTable(descriptor); admin.disableTable(tableName); admin.deleteTable(tableName); } }
Source:
<code>public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? (disksLeftInVm.isEmpty() ? AuditLogType.USER_REMOVE_VM_FINISHED : AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS) <START> : AuditLogType.USER_FAILED_REMOVE_VM; <END> }</code><technical_language>Remove VM place audit log removed</technical_language>

Target:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? AuditLogType.USER_REMOVE_VM_FINISHED : AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS; }
Source:
<code>public void testFilterBuilderUri() { Warp .execute(clientAction) <START> .filter(request().uri().endsWith(".jsf").build()) <END> .verify(serverAssertion); }</code><technical_language>build() method is necessary I BasicWarpTestm right</technical_language>

Target:
public void testFilterBuilderUri() { Warp .execute(clientAction) .filter(request().uri().endsWith(".jsf")) .verify(serverAssertion); }
Source:
<code>public Response intercept(final Chain chain) throws IOException { final Response response = chain.proceed(chain.request()); if (response.isSuccessful()) { return response; } else { final ResponseBody body = response.body(); if (body != null) { final Reader bodyReader = body.charStream(); if (bodyReader != null) { try { <START> final JsonNode responseBody = this.mapper.readTree(bodyReader); <END> throw new GenieClientException( response.code(), response.message() + " : " + responseBody.get(ERROR_MESSAGE_KEY).asText() ); } catch (final JsonProcessingException jpe) { throw new GenieClientException(response.code(), response.message() + " " + jpe.getMessage()); } } } throw new GenieClientException(response.code(), "Unable to find response body to parse error message from"); } }</code><technical_language>check for possibility responseBody is null</technical_language>

Target:
public Response intercept(final Chain chain) throws IOException { final Response response = chain.proceed(chain.request()); if (response.isSuccessful()) { return response; } else { final ResponseBody body = response.body(); if (body != null) { final Reader bodyReader = body.charStream(); if (bodyReader != null) { try { final JsonNode responseBody = this.mapper.readTree(bodyReader); final String errorMessage = responseBody == null || !responseBody.has(ERROR_MESSAGE_KEY) ? EMPTY_STRING : responseBody.get(ERROR_MESSAGE_KEY).asText(); throw new GenieClientException( response.code(), response.message() + " : " + errorMessage ); } catch (final JsonProcessingException jpe) { throw new GenieClientException(response.code(), response.message() + " " + jpe.getMessage()); } } } throw new GenieClientException(response.code(), "Unable to find response body to parse error message from"); } }
Source:
<code>public CompositeMenuBuilder(final String label, final Collection<AbstractMenuBuilder> menus) { this.label = label; this.menus = menus; AbstractMenuBuilder firstMenu = (AbstractMenuBuilder) <START> menus.toArray()[0]; <END> priority = firstMenu.getPriority(); }</code><technical_language>A dangerous access array index checking validity</technical_language>

Target:
public CompositeMenuBuilder(final String label, final Collection<AbstractMenuBuilder> menus) { this.label = label; this.menus = menus; if (menus != null && menus.toArray().length > 0) { AbstractMenuBuilder firstMenu = (AbstractMenuBuilder) menus.toArray()[0]; priority = firstMenu.getPriority(); } }
Source:
<code>public static void main(String[] args) { MungeOptions options = handleOptions(MungeOptions.class, args); UrisScheme uris = OptionsUtils.WikibaseOptions.wikibaseUris(options); Munger munger = mungerFromOptions(options); int chunksize = options.chunkSize(); if (chunksize < 1) { chunksize = Integer.MAX_VALUE; } try { Munge munge = new Munge(uris, munger, CliUtils.reader(options.from()), chunksize, options.to()); munge.run(); } catch <START> (IOException | RDFHandlerException | RDFParseException | InterruptedException e) <END> { log.error("Fatal error munging RDF", e); System.exit(1); } }</code><technical_language>Catching Exception in a main error handler a bad thing. specific checked exceptions, RuntimeException default printing a stacktrace stdout</technical_language>

Target:
public static void main(String[] args) { MungeOptions options = handleOptions(MungeOptions.class, args); UrisScheme uris = OptionsUtils.WikibaseOptions.wikibaseUris(options); Munger munger = mungerFromOptions(options); int chunksize = options.chunkSize(); if (chunksize < 1) { chunksize = Integer.MAX_VALUE; } try { Munge munge = new Munge(uris, munger, CliUtils.reader(options.from()), chunksize, options.to()); munge.run(); } catch (Exception e) { log.error("Fatal error munging RDF", e); System.exit(1); } }
Source:
<code>public String getResourceName() { <START> return null; <END> }</code><technical_language>nan</technical_language>

Target:
public String getResourceName() { return name; }
Source:
<code>public Transaction beginTransaction(MuleContext muleContext) throws TransactionException { try { <START> XaTransaction xat = <END> new XaTransaction(muleContext.getConfiguration().getId(), muleContext.getTransactionManager(), ((MuleContextWithRegistry) muleContext).getRegistry().lookupObject(NotificationDispatcher.class), timeout); xat.begin(); return xat; } catch (Exception e) { throw new TransactionException(cannotStartTransaction("XA"), e); } }</code><technical_language>delegate this implementation new method</technical_language>

Target:
public Transaction beginTransaction(MuleContext muleContext) throws TransactionException { try { return this.beginTransaction(muleContext.getConfiguration().getId(), ((MuleContextWithRegistry) muleContext).getRegistry() .lookupObject(NotificationDispatcher.class), muleContext.getTransactionFactoryManager(), muleContext.getTransactionManager(), 10000); } catch (RegistrationException e) { throw new TransactionException(cannotStartTransaction("XA"), e); } }
Source:
<code>protected ImmutableMap<String, ImmutableList<Object>> getParameters() { ImmutableList.Builder<Object> listOfActionChains = ImmutableList.builder(); ImmutableList<TouchAction> touchActions = actions.build(); <START> touchActions.forEach(action -> <END> listOfActionChains.add(action.getParameters().get("actions"))); return ImmutableMap.of("actions", listOfActionChains.build()); }</code><technical_language>replace ImmutableList.Builder<Object> listOfActionChains = ImmutableList.copyOf(touchActions.stream().map(x -> x.getParameters().get("actions")));</technical_language>

Target:
protected Map<String, List<Object>> getParameters() { ImmutableList<TouchAction> touchActions = actions.build(); return ImmutableMap.of("actions", touchActions.stream().map(touchAction -> touchAction.getParameters().get("actions")).collect(toList())); }
Source:
<code>public void moveMarker(View view, int left, int top) { MarkerPlugin.LayoutParams lp = (LayoutParams) view.getLayoutParams(); if (lp == null) { return; } <START> lp.mLeft = left; <END> lp.mTop = top; view.setLeft(left); view.setTop(top); }</code><technical_language>If if be: lp.x = left; lp.y = top; requestLayout(); this change I longer markers coming initial position scale change. I notice code in demo test marker move, markers moved position (which is happening, I find out why). I suspect this do measuring/layout logic, I triple checked code in demo, fine</technical_language>

Target:
public void moveMarker(View view, int left, int top) { MarkerPlugin.LayoutParams lp = (LayoutParams) view.getLayoutParams(); if (lp == null) { return; } lp.x = left; lp.y = top; populateLayoutParams(view); view.setLeft(lp.mLeft); view.setTop(lp.mTop); }
Source:
<code>public static SshMachineLocation getSshMachine(Entity entity) { try { Collection<Location> locations = entity.getLocations(); if (locations.size()==1) return (SshMachineLocation) Iterables.getOnlyElement( entity.getLocations() ); <START> Collection<Location> sshs = LocationFunctions.filter(locations, LocationFunctions.isOfType(SshMachineLocation.class)); <END> return (SshMachineLocation) Iterables.getOnlyElement( sshs ); } catch (Exception e) { throw new IllegalStateException("Entity "+entity+" (in "+Tasks.current()+") requires a single SshMachineLocation, but has "+entity.getLocations(), e); } }</code><technical_language>Iterables.filter(locations, SshMachineLocation.class), passed Iterables method afterwards. save subsequent casting well</technical_language>

Target:
public static SshMachineLocation getSshMachine(Entity entity) { try { return Machines.findUniqueSshMachineLocation(entity.getLocations()).get(); } catch (Exception e) { throw new IllegalStateException("Entity "+entity+" (in "+Tasks.current()+") requires a single SshMachineLocation, but has "+entity.getLocations(), e); } }
Source:
<code>protected AbstractTransmission( TransmissionMeta meta, BooleanSupplier stopChecker, IgniteLogger log, int chunkSize ) { A.notNull(meta, "Initial file meta cannot be null"); A.notNullOrEmpty(meta.name(), "Trasmisson name cannot be empty or null"); A.ensure(meta.offset() >= 0, "File start position cannot be negative"); <START> A.ensure(meta.count() >= 0, "Total number of bytes to transfer must be greater than zero"); <END> A.notNull(stopChecker, "Process stop checker cannot be null"); A.ensure(chunkSize > 0, "Size of chunks to transfer data must be positive"); this.stopChecker = stopChecker; this.log = log.getLogger(AbstractTransmission.class); this.chunkSize = chunkSize; this.meta = meta; }</code><technical_language>message corrected match condition</technical_language>

Target:
protected AbstractTransmission( TransmissionMeta meta, BooleanSupplier stopChecker, IgniteLogger log, int chunkSize ) { A.notNull(meta, "Initial file meta cannot be null"); A.notNullOrEmpty(meta.name(), "Trasmisson name cannot be empty or null"); A.ensure(meta.offset() >= 0, "File start position cannot be negative"); A.ensure(meta.count() >= 0, "Total number of bytes to transfer can't be less than zero"); A.notNull(stopChecker, "Process stop checker cannot be null"); A.ensure(chunkSize > 0, "Size of chunks to transfer data must be positive"); this.stopChecker = stopChecker; this.log = log.getLogger(AbstractTransmission.class); this.chunkSize = chunkSize; this.meta = meta; }
Source:
<code>private IStatus importTraceFiles(TracePackageFilesElement traceFilesElement, IProgressMonitor monitor) { List<Pair<String, String>> fileNameAndLabelPairs = new ArrayList<>(); String sourceName = traceFilesElement.getFileName(); String destinationName = traceFilesElement.getParent().getText(); fileNameAndLabelPairs.add(new Pair<>(sourceName, destinationName)); IPath containerPath = fTmfTraceFolder.getPath(); IStatus status = importFiles(getSpecifiedArchiveFile(), fileNameAndLabelPairs, containerPath, monitor); if (status.isOK()) { <START> new TmfNavigatorContentProvider().getChildren(fTmfTraceFolder); <END> } return status; }</code><technical_language>I Patrick removed this in master necessary anymore</technical_language>

Target:
private IStatus importTraceFiles(TracePackageFilesElement traceFilesElement, IProgressMonitor monitor) { List<Pair<String, String>> fileNameAndLabelPairs = new ArrayList<>(); String sourceName = traceFilesElement.getFileName(); String destinationName = traceFilesElement.getParent().getText(); fileNameAndLabelPairs.add(new Pair<>(sourceName, destinationName)); IPath containerPath = fTmfTraceFolder.getPath(); IStatus status = importFiles(getSpecifiedArchiveFile(), fileNameAndLabelPairs, containerPath, monitor); return status; }
Source:
<code>private void processImageChooserResponse(Intent intent) { Uri selectedImage = intent.getData(); File originalImage = new File(FileUtils.getPath(this, selectedImage)); if (originalImage.exists()) { File unscaledFinalImage = moveAndScaleImage(originalImage, true); <START> ContentValues values = new ContentValues(6); <END> values.put(Images.Media.TITLE, unscaledFinalImage.getName()); values.put(Images.Media.DISPLAY_NAME, unscaledFinalImage.getName()); values.put(Images.Media.DATE_TAKEN, System.currentTimeMillis()); values.put(Images.Media.MIME_TYPE, "image/jpeg"); values.put(Images.Media.DATA, unscaledFinalImage.getAbsolutePath()); Uri imageURI = getContentResolver().insert(Images.Media.EXTERNAL_CONTENT_URI, values); Log.i(TAG, "Inserting image returned uri = " + imageURI.toString()); ((ODKView) mCurrentView).setBinaryData(imageURI); saveAnswersForCurrentScreen(DO_NOT_EVALUATE_CONSTRAINTS); } else { CommCareActivity.createErrorDialog(this, Localization.get("invalid.image.selection"), false); } refreshCurrentView(); }</code><technical_language>This is identical method in a helper method</technical_language>

Target:
private void processImageChooserResponse(Intent intent) { Uri selectedImage = intent.getData(); File originalImage = new File(FileUtils.getPath(this, selectedImage)); if (originalImage.exists()) { try { File unscaledFinalImage = moveAndScaleImage(originalImage, true); saveImageWidgetAnswer(unscaledFinalImage); } catch (IOException e) { e.printStackTrace(); showCustomToast(Localization.get("image.selection.not.saved"), Toast.LENGTH_LONG); } } else { showCustomToast(Localization.get("invalid.image.selection"), Toast.LENGTH_LONG); } }
Source:
<code>public long getLastAddConfirmed() { <START> return entries.size() - 1; <END> }</code><technical_language>return entry id of entry</technical_language>

Target:
public long getLastAddConfirmed() { return entries.get(entries.size() - 1).getEntryId(); }
Source:
<code>public XMLParserConfiguration (final boolean keepStrings, final String cDataTagName) { <START> this(keepStrings, cDataTagName, false); <END> }</code><technical_language>Please do modify deprecated functions, in tests</technical_language>

Target:
public XMLParserConfiguration (final boolean keepStrings, final String cDataTagName) { this.keepStrings = keepStrings; this.cDataTagName = cDataTagName; this.convertNilAttributeToNull = false; }
Source:
<code>public void testExpandableItemStatusAfterOpening() { SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(VSM); SWTBotTreeItem[] treeItem = odesignEditor.bot().tree().getAllItems(); <START> assertEquals(1, treeItem.length); <END> SWTBotTreeItem resourceItem = treeItem[0]; assertEquals(1, resourceItem.getItems().length); SWTBotTreeItem groupItem = resourceItem.getItems()[0]; assertEquals(6, groupItem.getItems().length); SWTBotTreeItem viewpointItem = groupItem.getItems()[0]; assertEquals(7, viewpointItem.getItems().length); SWTBotTreeItem entitiesDiagramItem = viewpointItem.getItems()[0]; assertEquals(1, entitiesDiagramItem.getItems().length); SWTBotTreeItem viewpointItem2 = groupItem.getItems()[2]; assertEquals(4, viewpointItem2.getItems().length); SWTBotTreeItem entitiesDiagramItem2 = viewpointItem2.getItems()[0]; assertEquals(1, entitiesDiagramItem2.getItems().length); SWTBotTreeItem expandedEntitiesDiagramItem2 = entitiesDiagramItem2.expand(); assertEquals(2, expandedEntitiesDiagramItem2.getItems().length); SWTBotTreeItem expandedEntitiesDiagramItem = entitiesDiagramItem.expand(); assertEquals(9, expandedEntitiesDiagramItem.getItems().length); }</code><technical_language>add a message understand issue reading code DO for assert</technical_language>

Target:
public void testExpandableItemStatusAfterOpening() { SWTBotVSMEditor odesignEditor = openViewpointSpecificationModel(VSM); SWTBotTreeItem[] treeItem = odesignEditor.bot().tree().getAllItems(); assertEquals("There should be only one group node under resource node", 1, treeItem.length); SWTBotTreeItem resourceItem = treeItem[0]; assertEquals("There should be only one viewpoint node under group node", resourceItem.getItems().length); SWTBotTreeItem groupItem = resourceItem.getItems()[0]; assertEquals("The level 2 node should be expanded with 6 sub items", 6, groupItem.getItems().length); SWTBotTreeItem viewpointItem = groupItem.getItems()[0]; assertEquals("The level 3 node should be expanded with 7 sub items", 7, viewpointItem.getItems().length); SWTBotTreeItem viewpointItem2 = groupItem.getItems()[2]; assertEquals("The level 3 node should be expanded with 4 sub items", 4, viewpointItem2.getItems().length); SWTBotTreeItem entitiesDiagramItem2 = viewpointItem2.getItems()[0]; assertEquals("The level 4 node should not be expanded. It should contains only the empty node.", 1, entitiesDiagramItem2.getItems().length); SWTBotTreeItem entitiesDiagramItem = viewpointItem.getItems()[0]; assertEquals("The level 4 node should not be expanded. It should contains only the empty node.", 1, entitiesDiagramItem.getItems().length); SWTBotTreeItem expandedEntitiesDiagramItem2 = entitiesDiagramItem2.expand(); assertEquals("The level 4 node should have 2 sub elements when expanded.", 2, expandedEntitiesDiagramItem2.getItems().length); SWTBotTreeItem expandedEntitiesDiagramItem = entitiesDiagramItem.expand(); assertEquals("The level 4 node should have 9 sub elements when expanded.", 9, expandedEntitiesDiagramItem.getItems().length); }
Source:
<code>public static YamlNode load(InputStream inputStream, String rootName) { try { Object document = getLoad().loadFromInputStream(inputStream); <START> inputStream.close(); <END> return buildDom(rootName, document); } catch (Exception ex) { throw new YamlException("An error occurred while loading and parsing the YAML stream", ex); } }</code><technical_language>Is close this method is created? avoid problems adding new methods. I some code paths close it, e.g. YamlClientConfigBuilder#build YamlClientFailoverConfigBuilder#build YamlConfigBuilder#build</technical_language>

Target:
public static YamlNode load(InputStream inputStream, String rootName) { try { Object document = getLoad().loadFromInputStream(inputStream); return buildDom(rootName, document); } catch (Exception ex) { throw new YamlException("An error occurred while loading and parsing the YAML stream", ex); } }
Source:
<code>private void carryOntoHistory(RevCommit c, int carry) { stack = null; for (;;) { carryOntoHistoryInnerLoop(c, carry); CarryStack s = stack; if (s != null) { <START> stack = s.prev; c = s.c; carry = s.carry; <END> continue; } break; } }</code><technical_language>change order save a temp variable s</technical_language>

Target:
private void carryOntoHistory(RevCommit c, int carry) { stack = null; for (;;) { carryOntoHistoryInnerLoop(c, carry); if (stack != null) { c = stack.c; carry = stack.carry; stack = stack.prev; continue; } break; } }
Source:
<code>public CoordinatorDynamicConfig( @JsonProperty("millisToWaitBeforeDeleting") long millisToWaitBeforeDeleting, @JsonProperty("mergeBytesLimit") long mergeBytesLimit, @JsonProperty("mergeSegmentsLimit") int mergeSegmentsLimit, @JsonProperty("maxSegmentsToMove") int maxSegmentsToMove, @JsonProperty("replicantLifetime") int replicantLifetime, @JsonProperty("replicationThrottleLimit") int replicationThrottleLimit, @JsonProperty("balancerComputeThreads") int balancerComputeThreads, @JsonProperty("emitBalancingStats") boolean emitBalancingStats, @JsonProperty("killDataSourceWhitelist") Object killDataSourceWhitelist ) { this.maxSegmentsToMove = maxSegmentsToMove; this.millisToWaitBeforeDeleting = millisToWaitBeforeDeleting; this.mergeSegmentsLimit = mergeSegmentsLimit; this.mergeBytesLimit = mergeBytesLimit; this.replicantLifetime = replicantLifetime; this.replicationThrottleLimit = replicationThrottleLimit; this.emitBalancingStats = emitBalancingStats; this.balancerComputeThreads = Math.max(balancerComputeThreads, 1); if (killDataSourceWhitelist instanceof String) { String[] tmp = ((String) killDataSourceWhitelist).split(","); this.killDataSourceWhitelist = new HashSet<>(); for (int i = 0; i < tmp.length; i++) { if (!tmp[i].isEmpty()) { <START> this.killDataSourceWhitelist.add(tmp[i]); <END> } } } else if (killDataSourceWhitelist instanceof Collection){ this.killDataSourceWhitelist = ImmutableSet.copyOf(((Collection) killDataSourceWhitelist)); } else { this.killDataSourceWhitelist = ImmutableSet.of(); } }</code><technical_language>properry account for spaces comma</technical_language>

Target:
public CoordinatorDynamicConfig( @JsonProperty("millisToWaitBeforeDeleting") long millisToWaitBeforeDeleting, @JsonProperty("mergeBytesLimit") long mergeBytesLimit, @JsonProperty("mergeSegmentsLimit") int mergeSegmentsLimit, @JsonProperty("maxSegmentsToMove") int maxSegmentsToMove, @JsonProperty("replicantLifetime") int replicantLifetime, @JsonProperty("replicationThrottleLimit") int replicationThrottleLimit, @JsonProperty("balancerComputeThreads") int balancerComputeThreads, @JsonProperty("emitBalancingStats") boolean emitBalancingStats, @JsonProperty("killDataSourceWhitelist") Object killDataSourceWhitelist ) { this.maxSegmentsToMove = maxSegmentsToMove; this.millisToWaitBeforeDeleting = millisToWaitBeforeDeleting; this.mergeSegmentsLimit = mergeSegmentsLimit; this.mergeBytesLimit = mergeBytesLimit; this.replicantLifetime = replicantLifetime; this.replicationThrottleLimit = replicationThrottleLimit; this.emitBalancingStats = emitBalancingStats; this.balancerComputeThreads = Math.max(balancerComputeThreads, 1); if (killDataSourceWhitelist instanceof String) { String[] tmp = ((String) killDataSourceWhitelist).split(","); this.killDataSourceWhitelist = new HashSet<>(); for (int i = 0; i < tmp.length; i++) { String trimmed = tmp[i].trim(); if (!trimmed.isEmpty()) { this.killDataSourceWhitelist.add(trimmed); } } } else if (killDataSourceWhitelist instanceof Collection){ this.killDataSourceWhitelist = ImmutableSet.copyOf(((Collection) killDataSourceWhitelist)); } else { this.killDataSourceWhitelist = ImmutableSet.of(); } }
Source:
<code>public void onClick(final ClickEvent e) { <START> final Object ele = getTarget(e); <END> if (Objects.equals(ele, checkbox)) { return; } if (HiddenHelper.isHidden(itemsContainer)) { showElement(itemsContainer); } else { hideElement(itemsContainer); } }</code><technical_language>please rename variable element</technical_language>

Target:
public void onClick(final ClickEvent e) { final Object target = getTarget(e); if (Objects.equals(target, checkbox)) { return; } if (HiddenHelper.isHidden(itemsContainer)) { showElement(itemsContainer); } else { hideElement(itemsContainer); } }
Source:
<code>protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { log.trace("doPost"); int idx = Integer.parseInt(request.getParameter("idx"), 10); String source = request.getParameter("source"); String target = request.getParameter("target"); log.debug("Removing entry with at {}",source, target, idx); <START> InputStream is = request.getResource().getChild(RedirectMapModel.MAP_FILE_NODE).adaptTo(InputStream.class); <END> List<String> lines = IOUtils.readLines(is); log.debug("Loaded lines", lines.size()); lines.add(idx, source+" "+target); log.debug("Added entry..."); ModifiableValueMap mvm = request.getResource().getChild(RedirectMapModel.MAP_FILE_NODE) .getChild(JcrConstants.JCR_CONTENT).adaptTo(ModifiableValueMap.class); mvm.put(JcrConstants.JCR_DATA, StringUtils.join(lines, "\n")); request.getResourceResolver().commit(); request.getResourceResolver().refresh(); log.debug("Changes saved..."); super.doGet(request, response); }</code><technical_language>unclosed stream</technical_language>

Target:
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServletException, IOException { log.trace("doPost"); int idx = Integer.parseInt(request.getParameter("idx"), 10); String source = request.getParameter("source"); String target = request.getParameter("target"); log.debug("Removing entry with at {}", source, target, idx); List<String> lines = RedirectEntriesUtils.readEntries(request); lines.add(idx, source + " " + target); log.debug("Added entry..."); RedirectEntriesUtils.updateRedirectMap(request, lines); RedirectEntriesUtils.writeEntriesToResponse(request, response); }
Source:
<code>public void testCompilerLogWithCustomComilerArgsAndLog() throws Exception { File basedir = getBasedir("projects/logs/customCompilerArgsAndLog"); List<MavenProject> projects = getSortedProjects(basedir, null); MavenProject project = projects.get(0); try { getMojo(projects, project).execute(); fail(); } catch <START> (MojoExecutionException e) <END> { assertThat(e.getMessage(), containsString("Compiler logging is configured by the 'log' compiler" + " plugin parameter and the custom compiler argument '-log'. Only either of them is allowed.")); } }</code><technical_language>Oops, forgot adapt this. @Martin: please fix this touching this change</technical_language>

Target:
public void testCompilerLogWithCustomComilerArgsAndLog() throws Exception { File basedir = getBasedir("projects/logs/customCompilerArgsAndLog"); List<MavenProject> projects = getSortedProjects(basedir, null); MavenProject project = projects.get(0); try { lookupConfiguredMojo(project, "compile").execute(); fail(); } catch (MojoFailureException e) { assertThat(e.getMessage(), containsString("Compiler logging is configured by the 'log' compiler" + " plugin parameter and the custom compiler argument '-log'. Only either of them is allowed.")); } }
Source:
<code>public void onFeatureClicked(int featureId) { <START> showSummary(featureId); <END> }</code><technical_language>sense onFeatureClicked showSummary parameters showSummary is called here. onFeatureClicked move code rename showSummary if clearer</technical_language>

Target:
public void onFeatureClicked(int featureId) { FormMapViewModel.MappableFormInstance mappableFormInstance = instancesByFeatureId.get(featureId); if (mappableFormInstance != null) { map.zoomToPoint(new MapPoint(mappableFormInstance.getLatitude(), mappableFormInstance.getLongitude()), map.getZoom(), true); setUpSummarySheet(mappableFormInstance); summarySheet.setState(BottomSheetBehavior.STATE_EXPANDED); } }
Source:
<code>public void disableTableReplication(String tableName) throws IOException { TableName tn = tableInfoFactory.getTableInfo(tableName); try { HTableDescriptor htd = admin.getTableDescriptor(tn); if (admin.isTableEnabled(tn)) { admin.disableTable(tn); } for (HColumnDescriptor hcd : htd.getFamilies()) { hcd.setScope(HConstants.REPLICATION_SCOPE_LOCAL); } admin.modifyTable(tn, htd); SpliceLogUtils.info(LOG, "disabled replication for table %s", tn); } finally { if (tn != null && !admin.isTableEnabled(tn)) { admin.enableTable(tn); } <START> } <END> }</code><technical_language>Similar enable replication case, enable tables in HBase started out disabled this method called</technical_language>

Target:
public void disableTableReplication(String tableName) throws IOException { TableName tn = tableInfoFactory.getTableInfo(tableName); boolean tableEnabled = admin.isTableEnabled(tn); try { HTableDescriptor htd = admin.getTableDescriptor(tn); if (tableEnabled) { admin.disableTable(tn); } for (HColumnDescriptor hcd : htd.getFamilies()) { hcd.setScope(HConstants.REPLICATION_SCOPE_LOCAL); } admin.modifyTable(tn, htd); SpliceLogUtils.info(LOG, "disabled replication for table %s", tn); } finally { if (tn != null && !admin.isTableEnabled(tn) && tableEnabled) { admin.enableTable(tn); } } }
Source:
<code>private void setProgress() { <START> if (supervisor != null) { <END> int checked = state.equals(ImageGeneratorStep.GENERATE_IMAGES) ? getMode().equals(GenerationMode.ALL) ? 1 : sources.size() : 0; int generated = getMode().equals(GenerationMode.ALL) && state.equals(ImageGeneratorStep.DETERMINE_WHICH_IMAGES_NEED_TO_BE_GENERATED) ? 0 : getPosition(); int total = sources.size() + (getMode().equals(GenerationMode.ALL) ? 1 : getContentToBeGenerated().size()) + 1; supervisor.setProgress(100d * (1 + checked + generated) / total); } }</code><technical_language>Objects.nonNull</technical_language>

Target:
private void setProgress() { if (Objects.nonNull(supervisor)) { int checked = state.equals(ImageGeneratorStep.GENERATE_IMAGES) ? getMode().equals(GenerationMode.ALL) ? 1 : sources.size() : 0; int generated = getMode().equals(GenerationMode.ALL) && state.equals(ImageGeneratorStep.DETERMINE_WHICH_IMAGES_NEED_TO_BE_GENERATED) ? 0 : getPosition(); int total = sources.size() + (getMode().equals(GenerationMode.ALL) ? 1 : getContentToBeGenerated().size()) + 1; supervisor.setProgress(100d * (1 + checked + generated) / total); } }
Source:
<code>public void run() { <START> List<Throwable> errors = new LinkedList<>(); <END> for ( Runnable o : operations ) { try { o.run(); } catch ( RuntimeException e ) { errors.add( e ); } } if ( !errors.isEmpty() ) { RuntimeException exception = new RuntimeException(); errors.forEach( exception::addSuppressed ); throw exception; } }</code><technical_language>please arraylist</technical_language>

Target:
public void run() { List<Throwable> errors = new ArrayList<>(); for ( Runnable o : operations ) { try { o.run(); } catch ( RuntimeException e ) { errors.add( e ); } } if ( !errors.isEmpty() ) { RuntimeException exception = new RuntimeException(); errors.forEach( exception::addSuppressed ); throw exception; } }
Source:
<code>public void startup(Application application, ComponentStartupStatus ss) { <START> Pattern pattern = Pattern.compile("^(topic|queues)/(.*)$"); <END> Matcher matcher = pattern.matcher(brokerDestination); if (matcher.find()) { String destinationType = matcher.group(1).equals("topic") ? "topic" : "queue"; String destinationName = matcher.group(2); String destinationBinding = String.format("%s.%s", destinationType, brokerDestination); Properties properties = new Properties(); properties.put(INITIAL_CONTEXT_FACTORY, factoryInitial); properties.put(PROVIDER_URL, providerURL); properties.put(destinationBinding, destinationName); try { InitialContext ic = new InitialContext(properties); ConnectionFactory cf = (ConnectionFactory) ic.lookup(connectionFactory); Destination destination = (Destination) ic.lookup(brokerDestination); Connection connection = cf.createConnection(brokerUsername, brokerPassword); session = connection.createSession(Session.AUTO_ACKNOWLEDGE); producer = session.createProducer(destination); ss.info(String.format("Connected to %s at %s", brokerDestination, providerURL)); } catch (NamingException | JMSException e) { ss.warning(String.format("Failed to connect to %s at %s", brokerDestination, providerURL), e); } } else { ss.warning(String.format("%s is not a valid broker destination", brokerDestination)); } }</code><technical_language>Is this a typo? queue</technical_language>

Target:
public void startup(Application application, ComponentStartupStatus ss) { Pattern pattern = Pattern.compile("^.*/(.*)$"); Matcher matcher = pattern.matcher(brokerDestination); if (matcher.find()) { String destinationName = matcher.group(1); String destinationBinding = String.format("%s.%s", brokerType, brokerDestination); Properties properties = new Properties(); properties.put(INITIAL_CONTEXT_FACTORY, factoryInitial); properties.put(PROVIDER_URL, providerURL); properties.put(destinationBinding, destinationName); try { InitialContext ic = new InitialContext(properties); ConnectionFactory cf = (ConnectionFactory) ic.lookup(connectionFactory); Destination destination = (Destination) ic.lookup(brokerDestination); Connection connection = cf.createConnection(brokerUsername, brokerPassword); session = connection.createSession(Session.AUTO_ACKNOWLEDGE); producer = session.createProducer(destination); ss.info(String.format("Connected to %s at %s", brokerDestination, providerURL)); } catch (NamingException | JMSException e) { ss.warning(String.format("Failed to connect to %s at %s", brokerDestination, providerURL), e); } } else { ss.warning(String.format("%s is not a valid broker destination", brokerDestination)); } }
Source:
<code>public void timestampFiltersAreAdapted() { TimestampsFilter filter = new TimestampsFilter(ImmutableList.of(1L, 10L, 20L)); Filters.Filter expected = filterAdapter.adapt(emptyScanContext, filter); Assert.assertEquals(3, expected.toProto().getInterleave().getFiltersCount()); Assert.assertEquals( 10000L, <START> expected.toProto() <END> .getInterleave() .getFilters(1) .getTimestampRangeFilter() .getStartTimestampMicros()); Assert.assertEquals( 11000L, expected.toProto() .getInterleave() .getFilters(1) .getTimestampRangeFilter() .getEndTimestampMicros()); }</code><technical_language>Please revert expected a RowFilter, 3 conversions .toProto()</technical_language>

Target:
public void timestampFiltersAreAdapted() { TimestampsFilter filter = new TimestampsFilter(ImmutableList.of(1L, 10L, 20L)); Filters.Filter expected = filterAdapter.adapt(emptyScanContext, filter); Interleave expectedInterleaveFilter = expected.toProto().getInterleave(); Assert.assertEquals(3, expectedInterleaveFilter.getFiltersCount()); Assert.assertEquals( 10000L, expectedInterleaveFilter .getFilters(1) .getTimestampRangeFilter() .getStartTimestampMicros()); Assert.assertEquals( 11000L, expectedInterleaveFilter .getFilters(1) .getTimestampRangeFilter() .getEndTimestampMicros()); }
Source:
<code>public File gitPrefix() { Holder<File> p = gitPrefix; if (p == null) { <START> String overrideGitPrefix = System.getProperty("jgit.gitprefix"); <END> if (overrideGitPrefix != null) p = new Holder<File>(new File(overrideGitPrefix)); else p = new Holder<File>(discoverGitPrefix()); gitPrefix = p; } return p.value; }</code><technical_language>SystemReader, System.getProperty. SystemReader here</technical_language>

Target:
public File gitPrefix() { Holder<File> p = gitPrefix; if (p == null) { String overrideGitPrefix = SystemReader.getInstance().getProperty( "jgit.gitprefix"); if (overrideGitPrefix != null) p = new Holder<File>(new File(overrideGitPrefix)); else p = new Holder<File>(discoverGitPrefix()); gitPrefix = p; } return p.value; }
Source:
<code>public static void commitJob(String domainName, JobConf conf) throws IOException { Path outputPath = new Path(DomainBuilderProperties.getOutputPath(domainName, conf)); Path tmpOutputPath = new Path(DomainBuilderProperties.getTmpOutputPath(domainName, conf)); FileSystem fs = outputPath.getFileSystem(conf); fs.mkdirs(outputPath); LOG.info("Moving temporary output files from: " + tmpOutputPath + " to final output path: " + outputPath); FileStatus[] partitions = fs.listStatus(tmpOutputPath); <START> final int nThreads = 10; <END> final ExecutorService executor = Executors.newFixedThreadPool(nThreads); final List<PartitionCopier> partitionCopiers = new ArrayList<PartitionCopier>(); for (FileStatus partition : partitions) { PartitionCopier partitionCopier = new PartitionCopier(partition, fs, outputPath); partitionCopiers.add(partitionCopier); executor.execute(partitionCopier); } executor.shutdown(); final long waitSeconds = 10000; try { executor.awaitTermination(waitSeconds, TimeUnit.SECONDS); } catch (InterruptedException exc) { throw new RuntimeException("executor interrupted"); } for (PartitionCopier partitionCopier : partitionCopiers) { if (partitionCopier.exception != null) { throw new IOException("Partition copying failed for " + partitionCopier.partition, partitionCopier.exception); } } cleanupJob(domainName, conf); }</code><technical_language>I this higher. Domains thousands of partitions. I for 50</technical_language>

Target:
public static void commitJob(String domainName, JobConf conf) throws IOException { Path outputPath = new Path(DomainBuilderProperties.getOutputPath(domainName, conf)); Path tmpOutputPath = new Path(DomainBuilderProperties.getTmpOutputPath(domainName, conf)); FileSystem fs = outputPath.getFileSystem(conf); fs.mkdirs(outputPath); LOG.info("Moving temporary output files from: " + tmpOutputPath + " to final output path: " + outputPath); FileStatus[] partitions = fs.listStatus(tmpOutputPath); final ExecutorService executor = Executors.newFixedThreadPool(N_THREADS); final List<PartitionCopier> partitionCopiers = new ArrayList<PartitionCopier>(); for (FileStatus partition : partitions) { if (!IGNORE_PATHS.contains(partition.getPath().getName()) && partition.isDir()) { PartitionCopier partitionCopier = new PartitionCopier(partition, outputPath, fs); partitionCopiers.add(partitionCopier); executor.execute(partitionCopier); } } executor.shutdown(); try { boolean allCopiersFinished = false; while (!allCopiersFinished) { allCopiersFinished = executor.awaitTermination(WAIT_CYCLE_SECONDS, TimeUnit.SECONDS); } } catch (InterruptedException e) { throw new IOException("Executor interrupted", e); } for (PartitionCopier partitionCopier : partitionCopiers) { if (partitionCopier.exception != null) { throw new IOException("Partition copying failed for " + partitionCopier.partition, partitionCopier.exception); } } cleanupJob(domainName, conf); }
Source:
<code><START> public void processResponse(final CopyResult copyResult) <END> throws PathIOException { }</code><technical_language>+1, add debug logging</technical_language>

Target:
public void processResponse(final CopyResult copyResult) throws PathIOException { String newRevisionId = policy.getRevisionId(copyResult); LOG.debug("Copy result {}: {}", policy.getSource(), newRevisionId); if (newRevisionId == null && policy.isRequireVersion()) { throw new NoVersionAttributeException(uri, String.format( "Change detection policy requires %s", policy.getSource())); } }
Source:
<code>public FileStatus getFileStatus(Path path) throws IOException { if (path.getName().isEmpty()) { if (getS3ObjectMetadata(path) != null) { return new FileStatus(0, true, 1, 0, 0, qualifiedPath(path)); } throw new FileNotFoundException("File does not exist: " + path); } ObjectMetadata metadata = getS3ObjectMetadata(path); if (metadata == null) { Iterator<LocatedFileStatus> iterator = listPrefix(path); if (iterator.hasNext()) { return new FileStatus(0, true, 1, 0, 0, qualifiedPath(path)); } throw new FileNotFoundException("File does not exist: " + path); } return new FileStatus( getObjectSize(path, metadata), <START> metadata.getContentType().equals(S3_DIRECTORY_OBJECT_CONTENT_TYPE), <END> 1, BLOCK_SIZE.toBytes(), lastModifiedTime(metadata), qualifiedPath(path)); }</code><technical_language>possibility of metadata.getContentType() null here</technical_language>

Target:
public FileStatus getFileStatus(Path path) throws IOException { if (path.getName().isEmpty()) { if (getS3ObjectMetadata(path) != null) { return new FileStatus(0, true, 1, 0, 0, qualifiedPath(path)); } throw new FileNotFoundException("File does not exist: " + path); } ObjectMetadata metadata = getS3ObjectMetadata(path); if (metadata == null) { Iterator<LocatedFileStatus> iterator = listPrefix(path); if (iterator.hasNext()) { return new FileStatus(0, true, 1, 0, 0, qualifiedPath(path)); } throw new FileNotFoundException("File does not exist: " + path); } return new FileStatus( getObjectSize(path, metadata), S3_DIRECTORY_OBJECT_CONTENT_TYPE.equals(metadata.getContentType()), 1, BLOCK_SIZE.toBytes(), lastModifiedTime(metadata), qualifiedPath(path)); }
Source:
<code>protected void restartDeadTasks() { synchronized (_runningTasks) { if (_runningTasks.isEmpty()) { _logger.info("Connector received no datastreams tasks yet."); return; } _logger.info("Checking the status of running connector tasks.", _runningTasks.size()); Set<DatastreamTask> deadDatastreamTasks = new HashSet<>(); _runningTasks.forEach((datastreamTask, connectorTaskEntry) -> { if (isTaskDead(connectorTaskEntry)) { _logger.warn("Detected that the kafka connector task is not running for datastream task {}. Restarting it", datastreamTask); boolean stopped = stopTask(datastreamTask, connectorTaskEntry); if (stopped) { deadDatastreamTasks.add(datastreamTask); } else { _logger.error("Connector task for datastream task could not be stopped.", datastreamTask); } } else { _logger.info("Connector task for datastream task is healthy", datastreamTask); } }); deadDatastreamTasks.forEach(datastreamTask -> { _logger.warn("Creating a new connector task for the datastream task {}", datastreamTask); _runningTasks.put(datastreamTask, createKafkaConnectorTask(datastreamTask)); }); <START> _dynamicMetricsManager.createOrUpdateCounter(MODULE, NUM_TASK_RESTARTS, deadDatastreamTasks.size()); <END> } }</code><technical_language>@ahmedahamid is a recommendation a gauge vs. a counter</technical_language>

Target:
protected void restartDeadTasks() { synchronized (_runningTasks) { if (_runningTasks.isEmpty()) { _logger.info("Connector received no datastreams tasks yet."); return; } _logger.info("Checking the status of running connector tasks.", _runningTasks.size()); Set<DatastreamTask> deadDatastreamTasks = new HashSet<>(); _runningTasks.forEach((datastreamTask, connectorTaskEntry) -> { if (isTaskDead(connectorTaskEntry)) { _logger.warn("Detected that the kafka connector task is not running for datastream task {}. Restarting it", datastreamTask); boolean stopped = stopTask(datastreamTask, connectorTaskEntry); if (stopped) { deadDatastreamTasks.add(datastreamTask); } else { _logger.error("Connector task for datastream task could not be stopped.", datastreamTask); } } else { _logger.info("Connector task for datastream task is healthy", datastreamTask); } }); deadDatastreamTasks.forEach(datastreamTask -> { _logger.warn("Creating a new connector task for the datastream task {}", datastreamTask); _runningTasks.put(datastreamTask, createKafkaConnectorTask(datastreamTask)); }); _numTaskRestarts = deadDatastreamTasks.size(); } }
Source:
<code>public void onCreate() { if (DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectDiskReads() .detectDiskWrites() .detectNetwork() .penaltyLog().build()); } super.onCreate(); try{ <START> DatabaseHelper.init(this.getApplicationContext()); <END> } catch (Exception e) { LogUtils.logD("Database initialize error! \n" + e.getMessage()); } }</code><technical_language>DatabaseHelper.init(this);</technical_language>

Target:
public void onCreate() { if (DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectDiskReads() .detectDiskWrites() .detectNetwork() .penaltyLog().build()); } super.onCreate(); try{ DatabaseHelper.init(this); } catch (Exception e) { LogUtils.logD("Database initialize error! " + e.getMessage()); } }
Source:
<code>public BasicCallbackHandler(String username, char[] password) { <START> this.username = username; <END> this.password = password; this.realm = null; }</code><technical_language>DRY: this(username, password, null) instead</technical_language>

Target:
public BasicCallbackHandler(String username, char[] password) { this(username, null, password); }