auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean passesOcspCheck(X509Certificate[] certs) { <START> if (!ocspEnabled) { <END> LOGGER.debug("OCSP check is not enabled. Skipping."); return true; } for (X509Certificate cert : certs) { try { Certificate certificate = convertToBouncyCastleCert(cert); OCSPReq ocspRequest = generateOcspRequest(certificate); List<OCSPResp> ocspResponses = sendOcspRequests(cert, ocspRequest); if (anyOcspResponseStatusIsRevoked(ocspResponses)) { SecurityLogger.audit( "Certificate has been revoked by the OCSP server {}.", cert, ocspServerUrls); LOGGER.debug("Certificate has been revoked by the OCSP server."); return false; } } catch (OcspCheckerException ignore) { } } return true; }</code><technical_language>check if ocspServerUrls is null if ocspServerUrls.isEmpty() return. I is set null need process if ocsp urls</technical_language>

Target:
public boolean passesOcspCheck(X509Certificate[] certs) { if (!ocspEnabled) { LOGGER.debug("OCSP check is not enabled. Skipping."); return true; } for (X509Certificate cert : certs) { try { Certificate certificate = convertToBouncyCastleCert(cert); OCSPReq ocspRequest = generateOcspRequest(certificate); Map<String, CertificateStatus> ocspStatuses = sendOcspRequests(cert, ocspRequest); String revokedStatusUrl = getFirstRevokedStatusUrl(ocspStatuses); if (revokedStatusUrl != null) { SecurityLogger.audit( "Certificate has been revoked by the OCSP server at URL {}.", cert, revokedStatusUrl); LOGGER.warn( "Certificate has been revoked by the OCSP server at URL {}.", cert, revokedStatusUrl); return false; } } catch (OcspCheckerException e) { postErrorEvent(e.getMessage()); } } return true; }
Source:
<code>public List<Sample> listBySearchOffsetAndNumResults(int offset, int resultsPerPage, String querystr, String sortCol, String sortDir) throws IOException { if (offset < 0 || resultsPerPage < 0) throw new IOException("Limit and Offset must not be less than zero"); if ("lastModified".equals(sortCol)) sortCol = "derivedInfo.lastModified"; Criteria criteria = currentSession().createCriteria(SampleImpl.class); criteria.add(searchRestrictions(querystr)); criteria.createAlias("derivedInfo", "derivedInfo"); criteria.setFirstResult(offset); criteria.setMaxResults(resultsPerPage); criteria.addOrder("asc".equalsIgnoreCase(sortDir) ? Order.asc(sortCol) : Order.desc(sortCol)); criteria.setProjection(Projections.property("id")); @SuppressWarnings("unchecked") List<Long> ids = criteria.list(); if (ids.isEmpty()) { return Collections.emptyList(); } Criteria query = currentSession().createCriteria(SampleImpl.class); query.add(Restrictions.in("id", ids)); <START> query.addOrder("asc".equalsIgnoreCase(sortDir) ? Order.asc(sortCol) : Order.desc(sortCol)); <END> query.createAlias("derivedInfo", "derivedInfo"); @SuppressWarnings("unchecked") List<Sample> requestedPage = query.list(); return requestedPage; }</code><technical_language>nice if instances of query renamed criteria (and converted Criteria if not, care of those)</technical_language>

Target:
public List<Sample> listBySearchOffsetAndNumResults(int offset, int resultsPerPage, String querystr, String sortCol, String sortDir) throws IOException { if (offset < 0 || resultsPerPage < 0) throw new IOException("Limit and Offset must not be less than zero"); if ("lastModified".equals(sortCol)) sortCol = "derivedInfo.lastModified"; Criteria criteria = currentSession().createCriteria(SampleImpl.class); criteria.add(searchRestrictions(querystr)); criteria.createAlias("derivedInfo", "derivedInfo"); criteria.setFirstResult(offset); criteria.setMaxResults(resultsPerPage); criteria.addOrder("asc".equalsIgnoreCase(sortDir) ? Order.asc(sortCol) : Order.desc(sortCol)); criteria.setProjection(Projections.property("id")); @SuppressWarnings("unchecked") List<Long> ids = criteria.list(); if (ids.isEmpty()) { return Collections.emptyList(); } Criteria sampleCriteria = currentSession().createCriteria(SampleImpl.class); sampleCriteria.add(Restrictions.in("id", ids)); sampleCriteria.addOrder("asc".equalsIgnoreCase(sortDir) ? Order.asc(sortCol) : Order.desc(sortCol)); sampleCriteria.createAlias("derivedInfo", "derivedInfo"); @SuppressWarnings("unchecked") List<Sample> requestedPage = sampleCriteria.list(); return requestedPage; }
Source:
<code>public void updateFromTileSourceTemplate(TileSourceTemplate r) { <START> db = ctx.getSQLiteAPI().getOrCreateDatabase( <END> ctx.getAppPath(TILES_INDEX_DIR).getAbsolutePath() + "/" + name + SQLITE_EXT, false); if (!onlyReadonlyAvailable) { int maxZoom = r.getMaximumZoomSupported(); int minZoom = r.getMinimumZoomSupported(); if (inversiveZoom) { int mnz = minZoom; minZoom = 17 - maxZoom; maxZoom = 17 - mnz; } if (getUrlTemplate() != null && !getUrlTemplate().equals(r.getUrlTemplate())) { db.execSQL("update info set " + URL + " = '" + r.getUrlTemplate() + "'"); } if (minZoom != this.minZoom) { db.execSQL("update info set " + MIN_ZOOM + " = '" + minZoom + "'"); } if (maxZoom != this.maxZoom) { db.execSQL("update info set " + MAX_ZOOM + " = '" + maxZoom + "'"); } if (r.isEllipticYTile() != isEllipticYTile()) { db.execSQL("update info set " + ELLIPSOID + " = '" + (r.isEllipticYTile() ? 1 : 0) + "'"); } if (r.getExpirationTimeMinutes() != getExpirationTimeMinutes()) { db.execSQL("update info set " + EXPIRE_MINUTES + " = '" + r.getExpirationTimeMinutes() + "'"); } } }</code><technical_language>Wrong call</technical_language>

