auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor) { controller.resetLineNumber(); Parameter[] parameters = node.getParameters(); String methodType = BytecodeHelper.getMethodDescriptor(node.getReturnType(), parameters); String signature = BytecodeHelper.getGenericsMethodSignature(node); int modifiers = node.getModifiers(); if (isVargs(node.getParameters())) modifiers |= Opcodes.ACC_VARARGS; MethodVisitor mv = cv.visitMethod(modifiers, node.getName(), methodType, signature, buildExceptions(node.getExceptions())); controller.setMethodVisitor(mv); visitAnnotations(node, mv); for (int i = 0; i < parameters.length; i++) { visitParameterAnnotations(parameters[i], i, mv); } <START> if (getCompileUnit().getConfig().getParameters()){ <END> for (int i = 0; i < parameters.length; i++) { mv.visitParameter(parameters[i].getName(), 0); } } if (controller.getClassNode().isAnnotationDefinition() && !node.isStaticConstructor()) { visitAnnotationDefault(node, mv); } else if (!node.isAbstract()) { Statement code = node.getCode(); mv.visitCode(); if (code instanceof BytecodeSequence && ((BytecodeSequence)code).getInstructions().size() == 1 && ((BytecodeSequence)code).getInstructions().get(0) instanceof BytecodeInstruction) { ((BytecodeInstruction)((BytecodeSequence)code).getInstructions().get(0)).visit(mv); } else { visitStdMethod(node, isConstructor, parameters, code); } mv.visitMaxs(0, 0); } mv.visitEnd(); }</code><technical_language>A minor - a space ...getParameters()) {</technical_language>

Target:
protected void visitConstructorOrMethod(MethodNode node, boolean isConstructor) { controller.resetLineNumber(); Parameter[] parameters = node.getParameters(); String methodType = BytecodeHelper.getMethodDescriptor(node.getReturnType(), parameters); String signature = BytecodeHelper.getGenericsMethodSignature(node); int modifiers = node.getModifiers(); if (isVargs(node.getParameters())) modifiers |= Opcodes.ACC_VARARGS; MethodVisitor mv = cv.visitMethod(modifiers, node.getName(), methodType, signature, buildExceptions(node.getExceptions())); controller.setMethodVisitor(mv); visitAnnotations(node, mv); for (int i = 0; i < parameters.length; i++) { visitParameterAnnotations(parameters[i], i, mv); } if (controller.getClassNode().isAnnotationDefinition() && !node.isStaticConstructor()) { visitAnnotationDefault(node, mv); } else if (!node.isAbstract()) { Statement code = node.getCode(); mv.visitCode(); if (code instanceof BytecodeSequence && ((BytecodeSequence)code).getInstructions().size() == 1 && ((BytecodeSequence)code).getInstructions().get(0) instanceof BytecodeInstruction) { ((BytecodeInstruction)((BytecodeSequence)code).getInstructions().get(0)).visit(mv); } else { visitStdMethod(node, isConstructor, parameters, code); } mv.visitMaxs(0, 0); } mv.visitEnd(); }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_playlist, container, false); unbinder = ButterKnife.bind(this, root); playListAdapter = new PlayListAdapter(); playlistListView.setAdapter(playListAdapter); playlistListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { int playlistId = playlists.get(playlistsBar.getSelectedPlaylistType()).getPlaylistId(); Player.Open action = new Player.Open(Player.Open.TYPE_PLAYLIST, playlistId, position); action.execute(hostManager.getConnection(), defaultStringActionCallback, callbackHandler); } }); playlistsBar.setOnPlaylistSelectedListener(new PlaylistsBar.OnPlaylistSelectedListener() { @Override public void onPlaylistSelected(String playlistType) { userSelectedTab = true; displayPlaylist(); PlaylistHolder playlistHolder = playlists.get(playlistType); <START> if ( playlistHolder != null) { <END> refreshPlaylist(playlistHolder.getPlaylistResult.type, playlistHolder.index, playlistHolder.top); } } @Override public void onPlaylistDeselected(String playlistType) { View v = playlistListView.getChildAt(0); int top = (v == null) ? 0 : (v.getTop() - playlistListView.getPaddingTop()); PlaylistHolder playlistHolder = playlists.get(playlistType); if (playlistHolder != null) playlistHolder.setListViewPosition(playlistListView.getFirstVisiblePosition(), top); } }); return root; }</code><technical_language>For consistency rest of code, spaces ()</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup) inflater.inflate(R.layout.fragment_playlist, container, false); unbinder = ButterKnife.bind(this, root); playListAdapter = new PlayListAdapter(); playlistListView.setAdapter(playListAdapter); playlistListView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { int playlistId = playlists.get(playlistsBar.getSelectedPlaylistType()).getPlaylistId(); Player.Open action = new Player.Open(Player.Open.TYPE_PLAYLIST, playlistId, position); action.execute(hostManager.getConnection(), defaultStringActionCallback, callbackHandler); } }); playlistsBar.setOnPlaylistSelectedListener(new PlaylistsBar.OnPlaylistSelectedListener() { @Override public void onPlaylistSelected(String playlistType) { userSelectedTab = true; displayPlaylist(); } @Override public void onPlaylistDeselected(String playlistType) { View v = playlistListView.getChildAt(0); int top = (v == null) ? 0 : (v.getTop() - playlistListView.getPaddingTop()); PlaylistHolder playlistHolder = playlists.get(playlistType); if (playlistHolder != null) playlistHolder.setListViewPosition(playlistListView.getFirstVisiblePosition(), top); } }); return root; }
Source:
<code><START> public SerialNumberPolicyWidget(EventBus eventBus) { <END> serialNumberPolicy = new EnumRadioEditor<SerialNumberPolicy>(SerialNumberPolicy.class, eventBus); serialNumberPolicy.addValueChangeHandler(this); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); ViewIdHandler.idHandler.generateAndSetIds(this); serialNumberPolicy.asWidget().addStyleName(style.serialNumberPolicy()); }</code><technical_language>Please consider moving constructor field declarations (i.e. @UiField stuff) for readability</technical_language>

Target:
public SerialNumberPolicyWidget(EventBus eventBus) { serialNumberPolicy = new EnumRadioEditor<SerialNumberPolicy>(SerialNumberPolicy.class, eventBus); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); ViewIdHandler.idHandler.generateAndSetIds(this); serialNumberPolicy.asWidget().addStyleName(style.serialNumberPolicy()); }
Source:
<code>public final Maybe<T> defaultIfEmpty(T defaultItem) { ObjectHelper.requireNonNull(defaultItem, "item is null"); <START> return switchIfEmpty(Single.just(defaultItem)); <END> }</code><technical_language>this changed, original work?</technical_language>

