auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void addMacroAdditionFiles(HashMap<String, String> map, String macroName, Vector<String> filenames) { StringBuffer buffer = new StringBuffer(); buffer.append(map.get(macroName)); for (int i=0; i<filenames.size(); i++) { String filename = filenames.get(i); if (filename.length() > 0) { <START> buffer.append(escapeWhitespaces(filename) + WHITESPACE + LINEBREAK); <END> } } map.put(macroName, buffer.toString()); }</code><technical_language>a suggestion in bug 373438 is a notch better. resubmit patch</technical_language>

Target:
public void addMacroAdditionFiles(HashMap<String, String> map, String macroName, Vector<String> filenames) { StringBuffer buffer = new StringBuffer(); buffer.append(map.get(macroName)); for (int i=0; i<filenames.size(); i++) { String filename = filenames.get(i); if (filename.length() > 0) { filename = ensurePathIsGNUMakeTargetRuleCompatibleSyntax(filename); buffer.append(filename + WHITESPACE + LINEBREAK); } } map.put(macroName, buffer.toString()); }
Source:
<code>public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); initializeDialogUnits(parent); PlatformUI.getWorkbench().getHelpSystem() .setHelp(container, IIDEHelpContextIds.NEW_PROJECT_WIZARD_PAGE); container.setLayout(new GridLayout(2,false)); container.setLayoutData(new GridData(GridData.FILL_BOTH)); new Label(container,SWT.NONE).setText("Select one of these Emf Parsley templates"); new Label(container,SWT.NONE).setText(""); SashForm sashForm = new SashForm(container, SWT.HORIZONTAL); gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 300; sashForm.setLayoutData(gd); templateSelectionViewer = new TableViewer(sashForm, SWT.BORDER); templateSelectionViewer.setContentProvider(new ArrayContentProvider()); templateSelectionViewer.setLabelProvider(new LabelProvider(){ @Override public String getText(Object element) { return ((TemplateWizardConfiguration)element).getLabel(); } }); createDescriptionIn(sashForm); templateSelectionViewer.setInput( new TemplateWizardConfigurationsFactory(). createTemplateWizardConfigurations()); templateSelectionViewer.addSelectionChangedListener(this); Dialog.applyDialogFont(container); setPageComplete(false); setControl(container); <START> new Label(container, SWT.NONE); <END> btnRapOption = new Button(container, SWT.CHECK); btnRapOption.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); btnRapOption.setText("Create for Remote Application Platform (RAP)"); }</code><technical_language>please add a .setText("") done a lines above; Sonarqube complain create object using/assigning it. :)</technical_language>

Target:
public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NULL); initializeDialogUnits(parent); PlatformUI.getWorkbench().getHelpSystem() .setHelp(container, IIDEHelpContextIds.NEW_PROJECT_WIZARD_PAGE); container.setLayout(new GridLayout(2,false)); container.setLayoutData(new GridData(GridData.FILL_BOTH)); new Label(container,SWT.NONE).setText("Select one of these Emf Parsley templates"); new Label(container,SWT.NONE).setText(""); SashForm sashForm = new SashForm(container, SWT.HORIZONTAL); gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 300; sashForm.setLayoutData(gd); templateSelectionViewer = new TableViewer(sashForm, SWT.BORDER); templateSelectionViewer.setContentProvider(new ArrayContentProvider()); templateSelectionViewer.setLabelProvider(new LabelProvider(){ @Override public String getText(Object element) { return ((TemplateWizardConfiguration)element).getLabel(); } }); createDescriptionIn(sashForm); templateSelectionViewer.setInput( new TemplateWizardConfigurationsFactory(). createTemplateWizardConfigurations()); templateSelectionViewer.addSelectionChangedListener(this); Dialog.applyDialogFont(container); setPageComplete(false); setControl(container); new Label(container, SWT.NONE).setText(""); btnRapOption = new Button(container, SWT.CHECK); btnRapOption.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); btnRapOption.setText("Prepare for Remote Application Platform (RAP)"); }
Source:
<code>public void stop(Future<Void> stopFuture) throws Exception { <START> super.stop(stopFuture); <END> logger.info("Stopped listening on port: " + PORT); }</code><technical_language>Remove</technical_language>

Target:
public void stop(Future<Void> stopFuture) throws Exception { logger.info("Stopped listening on port: " + PORT); stopFuture.complete(); }
Source:
<code>protected void endWithFailure() { restoreCommandState(); if <START> (getCommandCoordinatorUtil().getCommandExecutionStatus(getParameters().getCommandId()) <END> == CommandExecutionStatus.EXECUTED) { if (getVmTemplate() != null) { vmTemplateDao.remove(getVmTemplateId()); removeNetwork(); } } if (!getVmId().equals(Guid.Empty) && getVm() != null) { vmHandler.unLockVm(getVm()); } setSucceeded(true); }</code><technical_language>is of instance this way</technical_language>

Target:
protected void endWithFailure() { restoreCommandState(); if (commandCoordinatorUtil.getCommandExecutionStatus(getParameters().getCommandId()) == CommandExecutionStatus.EXECUTED) { if (getVmTemplate() != null) { vmTemplateDao.remove(getVmTemplateId()); removeNetwork(); } } if (!getVmId().equals(Guid.Empty) && getVm() != null) { vmHandler.unLockVm(getVm()); } setSucceeded(true); }
Source:
<code>public static void addToolbarToDialog(final Fragment context, final Dialog dialog, String title) { if (!context.isAdded() || dialog == null) { return; } Toolbar toolbar; if (dialog.findViewById(android.R.id.list) == null && dialog.findViewById(android.R.id.list_container) == null) { return; } ViewGroup root = null; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { ViewGroup listContainer = (ViewGroup) dialog.findViewById(android.R.id.list_container); if (listContainer != null) { root = (ViewGroup) listContainer.getParent(); } } if (root == null) { root = (ViewGroup) dialog.findViewById(android.R.id.list).getParent(); <START> } <END> toolbar = (Toolbar) LayoutInflater.from(context.getActivity()) .inflate(org.wordpress.android.R.layout.toolbar, root, false); root.addView(toolbar, 0); dialog.getWindow().setWindowAnimations(R.style.DialogAnimations); TextView titleView = (TextView) toolbar.findViewById(R.id.toolbar_title); titleView.setVisibility(View.VISIBLE); titleView.setText(title); toolbar.setTitle(""); toolbar.setNavigationIcon(org.wordpress.android.R.drawable.ic_arrow_back_white_24dp); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); } }); }</code><technical_language>This works, simplified below? View child = dialog.findViewById(android.R.id.list_container); if (child == null) { child = dialog.findViewById(android.R.id.list); if (child == null) return; } ViewGroup root = (ViewGroup) child.getParent();</technical_language>