Target:
public void updateFromTileSourceTemplate(TileSourceTemplate r) { boolean openedBefore = isDbOpened(); SQLiteConnection db = getDatabase(); if (!onlyReadonlyAvailable && db != null) { int maxZoom = r.getMaximumZoomSupported(); int minZoom = r.getMinimumZoomSupported(); if (inversiveZoom) { int mnz = minZoom; minZoom = 17 - maxZoom; maxZoom = 17 - mnz; } if (getUrlTemplate() != null && !getUrlTemplate().equals(r.getUrlTemplate())) { db.execSQL("update info set " + URL + " = '" + r.getUrlTemplate() + "'"); } if (minZoom != this.minZoom) { db.execSQL("update info set " + MIN_ZOOM + " = '" + minZoom + "'"); } if (maxZoom != this.maxZoom) { db.execSQL("update info set " + MAX_ZOOM + " = '" + maxZoom + "'"); } if (r.isEllipticYTile() != isEllipticYTile()) { db.execSQL("update info set " + ELLIPSOID + " = '" + (r.isEllipticYTile() ? 1 : 0) + "'"); } if (r.getExpirationTimeMinutes() != getExpirationTimeMinutes()) { db.execSQL("update info set " + EXPIRE_MINUTES + " = '" + r.getExpirationTimeMinutes() + "'"); } } if (db != null && !openedBefore) { db.close(); } }
Source:
<code>private EventSeverity parseMinSeverity(String input) { EventSeverity sev = EventSeverity.SEVERITY_CLEAR; if (ZingUtils.isNullOrEmpty(input)) { return sev; } <START> switch (input.toUpperCase()) { <END> case "CLEAR": sev = EventSeverity.SEVERITY_CLEAR; break; case "DEBUG": sev = EventSeverity.SEVERITY_DEBUG; break; case "INFO": sev = EventSeverity.SEVERITY_INFO; break; case "WARNING": sev = EventSeverity.SEVERITY_WARNING; break; case "ERROR": sev = EventSeverity.SEVERITY_ERROR; break; case "CRITICAL": sev = EventSeverity.SEVERITY_CRITICAL; break; default: logger.warn("Could not parse minimum severity. All events will be forwarded."); } return sev; }</code><technical_language>this func simplified. so: try { sev = EventSeverity.valueOf(StringUtils.sanitizeToken(input)) } catch (Exception e) { logger.warn("Could parse minimum severity. events forwarded."); sev = EventSeverity.SEVERITY_CLEAR; } StringUtils is dfc copy method ZingUtils</technical_language>

Target:
private EventSeverity parseMinSeverity(String input) { EventSeverity sev = EventSeverity.SEVERITY_CLEAR; if (ZingUtils.isNullOrEmpty(input)) { return sev; } switch (ZingUtils.sanitizeToken(input)) { case "CLEAR": sev = EventSeverity.SEVERITY_CLEAR; break; case "DEBUG": sev = EventSeverity.SEVERITY_DEBUG; break; case "INFO": sev = EventSeverity.SEVERITY_INFO; break; case "WARNING": sev = EventSeverity.SEVERITY_WARNING; break; case "ERROR": sev = EventSeverity.SEVERITY_ERROR; break; case "CRITICAL": sev = EventSeverity.SEVERITY_CRITICAL; break; default: logger.warn("Could not parse minimum severity. All events will be forwarded."); } return sev; }
Source:
<code>public Object getImage(Object object) { Match match = (Match)object; Object ret = null; try { <START> ret = itemDelegator.getImage(match.getLeft()); <END> if (ret == null) { ret = itemDelegator.getImage(match.getOrigin()); } if (ret == null) { ret = itemDelegator.getImage(match.getRight()); } if (ret == null && match instanceof NotLoadedFragmentMatch) { ret = itemDelegator.getImage(((NotLoadedFragmentMatch)match).getResource()); } } catch (MissingResourceException ex) { EMFCompareEditPlugin.getPlugin().log(ex); } if (ret == null) { ret = super.getImage(object); } Object matchImage = overlayProvider.getComposedImage(match, ret); ret = overlayImage(object, matchImage); return ret; }</code><technical_language>I extract try/catch in a method safeGetImage(Object) return null logging. way, if getImage(left) throws a MissingResourceException try right origin. this extracted shared other classes? Please note, this is open question, propose, feel free discuss it</technical_language>

Target:
public Object getImage(Object object) { Match match = (Match)object; Object ret = itemDelegator.getImage(match.getLeft()); if (ret == null) { ret = itemDelegator.getImage(match.getOrigin()); } if (ret == null) { ret = itemDelegator.getImage(match.getRight()); } if (ret == null && match instanceof NotLoadedFragmentMatch) { ret = itemDelegator.getImage(((NotLoadedFragmentMatch)match).getResource()); } if (ret == null) { Adapter adapter = EcoreUtil.getAdapter(match.eAdapters(), MatchOfContainmentReferenceChangeAdapter.class); if (adapter instanceof MatchOfContainmentReferenceChangeAdapter) { ReferenceChange referenceChange = ((MatchOfContainmentReferenceChangeAdapter)adapter) .getReferenceChange(); if (referenceChange != null) { ret = itemDelegator.getImage(referenceChange.getValue()); } } } if (ret == null) { ret = super.getImage(object); } Object matchImage = overlayProvider.getComposedImage(match, ret); ret = overlayImage(object, matchImage); return ret; }
Source:
<code>public String getExtensionResource(final String resourcePath) throws FalconException { if (StringUtils.isBlank(resourcePath)) { <START> throw new StoreAccessException(new Exception("Resource path cannot be null or empty")); <END> } try { Path resourceFile = new Path(resourcePath); InputStream data; ByteArrayOutputStream writer = new ByteArrayOutputStream(); if (resourcePath.startsWith("hdfs")){ FileSystem fileSystem = getHdfsFileSystem(resourcePath); data = fileSystem.open(resourceFile); IOUtils.copyBytes(data, writer, fileSystem.getConf(), true); }else{ data = fs.open(resourceFile); IOUtils.copyBytes(data, writer, fs.getConf(), true); } return writer.toString(); } catch (IOException e) { throw new StoreAccessException(e); } }</code><technical_language>Remove nested exception, while it</technical_language>

Target:
public String getExtensionResource(final String resourcePath) throws FalconException { if (StringUtils.isBlank(resourcePath)) { throw new StoreAccessException("Resource path cannot be null or empty"); } try { Path resourceFile = new Path(resourcePath); InputStream data; ByteArrayOutputStream writer = new ByteArrayOutputStream(); if (resourcePath.startsWith("file")){ data = fs.open(resourceFile); IOUtils.copyBytes(data, writer, fs.getConf(), true); }else{ FileSystem fileSystem = getHdfsFileSystem(resourcePath); data = fileSystem.open(resourceFile); IOUtils.copyBytes(data, writer, fileSystem.getConf(), true); } return writer.toString(); } catch (IOException e) { throw new StoreAccessException(e); } }
Source:
<code><START> public void deleteRecord(DataIdentifier identifier) throws DataStoreException { <END> }</code><technical_language>Need implement</technical_language>