Target:
public final Maybe<T> defaultIfEmpty(T defaultItem) { ObjectHelper.requireNonNull(defaultItem, "item is null"); return switchIfEmpty(just(defaultItem)); }
Source:
<code>protected void computeWithClause(List<SqlHandler<?>> handlers) throws OseeCoreException { if (OptionsUtil.isHistorical(getOptions())) { if (queryType != QueryType.COUNT) { <START> for (SqlHandler<?> handler : handlers) { <END> if (handler instanceof ArtifactGuidSqlHandler) { ArtifactGuidSqlHandler theHandler = (ArtifactGuidSqlHandler) handler; theHandler.addWith(this, branchId); } else if (handler instanceof AttributeTypeExistsSqlHandler) { AttributeTypeExistsSqlHandler theHandler = (AttributeTypeExistsSqlHandler) handler; theHandler.addWith(this, branchId); } else if (handler instanceof RelatedToSqlHandler) { RelatedToSqlHandler theHandler = (RelatedToSqlHandler) handler; theHandler.addWith(this, branchId); } } } } super.computeWithClause(handlers); }</code><technical_language>writer specific handler implementations. If a reason addWithTables insufficient for handlers</technical_language>

Target:
protected void computeWithClause(List<SqlHandler<?>> handlers) throws OseeCoreException { if (OptionsUtil.isHistorical(getOptions())) { if (queryType != QueryType.COUNT) { for (SqlHandler<?> handler : handlers) { handler.addWithTables(this, branchId); } } } super.computeWithClause(handlers); }
Source:
<code><START> List<?> convertListItems(List<?> unconvertedValues) { <END> return unconvertedValues.stream().map(this::convertSingle).collect(toList()); }</code><technical_language>new methods could/should private</technical_language>

Target:
private List<?> convertListItems(List<?> unconvertedValues) { return unconvertedValues.stream().map(this::convertSingle).collect(toList()); }
Source:
<code>public <T> Query<T> mapTo(Class<T> resultType) { <START> return this.mapTo(resultType); <END> }</code><technical_language>StackOverflow coming this change</technical_language>

Target:
public <T> Query<T> mapTo(Class<T> resultType) { return this.mapTo((Type) resultType); }
Source:
<code>public String describeFirstNonRequestableCapability() { <START> if (hasCapability(NET_CAPABILITY_VALIDATED)) return "NET_CAPABILITY_VALIDATED"; if (hasCapability(NET_CAPABILITY_CAPTIVE_PORTAL)) return "NET_CAPABILITY_CAPTIVE_PORTAL"; if (hasCapability(NET_CAPABILITY_FOREGROUND)) return "NET_CAPABILITY_FOREGROUND"; if (hasCapability(NET_CAPABILITY_UNCONGESTED)) return "NET_CAPABILITY_UNCONGESTED"; <END> if ((mNetworkCapabilities & NON_REQUESTABLE_CAPABILITIES) != 0) { return "unknown non-requestable capabilities " + Long.toHexString(mNetworkCapabilities); } if (mLinkUpBandwidthKbps != 0 || mLinkDownBandwidthKbps != 0) return "link bandwidth"; if (hasSignalStrength()) return "signalStrength"; return null; }</code><technical_language>I suggest is time for like: for (int c : nonRequestableBits) { if (hasCapability(c)) { return capabilityNameOf(c); } }</technical_language>

Target:
public String describeFirstNonRequestableCapability() { final long nonRequestable = (mNetworkCapabilities & NON_REQUESTABLE_CAPABILITIES); if (nonRequestable != 0) { return capabilityNameOf(BitUtils.unpackBits(nonRequestable)[0]); } if (mLinkUpBandwidthKbps != 0 || mLinkDownBandwidthKbps != 0) return "link bandwidth"; if (hasSignalStrength()) return "signalStrength"; return null; }
Source:
<code>private void setDefaults() { IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); final boolean enabled = store.getBoolean(IGdbDebugPreferenceConstants.PREF_CONSOLE_INVERTED_COLORS); <START> final int bufferLines = store.getInt(IGdbDebugPreferenceConstants.PREF_CONSOLE_BUFFERLINES); <END> Display.getDefault().asyncExec(() -> { getInputStream().setColor(Display.getDefault().getSystemColor(SWT.COLOR_GREEN)); fErrorStream.setColor(Display.getDefault().getSystemColor(SWT.COLOR_RED)); setInvertedColors(enabled); setBufferLineLimit(bufferLines); }); }</code><technical_language>Done in patchset 11</technical_language>

Target:
private void setDefaults() { IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); boolean enabled = store.getBoolean(IGdbDebugPreferenceConstants.PREF_CONSOLE_INVERTED_COLORS); int bufferLines = store.getInt(IGdbDebugPreferenceConstants.PREF_CONSOLE_BUFFERLINES); Display.getDefault().asyncExec(() -> { getInputStream().setColor(Display.getDefault().getSystemColor(SWT.COLOR_GREEN)); fErrorStream.setColor(Display.getDefault().getSystemColor(SWT.COLOR_RED)); setInvertedColors(enabled); setBufferLineLimit(bufferLines); }); }
Source:
<code>public void delete(GoogleComputeInstanceTemplate template, Collection<String> instanceIds) throws InterruptedException { for (String currentId : instanceIds) { Compute compute = credentials.getCompute(); String projectId = credentials.getProjectId(); String zone = getConfigurationValue(GoogleComputeProviderConfigurationProperty.ZONE); String decoratedInstanceName = decorateInstanceName(template, currentId); try { compute.instances().delete(projectId, zone, decoratedInstanceName).execute(); <START> } catch (IOException e) { <END> e.printStackTrace(); } } }</code><technical_language>propagate - require wrapping a runtime exception acceptable</technical_language>

