auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void endElement(String uri, String localName, String qName) throws SAXException { int l = isHeader(qName); int <START> pl = <END> l - 1; if (l > 0 && l < 7) { recording = false; NavPoint np = createNavPoint(buffer.toString()); if (l > 1) { NavPoint parent = headers[pl - 1]; while (parent == null && pl > 1) { pl = pl - 1; parent = headers[pl - 1]; } if (parent == null) { ncx.getNavMap().getNavPoints().add(np); headers[0] = np; } else { parent.getNavPoints().add(np); headers[pl] = np; } } else { ncx.getNavMap().getNavPoints().add(np); headers[0] = np; } buffer.setLength(0); } }</code><technical_language>variable names pretty cryptic. Consider giving names meaningful</technical_language>

Target:
public void endElement(String uri, String localName, String qName) throws SAXException { int currentLevel = isHeader(qName); int parentLevel = currentLevel - 1; if (currentLevel > 0 && currentLevel < 7) { recording = false; NavPoint navPoint = createNavPoint(buffer.toString()); if (currentLevel > 1) { NavPoint parent = headers[parentLevel - 1]; while (parent == null && parentLevel > 1) { parentLevel = parentLevel - 1; parent = headers[parentLevel - 1]; } if (parent == null) { ncx.getNavMap().getNavPoints().add(navPoint); headers[0] = navPoint; } else { parent.getNavPoints().add(navPoint); headers[parentLevel] = navPoint; } } else { ncx.getNavMap().getNavPoints().add(navPoint); headers[0] = navPoint; } buffer.setLength(0); } }
Source:
<code>public void detectsPullRequest() throws Exception { final Issue issue = Mockito.mock(Issue.class); Mockito.doReturn( Json.createObjectBuilder().add( "pull_request", Json.createObjectBuilder().add( "html_url", "<LINK_0>" ) ).build() ).when(issue).json(); final Pulls pulls = Mockito.mock(Pulls.class); final Repo repo = Mockito.mock(Repo.class); final Pull pull = Mockito.mock(Pull.class); Mockito.doReturn(repo).when(issue).repo(); Mockito.doReturn(pulls).when(repo).pulls(); <START> Mockito.when(pulls.get(Mockito.eq(1))).thenReturn(pull); <END> MatcherAssert.assertThat( new Issue.Smart(issue).isPull(), Matchers.is(true) ); new Issue.Smart(issue).pull(); Mockito.verify(pulls).get(1); }</code><technical_language>Instead of constant please use, for example, Tv.THREE</technical_language>

Target:
public void detectsPullRequest() throws Exception { final Issue issue = Mockito.mock(Issue.class); Mockito.doReturn( Json.createObjectBuilder().add( "pull_request", Json.createObjectBuilder().add( "html_url", "<LINK_1>" ) ).build() ).when(issue).json(); final Pulls pulls = Mockito.mock(Pulls.class); final Repo repo = Mockito.mock(Repo.class); final Pull pull = Mockito.mock(Pull.class); Mockito.doReturn(repo).when(issue).repo(); Mockito.doReturn(pulls).when(repo).pulls(); Mockito.when(pulls.get(Mockito.eq(Tv.THREE))).thenReturn(pull); MatcherAssert.assertThat( new Issue.Smart(issue).isPull(), Matchers.is(true) ); new Issue.Smart(issue).pull(); Mockito.verify(pulls).get(Tv.THREE); }
Source:
<code>public Port getPortToConnectTo() { if (sslEnabledDataCenters.contains(datacenter)) { if (ports.containsKey(PortType.SSL)) { <START> return new Port(ports.get(PortType.SSL), PortType.SSL); <END> } else { throw new IllegalArgumentException("No SSL Port exists for the data node " + hostname + ":" + port); } } return new Port(port, PortType.PLAINTEXT); }</code><technical_language>in making portNum changes in MockDataNodeId ? is work for gain</technical_language>

Target:
public Port getPortToConnectTo() { if (sslEnabledDataCenters.contains(datacenter)) { if (ports.containsKey(PortType.SSL)) { return ports.get(PortType.SSL); } else { throw new IllegalArgumentException("No SSL Port exists for the data node " + hostname + ":" + portNum); } } return new Port(portNum, PortType.PLAINTEXT); }
Source:
<code>protected void confirmLargeMessage(final LargeServerMessage largeServerMessage) { if (largeServerMessage.getPendingRecordID() >= 0) { try { confirmPendingLargeMessage(largeServerMessage.getPendingRecordID()); largeServerMessage.setPendingRecordID(LargeServerMessage.NO_PENDING_ID); } catch (Exception e) { <START> ActiveMQServerLogger.LOGGER.unableToConfirmLargeMessage(e); <END> } } }</code><technical_language>I log warn here.. need for a special ID</technical_language>

Target:
protected void confirmLargeMessage(final LargeServerMessage largeServerMessage) { if (largeServerMessage.getPendingRecordID() >= 0) { try { confirmPendingLargeMessage(largeServerMessage.getPendingRecordID()); largeServerMessage.setPendingRecordID(LargeServerMessage.NO_PENDING_ID); } catch (Exception e) { ActiveMQServerLogger.LOGGER.warn(e.getMessage(), e); } } }
Source:
<code>private void maintainAllCheckIntegrity() { Set<Object> parents = new HashSet<>(); ITreeContentProvider contentProvider = (ITreeContentProvider) getCheckboxTreeViewer().getContentProvider(); for (Object checkedElement : getCheckedElements()) { Object parentElem = contentProvider.getParent(checkedElement); if (parentElem != null) { parents.add(parentElem); } } HashSet<Object> parentsCopy = new HashSet<>(parents); for (Object element : parentsCopy) { Object parentElem = contentProvider.getParent(element); if (parentElem != null) { parents.add(parentElem); parents.removeAll(Arrays.asList(contentProvider.getChildren(parentElem))); } } for (Object element : parents) { <START> getCheckboxTreeViewer().setChecked(parent, true); <END> maintainCheckIntegrity(element); } }</code><technical_language>element? parent is a Composite this line exception</technical_language>