Target:
public void deleteRecord(DataIdentifier identifier) throws DataStoreException { Iterator<DataStore> iter = delegateHandler.getWritableDelegatesIterator(identifier); if (! iter.hasNext()) { iter = delegateHandler.getWritableDelegatesIterator(); } boolean deleted = false; while (iter.hasNext()) { DataStore ds = iter.next(); if (null != ds.getRecordIfStored(identifier)) { if (ds instanceof MultiDataStoreAware) { ((MultiDataStoreAware) ds).deleteRecord(identifier); deleted = true; } else if (ds instanceof DataStoreBlobStore) { try { ((DataStoreBlobStore) ds).deleteChunks(Lists.newArrayList(identifier.toString()), 0L); deleted = true; } catch (Exception e) { throw new DataStoreException(e); } } } if (deleted) { unmapIdFromDelegate(identifier); } } if (! deleted) { iter = delegateHandler.getAllDelegatesIterator(identifier); if (! iter.hasNext()) { iter = delegateHandler.getAllDelegatesIterator(); } if (! iter.hasNext()) { throw new DataStoreException(String.format("No such record for identifier %s", identifier.toString())); } else { while (iter.hasNext()) { if (null != iter.next().getRecordIfStored(identifier)) { return; } } } throw new DataStoreException(String.format("No such record for identifier %s", identifier.toString())); } }
Source:
<code>public void checkWebElementVisibilityAtPreviewPage(By webElement) { String currentWindow = seleniumWebDriver.getWindowHandle(); waitPreviewUrlIsPresent(); waitPreviewUrlIsResponsive(10); WaitUtils.sleepQuietly(2); clickOnPreviewUrl(); seleniumWebDriverHelper.switchToNextWindow(currentWindow); try { seleniumWebDriverHelper.waitVisibility(webElement, LOADER_TIMEOUT_SEC); } catch (TimeoutException ex) { seleniumWebDriver.close(); seleniumWebDriver.switchTo().window(currentWindow); <START> seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); <END> } seleniumWebDriver.close(); seleniumWebDriver.switchTo().window(currentWindow); seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); }</code><technical_language>ignoring absence of element preview page, is idea</technical_language>

Target:
public void checkWebElementVisibilityAtPreviewPage(By webElement) { String currentWindow = seleniumWebDriver.getWindowHandle(); waitPreviewUrlIsPresent(); waitPreviewUrlIsResponsive(10); WaitUtils.sleepQuietly(5); clickOnPreviewUrl(); seleniumWebDriverHelper.switchToNextWindow(currentWindow); try { seleniumWebDriverHelper.waitVisibility(webElement, LOADER_TIMEOUT_SEC); } finally { seleniumWebDriver.close(); seleniumWebDriver.switchTo().window(currentWindow); seleniumWebDriverHelper.switchToIdeFrameAndWaitAvailability(); } }
Source:
<code>protected void handleAdditionalRecords(SAMRecord currentRecord, Map<SAMReadGroupRecord, List<FastqWriter>> tagWriters, SAMRecord read1, SAMRecord read2) { <START> if (currentRecord.isSecondaryOrSupplementary() && !INCLUDE_NON_PRIMARY_ALIGNMENTS) <END> return; if (currentRecord.getReadFailsVendorQualityCheckFlag() && !INCLUDE_NON_PF_READS) return; final List<FastqWriter> rgTagWriters = tagWriters.get(currentRecord.getReadGroup()); if (currentRecord.getReadPairedFlag()) { if (read1 != null && read2 !=null){ writeTagRecords(read1, 1, rgTagWriters); writeTagRecords(read2, 2, rgTagWriters); } } else { writeTagRecords(currentRecord, null, rgTagWriters); } }</code><technical_language>please { } if body</technical_language>

Target:
protected void handleAdditionalRecords(SAMRecord currentRecord, Map<SAMReadGroupRecord, List<FastqWriter>> tagWriters, SAMRecord read1, SAMRecord read2) { final List<FastqWriter> rgTagWriters = tagWriters.get(currentRecord.getReadGroup()); if (currentRecord.getReadPairedFlag()) { if (read1 != null && read2 !=null) { writeTagRecords(read1, 1, rgTagWriters); writeTagRecords(read2, 2, rgTagWriters); } } else { writeTagRecords(currentRecord, null, rgTagWriters); } }
Source:
<code>public static Bitmap roundedCorners(@NonNull BitmapPool pool, @NonNull Bitmap inBitmap, int width, int height, int roundingRadius) { Preconditions.checkArgument(width > 0, "width must be greater than 0."); Preconditions.checkArgument(height > 0, "height must be greater than 0."); Preconditions.checkArgument(roundingRadius > 0, "roundingRadius must be greater than 0."); Bitmap toTransform = getAlphaSafeBitmap(pool, inBitmap); Bitmap result = pool.get(width, height, Bitmap.Config.ARGB_8888); setAlphaIfAvailable(result, true ); BitmapShader shader = new BitmapShader(toTransform, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setShader(shader); RectF rect = new RectF(0, 0, result.getWidth(), result.getHeight()); <START> TransformationUtils.getBitmapDrawableLock().lock(); <END> try { Canvas canvas = new Canvas(result); canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); canvas.drawRoundRect(rect, roundingRadius, roundingRadius, paint); clear(canvas); } finally { TransformationUtils.getBitmapDrawableLock().unlock(); } if (!toTransform.equals(inBitmap)) { pool.put(toTransform); } return result; }</code><technical_language>nitpick: direct access get instance in class. I prefer direct access defined, in applyMatrix, getter class</technical_language>