Target:
public void delete(GoogleComputeInstanceTemplate template, Collection<String> instanceIds) throws InterruptedException { for (String currentId : instanceIds) { Compute compute = credentials.getCompute(); String projectId = credentials.getProjectId(); String zone = getConfigurationValue(GoogleComputeInstanceTemplateConfigurationProperty.ZONE); String decoratedInstanceName = decorateInstanceName(template, currentId); try { compute.instances().delete(projectId, zone, decoratedInstanceName).execute(); } catch (IOException e) { throw new RuntimeException(e); } } }
Source:
<code>public void customize(Connector connector, HttpConfiguration config, Request request) { HttpFields httpFields = request.getHttpFields(); Forwarded forwarded = new Forwarded(request, config); try { for (HttpField field : httpFields) { try { MethodHandle handle = _handles.get(field.getName()); if (handle != null) handle.invoke(forwarded, field); } catch (Throwable t) { <START> onError(field, t); <END> } } } catch (Throwable e) { throw new RuntimeException(e); } if (forwarded._proto != null) { request.setScheme(forwarded._proto); if (forwarded._proto.equalsIgnoreCase(config.getSecureScheme())) request.setSecure(true); } if (forwarded._server != null && forwarded._host instanceof PortSetHostPort) { httpFields.put(new HostPortHttpField(forwarded._server, forwarded._host.getPort())); request.setAuthority(forwarded._server, forwarded._host.getPort()); } else if (forwarded._host != null) { httpFields.put(new HostPortHttpField(forwarded._host)); request.setAuthority(forwarded._host.getHost(), forwarded._host.getPort()); } else if (forwarded._server != null) { httpFields.put(new HostPortHttpField(forwarded._server)); request.setAuthority(forwarded._server, 0); } if (forwarded._for != null) { int port = forwarded._for.getPort() > 0 ? forwarded._for.getPort() : request.getRemotePort(); request.setRemoteAddr(InetSocketAddress.createUnresolved(forwarded._for.getHost(), port)); } }</code><technical_language>but... thinking this more, avoid double try blocks. onError declared exceptions, throws thrown this method. If throw continue. need wrap a RuntimeException</technical_language>

Target:
public void customize(Connector connector, HttpConfiguration config, Request request) { HttpFields httpFields = request.getHttpFields(); Forwarded forwarded = new Forwarded(request, config); for (HttpField field : httpFields) { try { MethodHandle handle = _handles.get(field.getName()); if (handle != null) handle.invoke(forwarded, field); } catch (Throwable t) { onError(field, t); } } if (forwarded._proto != null) { request.setScheme(forwarded._proto); if (forwarded._proto.equalsIgnoreCase(config.getSecureScheme())) request.setSecure(true); } if (forwarded._server != null && forwarded._host instanceof PortSetHostPort) { httpFields.put(new HostPortHttpField(forwarded._server, forwarded._host.getPort())); request.setAuthority(forwarded._server, forwarded._host.getPort()); } else if (forwarded._host != null) { httpFields.put(new HostPortHttpField(forwarded._host)); request.setAuthority(forwarded._host.getHost(), forwarded._host.getPort()); } else if (forwarded._server != null) { httpFields.put(new HostPortHttpField(forwarded._server)); request.setAuthority(forwarded._server, 0); } if (forwarded._for != null) { int port = forwarded._for.getPort() > 0 ? forwarded._for.getPort() : request.getRemotePort(); request.setRemoteAddr(InetSocketAddress.createUnresolved(forwarded._for.getHost(), port)); } }
Source:
<code>protected StorageDomain getEntityObject(StorageDomain object) { if (object instanceof <START> StorageDomain){ <END> return object; } else { return null; } }</code><technical_language>return true if null? if so, return "object"? similar findbugs issue for host patch</technical_language>

Target:
protected StorageDomain getEntityObject(StorageDomain object) { return object; }
Source:
<code>private void checkAnnotationIndentation(DetailAST atNode, NavigableMap<Integer, DetailAST> firstNodesOnLines, int indentLevel) { final int firstNodeIndent = getLineStart(atNode); final int currentIndent = firstNodeIndent + indentLevel; final Collection<DetailAST> values = firstNodesOnLines.values(); final DetailAST lastAnnotationNode = atNode.getParent().getLastChild(); final int lastAnnotationLine = lastAnnotationNode.getLineNo(); final Iterator<DetailAST> itr = values.iterator(); while (firstNodesOnLines.size() > 1) { final DetailAST node = itr.next(); final DetailAST parentNode = node.getParent(); final boolean isCurrentNodeCloseAnnotationAloneInLine = node.getLineNo() == lastAnnotationLine && isEndOfScope(lastAnnotationNode, node); if (isCurrentNodeCloseAnnotationAloneInLine || node.getType() == TokenTypes.AT && (parentNode.getParent().getType() == TokenTypes.MODIFIERS || parentNode.getParent().getType() == TokenTypes.ANNOTATIONS) <START> || parentNode.getType() == TokenTypes.MODIFIERS) { <END> logWarningMessage(node, firstNodeIndent); } else { logWarningMessage(node, currentIndent); } itr.remove(); } }</code><technical_language>@pietern other checks verifying validating annotation, || parentNode.getType() == TokenTypes.MODIFIERS is work if is modifiers, of annotations not. method is annotation related, this check verifying a annotation somehow? this validating more should</technical_language>

Target:
private void checkAnnotationIndentation(DetailAST atNode, NavigableMap<Integer, DetailAST> firstNodesOnLines, int indentLevel) { final int firstNodeIndent = getLineStart(atNode); final int currentIndent = firstNodeIndent + indentLevel; final Collection<DetailAST> values = firstNodesOnLines.values(); final DetailAST lastAnnotationNode = atNode.getParent().getLastChild(); final int lastAnnotationLine = lastAnnotationNode.getLineNo(); final Iterator<DetailAST> itr = values.iterator(); while (firstNodesOnLines.size() > 1) { final DetailAST node = itr.next(); final DetailAST parentNode = node.getParent(); final boolean isCurrentNodeCloseAnnotationAloneInLine = node.getLineNo() == lastAnnotationLine && isEndOfScope(lastAnnotationNode, node); if (isCurrentNodeCloseAnnotationAloneInLine || node.getType() == TokenTypes.AT && (parentNode.getParent().getType() == TokenTypes.MODIFIERS || parentNode.getParent().getType() == TokenTypes.ANNOTATIONS) || node.getLineNo() == atNode.getLineNo()) { logWarningMessage(node, firstNodeIndent); } else { logWarningMessage(node, currentIndent); } itr.remove(); } }
Source:
<code>private List<FeedbackResultsResponseTable> createResponseTables( FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responsesBundle) { List<FeedbackResultsResponseTable> responseTables = new ArrayList<FeedbackResultsResponseTable>(); List<String> recipients = new ArrayList<String>(); for (FeedbackResponseAttributes singleResponse : responsesBundle) { if (!recipients.contains(singleResponse.recipient)) { recipients.add(singleResponse.recipient); } } for (String recipient : recipients) { List<FeedbackResponseAttributes> responsesForRecipient = filterResponsesByRecipientEmail(recipient, responsesBundle); boolean isUserRecipient = student.email.equals(recipient); boolean isUserTeamRecipient = (question.recipientType == FeedbackParticipantType.TEAMS || question.recipientType == FeedbackParticipantType.CUSTOM <START> && question.isFeedbackPathsRecipientTypeTeams()) <END> && student.team.equals(recipient); String recipientName; if (isUserRecipient) { recipientName = "You"; } else if (isUserTeamRecipient) { recipientName = String.format("Your Team (%s)", bundle.getNameForEmail(recipient)); } else { recipientName = bundle.getNameForEmail(recipient); } responseTables.add(createResponseTable(question, responsesForRecipient, recipientName)); } return responseTables; }</code><technical_language>Likewise, a method isRecipientTeam in FeedbackQuestionAttributes</technical_language>