Target:
public static void addToolbarToDialog(final Fragment context, final Dialog dialog, String title) { if (!context.isAdded() || dialog == null) { return; } Toolbar toolbar; if (dialog.findViewById(android.R.id.list) == null && dialog.findViewById(android.R.id.list_container) == null) { return; } @SuppressLint("InlinedApi") View child = dialog.findViewById(android.R.id.list_container); if (child == null) { child = dialog.findViewById(android.R.id.list); if (child == null) return; } ViewGroup root = (ViewGroup) child.getParent(); toolbar = (Toolbar) LayoutInflater.from(context.getActivity()) .inflate(org.wordpress.android.R.layout.toolbar, root, false); root.addView(toolbar, 0); dialog.getWindow().setWindowAnimations(R.style.DialogAnimations); TextView titleView = (TextView) toolbar.findViewById(R.id.toolbar_title); titleView.setVisibility(View.VISIBLE); titleView.setText(title); toolbar.setTitle(""); toolbar.setNavigationIcon(org.wordpress.android.R.drawable.ic_arrow_back_white_24dp); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); } }); }
Source:
<code>public int run(CompiledDefinition compiledDef, KRunOptions options, Function<Module, Rewriter> rewriterGenerator) { String pgmFileName = options.configurationCreation.pgm(); if (!options.configurationCreation.term()) { KExceptionManager.criticalError("Unsupported options: term=false"); } String pgm = files.loadFromWorkingDirectory(pgmFileName); K program = compiledDef.getProgramParser().apply(pgm, Source.apply(pgm)); Rewriter rewriter = rewriterGenerator.apply(compiledDef.executionModule()); K result = rewriter.execute(program); <START> System.err.println("result:" + unparseTerm(result, compiledDef.kompiledDefinition.mainSyntaxModule())); <END> return 0; }</code><technical_language>this needs main module, again, needs syntax is exist in output configuration</technical_language>

Target:
public int run(CompiledDefinition compiledDef, KRunOptions options, Function<Module, Rewriter> rewriterGenerator) { String pgmFileName = options.configurationCreation.pgm(); if (!options.configurationCreation.term()) { throw KExceptionManager.criticalError("Unsupported options: term=false"); } String pgm = files.loadFromWorkingDirectory(pgmFileName); K program = compiledDef.getProgramParser().apply(pgm, Source.apply(pgm)); Rewriter rewriter = rewriterGenerator.apply(compiledDef.executionModule()); K result = rewriter.execute(program); System.err.println(unparseTerm(result, compiledDef.kompiledDefinition.mainSyntaxModule())); return 0; }
Source:
<code>public void testNotificationsCalledWhenTimelineUpdated() throws InterruptedException { final String eventType1 = UUID.randomUUID().toString(); final String eventType2 = UUID.randomUUID().toString(); final RefreshListener l1 = new RefreshListener(); final TimelineSync t1 = createTimeline(); t1.registerTimelineChangeListener(eventType1, l1.createConsumer()); final RefreshListener l2 = new RefreshListener(); final TimelineSync t2 = createTimeline(); t2.registerTimelineChangeListener(eventType2, l2.createConsumer()); t1.startTimelineUpdate(eventType1, TimeUnit.SECONDS.toMillis(3)); t1.startTimelineUpdate(eventType2, TimeUnit.SECONDS.toMillis(3)); Assert.assertEquals(0, l1.getData().size()); Assert.assertEquals(0, l2.getData().size()); t1.finishTimelineUpdate(eventType1); <START> Thread.sleep(TimeUnit.SECONDS.toMillis(1)); <END> Assert.assertEquals(1, l1.getData().size()); Assert.assertEquals(new Integer(1), l1.getData().get(eventType1)); Assert.assertEquals(0, l2.getData().size()); t1.finishTimelineUpdate(eventType2); Assert.assertEquals(1, l1.getData().size()); Assert.assertEquals(new Integer(1), l1.getData().get(eventType1)); Assert.assertEquals(1, l2.getData().size()); Assert.assertEquals(new Integer(1), l2.getData().get(eventType2)); }</code><technical_language>I suggest TestUtils.waitFor(...)</technical_language>