Target:
public static Bitmap roundedCorners(@NonNull BitmapPool pool, @NonNull Bitmap inBitmap, int width, int height, int roundingRadius) { Preconditions.checkArgument(width > 0, "width must be greater than 0."); Preconditions.checkArgument(height > 0, "height must be greater than 0."); Preconditions.checkArgument(roundingRadius > 0, "roundingRadius must be greater than 0."); Bitmap toTransform = getAlphaSafeBitmap(pool, inBitmap); Bitmap result = pool.get(width, height, Bitmap.Config.ARGB_8888); setAlphaIfAvailable(result, true ); BitmapShader shader = new BitmapShader(toTransform, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setShader(shader); RectF rect = new RectF(0, 0, result.getWidth(), result.getHeight()); BITMAP_DRAWABLE_LOCK.lock(); try { Canvas canvas = new Canvas(result); canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); canvas.drawRoundRect(rect, roundingRadius, roundingRadius, paint); clear(canvas); } finally { BITMAP_DRAWABLE_LOCK.unlock(); } if (!toTransform.equals(inBitmap)) { pool.put(toTransform); } return result; }
Source:
<code>public void shouldThrowException_whenPrivateKeyIsInvalid() { <START> when(mockApplePayConfig.getPrivateKey()).thenReturn("nope".getBytes()); <END> applePayDecrypter = new ApplePayDecrypter(mockConfig, objectMapper); applePayDecrypter.performDecryptOperation( data, ephemeralKey ); }</code><technical_language>more place for getBytes(StandardCharsets.UTF_8)</technical_language>

Target:
public void shouldThrowException_whenPrivateKeyIsInvalid() { when(mockApplePayConfig.getPrivateKey()).thenReturn("nope".getBytes(UTF_8)); applePayDecrypter = new ApplePayDecrypter(mockConfig, objectMapper); applePayDecrypter.performDecryptOperation( DATA, EPHEMERAL_KEY ); }
Source:
<code>public List<String> getExamples() { return Lists.newArrayList( "# Print every column size in byte and percentage for a Parquet file", "sample.parquet", <START> "sample.parquet col_1 col_2", "sample.parquet col_1 col_2.sub_col_a" <END> ); }</code><technical_language>I think, of -c, --column --columns is missing</technical_language>

Target:
public List<String> getExamples() { return Lists.newArrayList( "# Print every column size in byte and ratio for a Parquet file", "sample.parquet", "sample.parquet -c col_1", "sample.parquet --column col_2", "sample.parquet --columns col_1 col_2", "sample.parquet --columns col_1 col_2.sub_col_a" ); }
Source:
<code>public boolean select(Viewer viewer, Object parentElement, Object element) { DRepresentation representation = null; if (element instanceof DRepresentation) { representation = (DRepresentation) element; } else if (element instanceof DRepresentationDescriptor) { DRepresentationDescriptor repDesc = (DRepresentationDescriptor) element; representation = repDesc.isLoadedRepresentation() ? repDesc.getRepresentation() : null; } else if (element instanceof RepresentationItemImpl) { DRepresentationDescriptor repDesc = ((RepresentationItemImpl) element).getDRepresentationDescriptor(); if (repDesc != null) { representation = repDesc.isLoadedRepresentation() ? repDesc.getRepresentation() : null; } } if (representation != null) { return <START> !new DRepresentationQuery(representation).isDanglingRepresentation(); <END> } return true; }</code><technical_language>need test if target is null. DRepresentationDescriptor instead of DRepresentation</technical_language>

Target:
public boolean select(Viewer viewer, Object parentElement, Object element) { boolean select = true; DRepresentationDescriptor repDesc = null; if (element instanceof DRepresentation) { select = !new DRepresentationQuery((DRepresentation) element).isDanglingRepresentation(); } else if (element instanceof DRepresentationDescriptor) { repDesc = (DRepresentationDescriptor) element; } else if (element instanceof RepresentationItemImpl) { repDesc = ((RepresentationItemImpl) element).getDRepresentationDescriptor(); } if (repDesc != null) { select = !new DRepresentationDescriptorQuery(repDesc).isDangling(); } return select; }
Source:
<code><START> public void setFocus() { <END> }</code><technical_language>Call setFocus() table control</technical_language>

Target:
public void setFocus() { if (fTableViewer != null) { fTableViewer.getTableViewer().getControl().setFocus(); } }
Source:
<code>protected static void createStableBranch(Repository myRepository) throws IOException { String newRefName = "refs/heads/stable"; RefUpdate updateRef = myRepository.updateRef(newRefName); Ref sourceBranch = <START> myRepository.findRef("refs/heads/master"); <END> ObjectId startAt = sourceBranch.getObjectId(); String startBranch = Repository.shortenRefName(sourceBranch.getName()); updateRef.setNewObjectId(startAt); updateRef .setRefLogMessage("branch: Created from " + startBranch, false); updateRef.update(); }</code><technical_language>exactRef</technical_language>

Target:
protected static void createStableBranch(Repository myRepository) throws IOException { String newRefName = "refs/heads/stable"; RefUpdate updateRef = myRepository.updateRef(newRefName); Ref sourceBranch = myRepository.exactRef("refs/heads/master"); ObjectId startAt = sourceBranch.getObjectId(); String startBranch = Repository.shortenRefName(sourceBranch.getName()); updateRef.setNewObjectId(startAt); updateRef .setRefLogMessage("branch: Created from " + startBranch, false); updateRef.update(); }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { log.debug("Entered SsoPostLoginFilter"); HttpServletRequest req = (HttpServletRequest) request; try { String engineSessionId = (String) req.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); if (StringUtils.isEmpty(engineSessionId) && req.getSession(false) != null) { engineSessionId = (String) req.getSession(false). getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); } if (StringUtils.isNotEmpty(engineSessionId)) { InitialContext ctx = new InitialContext(); try { String ssoToken = (String) runQuery(VdcQueryType.GetEngineSessionIdToken, engineSessionId, ctx); log.debug("Adding userInfo to session"); DbUser loggedInUser = (DbUser) runQuery(VdcQueryType.GetUserBySessionId, engineSessionId, ctx); req.getSession(true).setAttribute(ATTR_USER_INFO, getUserInfoObject(loggedInUser, ssoToken)); chain.doFilter(request, response); } finally { ctx.close(); } } else { log.warn("Missing sessionId in either request or session scope. " + <START> "Please configure SSO properly with SsoPostLoginServlet."); <END> } } catch (Exception ex) { log.error("Unable to get token for engine session {}", ex.getMessage()); } log.debug("Exiting SsoPostLoginFilter"); }</code><technical_language>line in message skipped. A warning sufficient long client handle lack of user info in session</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { log.debug("Entered SsoPostLoginFilter"); HttpServletRequest req = (HttpServletRequest) request; try { String engineSessionId = (String) req.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); if (StringUtils.isEmpty(engineSessionId) && req.getSession(false) != null) { engineSessionId = (String) req.getSession(false). getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); } if (StringUtils.isNotEmpty(engineSessionId)) { InitialContext ctx = new InitialContext(); try { String ssoToken = (String) runQuery(VdcQueryType.GetEngineSessionIdToken, engineSessionId, ctx); log.debug("Adding userInfo to session"); DbUser loggedInUser = (DbUser) runQuery(VdcQueryType.GetUserBySessionId, engineSessionId, ctx); req.getSession(true).setAttribute(ATTR_USER_INFO, getUserInfoObject(loggedInUser, ssoToken)); chain.doFilter(request, response); } finally { ctx.close(); } } else { log.warn("Missing sessionId in either request or session scope. " + "Please configure SSO properly with SsoPostLoginServlet."); } } catch (Exception ex) { log.error("Unable to get token for engine session {}", ex.getMessage()); log.debug("Exception", ex); } log.debug("Exiting SsoPostLoginFilter"); }
Source:
<code>public void setContext(Token token, final EndpointContext ctx) { if (token != null && ctx != null) { <START> Observation obs = map.get(token); <END> if (obs != null) { map.put(token, new Observation(obs.getRequest(), ctx)); } } }</code><technical_language>I feel this method done atomicly, case this is out of topic</technical_language>