Target:
private List<FeedbackResultsResponseTable> createResponseTables( FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responsesBundle) { List<FeedbackResultsResponseTable> responseTables = new ArrayList<FeedbackResultsResponseTable>(); List<String> recipients = new ArrayList<String>(); for (FeedbackResponseAttributes singleResponse : responsesBundle) { if (!recipients.contains(singleResponse.recipient)) { recipients.add(singleResponse.recipient); } } for (String recipient : recipients) { List<FeedbackResponseAttributes> responsesForRecipient = filterResponsesByRecipientEmail(recipient, responsesBundle); boolean isUserRecipient = student.email.equals(recipient); boolean isUserTeamRecipient = question.isRecipientATeam() && student.team.equals(recipient); String recipientName; if (isUserRecipient) { recipientName = "You"; } else if (isUserTeamRecipient) { recipientName = String.format("Your Team (%s)", bundle.getNameForEmail(recipient)); } else { recipientName = bundle.getNameForEmail(recipient); } responseTables.add(createResponseTable(question, responsesForRecipient, recipientName)); } return responseTables; }
Source:
<code>static ParquetMetadata readSummaryMetadata(Configuration configuration, Path basePath, boolean skipRowGroups) throws IOException { Path metadataFile = new Path(basePath, PARQUET_METADATA_FILE); Path commonMetaDataFile = new Path(basePath, PARQUET_COMMON_METADATA_FILE); FileSystem fileSystem = basePath.getFileSystem(configuration); if (skipRowGroups && fileSystem.exists(commonMetaDataFile)) { <START> if (Log.INFO) { <END> LOG.info("reading summary file: " + commonMetaDataFile); } return readFooter(configuration, commonMetaDataFile, filter(skipRowGroups)); } else if (fileSystem.exists(metadataFile)) { if (Log.INFO) { LOG.info("reading summary file: " + metadataFile); } return readFooter(configuration, metadataFile, filter(skipRowGroups)); } else { return null; } }</code><technical_language>please avoid unnecessary reformating</technical_language>

Target:
static ParquetMetadata readSummaryMetadata(Configuration configuration, Path basePath, boolean skipRowGroups) throws IOException { Path metadataFile = new Path(basePath, PARQUET_METADATA_FILE); Path commonMetaDataFile = new Path(basePath, PARQUET_COMMON_METADATA_FILE); FileSystem fileSystem = basePath.getFileSystem(configuration); if (skipRowGroups && fileSystem.exists(commonMetaDataFile)) { if (Log.INFO) LOG.info("reading summary file: " + commonMetaDataFile); return readFooter(configuration, commonMetaDataFile, filter(skipRowGroups)); } else if (fileSystem.exists(metadataFile)) { if (Log.INFO) { LOG.info("reading summary file: " + metadataFile); } return readFooter(configuration, metadataFile, filter(skipRowGroups)); } else { return null; } }
Source:
<code><START> public void setAttribute(String key, Object value) <END> { if (!key.startsWith(__ASYNC_PREFIX)) super.setAttribute(key, value); switch (key) { case AsyncContext.ASYNC_REQUEST_URI: _requestURI = (String)value; break; case AsyncContext.ASYNC_CONTEXT_PATH: _contextPath = (String)value; break; case AsyncContext.ASYNC_SERVLET_PATH: _servletPath = (String)value; break; case AsyncContext.ASYNC_PATH_INFO: _pathInfo = (String)value; break; case AsyncContext.ASYNC_QUERY_STRING: _query = (String)value; break; default: super.setAttribute(key, value); } }</code><technical_language>Currently create AsyncContextEvent does: java baseRequest.setAttribute(AsyncContext.ASYNC_REQUEST_URI, baseRequest.getRequestURI()); baseRequest.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH, baseRequest.getContextPath()); baseRequest.setAttribute(AsyncContext.ASYNC_SERVLET_PATH, baseRequest.getServletPath()); baseRequest.setAttribute(AsyncContext.ASYNC_PATH_INFO, baseRequest.getPathInfo()); baseRequest.setAttribute(AsyncContext.ASYNC_QUERY_STRING, baseRequest.getQueryString()); 5 (6 in jetty-10) startWith string switches. good able set in bulk. AsyncContextEvent unwrap downcast AsyncAttributesMap sets fields... a synthentic set-only attribute called "org.eclipse.jetty.servlet.AsyncContextEvent.request" pass request object. This class extract 5 (eventually 6) fields request. Ditto for forwarded path another synth attribute</technical_language>