Target:
public void testNotificationsCalledWhenTimelineUpdated() throws InterruptedException { final String eventType1 = UUID.randomUUID().toString(); final String eventType2 = UUID.randomUUID().toString(); final RefreshListener l1 = new RefreshListener(); final TimelineSync t1 = createTimeline(); t1.registerTimelineChangeListener(eventType1, l1.createConsumer()); final RefreshListener l2 = new RefreshListener(); final TimelineSync t2 = createTimeline(); t2.registerTimelineChangeListener(eventType2, l2.createConsumer()); t1.startTimelineUpdate(eventType1, TimeUnit.SECONDS.toMillis(3)); t1.startTimelineUpdate(eventType2, TimeUnit.SECONDS.toMillis(3)); Assert.assertEquals(0, l1.getData().size()); Assert.assertEquals(0, l2.getData().size()); t1.finishTimelineUpdate(eventType1); TestUtils.waitFor(() -> Assert.assertEquals(1, l1.getData().size()), TimeUnit.SECONDS.toMillis(1)); Assert.assertEquals(new Integer(1), l1.getData().get(eventType1)); Assert.assertEquals(0, l2.getData().size()); t1.finishTimelineUpdate(eventType2); Assert.assertEquals(1, l1.getData().size()); Assert.assertEquals(new Integer(1), l1.getData().get(eventType1)); Assert.assertEquals(1, l2.getData().size()); Assert.assertEquals(new Integer(1), l2.getData().get(eventType2)); }
Source:
<code>public void addWorkflowEntry(WorkflowDTO workflow) throws APIManagementException { Connection connection = null; PreparedStatement prepStmt = null; String query = SQLConstants.ADD_WORKFLOW_ENTRY_SQL; try { Timestamp cratedDateStamp = new Timestamp(workflow.getCreatedTime()); connection = APIMgtDBUtil.getConnection(); connection.setAutoCommit(false); prepStmt = connection.prepareStatement(query); prepStmt.setString(1, workflow.getWorkflowReference()); prepStmt.setString(2, workflow.getWorkflowType()); prepStmt.setString(3, workflow.getStatus().toString()); prepStmt.setTimestamp(4, cratedDateStamp); prepStmt.setString(5, workflow.getWorkflowDescription()); prepStmt.setInt(6, workflow.getTenantId()); prepStmt.setString(7, workflow.getTenantDomain()); prepStmt.setString(8, workflow.getExternalWorkflowReference()); byte[] byteData1 = workflow.getMetadata().toJSONString().getBytes("UTF-8"); byte[] byteData2 = workflow.getProperties().toJSONString().getBytes("UTF-8"); <START> <END> prepStmt.setBlob(9, new ByteArrayInputStream(byteData1) ); prepStmt.setBlob(10, new ByteArrayInputStream(byteData2) ); prepStmt.execute(); connection.commit(); } catch (SQLException | UnsupportedEncodingException e) { handleException("Error while adding Workflow : " + workflow.getExternalWorkflowReference() + " to the " + "database", e); } finally { APIMgtDBUtil.closeAllConnections(prepStmt, connection, null); } }</code><technical_language>do a null check converting toJSONString(). if properties set, NPE thrown</technical_language>

Target:
public void addWorkflowEntry(WorkflowDTO workflow) throws APIManagementException { Connection connection = null; PreparedStatement prepStmt = null; String query = SQLConstants.ADD_WORKFLOW_ENTRY_SQL; try { Timestamp cratedDateStamp = new Timestamp(workflow.getCreatedTime()); connection = APIMgtDBUtil.getConnection(); connection.setAutoCommit(false); prepStmt = connection.prepareStatement(query); prepStmt.setString(1, workflow.getWorkflowReference()); prepStmt.setString(2, workflow.getWorkflowType()); prepStmt.setString(3, workflow.getStatus().toString()); prepStmt.setTimestamp(4, cratedDateStamp); prepStmt.setString(5, workflow.getWorkflowDescription()); prepStmt.setInt(6, workflow.getTenantId()); prepStmt.setString(7, workflow.getTenantDomain()); prepStmt.setString(8, workflow.getExternalWorkflowReference()); if(workflow.getMetadata() != null) { byte[] metadataByte = workflow.getMetadata().toJSONString().getBytes("UTF-8"); prepStmt.setBlob(9, new ByteArrayInputStream(metadataByte) ); } else { prepStmt.setBlob(9, (Blob)null); } if(workflow.getProperties() != null) { byte[] propertiesByte = workflow.getProperties().toJSONString().getBytes("UTF-8"); prepStmt.setBlob(10, new ByteArrayInputStream(propertiesByte)); } else { prepStmt.setBlob(10, (Blob)null); } prepStmt.execute(); connection.commit(); } catch (SQLException | UnsupportedEncodingException e) { handleException("Error while adding Workflow : " + workflow.getExternalWorkflowReference() + " to the " + "database", e); } finally { APIMgtDBUtil.closeAllConnections(prepStmt, connection, null); } }
Source:
<code><START> public LayerBuildsAccessor( <END> int layerId, ConcurrentMap<String, CacheEntry> map, ICacheManager cacheMgr, ReadWriteLock cloneLock, NavigableSet<String> sortedKeys, LayerCacheImpl layerCache) { this.layerId = layerId; this.keyPrefix = Integer.toString(layerId) + "-"; this.keyPrefixUpperBound = Integer.toString(layerId) + "."; this.map = map; this.cacheMgr = cacheMgr; this.cloneLock = cloneLock; this.layerCacheRef = new WeakReference<LayerCacheImpl>(layerCache); int count = 0; if (sortedKeys != null) { count = sortedKeys.subSet(keyPrefix, true, keyPrefixUpperBound, false).size(); } this.evictionLatch = new LatchingCounter(count); }</code><technical_language>Restore visibility package level unit tests moved jaggr-core</technical_language>

Target:
LayerBuildsAccessor( int layerId, ConcurrentMap<String, CacheEntry> map, ICacheManager cacheMgr, ReadWriteLock cloneLock, NavigableSet<String> sortedKeys, LayerCacheImpl layerCache) { this.layerId = layerId; this.keyPrefix = Integer.toString(layerId) + "-"; this.keyPrefixUpperBound = Integer.toString(layerId) + "."; this.map = map; this.cacheMgr = cacheMgr; this.cloneLock = cloneLock; this.layerCacheRef = new WeakReference<LayerCacheImpl>(layerCache); int count = 0; if (sortedKeys != null) { count = sortedKeys.subSet(keyPrefix, true, keyPrefixUpperBound, false).size(); } this.evictionLatch = new LatchingCounter(count); }
Source:
<code>public List<Programme> next() { try { <START> return ImmutableList.copyOf(currentResponse.getNext().getResults()); <END> } catch (GlycerinException e) { throw Throwables.propagate(e); } }</code><technical_language>this return current page of programmes</technical_language>

Target:
public List<Programme> next() { try { if (currentResponse == null) { boolean gotSomething = executeRequest(); if (!gotSomething) { throw new NoSuchElementException(); } } ImmutableList<Programme> programmes = currentResponse.getResults(); if (currentResponse.hasNext()) { currentResponse = currentResponse.getNext(); } else { currentResponse = null; } return programmes; } catch (GlycerinException e) { throw Throwables.propagate(e); } }
Source:
<code>public void testFetchUnreachableBlobWithBitmap() throws Exception { RevBlob blob = remote.blob("foo"); RevCommit <START> commit = <END> remote.commit(remote.tree(remote.file("foo", blob))); generateBitmaps(server); testProtocol = generateReachableCommitUploadPackProtocol(); uri = testProtocol.register(ctx, server); assertFalse(client.hasObject(blob.toObjectId())); try (Transport tn = testProtocol.open(uri, client, "server")) { thrown.expect(TransportException.class); thrown.expectMessage(Matchers.containsString( "want " + blob.name() + " not valid")); tn.fetch(NullProgressMonitor.INSTANCE, Collections.singletonList(new RefSpec(blob.name()))); } }</code><technical_language>commit is used</technical_language>