Target:
private void maintainAllCheckIntegrity() { Set<Object> checked = new HashSet<>(); for (Object checkedElement : getCheckedElements()) { maintainCheckIntegrity(checkedElement, checked); } }
Source:
<code>public void invoke(ExtMap input, ExtMap output) { try { Object command = input.get(Base.InvokeKeys.COMMAND); if (command.equals(Base.InvokeCommands.LOAD)) { doLoad(input, output); <START> } else <END> if (command.equals(Base.InvokeCommands.INITIALIZE)) { doInit(input, output); } else if (command.equals(Authz.InvokeCommands.QUERY_OPEN)) { doQueryOpen(input, output); } else if (command.equals(Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD)) { doFetchPrincipalRecord(input, output); } else if (command.equals(Authz.InvokeCommands.QUERY_EXECUTE)) { doQueryExecute(input, output); } else if (command.equals(Authz.InvokeCommands.QUERY_CLOSE)) { } else { output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.UNSUPPORTED); } output.putIfAbsent(Base.InvokeKeys.RESULT, Base.InvokeResult.SUCCESS); } catch (Exception ex) { output.mput(Base.InvokeKeys.RESULT, Base.InvokeResult.FAILED). mput(Base.InvokeKeys.MESSAGE, ex.getMessage()); } }</code><technical_language>new line</technical_language>

Target:
public void invoke(ExtMap input, ExtMap output) { try { Object command = input.get(Base.InvokeKeys.COMMAND); if (command.equals(Base.InvokeCommands.LOAD)) { doLoad(input, output); } else if (command.equals(Authz.InvokeCommands.QUERY_OPEN)) { doQueryOpen(input, output); } else if (command.equals(Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD)) { doFetchPrincipalRecord(input, output); } else if (command.equals(Authz.InvokeCommands.QUERY_EXECUTE)) { doQueryExecute(input, output); } else if (command.equals(Authz.InvokeCommands.QUERY_CLOSE)) { } else { output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.UNSUPPORTED); } output.putIfAbsent(Base.InvokeKeys.RESULT, Base.InvokeResult.SUCCESS); } catch (Exception ex) { output.mput(Base.InvokeKeys.RESULT, Base.InvokeResult.FAILED). mput(Base.InvokeKeys.MESSAGE, ex.getMessage()); } }
Source:
<code>public Query createNamedQuery(String name) { OgmSessionFactory sessionFactory = (OgmSessionFactory) factory.getSessionFactory(); <START> NamedSQLQueryDefinition noSQLQuery = sessionFactory.getNamedSQLQuery( name ); <END> String sqlQueryString = noSQLQuery.getQueryString(); SQLQuery noSqlQuery = ( (Session) getDelegate() ).createSQLQuery( sqlQueryString ); if ( noSQLQuery.getQueryReturns().length == 1 ) { NativeSQLQueryRootReturn rootReturn = (NativeSQLQueryRootReturn) noSQLQuery.getQueryReturns()[0]; noSqlQuery.addEntity( "alias1", rootReturn.getReturnEntityName(), LockMode.READ ); } return new OgmNativeQuery( noSqlQuery, hibernateEm ); }</code><technical_language>this work for named JP-QL queries, too? docs, createNamedQuery() create both, native JP-QL queries</technical_language>

Target:
public Query createNamedQuery(String name) { OgmSessionFactory sessionFactory = (OgmSessionFactory) factory.getSessionFactory(); NamedQueryDefinition queryDefinition = sessionFactory.getNamedSQLQuery( name ); if ( queryDefinition == null ) { queryDefinition = sessionFactory.getNamedQuery( name ); if ( queryDefinition == null ) { throw new IllegalArgumentException( "Named query not found: " + name ); } else { throw new NotSupportedException( "OGM-15", "named queries are not supported yet" ); } } else { return createNativeQuery( (NamedSQLQueryDefinition) queryDefinition ); } }
Source:
<code>protected String toString(List<T> list) { final StringBuilder stringBuilder = new StringBuilder(0); for (T element : list) { <START> final char quote = '"'; <END> stringBuilder.append(quote) .append(element) .append(quote) .append(delimiter); } final int length = stringBuilder.length(); final String result = stringBuilder.substring(0, length - 1); return result; }</code><technical_language>is fragile. knowledge quoting element is in org.spine3.base.Stringifiers.isQuotedString. Making change of places lead a hardly-traceable fail</technical_language>

Target:
protected String toString(List<T> list) { final Converter<String, String> quoteConverter = ItemQuoter.converter(); final List<String> convertedItems = newArrayList(); for (T item : list) { final String convertedItem = elementStringifier.andThen(quoteConverter) .convert(item); convertedItems.add(convertedItem); } final String result = Joiner.on(delimiter) .join(convertedItems); return result; }
Source:
<code>protected void preSave() { if (StringHelper.stringsEqualIgnoreCase((String) getUrl().getEntity(), oldUrl)) { actualSave(); } else { ArrayList<VdcQueryType> queryTypes = new ArrayList<VdcQueryType>(); ArrayList<VdcQueryParametersBase> queryParams = new ArrayList<VdcQueryParametersBase>(); final Set<VdcObjectType> providedTypes = provider.getType().getProvidedTypes(); if (providedTypes.contains(VdcObjectType.Network)) { queryTypes.add(VdcQueryType.GetAllNetworksForProvider); queryParams.add(new IdQueryParameters(provider.getId())); } startProgress(null); <START> Frontend.RunMultipleQueries(queryTypes, queryParams, new IFrontendMultipleQueryAsyncCallback() { <END> @SuppressWarnings("unchecked") @Override public void executed(FrontendMultipleQueryAsyncResult result) { stopProgress(); Iterator<VdcQueryReturnValue> i = result.getReturnValues().iterator(); if (providedTypes.contains(VdcObjectType.Network)) { providedNetworks = (Collection<Network>) (i.next()).getReturnValue(); } showConfirmation(); } }); } }</code><technical_language>If queryTypes queryParams empty query backend</technical_language>