Target:
public void setAttribute(String key, Object value) { switch (key) { case AsyncContext.ASYNC_REQUEST_URI: _requestURI = (String)value; break; case AsyncContext.ASYNC_CONTEXT_PATH: _contextPath = (String)value; break; case AsyncContext.ASYNC_SERVLET_PATH: _servletPath = (String)value; break; case AsyncContext.ASYNC_PATH_INFO: _pathInfo = (String)value; break; case AsyncContext.ASYNC_QUERY_STRING: _queryString = (String)value; break; default: super.setAttribute(key, value); break; } }
Source:
<code>void reset(int width, int height) { if (mAllocationOut != null) { <START> mAllocationOut.setSurface(null); <END> mAllocationOut.destroy(); } android.util.Log.v("cpa", "reset " + width + ", " + height); mHeight = height; mWidth = width; mScript.invoke_setSize(mWidth, mHeight); Type.Builder tb = new Type.Builder(mRS, Element.RGBA_8888(mRS)); tb.setX(mWidth); tb.setY(mHeight); Type t = tb.create(); mAllocationOut = Allocation.createTyped(mRS, t, Allocation.USAGE_SCRIPT | Allocation.USAGE_IO_OUTPUT); tb = new Type.Builder(mRS, Element.createPixel(mRS, Element.DataType.UNSIGNED_8, Element.DataKind.PIXEL_YUV)); tb.setX(mWidth); tb.setY(mHeight); tb.setYuvFormat(android.graphics.ImageFormat.NV21); mAllocationIn = Allocation.createTyped(mRS, tb.create(), Allocation.USAGE_SCRIPT); mYuv.setInput(mAllocationIn); setupSurface(); ScriptGroup.Builder b = new ScriptGroup.Builder(mRS); b.addKernel(mScript.getKernelID_root()); b.addKernel(mYuv.getKernelID()); b.addConnection(t, mYuv.getKernelID(), mScript.getKernelID_root()); mGroup = b.create(); }</code><technical_language>Allocation.destroy() automatically call setSurface(null) for USAGE_IO_OUTPUT allocations. This line is redundant now</technical_language>

Target:
void reset(int width, int height) { if (mAllocationOut != null) { mAllocationOut.destroy(); } android.util.Log.v("cpa", "reset " + width + ", " + height); mHeight = height; mWidth = width; mScript.invoke_setSize(mWidth, mHeight); Type.Builder tb = new Type.Builder(mRS, Element.RGBA_8888(mRS)); tb.setX(mWidth); tb.setY(mHeight); Type t = tb.create(); mAllocationOut = Allocation.createTyped(mRS, t, Allocation.USAGE_SCRIPT | Allocation.USAGE_IO_OUTPUT); tb = new Type.Builder(mRS, Element.createPixel(mRS, Element.DataType.UNSIGNED_8, Element.DataKind.PIXEL_YUV)); tb.setX(mWidth); tb.setY(mHeight); tb.setYuvFormat(android.graphics.ImageFormat.NV21); mAllocationIn = Allocation.createTyped(mRS, tb.create(), Allocation.USAGE_SCRIPT); mYuv.setInput(mAllocationIn); setupSurface(); ScriptGroup.Builder b = new ScriptGroup.Builder(mRS); b.addKernel(mScript.getKernelID_root()); b.addKernel(mYuv.getKernelID()); b.addConnection(t, mYuv.getKernelID(), mScript.getKernelID_root()); mGroup = b.create(); }
Source:
<code>public void expungeCharge(Long id, String externalId) { entityManager.get() .createNativeQuery("delete from charge_events where charge_id = ?1") .setParameter(1, id) .executeUpdate(); entityManager.get() .createNativeQuery("delete from tokens where charge_id = ?1") .setParameter(1, id) .executeUpdate(); entityManager.get() <START> .createNativeQuery("delete from emitted_events where resource_external_id = ?1 AND resource_type=PAYMENT") <END> .setParameter(1, externalId) .executeUpdate(); entityManager.get() .createNativeQuery("delete from fees where charge_id = ?1") .setParameter(1, id) .executeUpdate(); entityManager.get() .createNativeQuery("delete from charges where id = ?1") .setParameter(1, id) .executeUpdate(); }</code><technical_language>other resource_type=PAYMENT" resource_external_id = ?1 column order index is resource_type, resource_external_id</technical_language>

Target:
public void expungeCharge(Long id, String externalId) { entityManager.get() .createNativeQuery("delete from charge_events where charge_id = ?1") .setParameter(1, id) .executeUpdate(); entityManager.get() .createNativeQuery("delete from tokens where charge_id = ?1") .setParameter(1, id) .executeUpdate(); entityManager.get() .createNativeQuery("delete from emitted_events where resource_type = ?1 AND resource_external_id = ?2") .setParameter(1, "PAYMENT") .setParameter(2, externalId) .executeUpdate(); entityManager.get() .createNativeQuery("delete from fees where charge_id = ?1") .setParameter(1, id) .executeUpdate(); entityManager.get() .createNativeQuery("delete from charges where id = ?1") .setParameter(1, id) .executeUpdate(); }
Source:
<code>public void waitAllMarkersDisappear(String markerType) { <START> elemDriverWait.until( <END> (ExpectedCondition<Boolean>) driver -> driver.findElements(By.xpath(markerType)).size() == 0); }</code><technical_language>**elemDriverWait** is 3 times timeout compare **loaderDriverWait**. stabilize tests</technical_language>

Target:
public void waitAllMarkersDisappear(String markerType) { loaderDriverWait.until( (ExpectedCondition<Boolean>) driver -> driver.findElements(By.xpath(markerType)).size() == 0); }
Source:
<code>private INetworkStackConnector getRemoteConnector() { IBinder connector; try { final long before = System.currentTimeMillis(); while ((connector = ServiceManager.getService(Context.NETWORK_STACK_SERVICE)) == null) { Thread.sleep(20); if (System.currentTimeMillis() - before > NETWORKSTACK_TIMEOUT_MS) { Slog.e(TAG, "Timeout waiting for NetworkStack connector"); return null; } } } catch (InterruptedException e) { Slog.e(TAG, "Error waiting for NetworkStack connector", e); return null; } synchronized (mPendingNetStackRequests) { return INetworkStackConnector.Stub.asInterface(connector); <START> } <END> }</code><technical_language>Nit: do need this lock here</technical_language>

Target:
private INetworkStackConnector getRemoteConnector() { IBinder connector; try { final long before = System.currentTimeMillis(); while ((connector = ServiceManager.getService(Context.NETWORK_STACK_SERVICE)) == null) { Thread.sleep(20); if (System.currentTimeMillis() - before > NETWORKSTACK_TIMEOUT_MS) { Slog.e(TAG, "Timeout waiting for NetworkStack connector"); return null; } } } catch (InterruptedException e) { Slog.e(TAG, "Error waiting for NetworkStack connector", e); return null; } return INetworkStackConnector.Stub.asInterface(connector); }
Source:
<code><START> private List<ListBlobContainersIncludeType> toIncludeTypes(BlobContainerListDetails blobContainerListDetails) { <END> boolean hasDetails = blobContainerListDetails != null && (blobContainerListDetails.getRetrieveMetadata() || blobContainerListDetails.getRetrieveDeleted()); if (hasDetails) { List<ListBlobContainersIncludeType> flags = new ArrayList<>(2); if (blobContainerListDetails.getRetrieveMetadata()) { flags.add(ListBlobContainersIncludeType.METADATA); } if (blobContainerListDetails.getRetrieveDeleted()) { flags.add(ListBlobContainersIncludeType.DELETED); } return flags; } else { return null; } }</code><technical_language>is this instead of Details type? Is a public method Details allow access packages</technical_language>