Target:
public void testFetchUnreachableBlobWithBitmap() throws Exception { RevBlob blob = remote.blob("foo"); remote.commit(remote.tree(remote.file("foo", blob))); generateBitmaps(server); testProtocol = generateReachableCommitUploadPackProtocol(); uri = testProtocol.register(ctx, server); assertFalse(client.hasObject(blob.toObjectId())); try (Transport tn = testProtocol.open(uri, client, "server")) { thrown.expect(TransportException.class); thrown.expectMessage(Matchers.containsString( "want " + blob.name() + " not valid")); tn.fetch(NullProgressMonitor.INSTANCE, Collections.singletonList(new RefSpec(blob.name()))); } }
Source:
<code>public MetaStateEvent clone() { MetaStateEvent metaStateEvent = new MetaStateEvent(this.getStreamEventCount()); for (MetaStreamEvent metaStreamEvent: this.getMetaStreamEvents()) { metaStateEvent.addEvent(metaStreamEvent.clone()); } <START> metaStateEvent.setOutputDefinition(this.getOutputStreamDefinition()); <END> return metaStateEvent; }</code><technical_language>this.getOutputStreamDefinition() cloned</technical_language>

Target:
public MetaStateEvent clone() { MetaStateEvent metaStateEvent = new MetaStateEvent(this.getStreamEventCount()); for (MetaStreamEvent metaStreamEvent: this.getMetaStreamEvents()) { metaStateEvent.addEvent(metaStreamEvent.clone()); } if (this.getOutputStreamDefinition() != null) { metaStateEvent.setOutputDefinition(this.getOutputStreamDefinition().clone()); } return metaStateEvent; }
Source:
<code>protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.ImageDoesNotExistInDomainError) { <START> log.errorFormat("Image {0} does not exists in domain {1}. Removing disk from DB only.", <END> getDiskImage().getId(), getParameters().getStorageDomainId()); } else { throw e; } } if (getParameters().isRemoveDuringExecution() && getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { removeImageFromDB(false); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }</code><technical_language>s/exists/exist/</technical_language>

Target:
protected void executeCommand() { if (getDiskImage() != null) { try { VDSReturnValue vdsReturnValue = performImageVdsmOperation(); getReturnValue().getInternalTaskIdList().add( createTask(vdsReturnValue.getCreationInfo(), getParameters().getParentCommand(), VdcObjectType.Storage, getParameters().getStorageDomainId())); } catch (VdcBLLException e) { if (e.getErrorCode() == VdcBllErrors.ImageDoesNotExistInDomainError) { getReturnValue().setFault(new VdcFault(e, e.getVdsError().getCode())); log.errorFormat("Image {0} does not exist in domain {1}. Removing disk from DB.", getDiskImage().getId(), getParameters().getStorageDomainId()); } else { throw e; } } if (getParameters().isRemoveDuringExecution() && getParameters().getParentCommand() != VdcActionType.RemoveVmFromImportExport && getParameters().getParentCommand() != VdcActionType.RemoveVmTemplateFromImportExport) { removeImageFromDB(false); } } else { log.warn("DiskImage is null, nothing to remove"); } setSucceeded(true); }
Source:
<code>public State clone() { <START> State cloned = new State(); <END> cloned.isSynchronized = this.isSynchronized; cloned.startTime = this.startTime; cloned.endTime = this.endTime; cloned.lastUpdatedTime = this.lastUpdatedTime; cloned.numOfTrail = this.numOfTrail; cloned.numOfSuccess = this.numOfSuccess; cloned.numOfFailure = this.numOfFailure; cloned.numOfIgnored = this.numOfIgnored; cloned.isPaused = this.isPaused; cloned.rampStage = this.rampStage; cloned.lastRampDownTime = this.lastRampDownTime; cloned.cachedNumOfTrail = this.cachedNumOfTrail; cloned.cachedNumOfSuccess = this.cachedNumOfSuccess; cloned.cachedNumOfFailure = this.cachedNumOfFailure; cloned.cachedNumOfIgnored = this.cachedNumOfIgnored; cloned.isActive = true; return cloned; }</code><technical_language>constructor takes params set rest of states explicitly? This way, is demarcation of values set default</technical_language>

Target:
public State clone() { return new State(this.rampStage, this.isActive, this.isPaused, this.isSynchronized, this.startTime, this.endTime, this.lastUpdatedTime, this.lastRampDownTime, this.numOfTrail, this.numOfSuccess, this.numOfFailure, this.numOfIgnored, this.cachedNumOfTrail, this.cachedNumOfSuccess, this.cachedNumOfFailure, this.cachedNumOfIgnored); }
Source:
<code>public TaskLifecycleListener(TaskRepository taskRepository, TaskNameResolver taskNameResolver, ApplicationArguments applicationArguments, TaskExplorer taskExplorer, TaskProperties taskProperties, TaskListenerExecutorObjectFactory taskListenerExecutorObjectFactory, TaskTerminator taskTerminator) { Assert.notNull(taskRepository, "A taskRepository is required"); Assert.notNull(taskNameResolver, "A taskNameResolver is required"); Assert.notNull(taskExplorer, "A taskExplorer is required"); Assert.notNull(taskProperties, "TaskProperties is required"); Assert.notNull(taskListenerExecutorObjectFactory, "A TaskListenerExecutorObjectFactory is required"); Assert.notNull(taskTerminator, "A TaskTerminator is required"); this.taskRepository = taskRepository; this.taskNameResolver = taskNameResolver; this.applicationArguments = applicationArguments; this.taskExplorer = taskExplorer; this.taskProperties = taskProperties; this.taskListenerExecutorObjectFactory = taskListenerExecutorObjectFactory; this.taskMetrics = new TaskMetrics(); this.listenTo("HUP"); this.listenTo("INT"); <START> this.listenTo("TERM"); <END> this.taskTerminator = taskTerminator; }</code><technical_language>Enum for these</technical_language>

Target:
public TaskLifecycleListener(TaskRepository taskRepository, TaskNameResolver taskNameResolver, ApplicationArguments applicationArguments, TaskExplorer taskExplorer, TaskProperties taskProperties, TaskListenerExecutorObjectFactory taskListenerExecutorObjectFactory, TaskTerminator taskTerminator) { Assert.notNull(taskRepository, "A taskRepository is required"); Assert.notNull(taskNameResolver, "A taskNameResolver is required"); Assert.notNull(taskExplorer, "A taskExplorer is required"); Assert.notNull(taskProperties, "TaskProperties is required"); Assert.notNull(taskListenerExecutorObjectFactory, "A TaskListenerExecutorObjectFactory is required"); Assert.notNull(taskTerminator, "A TaskTerminator is required"); this.taskRepository = taskRepository; this.taskNameResolver = taskNameResolver; this.applicationArguments = applicationArguments; this.taskExplorer = taskExplorer; this.taskProperties = taskProperties; this.taskListenerExecutorObjectFactory = taskListenerExecutorObjectFactory; this.taskMetrics = new TaskMetrics(); for (SigTermSignals sigTerm : SigTermSignals.values()) { this.listenTo(sigTerm.name()); } this.taskTerminator = taskTerminator; }
Source:
<code>public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addRequiredProperty("name"); <START> description.addRequiredProperty("description"); <END> description.addRequiredProperty("identifierType"); return description; }</code><technical_language>add a ref representation? else if (rep instanceof RefRepresentation) { description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("display"); description.addSelfLink(); }</technical_language>