Target:
protected void preSave() { if (!StringHelper.stringsEqualIgnoreCase((String) getUrl().getEntity(), oldUrl)) { ArrayList<VdcQueryType> queryTypes = new ArrayList<VdcQueryType>(); ArrayList<VdcQueryParametersBase> queryParams = new ArrayList<VdcQueryParametersBase>(); final Set<VdcObjectType> providedTypes = provider.getType().getProvidedTypes(); if (providedTypes.contains(VdcObjectType.Network)) { queryTypes.add(VdcQueryType.GetAllNetworksForProvider); queryParams.add(new IdQueryParameters(provider.getId())); } if (!queryTypes.isEmpty()) { startProgress(null); Frontend.RunMultipleQueries(queryTypes, queryParams, new IFrontendMultipleQueryAsyncCallback() { @SuppressWarnings("unchecked") @Override public void executed(FrontendMultipleQueryAsyncResult result) { stopProgress(); Iterator<VdcQueryReturnValue> i = result.getReturnValues().iterator(); if (providedTypes.contains(VdcObjectType.Network)) { providedNetworks = (Collection<Network>) (i.next()).getReturnValue(); } showConfirmation(); } }); return; } } actualSave(); }
Source:
<code>private static Properties loadProperties(File localeFile) throws IOException { Properties properties = new Properties(); Reader fr = null; FileInputStream fis = null; try { fis = new FileInputStream(localeFile); <START> fr = new InputStreamReader(fis, "UTF-8"); <END> properties.load(fr); } finally { if (fis != null) { fis.close(); } if (fr != null) { fr.close(); } } return properties; }</code><technical_language>Instead of InputStreamReader(InputStream in, String charsetName) InputStreamReader(InputStream in, Charset cs) while Java 7's StandardCharsets, for example: new InputStreamReader(fis, StandardCharsets.UTF_8) This change retroactively applied Java code references "UTF-8" charset string, too</technical_language>

Target:
private static Properties loadProperties(File localeFile) throws IOException { Properties properties = new Properties(); Reader fr = null; FileInputStream fis = null; try { fis = new FileInputStream(localeFile); fr = new InputStreamReader(fis, StandardCharsets.UTF_8); properties.load(fr); } finally { if (fis != null) { fis.close(); } if (fr != null) { fr.close(); } } return properties; }
Source:
<code>public void setVariable(final String identifier, final String content, final String description) { if (identifier == null) throw new RuntimeException("identifier must not be null"); <START> if (identifier.isEmpty()) <END> throw new RuntimeException("identifier must not be empty"); if (content == null) throw new RuntimeException("content must not be null"); Variable variable = getVariable(identifier); if (variable != null) { variable.setContent(content); if (description != null) variable.setDescription(description); fDirty = true; return; } this.addVariable(identifier, content, description); }</code><technical_language>remove, needed</technical_language>

Target:
public void setVariable(final String identifier, final String content, final String description) { Variable variable = getVariable(identifier); if (variable != null) { variable.setContent(content); variable.setDescription(description); fDirty = true; return; } this.addVariable(identifier, content, description); }
Source:
<code><START> public void showDialogForVideoChargesAlert(@NonNull DialerCall call) { <END> if (call.hasProperty(Details.PROPERTY_WIFI)) { return; } if (didShowVideoChargesAlertDialog) { LogUtil.i( "InCallActivity.showDialogForVideoChargesAlert", "Video charges alert dialog had been displayed."); return; } LogUtil.enterBlock("InCallActivity.showDialogForVideoChargesAlert"); if (!VideoChargesAlertDialogFragment.shouldShow(this, call)) { LogUtil.i( "InCallActivity.showDialogForVideoChargesAlert", "VideoChargesAlertDialogFragment.shouldShow returned false"); didShowVideoChargesAlertDialog = false; return; } VideoChargesAlertDialogFragment fragment = VideoChargesAlertDialogFragment.newInstance( call.getId(), videoChargesAlertCallback); fragment.show(getSupportFragmentManager(), Tags.VIDEO_CHARGES_ALERT); didShowVideoChargesAlertDialog = true; }</code><technical_language>I prefer move this VideoCallPresenter call VideoCallPresenter#onVideoCallScreenUiReady. This logic belongs video call remove need of saved instance states of didShowVideoChargesAlertDialog this way</technical_language>

Target:
public void showDialogForVideoChargesAlert(@NonNull DialerCall call) { if (call.hasProperty(Details.PROPERTY_WIFI)) { return; } if (didShowVideoChargesAlertDialog) { LogUtil.i( "InCallActivity.showDialogForVideoChargesAlert", "Video charges alert dialog had been displayed."); return; } LogUtil.enterBlock("InCallActivity.showDialogForVideoChargesAlert"); if (!VideoChargesAlertDialogFragment.shouldShow(this, call)) { LogUtil.i( "InCallActivity.showDialogForVideoChargesAlert", "VideoChargesAlertDialogFragment.shouldShow returned false"); didShowVideoChargesAlertDialog = false; return; } VideoChargesAlertDialogFragment fragment = VideoChargesAlertDialogFragment.newInstance( call.getId(), null); fragment.show(getSupportFragmentManager(), Tags.VIDEO_CHARGES_ALERT); didShowVideoChargesAlertDialog = true; }
Source:
<code>public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { LayoutInflater vi; vi = LayoutInflater.from(getContext()); v = vi.inflate(R.layout.dialog_a1c_item, parent, false); } A1cEstimate p = getItem(position); if (p != null) { TextView value = v.findViewById(R.id.dialog_a1c_item_value); TextView month = v.findViewById(R.id.dialog_a1c_item_month); TextView glucoseAverage = v.findViewById(R.id.dialog_a1c_item_glucose_value); if (value != null) { <START> if ("percentage".equals(databaseHandler.getUser(1).getPreferred_unit_a1c())) { <END> String stringValue = p.getValue() + " %"; value.setText(stringValue); } else { String stringValue = GlucosioConverter.a1cNgspToIfcc(p.getValue()) + " mmol/mol"; value.setText(stringValue); } } if (month != null) { month.setText(p.getMonth()); } if (glucoseAverage != null) { if (DomainConstants.MG_D_L.equals(databaseHandler.getUser(1).getPreferred_unit())) { glucoseAverage.setText(getContext().getString(R.string.mg_dL_value, p.getGlucoseAverage())); } else { double mmol = GlucosioConverter.glucoseToMgDl(Double.parseDouble(p.getGlucoseAverage())); String reading = numberFormat.format(mmol); glucoseAverage.setText(getContext().getString(R.string.mmol_L_value, reading)); } } } return v; }</code><technical_language>app supports multiple users? If need parameter? Also, create a default method parameter internally call getUser(1) called getDefaultUser()</technical_language>