Target:
public void setContext(Token token, final EndpointContext ctx) { if (token != null && ctx != null) { Observation obs = map.get(token); if (obs != null) { map.replace(token, obs, new Observation(obs.getRequest(), ctx)); } } }
Source:
<code>List<OCSPResp> sendOcspRequests(X509Certificate cert, OCSPReq ocspRequest) { Set<String> urlsToCheck = new HashSet<>(); if (ocspServerUrls != null) { urlsToCheck.addAll(ocspServerUrls); } urlsToCheck.addAll(getOcspUrlsFromCert(cert)); List<OCSPResp> ocspResponses = new ArrayList<>(); for (String ocspServerUrl : urlsToCheck) { if (isNotBlank(ocspServerUrl)) { try { SecureCxfClientFactory cxfClientFactory = factory.getSecureCxfClientFactory(ocspServerUrl, WebClient.class); WebClient client = cxfClientFactory .getWebClient() .accept("application/ocsp-response") .type("application/ocsp-request"); Response response = client.post(ocspRequest.getEncoded()); ocspResponses.add(createOcspResponse(response)); continue; } catch (IOException | OcspCheckerException | ProcessingException ignore) { <START> } <END> } ocspResponses.add(null); } return ocspResponses; }</code><technical_language>Log exception information</technical_language>

Target:
Map<String, CertificateStatus> sendOcspRequests(X509Certificate cert, OCSPReq ocspRequest) { Set<String> urlsToCheck = new HashSet<>(); if (ocspServerUrls != null) { urlsToCheck.addAll(ocspServerUrls); } urlsToCheck.addAll(getOcspUrlsFromCert(cert)); Map<String, CertificateStatus> ocspStatuses = new HashMap<>(); for (String ocspServerUrl : urlsToCheck) { if (isNotBlank(ocspServerUrl)) { try { SecureCxfClientFactory cxfClientFactory = factory.getSecureCxfClientFactory(ocspServerUrl, WebClient.class); WebClient client = cxfClientFactory .getWebClient() .accept("application/ocsp-response") .type("application/ocsp-request"); Response response = client.post(ocspRequest.getEncoded()); OCSPResp ocspResponse = createOcspResponse(response); ocspStatuses.put(ocspServerUrl, getStatusFromOcspResponse(ocspResponse)); continue; } catch (IOException | OcspCheckerException | ProcessingException e) { LOGGER.debug( "Problem with the response from the OCSP Server at URL {}." + CONTINUING_MSG, ocspServerUrl, e); } } ocspStatuses.put( ocspServerUrl, new UnknownStatus()); } return ocspStatuses; }
Source:
<code>public void resetLogLevel() throws Exception { Logger root = LogManager.getRootLogger(); Level initialLevel = root.getLevel(); assertNotEquals( initialLevel, Level.ALL ); root.setLevel( Level.ALL ); <START> assertEquals( Level.ALL, root.getLevel() ); <END> Response res = target.resetLogLevel(); assertNotEquals( Level.ALL, LogManager.getRootLogger().getLevel() ); assertEquals( "Done", res.getEntity().toString() ); }</code><technical_language>checking level is equal ALL, check equal expected value</technical_language>

Target:
public void resetLogLevel() throws Exception { Logger root = LogManager.getRootLogger(); Level initialLevel = root.getLevel(); assertNotEquals( initialLevel, Level.ALL ); root.setLevel( Level.ALL ); assertEquals( Level.ALL, root.getLevel() ); Response res = target.reloadConfiguration(); assertNotEquals( Level.ALL, LogManager.getRootLogger().getLevel() ); assertEquals( "Done", res.getEntity().toString() ); }
Source:
<code>public void assignOperators(ID roamingGroupID, List<ID> ids) { List<Object> operatorIDs = Lists.newArrayList(); for (ID id : ids) { operatorIDs.add(id.value); } List<OperatorEntity> entities = datastore.findAllObjectsByFilter(OperatorEntity.class, Filter.where("_id").in(operatorIDs).and("state").is(OperatorState.ACTIVE.name())); <START> datastore.update(RoamingGroupEntity.class, Filter.where("_id").is(roamingGroupID.value), UpdateStatement.addToSet("operatorIDs").append(getIDOfOperators(entities))); <END> }</code><technical_language>getIDOfOperators(entities) is readable, assign a variable</technical_language>

Target:
public void assignOperators(ID roamingGroupID, List<ID> ids) { RoamingGroupEntity entity = datastore.findById(RoamingGroupEntity.class, roamingGroupID.value); if (entity == null) { throw new NotFoundException("Roaming group is unknown!"); } List<Object> activeOperatorIDs = getActiveOperatorIDs(entity, ids); datastore.update(RoamingGroupEntity.class, Filter.where("_id").is(roamingGroupID.value), UpdateStatement.update("operatorIDs").toBe(activeOperatorIDs)); }
Source:
<code>public void testList_NoOptionSingleContainer() throws IOException { blobStore.createContainerInLocation(null, CONTAINER_NAME); checkForContainerContent(CONTAINER_NAME, null); Set<String> blobsExpected = TestUtils.createBlobsInContainer(CONTAINER_NAME, "bbb" + "/" + "ccc" + "/" + "ddd" + "/" + "1234.jpg", "4rrr.jpg", "rrr" + "/" + "sss" <START> + "/" + "788.jpg", "xdc" + "/" + "wert.kpg"); <END> checkForContainerContent(CONTAINER_NAME, blobsExpected); }</code><technical_language>Collapse no-longer needed +</technical_language>