Target:
private List<ListBlobContainersIncludeType> toIncludeTypes(BlobContainerListDetails blobContainerListDetails) { boolean hasDetails = blobContainerListDetails != null && (blobContainerListDetails.getRetrieveMetadata() || blobContainerListDetails.getRetrieveDeleted()); if (hasDetails) { List<ListBlobContainersIncludeType> flags = new ArrayList<>(2); if (blobContainerListDetails.getRetrieveDeleted()) { flags.add(ListBlobContainersIncludeType.DELETED); } if (blobContainerListDetails.getRetrieveMetadata()) { flags.add(ListBlobContainersIncludeType.METADATA); } return flags; } else { return null; } }
Source:
<code>public void onRespondToDataPathRequest(int ndpId, boolean success) { if (VDBG) { Log.v(TAG, "onRespondToDataPathRequest: ndpId=" + ndpId + ", success=" + success); } String networkSpecifier = null; AwareNetworkRequestInformation nnri = null; for (Map.Entry<String, AwareNetworkRequestInformation> entry : mNetworkRequestsCache .entrySet()) { if (entry.getValue().ndpId == ndpId) { networkSpecifier = entry.getKey(); nnri = entry.getValue(); break; } } if (nnri == null) { Log.w(TAG, "onRespondToDataPathRequest: can't find a request with specified ndpId=" + ndpId); if (DBG) { Log.d(TAG, "onRespondToDataPathRequest: network request cache = " + mNetworkRequestsCache); } return; } if (nnri.state != AwareNetworkRequestInformation.STATE_RESPONDER_WAIT_FOR_RESPOND_RESPONSE) { Log.w(TAG, "onRespondToDataPathRequest: request " + networkSpecifier + " is incorrect state=" + nnri.state); mMgr.endDataPath(ndpId); mNetworkRequestsCache.remove(networkSpecifier); return; } <START> nnri.state = AwareNetworkRequestInformation.STATE_RESPONDER_WAIT_FOR_CONFIRM; <END> }</code><technical_language>this conditional |success|? (At present, |success| is for debugging.)</technical_language>

Target:
public void onRespondToDataPathRequest(int ndpId, boolean success) { if (VDBG) { Log.v(TAG, "onRespondToDataPathRequest: ndpId=" + ndpId + ", success=" + success); } String networkSpecifier = null; AwareNetworkRequestInformation nnri = null; for (Map.Entry<String, AwareNetworkRequestInformation> entry : mNetworkRequestsCache .entrySet()) { if (entry.getValue().ndpId == ndpId) { networkSpecifier = entry.getKey(); nnri = entry.getValue(); break; } } if (nnri == null) { Log.w(TAG, "onRespondToDataPathRequest: can't find a request with specified ndpId=" + ndpId); if (DBG) { Log.d(TAG, "onRespondToDataPathRequest: network request cache = " + mNetworkRequestsCache); } return; } if (!success) { Log.w(TAG, "onRespondToDataPathRequest: request " + networkSpecifier + " failed responding"); mMgr.endDataPath(ndpId); mNetworkRequestsCache.remove(networkSpecifier); return; } if (nnri.state != AwareNetworkRequestInformation.STATE_RESPONDER_WAIT_FOR_RESPOND_RESPONSE) { Log.w(TAG, "onRespondToDataPathRequest: request " + networkSpecifier + " is incorrect state=" + nnri.state); mMgr.endDataPath(ndpId); mNetworkRequestsCache.remove(networkSpecifier); return; } nnri.state = AwareNetworkRequestInformation.STATE_RESPONDER_WAIT_FOR_CONFIRM; }
Source:
<code>public void testReplicationQueueMultipleThreads() throws Exception { int numThreads = 5; final int numLoopsPerThread = 2; <START> ExecutorService executor = Executors.newFixedThreadPool(numThreads); <END> for (int i = 0; i < numThreads; i++) { final int i1 = i; executor.execute(new Runnable() { int index = i1; public void run() { for (int j = 0; j < numLoopsPerThread; j++) { cache1.put("key" + index + "_" + j, "value"); } } }); } executor.shutdown(); executor.awaitTermination(10, TimeUnit.SECONDS); eventually(new Condition() { @Override public boolean isSatisfied() throws Exception { return cache2.size() == REPL_QUEUE_MAX_ELEMENTS; } }); ReplicationQueue replicationQueue = TestingUtil.extractComponent(cache1, ReplicationQueue.class); assertEquals(replicationQueue.getElementsCount(), numThreads * numLoopsPerThread - REPL_QUEUE_MAX_ELEMENTS); }</code><technical_language>IMO, is fork() puts test name in thread's name</technical_language>

Target:
public void testReplicationQueueMultipleThreads() throws Exception { int numThreads = 5; final int numLoopsPerThread = 2; runConcurrently(new Callable() { AtomicInteger indexOffset = new AtomicInteger(); public Void call() { int index = indexOffset.getAndIncrement(); for (int j = 0; j < numLoopsPerThread; j++) { cache1.put("key" + index + "_" + j, "value"); } return null; } }, numThreads); eventually(new Condition() { @Override public boolean isSatisfied() throws Exception { return cache2.size() == REPL_QUEUE_MAX_ELEMENTS; } }); ReplicationQueue replicationQueue = TestingUtil.extractComponent(cache1, ReplicationQueue.class); assertEquals(replicationQueue.getElementsCount(), numThreads * numLoopsPerThread - REPL_QUEUE_MAX_ELEMENTS); }
Source:
<code>public long getCtime() { <START> return ctime.orElse(metadataStoreCtime.orElse(-1L)); <END> }</code><technical_language>this a behavior change</technical_language>