Target:
public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("name"); description.addProperty("description"); return description; }
Source:
<code>String getFunctionName(ITmfTrace trace, int processId, long timestamp, ITmfStateValue nameValue) { long address = Long.MAX_VALUE; String name = ""; try { if (nameValue.getType() == Type.STRING) { name = nameValue.unboxStr(); try { address = Long.parseLong(name, 16); } catch (NumberFormatException e) { } } else if (nameValue.getType() == Type.INTEGER) { name = "0x" + Integer.toUnsignedString(nameValue.unboxInt(), 16); address = nameValue.unboxInt(); } else if (nameValue.getType() == Type.LONG) { name = "0x" + Long.toUnsignedString(nameValue.unboxLong(), 16); address = nameValue.unboxLong(); } } catch (StateValueTypeException e) { } if (address != Long.MAX_VALUE) { <START> Collection<ISymbolProvider> providers = fSymbolProviders.get(trace); <END> if (!providers.isEmpty()) { for (ISymbolProvider provider : providers) { String symbol = provider.getSymbolText(processId, timestamp, address); if (symbol != null) { name = symbol; } } } } return name; }</code><technical_language>remove</technical_language>

Target:
String getFunctionName(ITmfTrace trace, int processId, long timestamp, ITmfStateValue nameValue) { long address = Long.MAX_VALUE; String name = ""; try { if (nameValue.getType() == Type.STRING) { name = nameValue.unboxStr(); try { address = Long.parseLong(name, 16); } catch (NumberFormatException e) { } } else if (nameValue.getType() == Type.INTEGER) { name = "0x" + Integer.toUnsignedString(nameValue.unboxInt(), 16); address = nameValue.unboxInt(); } else if (nameValue.getType() == Type.LONG) { name = "0x" + Long.toUnsignedString(nameValue.unboxLong(), 16); address = nameValue.unboxLong(); } } catch (StateValueTypeException e) { } if (address != Long.MAX_VALUE) { for (ISymbolProvider provider : fSymbolProviders.get(trace)) { String symbol = provider.getSymbolText(processId, timestamp, address); if (symbol != null) { name = symbol; } } } return name; }
Source:
<code>List<Long> getPositionList() { List<Long> ret = new ArrayList<Long>(); <START> ret.add((long) -1); <END> long count = 0; for (long index = 0; index < this.bitVector.size(); index++) { if (this.bitVector.getBit(index) == this.bit) { count++; } if (count >= this.blockSize) { count = 0; ret.add(index); } } return ret; }</code><technical_language>write this "-1L"</technical_language>

Target:
List<Long> getPositionList() { List<Long> ret = new ArrayList<Long>(); ret.add(-1L); long count = 0; for (long index = 0; index < this.bitVector.size(); index++) { if (this.bitVector.getBit(index) == this.bit) { count++; } if (count >= this.blockSize) { count = 0; ret.add(index); } } return ret; }
Source:
<code>public List<SurveyGroup> listByProjectFolderId(Long parentId) { <START> parentId = parentId < 0 ? null : parentId; <END> return super.listByProperty("parentId", parentId, "Long"); }</code><technical_language>a good practice override a parameter, create a local variable default parentId null</technical_language>

Target:
public List<SurveyGroup> listByProjectFolderId(Long parentId) { return super.listByProperty("parentId", parentId, "Long"); }
Source:
<code>public void run() { try { consumer.subscribe(topics); logger.info("Consumer successfully subscribed for topics {}", topics); <START> while (!closed.get()) { <END> ConsumerRecords<?, ?> records = consumer.poll(100); for (ConsumerRecord<?, ?> record : records) { handleRecord(record); } } } catch (WakeupException e) { if (!closed.get()) { throw e; } } finally { consumer.close(); } }</code><technical_language>closed.get() a bit unfriendly. adding a isClosed getter improve readiness: java while(!isClosed()) { ... }</technical_language>

Target:
public void run() { try { consumer.subscribe(topics); logger.info("Consumer successfully subscribed for topics {}", topics); while (isRunning()) { ConsumerRecords<?, ?> records = consumer.poll(100); for (ConsumerRecord<?, ?> record : records) { handleRecord(record); } } } catch (WakeupException e) { if (isRunning()) { throw e; } } finally { consumer.close(); } }
Source:
<code>public Image apply(org.jclouds.docker.domain.Image from) { checkNotNull(from, "image"); <START> String description = checkNotNull(Iterables.getFirst(from.getRepoTags(), null)); <END> OsFamily osFamily = osFamily().apply(description); String osVersion = parseVersion(description); OperatingSystem os = OperatingSystem.builder() .description(description) .family(osFamily) .version(osVersion) .is64Bit(is64bit(from)) .build(); return new ImageBuilder() .ids(from.getId()) .name(get(Splitter.on(":").split(description), 0)) .description(description) .operatingSystem(os) .status(Image.Status.AVAILABLE) .build(); }</code><technical_language>Add a message null check</technical_language>