Target:
public void testList_NoOptionSingleContainer() throws IOException { blobStore.createContainerInLocation(null, CONTAINER_NAME); checkForContainerContent(CONTAINER_NAME, null); Set<String> blobsExpected = TestUtils.createBlobsInContainer(CONTAINER_NAME, "bbb/ccc/ddd/1234.jpg", "4rrr.jpg", "rrr/sss/788.jpg", "xdc/wert.kpg"); checkForContainerContent(CONTAINER_NAME, blobsExpected); }
Source:
<code>private Map.Entry<String, Object> metacardEntryToJsonEntry( final Map.Entry<String, Object> entry) { return transformations .stream() .filter(transformation -> entry.getKey().equals(transformation.getMetacardKey())) .findAny() .map( <START> transformation -> { <END> if (transformation.getExpectedMetacardType().isInstance(entry.getValue())) { final String newKey = transformation.getJsonKey(); return new AbstractMap.SimpleEntry<>( newKey, transformation.metacardValueToJsonValue( this, transformation.getExpectedMetacardType().cast(entry.getValue()))); } else { LOGGER.warn( "A workspace transformation expected a value of type for key \"{}\", but instead found a value of type {}!", transformation.getExpectedMetacardType().getName(), entry.getKey(), entry.getValue().getClass().getName()); return (Map.Entry<String, Object>) null; } }) .orElse(entry); }</code><technical_language>I this more readable if this extracted a separate method</technical_language>

Target:
private Optional<Map.Entry<String, Object>> metacardEntryToJsonEntry( final Map.Entry<String, Object> entry) { return transformations .stream() .filter(transformation -> entry.getKey().equals(transformation.getMetacardKey())) .findAny() .map(transformation -> metacardEntryToJsonEntry(entry, transformation)) .orElse(Optional.of(entry)); }
Source:
<code><START> public static void assertEquals(String message, CharSequence expected, CharSequence actual) { <END> Assert.assertEquals(message, expected, actual); }</code><technical_language>making changes code junit.framework</technical_language>

Target:
protected static void assertEquals(String message, CharSequence expected, CharSequence actual) { Assert.assertEquals(message, expected.toString(), actual.toString()); }
Source:
<code>public Metadata updateMetadata(Metadata metadata) { this.getMetadata(metadata.getKey()).setDescription(metadata.getDescription()); this.getMetadata(metadata.getKey()).setValue(metadata.getValue()); <START> return this.getMetadata(metadata.getKey()); <END> }</code><technical_language>do need return metadata? updating object, part of method getMetadata if want obtain this data update it</technical_language>

Target:
public void updateMetadata(Metadata metadata) throws EntityNotFoundException { if (metadata.getDescription() != null) { this.getMetadata(metadata.getKey()).setDescription(metadata.getDescription()); } this.getMetadata(metadata.getKey()).setValue(metadata.getValue()); }
Source:
<code><START> void createSafeSpace(SafeSpaceIdentifier safeSpaceId) throws CachePersistenceException; <END> FileBasedPersistenceContext createContextWithin(SafeSpaceIdentifier safeSpaceId, String name) throws CachePersistenceException; void destroySafeSpace(SafeSpaceIdentifier safeSpaceId, boolean verbose); void destroyAll(String owner); void destroySafeSpace(String owner, String name, boolean verbose); interface SafeSpaceIdentifier {}</code><technical_language>discussed @rkavanap this return a FileBasedPersistenceContext (name revised though)</technical_language>

Target:
void createSafeSpace(SafeSpaceIdentifier safeSpaceId) throws CachePersistenceException; void destroySafeSpace(SafeSpaceIdentifier safeSpaceId, boolean verbose); void destroyAll(String owner); interface SafeSpaceIdentifier { File getRoot(); }
Source:
<code>private void copyQuotaPermissions() { if (!getParameters().isCopyPermissions()) { return; } UniquePermissionsSet permissionsToAdd = new UniquePermissionsSet(); List<permissions> vmPermissions = getDbFacade().getPermissionDao().getAllForEntity(getParameters().getQuotaId(), getCurrentUser().getUserId(), false); for (permissions vmPermission : vmPermissions) { permissionsToAdd.addPermission(vmPermission.getad_element_id(), vmPermission.getrole_id(), <START> getQuotaId(), VdcObjectType.Quota); <END> } if (!permissionsToAdd.isEmpty()) { List<permissions> permissionsList = permissionsToAdd.asPermissionList(); MultiLevelAdministrationHandler.addPermission(permissionsList.toArray(new permissions[permissionsList.size()])); } }</code><technical_language>overriding object type is error prone. vmPermmision.getObjectType() instead</technical_language>

Target:
private void copyQuotaPermissions() { UniquePermissionsSet permissionsToAdd = new UniquePermissionsSet(); List<permissions> vmPermissions = getDbFacade().getPermissionDao().getAllForEntity(getParameters().getQuotaId(), getCurrentUser().getId(), false); for (permissions vmPermission : vmPermissions) { permissionsToAdd.addPermission(vmPermission.getad_element_id(), vmPermission.getrole_id(), getQuotaId(), vmPermission.getObjectType()); } if (!permissionsToAdd.isEmpty()) { List<permissions> permissionsList = permissionsToAdd.asPermissionList(); MultiLevelAdministrationHandler.addPermission(permissionsList.toArray(new permissions[permissionsList.size()])); } }
Source:
<code>public void testInvalidExtensionPoint() throws Exception { ComponentWithXPoint co = (ComponentWithXPoint) Framework.getRuntime().getComponent(ComponentWithXPoint.NAME); DummyContribution[] contribs = co.getContributions(); assertEquals(0, contribs.length); List<String> warnings = Framework.getRuntime().getWarnings(); assertEquals(1, warnings.size()); assertEquals("Failed to load contributions for component service:OverridingXPoint-witherror", warnings.get(0)); assertEquals(1, loggingEvents.size()); LoggingEvent event = loggingEvents.get(0); <START> assertEquals("ERROR", event.getLevel().toString()); <END> assertEquals("Failed to load contributions for component service:OverridingXPoint-witherror", event.getRenderedMessage()); Throwable t = event.getThrowableInformation().getThrowable(); assertEquals(RuntimeException.class, t.getClass()); assertEquals("Cannot load class: this-is-not-a-class while processing component: OverridingXPoint-witherror", t.getMessage()); }</code><technical_language>assertEquals(org.apache.log4j.Level.ERROR, event.getLevel());</technical_language>