Target:
public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; if (v == null) { LayoutInflater vi; vi = LayoutInflater.from(getContext()); v = vi.inflate(R.layout.dialog_a1c_item, parent, false); } A1cEstimate p = getItem(position); if (p != null) { TextView value = v.findViewById(R.id.dialog_a1c_item_value); TextView month = v.findViewById(R.id.dialog_a1c_item_month); TextView glucoseAverage = v.findViewById(R.id.dialog_a1c_item_glucose_value); if (value != null) { if ("percentage".equals(databaseHandler.getUser(1).getPreferred_unit_a1c())) { String stringValue = p.getValue() + " %"; value.setText(stringValue); } else { String stringValue = GlucosioConverter.a1cNgspToIfcc(p.getValue()) + " mmol/mol"; value.setText(stringValue); } } if (month != null) { month.setText(p.getMonth()); } if (glucoseAverage != null) { if (Constants.Units.MG_DL.equals(databaseHandler.getUser(1).getPreferred_unit())) { glucoseAverage.setText(getContext().getString(R.string.mg_dL_value, p.getGlucoseAverage())); } else { double mmol = GlucosioConverter.glucoseToMgDl(ReadingTools.safeParseDouble(p.getGlucoseAverage())); String reading = numberFormat.format(mmol); glucoseAverage.setText(getContext().getString(R.string.mmol_L_value, reading)); } } } return v; }
Source:
<code>private void saveVmDevicesToDb() { <START> List<VmDevice> sortedVmDevices = new ArrayList<VmDevice>(); <END> sortedVmDevices.addAll(vmDeviceToSave.values()); sortVmDeviceList(sortedVmDevices); updateAllInTransaction(sortedVmDevices, getDbFacade().getVmDeviceDAO()); if (!removedDeviceIds.isEmpty()) { TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { @Override public Void runInTransaction() { getDbFacade().getVmDeviceDAO().removeAll(removedDeviceIds); return null; } }); } if (!newVmDevices.isEmpty()) { TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { @Override public Void runInTransaction() { getDbFacade().getVmDeviceDAO().saveAll(newVmDevices); return null; } }); } }</code><technical_language>a comparator sort devices if get devices DB get sorted wish ??</technical_language>

Target:
private void saveVmDevicesToDb() { updateAllInTransaction(vmDeviceToSave.values(), getDbFacade().getVmDeviceDAO()); if (!removedDeviceIds.isEmpty()) { TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { @Override public Void runInTransaction() { getDbFacade().getVmDeviceDAO().removeAll(removedDeviceIds); return null; } }); } if (!newVmDevices.isEmpty()) { TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { @Override public Void runInTransaction() { getDbFacade().getVmDeviceDAO().saveAll(newVmDevices); return null; } }); } }
Source:
<code>public ColumnMetadata(String name, Type type, String comment, String extraInfo, boolean hidden, Map<String, Object> properties) { if (name == null || name.isEmpty()) { throw new NullPointerException("name is null or empty"); } if (type == null) { throw new NullPointerException("type is null"); } this.name = name.toLowerCase(ENGLISH); this.type = type; this.comment = comment; this.extraInfo = extraInfo; this.hidden = hidden; <START> this.properties = (properties != null && !properties.isEmpty()) ? Collections.unmodifiableMap(new LinkedHashMap<>(properties)) : Collections.emptyMap(); <END> }</code><technical_language>Presto code base generally rejects nulls null-friendly, allow null here. Users instead pass empty collection. For example, ConnectorTableMetadata accept null properties. Nit: static import unmodifiableMap emptyMap for readability, method names self-descriptive class prefix</technical_language>

Target:
public ColumnMetadata(String name, Type type, String comment, String extraInfo, boolean hidden, Map<String, Object> properties) { if (name == null || name.isEmpty()) { throw new NullPointerException("name is null or empty"); } if (type == null) { throw new NullPointerException("type is null"); } if (properties == null) { throw new NullPointerException("properties is null"); } this.name = name.toLowerCase(ENGLISH); this.type = type; this.comment = comment; this.extraInfo = extraInfo; this.hidden = hidden; this.properties = properties.isEmpty() ? emptyMap() : unmodifiableMap(new LinkedHashMap<>(properties)); }
Source:
<code>public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException { return new StreamableOperator() { @Override public void runFinal(PortInput[] inputs, PortOutput[] outputs, ExecutionContext exec) throws Exception { RowInput in = (RowInput) inputs[0]; RowOutput out = (RowOutput) outputs[0]; final AtomicBoolean encounteredExceptions = new AtomicBoolean(false); ReadImgTableFunction<T> readImgFunction = createImgTableFunction(exec, in.getDataTableSpec(), 1); DataRow row; while ((row = in.poll()) != null) { readImgFunction.apply(row).forEachOrdered(result -> { if (result.getSecond().isPresent()) { encounteredExceptions.set(true); <START> LOGGER.warn("Encountered exception while reading image " + result.getFirst().getKey() <END> + "! Caught Exception: " + result.getSecond().get().getMessage()); LOGGER.debug(result.getSecond().get()); } try { out.push(result.getFirst()); } catch (Exception exc) { encounteredExceptions.set(true); LOGGER.warn("Couldn't push result for row " + result.getFirst().getKey()); } }); } if (encounteredExceptions.get()) { setWarningMessage("Encountered errors during execution!"); } in.close(); out.close(); readImgFunction.close(); } }; }</code><technical_language>set debug purpose. want get spammed warnings. log if want more information</technical_language>