Target:
public Image apply(org.jclouds.docker.domain.Image from) { checkNotNull(from, "image"); String description = checkNotNull(Iterables.getFirst(from.getRepoTags(), "image must have at least one repo tag")); OsFamily osFamily = osFamily().apply(description); String osVersion = parseVersion(description); OperatingSystem os = OperatingSystem.builder() .description(description) .family(osFamily) .version(osVersion) .is64Bit(is64bit(from)) .build(); return new ImageBuilder() .ids(from.getId()) .name(get(Splitter.on(":").split(description), 0)) .description(description) .operatingSystem(os) .status(Image.Status.AVAILABLE) .build(); }
Source:
<code>public IConnection update(IConnection conn) { Assert.isLegal(conn instanceof Connection); final Connection connection = (Connection) conn; Display.getDefault().syncExec(new Runnable() { @Override public void run() { connection.setAuthScheme(IAuthorizationContext.AUTHSCHEME_OAUTH); connection.setToken((String) tokenObservable.getValue()); <START> connection.setRememberToken((boolean) rememberTokenObservable.getValue()); <END> } }); return connection; }</code><technical_language>definition of rememberTokenObservable tokenObservable type parameter, casting needed all</technical_language>

Target:
public IConnection update(IConnection conn) { Assert.isLegal(conn instanceof Connection); final Connection connection = (Connection) conn; Display.getDefault().syncExec(new Runnable() { @Override public void run() { connection.setAuthScheme(IAuthorizationContext.AUTHSCHEME_OAUTH); connection.setToken(tokenObservable.getValue()); connection.setRememberToken(rememberTokenObservable.getValue()); } }); return connection; }
Source:
<code>public void testCreate_ensureMetricsAreRegistered() { SharedMetricRegistries.setDefault("test"); SslConfiguration sslConfig = SslConfiguration.of(Paths.get("src/test/resources/trustStore.jks")); ClientConfiguration conf = ClientConfigurations.of( ImmutableList.of("http://localhost"), SslSocketFactories.createSslSocketFactory(sslConfig), SslSocketFactories.createX509TrustManager(sslConfig)); OkHttpClients.create(conf, "test", OkHttpClients.class); SortedMap<String, Meter> meters = SharedMetricRegistries.getDefault().getMeters(); <START> assertThat(meters.get("com.palantir.remoting3.okhttp.OkHttpClients.response.family.informational")).isNotNull(); <END> assertThat(meters.get("com.palantir.remoting3.okhttp.OkHttpClients.response.family.successful")).isNotNull(); assertThat(meters.get("com.palantir.remoting3.okhttp.OkHttpClients.response.family.redirection")).isNotNull(); assertThat(meters.get("com.palantir.remoting3.okhttp.OkHttpClients.response.family.client-error")).isNotNull(); assertThat(meters.get("com.palantir.remoting3.okhttp.OkHttpClients.response.family.server-error")).isNotNull(); }</code><technical_language>guess is want extract out class portion of metric name blind search replace of s/remotingN/remotingN+1/g project release</technical_language>

Target:
public void testCreate_ensureMetricsAreRegistered() { SharedMetricRegistries.setDefault("test"); SslConfiguration sslConfig = SslConfiguration.of(Paths.get("src/test/resources/trustStore.jks")); ClientConfiguration conf = ClientConfigurations.of( ImmutableList.of("http://localhost"), SslSocketFactories.createSslSocketFactory(sslConfig), SslSocketFactories.createX509TrustManager(sslConfig)); OkHttpClients.create(conf, "test", String.class); SortedMap<String, Meter> meters = SharedMetricRegistries.getDefault().getMeters(); assertThat(meters.get("java.lang.String.response.family.informational")).isNotNull(); assertThat(meters.get("java.lang.String.response.family.successful")).isNotNull(); assertThat(meters.get("java.lang.String.response.family.redirection")).isNotNull(); assertThat(meters.get("java.lang.String.response.family.client-error")).isNotNull(); assertThat(meters.get("java.lang.String.response.family.server-error")).isNotNull(); }
Source:
<code>public void actionPerformed(AnActionEvent e) { BaseAction.State s = setupAction(e); List<String> lastTask = Collections.singletonList(s.getLastRanTask()); s.performTasks(lastTask); <START> s.cleanup(); <END> }</code><technical_language>want put this a try/finally block</technical_language>

Target:
public void actionPerformed(AnActionEvent e) { BaseAction.State s = setupAction(e); try { List<String> lastTask = Collections.singletonList(s.getLastRanTask()); s.performTasks(lastTask); } finally { s.cleanup(); } }
Source:
<code>public KubernetesInternalRuntime getRuntime() throws InfrastructureException { Optional<KubernetesRuntimeState> runtimeStateOpt = runtimeStatuses.get(getIdentity()); String workspaceId = getIdentity().getWorkspaceId(); if (!runtimeStateOpt.isPresent()) { return runtimeFactory.create( this, namespaceFactory.create(workspaceId), getEnvironment().getWarnings()); } KubernetesRuntimeState runtimeState = runtimeStateOpt.get(); <START> LOG.debug("Restoring runtime in workspace {}", runtimeState.getRuntimeId(), workspaceId); <END> KubernetesInternalRuntime runtime = runtimeFactory.create( this, namespaceFactory.create(workspaceId, runtimeState.getNamespace()), getEnvironment().getWarnings()); runtime.scheduleRuntimeStateChecks(); return runtime; }</code><technical_language>I guess runtimeState.getRuntimeId() logged RuntimeIdentityImpl{workspaceId='q', envName=....} I well. log LOG.debug("Restoring runtime {}:{}:{}", runtimeId.getWorkspaceId(), runtimeId.getEnvName(), runtimeId.getOwnerId());</technical_language>