Target:
public void testInvalidExtensionPoint() throws Exception { ComponentWithXPoint co = (ComponentWithXPoint) Framework.getRuntime().getComponent(ComponentWithXPoint.NAME); DummyContribution[] contribs = co.getContributions(); assertEquals(0, contribs.length); List<String> warnings = Framework.getRuntime().getWarnings(); assertEquals(1, warnings.size()); assertEquals("Failed to load contributions for component service:OverridingXPoint-witherror", warnings.get(0)); assertEquals(1, loggingEvents.size()); LoggingEvent event = loggingEvents.get(0); assertEquals(Level.ERROR, event.getLevel()); assertEquals("Failed to load contributions for component service:OverridingXPoint-witherror", event.getRenderedMessage()); Throwable t = event.getThrowableInformation().getThrowable(); assertEquals(RuntimeException.class, t.getClass()); assertEquals("Cannot load class: this-is-not-a-class while processing component: OverridingXPoint-witherror", t.getMessage()); }
Source:
<code>public int add(InputRow row, Supplier<Committer> committerSupplier) throws IndexSizeExceededException { if (row == null) { return -1; } Sink sink = getSink(row.getTimestampFromEpoch()); if (sink == null) { return -1; } final int numRows = sink.add(row); <START> if (!sink.canAppendRow()) { <END> persist(committerSupplier.get()); } return numRows; }</code><technical_language>is this needed for test</technical_language>

Target:
public int add(InputRow row, Supplier<Committer> committerSupplier) throws IndexSizeExceededException { if (row == null) { return -1; } Sink sink = getSink(row.getTimestampFromEpoch()); if (sink == null) { return -1; } return sink.add(row); }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FUNCDEF, ctx -> { FunctionDef functionDef = (FunctionDef) ctx.syntaxNode(); ControlFlowGraph cfg = ControlFlowGraph.build(functionDef, ctx.pythonFile()); if (cfg == null) { return; } LiveVariablesAnalysis lva = LiveVariablesAnalysis.analyze(cfg); Set<CfgBlock> unreachableBlocks = unreachableBlocks(cfg); cfg.blocks().forEach(block -> { List<DeadStoreUtils.UnnecessaryAssignment> unnecessaryAssignments = DeadStoreUtils.findUnnecessaryAssignments(block, lva.getLiveVariables(block), functionDef); unnecessaryAssignments.stream() .filter(assignment -> assignment.symbol.usages().stream().filter(Usage::isBindingUsage).count() > 1) .filter(assignment -> unreachableBlocks.stream().noneMatch(unreachableBlock -> lva.getLiveVariables(unreachableBlock).usedSymbols().contains(assignment.symbol))) <START> .filter((assignment -> isParameter(assignment.element))) <END> .forEach(assignment -> ctx.addIssue(assignment.element, String.format(MESSAGE_TEMPLATE, assignment.symbol.name()))); }); }); }</code><technical_language>filter isParameter end soon possible</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FUNCDEF, ctx -> { FunctionDef functionDef = (FunctionDef) ctx.syntaxNode(); ControlFlowGraph cfg = ControlFlowGraph.build(functionDef, ctx.pythonFile()); if (cfg == null) { return; } LiveVariablesAnalysis lva = LiveVariablesAnalysis.analyze(cfg); Set<CfgBlock> unreachableBlocks = unreachableBlocks(cfg); cfg.blocks().forEach(block -> { List<DeadStoreUtils.UnnecessaryAssignment> unnecessaryAssignments = DeadStoreUtils.findUnnecessaryAssignments(block, lva.getLiveVariables(block), functionDef); unnecessaryAssignments.stream() .filter((assignment -> isParameter(assignment.element))) .filter(assignment -> assignment.symbol.usages().stream().filter(Usage::isBindingUsage).count() > 1) .filter(assignment -> !isSymbolUsedInUnreachableBlocks(lva, unreachableBlocks, assignment.symbol)) .forEach(assignment -> ctx.addIssue(assignment.element, String.format(MESSAGE_TEMPLATE, assignment.symbol.name()))); }); }); }
Source:
<code>protected void doTest(@NotNull String codeBefore, @NotNull String expectedCodeAfter, @NotNull String surrounderDescription, boolean apply) { PsiFile file = myFixture.configureByText("a.go", normalizeCode(codeBefore)); ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { CommandProcessor.getInstance().executeCommand(getProject(), new Runnable() { @Override public void run() { <START> if (!CodeInsightUtilBase.prepareEditorForWrite(myFixture.getEditor())) return; <END> List<AnAction> applicable = SurroundWithHandler.buildSurroundActions(myFixture.getProject(), myFixture.getEditor(), file, null); if (applicable == null) return; String suffix = ". " + surrounderDescription; for (AnAction action : applicable) { String actionPresentation = action.getTemplatePresentation().getText(); if (actionPresentation != null && StringUtil.endsWith(actionPresentation, suffix)) { assert apply; myFixture.testAction(action); return; } } } }, "Surround action", null); } }); if (apply) { myFixture.checkResult(normalizeCode(expectedCodeAfter), true); } }</code><technical_language>is needed in tests</technical_language>