Target:
public long getCtime() { return ctime; }
Source:
<code>public void VEDisabledEditorEntryAnonTestsTests_002_MainEditEntry() { ArticlePageObject article = <START> base.openArticleByName(wikiURL, PageContent.articleNamePrefix + base.getTimeStamp()); <END> VisualEditModePageObject ck = article.editArticleInRTEUsingDropdown(); ck.verifyContentLoaded(); ck.clickPublishButton(); }</code><technical_language>please move creating article name separate line</technical_language>

Target:
public void VEDisabledEditorEntryAnonTestsTests_002_MainEditEntry() { ArticlePageObject article = base.openArticleByName(wikiURL, base.getNameForArticle()); VisualEditModePageObject ck = article.openCKModeWithMainEditButton(); ck.verifyContentLoaded(); ck.clickPublishButton(); }
Source:
<code>public List<Map.Entry<String, RubricRecipientStatistics>> getPerRecipientStatisticsSorted( List<FeedbackResponseAttributes> responses, FeedbackSessionResultsBundle bundle) { Map<String, RubricRecipientStatistics> recipientToRecipientStats = new HashMap<>(); for (FeedbackResponseAttributes response : responses) { if (!recipientToRecipientStats.containsKey(response.recipient)) { String recipient = response.recipient; String recipientTeam = bundle.getTeamNameForEmail(recipient); String recipientName = bundle.getNameForEmail(recipient); RubricRecipientStatistics recipientStats = new RubricRecipientStatistics(recipient, recipientName, recipientTeam); recipientToRecipientStats.put(recipient, recipientStats); } recipientToRecipientStats.get(response.recipient).addResponseToRecipientStats(response); } List<Map.Entry<String, RubricRecipientStatistics>> recipientStatsList = new LinkedList<>(recipientToRecipientStats.entrySet()); recipientStatsList.sort((Map.Entry<String, RubricRecipientStatistics> obj1, Map.Entry<String, RubricRecipientStatistics> obj2) -> { RubricRecipientStatistics a = obj1.getValue(); RubricRecipientStatistics b = obj2.getValue(); <START> if (a.recipientTeam.equalsIgnoreCase(b.recipientTeam)) { <END> return a.recipientName.compareTo(b.recipientName); } else { return a.recipientTeam.compareTo(b.recipientTeam); } }); return recipientStatsList; }</code><technical_language>chained comparators instead. is a simple bypass case sensitivity</technical_language>

Target:
public List<Map.Entry<String, RubricRecipientStatistics>> getPerRecipientStatisticsSorted( List<FeedbackResponseAttributes> responses, FeedbackSessionResultsBundle bundle) { Map<String, RubricRecipientStatistics> recipientToRecipientStats = new HashMap<>(); for (FeedbackResponseAttributes response : responses) { if (!recipientToRecipientStats.containsKey(response.recipient)) { String recipient = response.recipient; String recipientTeam = bundle.getTeamNameForEmail(recipient); String recipientName = bundle.getNameForEmail(recipient); RubricRecipientStatistics recipientStats = new RubricRecipientStatistics(recipient, recipientName, recipientTeam); recipientToRecipientStats.put(recipient, recipientStats); } recipientToRecipientStats.get(response.recipient).addResponseToRecipientStats(response); } List<Map.Entry<String, RubricRecipientStatistics>> recipientStatsList = new LinkedList<>(recipientToRecipientStats.entrySet()); recipientStatsList.sort(Comparator.comparing((Map.Entry<String, RubricRecipientStatistics> obj) -> obj.getValue().recipientTeam.toLowerCase()) .thenComparing(obj -> obj.getValue().recipientName)); return recipientStatsList; }
Source:
<code>private void sendEmailAlert(AbstractJobAlert jobAlert, String alertLink, String reason, Map<String, String> errors) { String description = jobAlert.description; boolean blankDescription = StringUtils.isBlank(description); <START> String shortDescription = description.split("\n")[0]; <END> if (blankDescription) { shortDescription = errors.keySet().toString(); } String subject = String.format("%s %s - %s", reason, jobAlert.getTypeString(), shortDescription); StringBuilder sb = new StringBuilder(reason + ' ' + jobAlert.getTypeString() + '\n'); sb.append("Alert link : ").append(alertLink).append('\n'); if (!blankDescription) { sb.append("Alert Description : ").append(description).append('\n'); } for (Map.Entry<String, String> entry : errors.entrySet()) { sb.append(emailSummary(spawn.getJob(entry.getKey()))).append('\n'); sb.append("Error Message\n"); sb.append(entry.getValue()); sb.append("\n------------------------------\n"); } if (!EmailUtil.email(jobAlert.email, subject, sb.toString())) { log.error("Unable to send email for alert {}", jobAlert.alertId); } }</code><technical_language>guard description null</technical_language>

Target:
private void sendEmailAlert(AbstractJobAlert jobAlert, String alertLink, String reason, Map<String, String> errors) { String description = jobAlert.description; boolean blankDescription = StringUtils.isBlank(description); final String shortDescription; if (blankDescription) { shortDescription = errors.keySet().toString(); } else { shortDescription = description.split("\n")[0]; } String subject = String.format("%s %s - %s", reason, jobAlert.getTypeString(), shortDescription); StringBuilder sb = new StringBuilder(reason + ' ' + jobAlert.getTypeString() + '\n'); sb.append("Alert link : ").append(alertLink).append('\n'); if (!blankDescription) { sb.append("Alert Description : ").append(description).append('\n'); } for (Map.Entry<String, String> entry : errors.entrySet()) { sb.append(emailSummary(spawn.getJob(entry.getKey()))).append('\n'); sb.append("Error Message\n"); sb.append(entry.getValue()); sb.append("\n------------------------------\n"); } if (!EmailUtil.email(jobAlert.email, subject, sb.toString())) { log.error("Unable to send email for alert {}", jobAlert.alertId); } }
Source:
<code>protected void performPlugCommand(VDSCommandType commandType, Disk disk, VmDevice vmDevice) { if (disk.getDiskStorageType() == DiskStorageType.LUN) { LunDisk lunDisk = (LunDisk) disk; if (commandType == VDSCommandType.HotPlugDisk) { LUNs lun = lunDisk.getLun(); updateLUNConnectionsInfo(lun); Map<StorageType, List<StorageServerConnections>> lunsByStorageType = StorageHelperBase.filterConnectionsByStorageType(lun); for (StorageType storageType : lunsByStorageType.keySet()) { if (!getStorageHelper(storageType).connectStorageToLunByVdsId(null, getVm().getRunOnVds(), lun, getVm().getStoragePoolId())) { throw new VdcBLLException(VdcBllErrors.StorageServerConnectionError); } } } } else if (disk.getDiskStorageType() == DiskStorageType.CINDER) { CinderDisk cinderDisk = (CinderDisk) disk; setStorageDomainId(cinderDisk.getStorageIds().get(0)); try { CinderConnectionInfo connectionInfo = getCinderConnectionInfo(cinderDisk); CinderVolumeDriver cinderVolumeDriver = CinderVolumeDriver.forValue(connectionInfo.getDriverVolumeType()); if (cinderVolumeDriver == null) { addCustomValue("DiskAlias", cinderDisk.getDiskAlias()); auditLogDirector.log(this, AuditLogType.CINDER_DISK_CONNECTION_VOLUME_DRIVER_UNSUPPORTED); } cinderDisk.setCinderConnectionInfo(connectionInfo); } catch (OpenStackResponseException ex) { addCustomValue("DiskAlias", cinderDisk.getDiskAlias()); auditLogDirector.log(this, AuditLogType.CINDER_DISK_CONNECTION_FAILURE); <START> throw ex; <END> } } runVdsCommand(commandType, new HotPlugDiskVDSParameters(getVm().getRunOnVds(), getVm(), disk, vmDevice)); }</code><technical_language>logic updateCinderDisksConnections(), re-use</technical_language>