Target:
public StreamableOperator createStreamableOperator(final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs) throws InvalidSettingsException { return new StreamableOperator() { @Override public void runFinal(PortInput[] inputs, PortOutput[] outputs, ExecutionContext exec) throws Exception { RowInput in = (RowInput) inputs[0]; RowOutput out = (RowOutput) outputs[0]; final AtomicBoolean encounteredExceptions = new AtomicBoolean(false); ReadImgTableFunction<T> readImgFunction = createImgTableFunction(exec, in.getDataTableSpec(), 1); DataRow row; while ((row = in.poll()) != null) { readImgFunction.apply(row).forEachOrdered(result -> { if (result.getSecond().isPresent()) { encounteredExceptions.set(true); LOGGER.warn("Encountered exception while reading image: " + result.getFirst().getKey() + "! view log for more info."); LOGGER.debug("Encountered exception while reading image:", result.getSecond().get()); } try { out.push(result.getFirst()); } catch (Exception exc) { encounteredExceptions.set(true); LOGGER.warn("Couldn't push row " + result.getFirst().getKey() + " into output stream."); LOGGER.debug("Encountered exception when trying to push result: ", exc); } }); } if (encounteredExceptions.get()) { setWarningMessage("Encountered errors during execution!"); } in.close(); out.close(); readImgFunction.close(); } }; }
Source:
<code>private PRPAIN201306UV02 checkPolicyFormatResponse(PRPAIN201305UV02 request, AssertionType assertion, PRPAIN201306UV02 response) { PRPAIN201306UV02 formatResponse = response; if (checkPolicy(formatResponse, assertion)) { storeMapping(request); try { II requestPatId = providedPatientId(request); if (requestPatId != null) { createPatientCorrelation(formatResponse, assertion, request); } } catch (Exception ex) { <START> LOG.error(ex.getMessage(), ex); <END> } formatResponse = addAuthorOrPerformer(formatResponse); } else { LOG.warn("Policy Check Failed"); formatResponse = addPolicyDenyReasonOf(formatResponse); } return formatResponse; }</code><technical_language>parameterized logging</technical_language>

Target:
private PRPAIN201306UV02 checkPolicyFormatResponse(PRPAIN201305UV02 request, AssertionType assertion, PRPAIN201306UV02 response) { PRPAIN201306UV02 formatResponse = response; if (checkPolicy(formatResponse, assertion)) { storeMapping(request); try { II requestPatId = providedPatientId(request); if (requestPatId != null) { createPatientCorrelation(formatResponse, assertion, request); } } catch (Exception ex) { LOG.error("Exception found in policy check: ", ex.getMessage(), ex); } formatResponse = addAuthorOrPerformer(formatResponse); } else { LOG.warn("Policy Check Failed"); formatResponse = addPolicyDenyReasonOf(formatResponse); } return formatResponse; }
Source:
<code>public void channelRead(ChannelHandlerContext ctx, Object obj) throws Exception { logger.trace("Reading on channel {}", ctx.channel()); <START> if (obj instanceof HttpRequest && ((HttpRequest) obj).getUri().equals(healthCheckUri)) { <END> logger.trace("Handling health check request while in state " + healthCheckService.isServiceUp()); HttpRequest request = (HttpRequest) obj; FullHttpResponse response; if (healthCheckService.isServiceUp()) { response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.wrappedBuffer(goodBytes)); HttpHeaders.setKeepAlive(response, HttpHeaders.isKeepAlive(request)); HttpHeaders.setContentLength(response, goodBytes.length); } else { response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.SERVICE_UNAVAILABLE, Unpooled.wrappedBuffer(badBytes)); HttpHeaders.setKeepAlive(response, false); HttpHeaders.setContentLength(response, badBytes.length); } ReferenceCountUtil.release(obj); ctx.writeAndFlush(response); } else { super.channelRead(ctx, obj); } }</code><technical_language>is a bug here. respond soon get HttpRequest. receive a LastHttpContent this. content sense handlers above. surprised tests caught this</technical_language>

Target:
public void channelRead(ChannelHandlerContext ctx, Object obj) throws Exception { logger.trace("Reading on channel {}", ctx.channel()); boolean forwardObj = false; if (obj instanceof HttpRequest) { if(request == null && ((HttpRequest) obj).getUri().equals(healthCheckUri)) { logger.trace("Handling health check request while in state " + restServerState.isServiceUp()); request = (HttpRequest) obj; if (restServerState.isServiceUp()) { response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.wrappedBuffer(goodBytes)); HttpHeaders.setKeepAlive(response, HttpHeaders.isKeepAlive(request)); HttpHeaders.setContentLength(response, goodBytes.length); } else { response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.SERVICE_UNAVAILABLE, Unpooled.wrappedBuffer(badBytes)); HttpHeaders.setKeepAlive(response, false); HttpHeaders.setContentLength(response, badBytes.length); } } else { forwardObj = true; } } if (obj instanceof LastHttpContent) { if (response != null) { ChannelFuture future = ctx.writeAndFlush(response); if(!HttpHeaders.isKeepAlive(response)){ future.addListener(ChannelFutureListener.CLOSE); } request = null; } else { forwardObj = true; } } else { forwardObj = true; } if (forwardObj) { super.channelRead(ctx, obj); } else{ ReferenceCountUtil.release(obj); } }
Source:
<code>public void testGetEntityNameByIdAndTypeForCpuProfile() { CpuProfile cpuProfile = dbFacade.getCpuProfileDao().get(FixturesTool.CPU_PROFILE_1); assertNotNull(cpuProfile); String name = cpuProfile.getName(); <START> assertTrue(name.equals(dbFacade.getEntityNameByIdAndType(FixturesTool.CPU_PROFILE_1, VdcObjectType.CpuProfile))); <END> }</code><technical_language>replace assertEquals</technical_language>

Target:
public void testGetEntityNameByIdAndTypeForCpuProfile() { CpuProfile cpuProfile = dbFacade.getCpuProfileDao().get(FixturesTool.CPU_PROFILE_1); assertNotNull(cpuProfile); String name = cpuProfile.getName(); assertEquals(name, dbFacade.getEntityNameByIdAndType(FixturesTool.CPU_PROFILE_1, VdcObjectType.CpuProfile)); }
Source:
<code>public void delete(int itemDataId) { String query = " delete from " + getDomainClassName() + " where itemDataId =:itemDataId "; <START> org.hibernate.Query q = getCurrentSession().createQuery(query); <END> q.setInteger("itemDataId", itemDataId); q.executeUpdate(); }</code><technical_language>remove "org.hibernate" done below</technical_language>