Target:
public KubernetesInternalRuntime getRuntime() throws InfrastructureException { Optional<KubernetesRuntimeState> runtimeStateOpt = runtimeStatuses.get(getIdentity()); String workspaceId = getIdentity().getWorkspaceId(); if (!runtimeStateOpt.isPresent()) { return runtimeFactory.create( this, namespaceFactory.create(workspaceId), getEnvironment().getWarnings()); } KubernetesRuntimeState runtimeState = runtimeStateOpt.get(); RuntimeIdentity runtimeId = runtimeState.getRuntimeId(); LOG.debug( "Restoring runtime `{}:{}:{}`", runtimeId.getWorkspaceId(), runtimeId.getEnvName(), runtimeId.getOwnerId()); KubernetesInternalRuntime runtime = runtimeFactory.create( this, namespaceFactory.create(workspaceId, runtimeState.getNamespace()), getEnvironment().getWarnings()); runtime.scheduleRuntimeStateChecks(); return runtime; }
Source:
<code>void initializePool(Collection<DiskSpaceRequirements> requirementsList) throws StoreException { reserveFiles.rwLock.writeLock().lock(); try { <START> try { <END> Map<Long, Long> overallRequirements = getOverallRequirements(requirementsList); deleteUnneededSegments(overallRequirements); addRequiredSegments(overallRequirements); poolInitialized = true; } catch (Exception e) { throw new StoreException("Exception while initializing DiskSpaceAllocator pool", e, StoreErrorCodes.Initialization_Error); } } finally { reserveFiles.rwLock.writeLock().unlock(); } }</code><technical_language>double try is needed</technical_language>

Target:
void initializePool(Collection<DiskSpaceRequirements> requirementsList) throws StoreException { long startTime = System.currentTimeMillis(); try { if (enablePooling) { if (poolState == PoolState.NOT_INVENTORIED) { throw inventoryException; } Map<Long, Long> overallRequirements = getOverallRequirements(requirementsList); deleteExtraSegments(overallRequirements); addRequiredSegments(overallRequirements); poolState = PoolState.INITIALIZED; } else { logger.info("Disk segment pooling disabled; pool will not be initialized."); } } catch (Exception e) { metrics.diskSpaceAllocatorInitFailureCount.inc(); poolState = PoolState.NOT_INVENTORIED; throw new StoreException("Exception while initializing DiskSpaceAllocator pool", e, StoreErrorCodes.Initialization_Error); } finally { long elapsedTime = System.currentTimeMillis() - startTime; logger.info("initializePool took ms", elapsedTime); metrics.diskSpaceAllocatorStartTimeMs.update(elapsedTime); } }
Source:
<code>public void typeInUserName(String userName) { userNameField.sendKeys(userName); userNameField.sendKeys(Keys.TAB); PageObjectLogging.log("typeInUserName ", "User name field populated " <START> +userName, true, driver); <END> }</code><technical_language>PageObjectLogging.log( "typeInUserName ", +"User name field populated " +userName, true, driver ); Remember spaces + String, put trailing ")" in seperate line Remove driver PageObjectLogging (no need screenshot)</technical_language>

Target:
public void typeInUserName(String userName) { userNameField.sendKeys(userName); userNameField.sendKeys(Keys.TAB); PageObjectLogging.log( "typeInUserName ", "User name field populated " + userName, true ); }
Source:
<code>public void spanSubstitution() { StringWriter writer = new StringWriter(); HtmlLanguage language = builder.addSpanFont() .add(SpanType.DELETED) .addSubstitution(SpanType.DELETED, "strike") .document("", "") .name("Test") .create(); DocumentBuilder builder = language.createDocumentBuilder(writer); builder.beginDocument(); <START> builder.beginSpan(SpanType.SPAN, new Attributes(null, null, "text-decoration: line-through", null)); builder.characters("testSPAN"); builder.endSpan(); <END> builder.beginSpan(SpanType.DELETED, new Attributes()); builder.characters("testDELETED"); builder.endSpan(); assertEquals("<strike>testSPAN</strike><strike>testDELETED</strike>", writer.toString()); }</code><technical_language>This part unrelated this change. Is functionality tested elsewhere? If not, consider splitting a separate test, consider removing</technical_language>

Target:
public void spanSubstitution() { StringWriter writer = new StringWriter(); HtmlLanguage language = builder.addSpanFont() .add(SpanType.DELETED) .addSubstitution(SpanType.DELETED, "strike") .document("", "") .name("Test") .create(); DocumentBuilder builder = language.createDocumentBuilder(writer); builder.beginDocument(); builder.beginSpan(SpanType.DELETED, new Attributes()); builder.characters("test"); builder.endSpan(); assertEquals("<strike>test</strike>", writer.toString()); }
Source:
<code>public static void openQueue(final ArrayList<Song> queue, final int startPosition, final boolean startPlaying) { if (!tryToHandleOpenPlayingQueue(queue, startPosition, startPlaying) && musicService != null) { musicService.openQueue(queue, startPosition, startPlaying); if (!PreferenceUtil.getInstance(musicService).rememberShuffle()) <START> setShuffleMode(MusicService.SHUFFLE_MODE_NONE); <END> } }</code><technical_language>Nitpick: wrap {/}</technical_language>

Target:
public static void openQueue(final ArrayList<Song> queue, final int startPosition, final boolean startPlaying) { if (!tryToHandleOpenPlayingQueue(queue, startPosition, startPlaying) && musicService != null) { musicService.openQueue(queue, startPosition, startPlaying); if (!PreferenceUtil.getInstance(musicService).rememberShuffle()){ setShuffleMode(MusicService.SHUFFLE_MODE_NONE); } } }
Source:
<code>public SerializableTransactionManager provideTransactionManager(ServicesConfig config, @Named("kvs") KeyValueService kvs, TransactionManagers.LockAndTimestampServices lts, LockClient lockClient, TransactionService transactionService, ConflictDetectionManager conflictManager, SweepStrategyManager sweepStrategyManager, Cleaner cleaner) { return new SerializableTransactionManager( kvs, lts.timelock(), lts.lock(), transactionService, Suppliers.ofInstance(AtlasDbConstraintCheckingMode.FULL_CONSTRAINT_CHECKING_THROWS_EXCEPTIONS), conflictManager, sweepStrategyManager, cleaner, config.allowAccessToHiddenTables(), <START> () -> AtlasDbConstants.DEFAULT_TRANSACTION_LOCK_ACQUIRE_TIMEOUT_MS); <END> }</code><technical_language>note: changes if incremental API :)</technical_language>