Target:
protected void doTest(@NotNull String codeBefore, @NotNull String expectedCodeAfter, @NotNull String surrounderDescription, boolean apply) { PsiFile file = myFixture.configureByText("a.go", normalizeCode(codeBefore)); List<AnAction> applicable = SurroundWithHandler.buildSurroundActions(myFixture.getProject(), myFixture.getEditor(), file, null); if (applicable == null) { assertFalse(apply); return; } String suffix = ". " + surrounderDescription; for (AnAction action : applicable) { String actionPresentation = action.getTemplatePresentation().getText(); if (actionPresentation != null && StringUtil.endsWith(actionPresentation, suffix)) { assertTrue(apply); myFixture.testAction(action); return; } } if (apply) { myFixture.checkResult(normalizeCode(expectedCodeAfter), true); } }
Source:
<code>protected ValidationResult validateRemovedUnmanagedNetworks( Collection<String> removedUnmanagedNetworks, Collection<VdsNetworkInterface> existingInterfaces, BusinessEntityMap<Network> networkBusinessEntityMap) { for (String removedUnmanagedNetworkName : removedUnmanagedNetworks){ Network network = networkBusinessEntityMap.get(removedUnmanagedNetworkName); if (network != null){ <START> return new ValidationResult(EngineMessage.REMOVED_UNMANAGED_NETWORK_IS_A_CLUSTER_NETWORK, <END> ReplacementUtils.createSetVariableString(NETWORK, removedUnmanagedNetworkName)); } ValidationResult result = validateNetworkIsAnUnmanagedNetworkOnHost(removedUnmanagedNetworkName, existingInterfaces); if (!result.isValid()){ return result; } } return ValidationResult.VALID; }</code><technical_language>leave code is. do Change message to- REMOVED_UNMANAGED_NETWORK_IS_A_CLUSTER_NETWORK = remove unmanaged network ${REMOVED_UNMANAGED_NETWORK_IS_A_CLUSTER_NETWORK_ENTITY} host, is existing cluster network. EngineMessage engineMessage = EngineMessage.REMOVED_UNMANAGED_NETWORK_IS_A_CLUSTER_NETWORK; return new ValidationResult(engineMessage, ReplacementUtils.getVariableAssignmentString(engineMessage, removedUnmanagedNetworkName));</technical_language>

Target:
protected ValidationResult validateRemovedUnmanagedNetworks( Collection<String> removedUnmanagedNetworks, Collection<VdsNetworkInterface> existingInterfaces, BusinessEntityMap<Network> networkBusinessEntityMap) { for (String removedUnmanagedNetworkName : removedUnmanagedNetworks){ Network network = networkBusinessEntityMap.get(removedUnmanagedNetworkName); if (network != null){ EngineMessage engineMessage = EngineMessage.REMOVED_UNMANAGED_NETWORK_IS_A_CLUSTER_NETWORK; return new ValidationResult(engineMessage, ReplacementUtils.getVariableAssignmentString(engineMessage, removedUnmanagedNetworkName)); } ValidationResult result = validateNetworkIsAnUnmanagedNetworkOnHost(removedUnmanagedNetworkName, existingInterfaces); if (!result.isValid()){ return result; } } return ValidationResult.VALID; }
Source:
<code>public List<Suggestion> enhanceResults(List<Suggestion> results, String query) { LiteralSuggestion literal = getLatLonSuggestions(query); if (literal != null && literal.hasGeo()) { results.add(0, literal); } <START> return results; <END> }</code><technical_language>this method return List assigned anything</technical_language>

Target:
public void enhanceResults(List<Suggestion> results, String query) { final LiteralSuggestion literal = getLatLonSuggestions(query); if (literal != null && literal.hasGeo()) { LOGGER.trace("Adding the Lat/Lon suggestion to results [{}]", literal); results.add(0, literal); } }
Source:
<code>public void testCreateZipMultipleResourceTypes() throws Exception { Map result = cloudinary.uploader().createZip(ObjectUtils.asMap("fully_qualified_public_ids",(new String[]{SRC_FULLY_QUALIFIED_IMAGE,SRC_FULLY_QUALIFIED_VIDEO}))); assertEquals(2, result.get("file_count")); <START> cloudinary.api().deleteResources(Arrays.asList(result.get("public_id").toString()), asMap("resource_type", "raw")); <END> }</code><technical_language>works it, set resource_type auto demonstrate 'correct' usage of feature (in future fail setting it)</technical_language>

Target:
public void testCreateZipMultipleResourceTypes() throws Exception { Map result = cloudinary.uploader().createZip(ObjectUtils.asMap("fully_qualified_public_ids",(new String[]{SRC_FULLY_QUALIFIED_IMAGE,SRC_FULLY_QUALIFIED_VIDEO}),"resource_type","auto")); assertEquals(2, result.get("file_count")); cloudinary.api().deleteResources(Arrays.asList(result.get("public_id").toString()), asMap("resource_type", "raw")); }
Source:
<code>public boolean clientTunneledAuthenticationInProgress() { if (!isSASLConfigured) { return false; } try { if ((clientConfig.getJaasConfKey() != null) || ((Configuration.getConfiguration() != null) && (Configuration.getConfiguration().getAppConfigurationEntry(clientConfig.getProperty(ZKClientConfig.LOGIN_CONTEXT_NAME_KEY, ZKClientConfig.LOGIN_CONTEXT_NAME_KEY_DEFAULT)) != null))) { if (!isComplete() && !isFailed()) { return true; } <START> return !gotLastPacket; <END> } return false; } catch (SecurityException e) { LOG.debug("Could not retrieve login configuration", e); return false; } }</code><technical_language>final result is same, flow is changing a little. I more comfortable before, if checkstyle happy</technical_language>

Target:
public boolean clientTunneledAuthenticationInProgress() { if (!isSASLConfigured) { return false; } try { if ((clientConfig.getJaasConfKey() != null) || ((Configuration.getConfiguration() != null) && (Configuration.getConfiguration().getAppConfigurationEntry( clientConfig.getProperty( ZKClientConfig.LOGIN_CONTEXT_NAME_KEY, ZKClientConfig.LOGIN_CONTEXT_NAME_KEY_DEFAULT)) != null))) { if (!isComplete() && !isFailed()) { return true; } if (!gotLastPacket) { return true; } } return false; } catch (SecurityException e) { LOG.debug("Could not retrieve login configuration", e); return false; } }
Source:
<code>public EjectedCrew(Aero originalRide, int escapedThisRound) { super(); setCrew(new Crew(CrewType.CREW)); setChassis(SPACE_EJECT_NAME); setModel(originalRide.getDisplayName()); StringBuffer newName = new StringBuffer(getDisplayName()); <START> newName.append(" of ").append(originalRide.getDisplayName()); <END> displayName = newName.toString(); initializeInternal(escapedThisRound, Infantry.LOC_INFANTRY); setOriginalRideId(originalRide.getId()); setOriginalRideExternalId(originalRide.getExternalIdAsString()); }</code><technical_language>Kinda pointless a stringbuffer here, in a loop anything</technical_language>

Target:
public EjectedCrew(Aero originalRide, int escapedThisRound) { super(); setCrew(new Crew(CrewType.CREW)); setChassis(SPACE_EJECT_NAME); setModel(originalRide.getDisplayName()); String newName = new String(getDisplayName() + " of " + originalRide.getDisplayName()); displayName = newName; initializeInternal(escapedThisRound, Infantry.LOC_INFANTRY); setOriginalRideId(originalRide.getId()); setOriginalRideExternalId(originalRide.getExternalIdAsString()); }