Target:
public void delete(int itemDataId) { String query = " delete from " + getDomainClassName() + " where itemDataId =:itemDataId "; Query q = getCurrentSession().createQuery(query); q.setInteger("itemDataId", itemDataId); q.executeUpdate(); }
Source:
<code>private Map<Type, Object> createValueAdapter() { Map<Type, Object> valueAdapter = new HashMap<>(); <START> valueAdapter.put(Observation.ObservationValue.class, new Observation.ObservationValueSerializer()); <END> return valueAdapter; }</code><technical_language>ValueSerializer ? I need deserialize</technical_language>

Target:
private Map<Type, Object> createValueAdapter() { Map<Type, Object> valueAdapter = new HashMap<>(); valueAdapter.put(Observation.ObservationValue.class, new Observation.ObservationValueDeserializer()); return valueAdapter; }
Source:
<code>protected List<List<MetricSchemaRecord>> _fracture(List<Metric> metrics) { List<List<MetricSchemaRecord>> fracturedList = new ArrayList<>(); List<MetricSchemaRecord> records = new ArrayList<>(_bulkIndexingSize); for(Metric metric : metrics) { if(metric.getTags().isEmpty()) { MetricSchemaRecord msr = new MetricSchemaRecord(metric.getScope(), metric.getMetric()); msr.setNamespace(metric.getNamespace()); records.add(msr); if(records.size() == _bulkIndexingSize) { fracturedList.add(records); records = new ArrayList<>(_bulkIndexingSize); } continue; } String retention = metric.getMetatagsRecord()==null?null:metric.getMetatagsRecord().getMetatagValue(MetricSchemaRecord.RETENTION_DISCOVERY); Integer retentionInt = null; if (retention != null) { try { retentionInt = Integer.parseInt(retention); } catch(NumberFormatException e) { <START> _logger.warn("expect _retention_discovery_ to be a numeric value; is invalid", retention); <END> } } for(Map.Entry<String, String> entry : metric.getTags().entrySet()) { records.add(new MetricSchemaRecord(metric.getNamespace(), metric.getScope(), metric.getMetric(), entry.getKey(), entry.getValue(), retentionInt)); if(records.size() == _bulkIndexingSize) { fracturedList.add(records); records = new ArrayList<>(_bulkIndexingSize); } } } if(!records.isEmpty()) { fracturedList.add(records); } return fracturedList; }</code><technical_language>this flood logs bring argus down, bad actor sending invalid retention value, I change this debug</technical_language>