Target:
protected void performPlugCommand(VDSCommandType commandType, Disk disk, VmDevice vmDevice) { if (disk.getDiskStorageType() == DiskStorageType.LUN) { LunDisk lunDisk = (LunDisk) disk; if (commandType == VDSCommandType.HotPlugDisk) { LUNs lun = lunDisk.getLun(); updateLUNConnectionsInfo(lun); Map<StorageType, List<StorageServerConnections>> lunsByStorageType = StorageHelperBase.filterConnectionsByStorageType(lun); for (StorageType storageType : lunsByStorageType.keySet()) { if (!getStorageHelper(storageType).connectStorageToLunByVdsId(null, getVm().getRunOnVds(), lun, getVm().getStoragePoolId())) { throw new VdcBLLException(VdcBllErrors.StorageServerConnectionError); } } } } else if (disk.getDiskStorageType() == DiskStorageType.CINDER) { CinderDisk cinderDisk = (CinderDisk) disk; setStorageDomainId(cinderDisk.getStorageIds().get(0)); getCinderBroker().updateConnectionInfoForDisk(cinderDisk); } runVdsCommand(commandType, new HotPlugDiskVDSParameters(getVm().getRunOnVds(), getVm(), disk, vmDevice)); }
Source:
<code>private synchronized Map<PlanNodeId, TaskSource> updateSources(List<TaskSource> sources) { Map<PlanNodeId, TaskSource> updatedUnpartitionedSources = new HashMap<>(); long currentMaxAcknowledgedSplit = this.maxAcknowledgedSplit; sources = sources.stream() .map(source -> new TaskSource( source.getPlanNodeId(), source.getSplits().stream() .filter(scheduledSplit -> scheduledSplit.getSequenceId() > currentMaxAcknowledgedSplit) .collect(Collectors.toSet()), source.getNoMoreSplitsForDriverGroup(), source.isNoMoreSplits())) .collect(toList()); for (TaskSource source : sources) { if (partitionedDriverRunnerFactories.containsKey(source.getPlanNodeId())) { schedulePartitionedSource(source); } else { scheduleUnpartitionedSource(source, updatedUnpartitionedSources); } } for (DriverSplitRunnerFactory driverSplitRunnerFactory : Iterables.concat(partitionedDriverRunnerFactories.values(), unpartitionedAllAtOnceDriverRunnerFactories, unpartitionedGroupedDriverRunnerFactories)) { driverSplitRunnerFactory.closeDriverFactoryIfFullyCreated(); <START> } <END> maxAcknowledgedSplit = sources.stream() .flatMap(source -> source.getSplits().stream()) .mapToLong(ScheduledSplit::getSequenceId) .max() .orElse(maxAcknowledgedSplit); return updatedUnpartitionedSources; }</code><technical_language>related driver, plan node group in this class. a container for related splits. A name SplitGroup more</technical_language>

Target:
private synchronized Map<PlanNodeId, TaskSource> updateSources(List<TaskSource> sources) { Map<PlanNodeId, TaskSource> updatedUnpartitionedSources = new HashMap<>(); long currentMaxAcknowledgedSplit = this.maxAcknowledgedSplit; sources = sources.stream() .map(source -> new TaskSource( source.getPlanNodeId(), source.getSplits().stream() .filter(scheduledSplit -> scheduledSplit.getSequenceId() > currentMaxAcknowledgedSplit) .collect(Collectors.toSet()), source.getNoMoreSplitsForLifespan(), source.isNoMoreSplits())) .collect(toList()); for (TaskSource source : sources) { if (driverRunnerFactoriesWithSplitLifeCycle.containsKey(source.getPlanNodeId())) { schedulePartitionedSource(source); } else { scheduleUnpartitionedSource(source, updatedUnpartitionedSources); } } for (DriverSplitRunnerFactory driverSplitRunnerFactory : Iterables.concat(driverRunnerFactoriesWithSplitLifeCycle.values(), driverRunnerFactoriesWithTaskLifeCycle, driverRunnerFactoriesWithDriverGroupLifeCycle)) { driverSplitRunnerFactory.closeDriverFactoryIfFullyCreated(); } maxAcknowledgedSplit = sources.stream() .flatMap(source -> source.getSplits().stream()) .mapToLong(ScheduledSplit::getSequenceId) .max() .orElse(maxAcknowledgedSplit); return updatedUnpartitionedSources; }
Source:
<code>public boolean cleanupRules() { if (!_canBridgeFirewall) { return false; } <START> final Script cmd = new Script(_securityGroupPath, _timeout.getMillis(), s_logger); <END> cmd.add("cleanup_rules"); final String result = cmd.execute(); if (result != null) { return false; } return true; }</code><technical_language>Please consider adding overridden version of Script(String, int, Logger) constructor accepts Duration encapsulate this type conversion</technical_language>

Target:
public boolean cleanupRules() { if (!_canBridgeFirewall) { return false; } final Script cmd = new Script(_securityGroupPath, _timeout, s_logger); cmd.add("cleanup_rules"); final String result = cmd.execute(); if (result != null) { return false; } return true; }