Target:
public SerializableTransactionManager provideTransactionManager(ServicesConfig config, @Named("kvs") KeyValueService kvs, TransactionManagers.LockAndTimestampServices lts, LockClient lockClient, TransactionService transactionService, ConflictDetectionManager conflictManager, SweepStrategyManager sweepStrategyManager, Cleaner cleaner) { return new SerializableTransactionManager( kvs, lts.timelock(), lts.lock(), transactionService, Suppliers.ofInstance(AtlasDbConstraintCheckingMode.FULL_CONSTRAINT_CHECKING_THROWS_EXCEPTIONS), conflictManager, sweepStrategyManager, cleaner, config.allowAccessToHiddenTables()); }
Source:
<code>private List<ResultMap> getStatementResultMaps( String resultMap, Class<?> resultType, String statementId) { resultMap = applyCurrentNamespace(resultMap, true); List<ResultMap> resultMaps = new ArrayList<>(); if (resultMap != null) { String[] resultMapNames = resultMap.split(","); for (String resultMapName : resultMapNames) { try { resultMaps.add(configuration.getResultMap(resultMapName.trim())); } catch (IllegalArgumentException e) { <START> throw new IncompleteElementException("Could not find result map " + resultMapName + " [statementId]" + statementId, e); <END> } } } else if (resultType != null) { ResultMap inlineResultMap = new ResultMap.Builder( configuration, statementId + "-Inline", resultType, new ArrayList<>(), null).build(); resultMaps.add(inlineResultMap); } return resultMaps; }</code><technical_language>Please change error message a bit. suggestion throw new IncompleteElementException("Could find result map '" + resultMapName + "' referenced '" + statementId + "'", e);</technical_language>

Target:
private List<ResultMap> getStatementResultMaps( String resultMap, Class<?> resultType, String statementId) { resultMap = applyCurrentNamespace(resultMap, true); List<ResultMap> resultMaps = new ArrayList<>(); if (resultMap != null) { String[] resultMapNames = resultMap.split(","); for (String resultMapName : resultMapNames) { try { resultMaps.add(configuration.getResultMap(resultMapName.trim())); } catch (IllegalArgumentException e) { throw new IncompleteElementException("Could not find result map '" + resultMapName + "' referenced from '" + statementId + "'", e); } } } else if (resultType != null) { ResultMap inlineResultMap = new ResultMap.Builder( configuration, statementId + "-Inline", resultType, new ArrayList<>(), null).build(); resultMaps.add(inlineResultMap); } return resultMaps; }
Source:
<code>public int[] getRequiredTokens() { return new int[] { <START> TokenTypes.RECORD_DEF, <END> }; }</code><technical_language>reuse getAcceptableTokens()</technical_language>

Target:
public int[] getRequiredTokens() { return getAcceptableTokens(); }
Source:
<code>private void verifyUsages(String componentKey, int line, int offset, TextRange... trs) { Collection<TextRange> textRanges = context.referencesForSymbolAt(componentKey, line, offset); <START> if (trs.length == 0) { <END> assertThat(textRanges).isEmpty(); } else { assertThat(textRanges).containsExactly(trs); } }</code><technical_language>need condition</technical_language>

Target:
private void verifyUsages(String componentKey, int line, int offset, TextRange... trs) { Collection<TextRange> textRanges = context.referencesForSymbolAt(componentKey, line, offset); assertThat(textRanges).containsExactly(trs); }
Source:
<code>protected boolean canDoAction() { <START> earlyUpdateVmDynamicRunOnce(); <END> if (!super.canDoAction()) { return false; } if (getParameters().getSysPrepUserName() == null ^ getParameters().getSysPrepPassword() == null) { return failCanDoAction(VdcBllMessages.VM_CANNOT_RUN_ONCE_WITH_ILLEGAL_SYSPREP_PARAM); } if (getParameters().getVmInit() != null) { if (!OsRepositoryImpl.INSTANCE.isWindows(getVm().getOs()) && !FeatureSupported.cloudInit(getVm().getVdsGroupCompatibilityVersion())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLOUD_INIT_IS_NOT_SUPPORTED); } if (getParameters().getVmInit().isPasswordAlreadyStored()) { VmBase temp = new VmBase(); temp.setId(getParameters().getVmId()); VmHandler.updateVmInitFromDB(temp, false); getParameters().getVmInit().setRootPassword(temp.getVmInit().getRootPassword()); } } return true; }</code><technical_language>please move ctor</technical_language>

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getParameters().getSysPrepUserName() == null ^ getParameters().getSysPrepPassword() == null) { return failCanDoAction(VdcBllMessages.VM_CANNOT_RUN_ONCE_WITH_ILLEGAL_SYSPREP_PARAM); } if (getParameters().getVmInit() != null) { if (!OsRepositoryImpl.INSTANCE.isWindows(getVm().getOs()) && !FeatureSupported.cloudInit(getVm().getVdsGroupCompatibilityVersion())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLOUD_INIT_IS_NOT_SUPPORTED); } if (getParameters().getVmInit().isPasswordAlreadyStored()) { VmBase temp = new VmBase(); temp.setId(getParameters().getVmId()); VmHandler.updateVmInitFromDB(temp, false); getParameters().getVmInit().setRootPassword(temp.getVmInit().getRootPassword()); } } return true; }
Source:
<code><START> public static <T> T decodeAvroSpecificRecord(Class<T> clazz, byte[] bytes, T reuse) throws IOException { <END> DatumReader<T> reader = new SpecificDatumReader<>(clazz); Decoder decoder = DecoderFactory.defaultFactory().createBinaryDecoder(bytes, null); return reader.read(reuse, decoder); }</code><technical_language>Do need this method anymore, static <T extends SpecificRecord> T decodeAvroSpecificRecord(Schema schema, byte[] bytes, T reuse)</technical_language>

Target:
public static <T extends SpecificRecord> T decodeAvroSpecificRecord(Class<T> clazz, byte[] bytes, T reuse) throws IOException { SpecificDatumReader<T> reader = new SpecificDatumReader<>(clazz); Decoder decoder = DecoderFactory.defaultFactory().createBinaryDecoder(bytes, null); return reader.read(reuse, decoder); }