Target:
protected List<List<MetricSchemaRecord>> _fracture(List<Metric> metrics) { List<List<MetricSchemaRecord>> fracturedList = new ArrayList<>(); List<MetricSchemaRecord> records = new ArrayList<>(_bulkIndexingSize); for(Metric metric : metrics) { if(metric.getTags().isEmpty()) { MetricSchemaRecord msr = new MetricSchemaRecord(metric.getScope(), metric.getMetric()); msr.setNamespace(metric.getNamespace()); records.add(msr); if(records.size() == _bulkIndexingSize) { fracturedList.add(records); records = new ArrayList<>(_bulkIndexingSize); } continue; } String retention = metric.getMetatagsRecord()==null?null:metric.getMetatagsRecord().getMetatagValue(MetricSchemaRecord.RETENTION_DISCOVERY); Integer retentionInt = null; if (retention != null) { try { retentionInt = Integer.parseInt(retention); } catch(NumberFormatException e) { _logger.debug("expect _retention_discovery_ to be a numeric value; is invalid", retention); } } for(Map.Entry<String, String> entry : metric.getTags().entrySet()) { records.add(new MetricSchemaRecord(metric.getNamespace(), metric.getScope(), metric.getMetric(), entry.getKey(), entry.getValue(), retentionInt)); if(records.size() == _bulkIndexingSize) { fracturedList.add(records); records = new ArrayList<>(_bulkIndexingSize); } } } if(!records.isEmpty()) { fracturedList.add(records); } return fracturedList; }
Source:
<code>private static String convert (String className) { if (className.startsWith("[")) { int dimensions = 0; char c = className.charAt(0); <START> StringBuilder suffix = new StringBuilder(); <END> while (c == '[') { dimensions++; suffix.append("[]"); c = className.charAt(dimensions); } char t = className.charAt(dimensions); switch (t) { case 'Z': return "boolean" + suffix; case 'B': return "byte" + suffix; case 'C': return "char" + suffix; case 'L': return className.substring(dimensions + 1, className.length() - 1).replace('$', '.') + suffix; case 'D': return "double" + suffix; case 'F': return "float" + suffix; case 'I': return "int" + suffix; case 'J': return "long" + suffix; case 'S': return "short" + suffix; default: throw new IllegalArgumentException("Couldn't transform '" + className + "' to qualified source name"); } } else { return className.replace('$', '.'); } }</code><technical_language>is some concatenation this (right GitHub's code fold) optimized. it, this optimization slightly hurt, of input classNames arrays (especially multi-dimension arrays)</technical_language>

Target:
private static String convert (String className) { if (className.startsWith("[")) { int dimensions = 0; char c = className.charAt(0); StringBuilder stringBuilder = new StringBuilder(); while (c == '[') { dimensions++; c = className.charAt(dimensions); } char t = className.charAt(dimensions); switch (t) { case 'Z': stringBuilder.append("boolean"); break; case 'B': stringBuilder.append("byte"); break; case 'C': stringBuilder.append("char"); break; case 'L': stringBuilder.append(className.substring(dimensions + 1, className.length() - 1).replace('$', '.')); break; case 'D': stringBuilder.append("double"); break; case 'F': stringBuilder.append("float"); break; case 'I': stringBuilder.append("int"); break; case 'J': stringBuilder.append("long"); break; case 'S': stringBuilder.append("short"); break; default: throw new IllegalArgumentException("Couldn't transform '" + className + "' to qualified source name"); } for(int i=0;i<dimensions;i++){ stringBuilder.append("[]"); } return stringBuilder.toString(); } else { return className.replace('$', '.'); } }
Source:
<code>public void testTextFiles() throws IOException { Configuration conf = new Configuration(); setConf(conf); conf.set("test.partfile.dir", partFileTextDir.toString()); conf.set(GrillConfConstants.QUERY_OUTPUT_FILE_EXTN, ".txt"); <START> conf.set(GrillConfConstants.QUERY_OUTPUT_HEADER, "firstcolformat(secondcol,2)thirdcolfourthcolfifthcolsixthcolseventhcol"); <END> testFormatter(conf, "UTF8", GrillConfConstants.GRILL_RESULT_SET_PARENT_DIR_DEFAULT, ".txt",getMockedResultSetWithoutComma()); Assert.assertEquals(readFinalOutputFile( new Path(formatter.getFinalOutputPath()), conf, "UTF-8"), getExpectedTextRows()); }</code><technical_language>Is this change correct? I header is set format(secondcol,2)</technical_language>

Target:
public void testTextFiles() throws IOException { Configuration conf = new Configuration(); setConf(conf); conf.set("test.partfile.dir", partFileTextDir.toString()); conf.set(GrillConfConstants.QUERY_OUTPUT_FILE_EXTN, ".txt"); conf.set(GrillConfConstants.QUERY_OUTPUT_HEADER, "firstcolsecondcolthirdcolfourthcolfifthcolsixthcolseventhcol"); testFormatter(conf, "UTF8", GrillConfConstants.GRILL_RESULT_SET_PARENT_DIR_DEFAULT, ".txt",getMockedResultSetWithoutComma()); Assert.assertEquals(readFinalOutputFile( new Path(formatter.getFinalOutputPath()), conf, "UTF-8"), getExpectedTextRowsWithoutComma()); }
Source:
<code>private String getSpecifiedSection(ExecutionHandlerContext context, <START> List<ByteArrayWrapper> commands) { <END> String result = ""; String section = commands.get(1).toString().toLowerCase(); switch (section) { case "server": result = getServerSection(context); break; case "cluster": result = getClusterSection(); break; case "persistence": result = getPersistenceSection(); break; case "default": case "all": result = getAllSections(context); break; } return result; }</code><technical_language>I code (using default switch) is better</technical_language>

Target:
private String getSpecifiedSection(ExecutionHandlerContext context, List<ByteArrayWrapper> commands) { String result; String section = commands.get(1).toString().toLowerCase(); switch (section) { case "server": result = getServerSection(context); break; case "cluster": result = getClusterSection(); break; case "persistence": result = getPersistenceSection(); break; case "default": case "all": result = getAllSections(context); break; default: result = ""; break; } return result; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_contact_us); initViewFields(); send.setOnClickListener(v -> { <START> String name_str = name.getText().toString(); <END> String subject_str = subject.getText().toString(); String msg_str = message.getText().toString(); Intent sendMail = new Intent(Intent.ACTION_SEND); sendMail.putExtra(Intent.EXTRA_EMAIL, new String[]{"helpdesk@openmrs.com"}); sendMail.putExtra(Intent.EXTRA_SUBJECT, name_str + " wants to get in touch."); sendMail.putExtra(Intent.EXTRA_TEXT, "Regarding: " + subject_str + "\n" + msg_str); sendMail.setType("message/rfc822"); startActivity(Intent.createChooser(sendMail, "Choose an Email Client")); }); }</code><technical_language>3 variables named camelCase</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_contact_us); initViewFields(); sendButton.setOnClickListener(view -> { String name_str = nameTIET.getText().toString(); String subject_str = subjectTIET.getText().toString(); String msg_str = messageTIET.getText().toString(); Intent sendMail = new Intent(Intent.ACTION_SEND); sendMail.putExtra(Intent.EXTRA_EMAIL, new String[]{getString(R.string.contact_us_helpdesk)}); sendMail.putExtra(Intent.EXTRA_SUBJECT, name_str + getString(R.string.contact_us_get_in_touch)); sendMail.putExtra(Intent.EXTRA_TEXT, getString(R.string.contact_us_regarding) + subject_str + "\n" + msg_str); sendMail.setType(getString(R.string.contact_email_type)); startActivity(Intent.createChooser(sendMail, getString(R.string.choose_a_email_client))); }); forumButton.setOnClickListener(view -> { Uri forumUri = Uri.parse(getString(R.string.contact_forum_url)); Intent forumIntent = new Intent(Intent.ACTION_VIEW, forumUri); startActivity(forumIntent); }); ircButton.setOnClickListener(view -> { Uri ircUri = Uri.parse(getString(R.string.contact_irc_url)); Intent ircIntent = new Intent(Intent.ACTION_VIEW, ircUri); startActivity(ircIntent); }); }
Source:
<code>public Answer execute(final OvsVpcPhysicalTopologyConfigCommand command, final LibvirtComputingResource libvirtComputingResource) { try { <START> final Script scriptCommand = new Script(libvirtComputingResource.getOvsTunnelPath(), libvirtComputingResource.getTimeout().getMillis(), s_logger); <END> scriptCommand.add("configure_ovs_bridge_for_network_topology"); scriptCommand.add("--bridge", command.getBridgeName()); scriptCommand.add("--config", command.getVpcConfigInJson()); final String result = scriptCommand.execute(); if (result.equalsIgnoreCase("SUCCESS")) { return new Answer(command, true, result); } else { return new Answer(command, false, result); } } catch (final Exception e) { s_logger.warn("caught exception while updating host with latest routing polcies", e); return new Answer(command, false, e.getMessage()); } }</code><technical_language>Please consider adding overridden version of Script(String, int, Logger) constructor accepts Duration encapsulate this type conversion</technical_language>

Target:
public Answer execute(final OvsVpcPhysicalTopologyConfigCommand command, final LibvirtComputingResource libvirtComputingResource) { try { final Script scriptCommand = new Script(libvirtComputingResource.getOvsTunnelPath(), libvirtComputingResource.getTimeout(), s_logger); scriptCommand.add("configure_ovs_bridge_for_network_topology"); scriptCommand.add("--bridge", command.getBridgeName()); scriptCommand.add("--config", command.getVpcConfigInJson()); final String result = scriptCommand.execute(); if (result.equalsIgnoreCase("SUCCESS")) { return new Answer(command, true, result); } else { return new Answer(command, false, result); } } catch (final Exception e) { s_logger.warn("caught exception while updating host with latest routing polcies", e); return new Answer(command, false, e.getMessage()); } }
Source:
<code>private Properties getAssociatedDataProperties() { try (InputStream inputStream = getAssociatedDataPropertiesInputStream()) { <START> if (inputStream == null) { <END> return new Properties(); } Properties properties = new Properties(); properties.load(inputStream); return properties; } catch (IOException e) { return new Properties(); } }</code><technical_language>Alternatively... java Properties properties = new Properties(); if (inputStream != null) { properties.load(inputStream); } return properties;</technical_language>

Target:
private Properties getAssociatedDataProperties() { try (InputStream inputStream = getAssociatedDataPropertiesInputStream()) { Properties properties = new Properties(); if (inputStream != null) { properties.load(inputStream); } return properties; } catch (IOException e) { return new Properties(); } }
Source:
<code><START> public void testStaticInnerClasses() { <END> try { ReflectData.get().getSchema(Meta.class); } catch (AvroTypeException ex) { fail("Should have no exception"); } }</code><technical_language>here, love annotation, remove fail("") part. If throws exception, fail</technical_language>

Target:
public void testStaticInnerClasses() { ReflectData.get().getSchema(Meta.class); }
Source:
<code>public void testDeployRoot() throws Exception { TestApplication app = new TestApplication(); ManagedApplication ma = new ManagedApplication( app ); this.managerWrapper.getNameToManagedApplication().put( app.getName(), ma ); String targetId = this.manager.targetsMngr().createTarget( "id:tid\nprop: ok\nhandler: test" ); this.manager.targetsMngr().associateTargetWith( targetId, app, null ); <START> File dir = new File( this.manager.configurationMngr().getWorkingDirectory(), ConfigurationUtils.TARGETS + "/" + targetId ); <END> Utils.createDirectory( dir ); Utils.writeStringInto( "#!/bin/bash\necho Bonjour le monde cruel > toto.txt", new File( dir, Constants.TARGET_SCRIPT_FILE_NAME )); Assert.assertNotNull( this.manager.targetsMngr().findScriptResources(targetId) ); Assert.assertEquals( 0, this.targetResolver.instancePathToRunningStatus.size()); this.manager.instancesMngr().changeInstanceState( ma, app.getMySqlVm(), InstanceStatus.DEPLOYED_STARTED ); Assert.assertEquals( 1, this.targetResolver.instancePathToRunningStatus.size()); Assert.assertTrue( this.targetResolver.isRunning( app.getMySqlVm())); Assert.assertEquals( 1, ma.getScopedInstanceToAwaitingMessages().size()); List<Message> messages = ma.getScopedInstanceToAwaitingMessages().get( app.getMySqlVm()); Assert.assertEquals( 1, messages.size()); Message msg = messages.get( 0 ); Assert.assertEquals( MsgCmdSetScopedInstance.class, msg.getClass()); Assert.assertEquals( app.getMySqlVm(), ((MsgCmdSetScopedInstance) msg).getScopedInstance()); }</code><technical_language>A HUGE no. Do modify this test. Write a new one. This test prevents regressions</technical_language>

Target:
public void testDeployRoot() throws Exception { TestApplication app = new TestApplication(); ManagedApplication ma = new ManagedApplication( app ); this.managerWrapper.getNameToManagedApplication().put( app.getName(), ma ); String targetId = this.manager.targetsMngr().createTarget( "id:tid\nprop: ok\nhandler: test" ); this.manager.targetsMngr().associateTargetWith( targetId, app, null ); Assert.assertEquals( 0, this.targetResolver.instancePathToRunningStatus.size()); this.manager.instancesMngr().changeInstanceState( ma, app.getMySqlVm(), InstanceStatus.DEPLOYED_STARTED ); Assert.assertEquals( 1, this.targetResolver.instancePathToRunningStatus.size()); Assert.assertTrue( this.targetResolver.isRunning( app.getMySqlVm())); Assert.assertEquals( 1, ma.getScopedInstanceToAwaitingMessages().size()); List<Message> messages = ma.getScopedInstanceToAwaitingMessages().get( app.getMySqlVm()); Assert.assertEquals( 1, messages.size()); Message msg = messages.get( 0 ); Assert.assertEquals( MsgCmdSetScopedInstance.class, msg.getClass()); Assert.assertEquals( app.getMySqlVm(), ((MsgCmdSetScopedInstance) msg).getScopedInstance()); }
Source:
<code>FeedbackSessionAttributes() { isOpeningEmailEnabled = true; isClosingEmailEnabled = true; isPublishedEmailEnabled = true; respondingInstructorList = new HashSet<>(); respondingStudentList = new HashSet<>(); <START> timeZone = ZoneId.of("UTC"); <END> instructions = new Text(""); }</code><technical_language>this extracted Const DEFAULT_TIME_ZONE? A similar fall is in CoursesDb</technical_language>

Target:
FeedbackSessionAttributes() { isOpeningEmailEnabled = true; isClosingEmailEnabled = true; isPublishedEmailEnabled = true; respondingInstructorList = new HashSet<>(); respondingStudentList = new HashSet<>(); timeZone = Const.DEFAULT_TIME_ZONE; instructions = new Text(""); }
Source:
<code><START> public Optional tileentityinventory$getCarrier() { <END> return Optional.of(this); }</code><technical_language>Raw type</technical_language>

Target:
public Optional<? extends TileEntityCarrier> tileentityinventory$getCarrier() { return Optional.of(this); }
Source:
<code><START> protected Exchange getExchange() { <END> if (exchange == null) { exchange = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification); } return exchange; }</code><technical_language>this method synchronized. in case called in time</technical_language>

Target:
protected synchronized Exchange getExchange() { if (exchange == null) { exchange = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification); } return exchange; }
Source:
<code>public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final IActionSource src ) { <START> if( this.hasPermission( src ) ) <END> { if( AEApi.instance().definitions().items().biometricCard().isSameAs( input.getDefinition() ) ) { if( this.canAccept( input ) ) { if( type == Actionable.SIMULATE ) { return null; } this.getStoredItems().add( input ); this.securityTile.inventoryChanged(); return null; } } } return input; }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Change this condition evaluate "false" [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final IActionSource src ) { if( this.hasPermission( src ) ) { if( AEApi.instance().definitions().items().biometricCard().isSameAs( input.createItemStack() ) ) { if( this.canAccept( input ) ) { if( type == Actionable.SIMULATE ) { return null; } this.getStoredItems().add( input ); this.securityTile.inventoryChanged(); return null; } } } return input; }