auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain filterChain) throws IOException, ServletException { final HttpServletResponse httpResponse = (HttpServletResponse) response; try { filterChain.doFilter(request, response); } catch (final ServletException e) { final Throwable t = null == e.getCause() ? e : e.getCause(); ErrorHolder currentMatch = null; for (final ErrorHolder errorHolder : this.errors) { if (errorHolder.exactMatch(t)) { currentMatch = errorHolder; break; } else if (errorHolder.inheritanceMatch(t)) { currentMatch = errorHolder; } } if (currentMatch != null) { httpResponse.sendRedirect(currentMatch.getUrl()); } else { httpResponse.sendRedirect(defaultErrorRedirectPage); } } }

Target:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain filterChain) throws IOException, ServletException { final HttpServletResponse httpResponse = (HttpServletResponse) response; try { filterChain.doFilter(request, response); } catch (final ServletException e) { final Throwable rootCause = e.getCause() == null ? e : e.getCause(); ErrorHolder currentMatch = null; for (final ErrorHolder errorHolder : this.errors) { if (errorHolder.exactMatch(rootCause)) { currentMatch = errorHolder; break; } else if (errorHolder.inheritanceMatch(rootCause)) { currentMatch = errorHolder; } } if (currentMatch != null) { httpResponse.sendRedirect(currentMatch.getUrl()); } else { httpResponse.sendRedirect(defaultErrorRedirectPage); } } }
Source:
public void close() throws Exception { super.close(); if (fetcher != null) { FunctionUtils.closeFunction(fetcher); } if (allResultFutures != null) { for (JoinedRowResultFuture rf : allResultFutures) { if (rf != null) { rf.close(); } } } }

Target:
public void close() throws Exception { super.close(); if (fetcher != null) { FunctionUtils.closeFunction(fetcher); } if (allResultFutures != null) { for (JoinedRowResultFuture rf : allResultFutures) { rf.close(); } } }
Source:
public CanvasViolationImpl build() { final CanvasViolationImpl result = new CanvasViolationImpl(ruleViolation.getMessage(), ruleViolation.getViolationType()); if (ruleViolation instanceof AbstractRuleViolation) { final String uuid = ((AbstractRuleViolation) ruleViolation).getUuid(); if (null != uuid) { result.setUuid(uuid); ; } } return result; }

Target:
public CanvasViolationImpl build() { final CanvasViolationImpl result = new CanvasViolationImpl(ruleViolation.getMessage(), ruleViolation.getViolationType()); if (ruleViolation instanceof AbstractRuleViolation) { final String uuid = ((AbstractRuleViolation) ruleViolation).getUuid(); if (null != uuid) { result.setUuid(uuid); } } return result; }
Source:
private String parseLogLevel(int level) { if (level == LogService.NONE) return "NONE"; if (level == LogService.ERROR) return "ERROR"; if (level == LogService.WARN) return "WARN"; if (level == LogService.INFO) return "INFO"; if (level == LogService.DEBUG) return "DEBUG"; if (level == LogService.TRACE) return "TRACE"; return "WARN"; }

Target:
private String parseLogLevel(int level) { if (level == LogService.NONE) return "NONE"; if (level == LogService.ERROR) return "ERROR"; if (level == LogService.WARN) return "WARN"; if (level == LogService.INFO) return "INFO"; if (level == LogService.DEBUG) return "DEBUG"; if (level == LogService.TRACE) return "TRACE"; return "" + level; }
Source:
public void renameColumn(long columnIndex, String newName) { verifyColumnName(newName); if (getPrimaryKey() == columnIndex) { Table pkTable = getPrimaryKeyTable(); String className = tableNameToClassName(getName()); long rowIndex = pkTable.findFirstString(PRIMARY_KEY_CLASS_COLUMN_INDEX, className); if (rowIndex != NO_MATCH) { pkTable.getUncheckedRow(rowIndex).setString(PRIMARY_KEY_FIELD_COLUMN_INDEX, newName); } else { throw new IllegalStateException("PrimaryKey field is not properly recorded for " + className + "."); } } nativeRenameColumn(nativePtr, columnIndex, newName); }

Target:
public void renameColumn(long columnIndex, String newName) { verifyColumnName(newName); final String oldName = nativeGetColumnName(nativePtr, columnIndex); final long oldPkColumnIndex = getPrimaryKey(); nativeRenameColumn(nativePtr, columnIndex, newName); if (oldPkColumnIndex == columnIndex) { try { String className = tableNameToClassName(getName()); Table pkTable = getPrimaryKeyTable(); long pkRowIndex = pkTable.findFirstString(PRIMARY_KEY_CLASS_COLUMN_INDEX, className); if (pkRowIndex != NO_MATCH) { pkTable.setString(PRIMARY_KEY_FIELD_COLUMN_INDEX, pkRowIndex, newName); } else { throw new IllegalStateException("Non-existent PrimaryKey column cannot be renamed"); } } catch (Exception e) { nativeRenameColumn(nativePtr, columnIndex, oldName); throw e; } } }
Source:
RequestBuilder createRequest(String engineAuthToken) { RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, restApiBaseUrl); if (engineAuthToken != null) { builder.setHeader(ENGINE_AUTH_TOKEN_HEADER, engineAuthToken); } builder.setHeader("Session-TTL", restApiSessionTimeout); String preferValue = "persistent-auth, csrf-protection"; if (engineAuthToken != null) { preferValue += ", new-auth"; } builder.setHeader("Prefer", preferValue); String sessionId = getSessionId(); if (sessionId != null) { builder.setHeader(SESSION_ID_HEADER, sessionId); } return builder; }

Target:
RequestBuilder createRequest(String engineAuthToken) { RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, restApiBaseUrl); builder.setHeader("Session-TTL", restApiSessionTimeout); String preferValue = "persistent-auth, csrf-protection"; if (engineAuthToken != null) { preferValue += ", new-auth"; builder.setHeader(ENGINE_AUTH_TOKEN_HEADER, engineAuthToken); } builder.setHeader("Prefer", preferValue); String sessionId = getSessionId(); if (sessionId != null) { builder.setHeader(SESSION_ID_HEADER, sessionId); } return builder; }
Source:
private void loadMetadataResources(JobModel jobModel) { MetadataStore metadataStore = null; try { createCoordinatorStream(); MetadataStoreFactory metadataStoreFactory = Util.getObj(new JobConfig(config).getMetadataStoreFactory(), MetadataStoreFactory.class); metadataStore = metadataStoreFactory.getMetadataStore(SetConfig.TYPE, config, metrics.getMetricsRegistry()); metadataStore.init(); MetadataResourceManager metadataResourceManager = new MetadataResourceManager(metadataStore, jobModel, metrics.getMetricsRegistry()); metadataResourceManager.createResources(); CoordinatorStreamValueSerde jsonSerde = new CoordinatorStreamValueSerde(SetConfig.TYPE); for (Map.Entry<String, String> entry : config.entrySet()) { byte[] serializedValue = jsonSerde.toBytes(entry.getValue()); String configKey = CoordinatorStreamStore.serializeCoordinatorMessageKeyToJson(SetConfig.TYPE, entry.getKey()); metadataStore.put(configKey, serializedValue); } } finally { if (metadataStore != null) { LOG.info("Stopping the coordinator system producer."); metadataStore.close(); } } }

Target:
private void loadMetadataResources(JobModel jobModel) { MetadataStore metadataStore = null; try { createCoordinatorStream(); MetadataStoreFactory metadataStoreFactory = Util.getObj(new JobConfig(config).getMetadataStoreFactory(), MetadataStoreFactory.class); metadataStore = metadataStoreFactory.getMetadataStore(SetConfig.TYPE, config, metrics.getMetricsRegistry()); metadataStore.init(); MetadataResourceUtil metadataResourceUtil = new MetadataResourceUtil(jobModel, metrics.getMetricsRegistry()); metadataResourceUtil.createResources(); CoordinatorStreamValueSerde jsonSerde = new CoordinatorStreamValueSerde(SetConfig.TYPE); for (Map.Entry<String, String> entry : config.entrySet()) { byte[] serializedValue = jsonSerde.toBytes(entry.getValue()); String configKey = CoordinatorStreamStore.serializeCoordinatorMessageKeyToJson(SetConfig.TYPE, entry.getKey()); metadataStore.put(configKey, serializedValue); } } finally { if (metadataStore != null) { LOG.info("Stopping the coordinator system producer."); metadataStore.close(); } } }
Source:
public String createComment(CoreSession session, Comment comment) { return CoreInstance.doPrivileged(session, s -> { DocumentModel commentModel = s.createDocumentModel(CommentsConstants.COMMENT_DOC_TYPE); commentModel.setPropertyValue(COMMENT_AUTHOR, comment.getAuthor()); commentModel.setPropertyValue(COMMENT_TEXT, comment.getText()); commentModel.setPropertyValue(COMMENT_CREATION_DATE, comment.getCreationDate()); commentModel.setPropertyValue(COMMENT_MODIFICATION_DATE, comment.getModificationDate()); commentModel = s.createDocument(commentModel); return commentModel.getId(); }); }

Target:
public String createComment(CoreSession session, Comment comment) throws IllegalArgumentException { DocumentRef commentRef = new IdRef(comment.getDocumentId()); if (!session.exists(commentRef)) { throw new IllegalArgumentException("The document " + comment.getDocumentId() + " does not exist."); } DocumentModel docToComment = session.getDocument(commentRef); return createComment(docToComment, comment.getText(), comment.getAuthor()).getId(); }
Source:
public final Github github() { throw new NotImplementedException("MkMarkdown#github()"); }

Target:
public final Github github() { throw new UnsupportedOperationException("MkMarkdown#github()"); }
Source:
void fillChunks() { try { PutChunk chunkToFill; while (!isChunkFillingDone()) { if (channelReadBuffer == null) { channelReadBuffer = chunkFillerChannel.getNextChunk(0); } if (channelReadBuffer != null) { maybeStopTrackingWaitForChannelDataTime(); chunkToFill = getChunkToFill(); if (chunkToFill == null) { maybeStartTrackingWaitForChunkTime(); break; } else { maybeStopTrackingWaitForChunkTime(); bytesFilledSoFar += chunkToFill.fillFrom(channelReadBuffer); if (chunkToFill.isReady()) { routerCallback.onPollReady(); updateChunkFillerWaitTimeMetrics(); } if (!channelReadBuffer.hasRemaining()) { chunkFillerChannel.resolveOldestChunk(null); channelReadBuffer = null; } } } else { if (getFreeChunk() != null) { maybeStartTrackingWaitForChannelDataTime(); } break; } } if (chunkFillingCompletedSuccessfully) { PutChunk lastChunk = getBuildingChunk(); if (lastChunk != null) { if (chunkCounter != 0 && lastChunk.buf.position() == 0) { logger.trace("The last chunk received from ReadableStreamChannel has no data, discarding"); } else { lastChunk.onFillComplete(true); updateChunkFillerWaitTimeMetrics(); } } routerCallback.onPollReady(); } } catch (Exception e) { RouterException routerException = e instanceof RouterException ? (RouterException) e : new RouterException("PutOperation fillChunks encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError); routerMetrics.chunkFillerUnexpectedErrorCount.inc(); routerCallback.onPollReady(); setOperationExceptionAndComplete(routerException); } }

Target:
void fillChunks() { try { PutChunk chunkToFill; while (!isChunkFillingDone()) { if (channelReadBuffer == null) { channelReadBuffer = chunkFillerChannel.getNextChunk(0); } if (channelReadBuffer != null) { maybeStopTrackingWaitForChannelDataTime(); chunkToFill = getChunkToFill(); if (chunkToFill == null) { maybeStartTrackingWaitForChunkTime(); break; } else { maybeStopTrackingWaitForChunkTime(); bytesFilledSoFar += chunkToFill.fillFrom(channelReadBuffer); if (chunkToFill.isReady()) { routerCallback.onPollReady(); updateChunkFillerWaitTimeMetrics(); } if (!channelReadBuffer.hasRemaining()) { chunkFillerChannel.resolveOldestChunk(null); channelReadBuffer = null; } } } else { if (getFreeChunk() != null) { maybeStartTrackingWaitForChannelDataTime(); } break; } } if (chunkFillingCompletedSuccessfully) { PutChunk lastChunk = getBuildingChunk(); if (lastChunk != null) { if (chunkCounter != 0 && lastChunk.buf.position() == 0) { logger.trace("The last buffer(s) received from chunkFillerChannel have no data, discarding them."); } else { lastChunk.onFillComplete(true); updateChunkFillerWaitTimeMetrics(); } } routerCallback.onPollReady(); } } catch (Exception e) { RouterException routerException = e instanceof RouterException ? (RouterException) e : new RouterException("PutOperation fillChunks encountered unexpected error", e, RouterErrorCode.UnexpectedInternalError); routerMetrics.chunkFillerUnexpectedErrorCount.inc(); routerCallback.onPollReady(); setOperationExceptionAndComplete(routerException); } }
Source:
public ExpressionTree ALTERNATIVE_CONDITIONAL_AND_EXPR() { return b.<ExpressionTree>nonterminal(Kind.ALTERNATIVE_CONDITIONAL_AND).is( f.binaryExpression( ASSIGNMENT_OR_CONDITIONAL_EXPRESSION(), b.zeroOrMore(f.newTuple( b.firstOf(b.token(PHPKeyword.AND)), ASSIGNMENT_OR_CONDITIONAL_EXPRESSION())))); }

Target:
public ExpressionTree ALTERNATIVE_CONDITIONAL_AND_EXPR() { return b.<ExpressionTree>nonterminal(Kind.ALTERNATIVE_CONDITIONAL_AND).is( f.binaryExpression( CONDITIONAL_EXPR(), b.zeroOrMore(f.newTuple( b.firstOf(b.token(PHPKeyword.AND)), CONDITIONAL_EXPR())))); }
Source:
public static List<String> readLines(InputStream in) throws IOException { return readLines(in, Charset.forName(CHARSET_UTF8)); }

Target:
public static List<String> readLines(InputStream in) throws IOException { return readLines(in, StandardCharsets.UTF_8); }
Source:
private boolean redefineVmCheckpoints() { List<VmCheckpoint> checkpoints = vmCheckpointDao.getAllForVm(getVmId()); if (checkpoints.isEmpty()) { log.info("No previous VM checkpoints found for VM '{}', skip redefine VM checkpoints", getVmId()); return true; } List definedCheckpointsIds = performVmCheckpointsOperation(VDSCommandType.ListVmCheckpoints, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId())); if (definedCheckpointsIds != null && definedCheckpointsIds.contains(getParameters().getVmBackup() .getFromCheckpointId())) { log.info("Checkpoints chain already defined for VM '{}'", getVmId()); return true; } for (VmCheckpoint checkpoint : checkpoints) { List redefinedCheckpointsIds = performVmCheckpointsOperation(VDSCommandType.RedefineVmCheckpoints, new VmCheckpointsVDSParameters(getVdsId(), getVmId(), List.of(checkpoint))); if (redefinedCheckpointsIds == null || redefinedCheckpointsIds.isEmpty()) { return false; } } return true; }

Target:
private boolean redefineVmCheckpoints() { List<VmCheckpoint> checkpoints = vmCheckpointDao.getAllForVm(getVmId()); if (checkpoints.isEmpty()) { log.info("No previous VM checkpoints found for VM '{}', skip redefining VM checkpoints", getVmId()); return true; } List<Guid> definedCheckpointsIds = performVmCheckpointsOperation(VDSCommandType.ListVmCheckpoints, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId())); if (definedCheckpointsIds != null && definedCheckpointsIds.contains(getParameters().getVmBackup() .getFromCheckpointId())) { log.info("Checkpoints chain is already defined for VM '{}'", getVmId()); return true; } for (VmCheckpoint checkpoint : checkpoints) { List<Guid> redefinedCheckpointsIds = performVmCheckpointsOperation(VDSCommandType.RedefineVmCheckpoints, new VmCheckpointsVDSParameters(getVdsId(), getVmId(), List.of(checkpoint))); if (redefinedCheckpointsIds == null || redefinedCheckpointsIds.isEmpty()) { return false; } } return true; }
Source:
public Map toMap() { final Map authMap = new TreeMap<>(); if (push != null) { authMap.put("push", push); } if (pull != null) { authMap.put("pull", pull); } if (StringUtils.isNotBlank(username)) { authMap.put(AuthConfig.AUTH_USERNAME, username); } if (StringUtils.isNotBlank(password)) { authMap.put(AuthConfig.AUTH_PASSWORD, password); } if (StringUtils.isNotBlank(authToken)) { authMap.put(AuthConfig.AUTH_AUTH, authToken); } if (StringUtils.isNotBlank(auth)) { authMap.put(AuthConfig.AUTH_AUTH, auth); } if (StringUtils.isNotBlank(email)) { authMap.put(AuthConfig.AUTH_EMAIL, email); } return authMap; }

Target:
public Map toMap() { final Map authMap = new TreeMap<>(); if (push != null) { authMap.put("push", push); } if (pull != null) { authMap.put("pull", pull); } if (StringUtils.isNotBlank(username)) { authMap.put(AuthConfig.AUTH_USERNAME, username); } if (StringUtils.isNotBlank(password)) { authMap.put(AuthConfig.AUTH_PASSWORD, password); } if (StringUtils.isNotBlank(authToken) && StringUtils.isNotBlank(auth)) { throw new IllegalStateException("For a registry configuration either 'auth' or 'authToken' (deprecated) can be specified but not both. Use only 'auth' and remove 'authToken' in the registry configuration"); } if (StringUtils.isNotBlank(authToken)) { authMap.put(AuthConfig.AUTH_AUTH, authToken); } if (StringUtils.isNotBlank(auth)) { authMap.put(AuthConfig.AUTH_AUTH, auth); } if (StringUtils.isNotBlank(email)) { authMap.put(AuthConfig.AUTH_EMAIL, email); } return authMap; }
Source:
private static boolean implementsSerializable(@Nullable Type type) { if (type == null || type.isUnknown()) { return false; } if (type.isPrimitive()) { return true; } if (type.isArray()) { return implementsSerializable(((Type.ArrayType) type).elementType()); } if (type.isClass() || ((JavaType) type).isTagged(JavaType.TYPEVAR)) { return type.erasure().isSubtypeOf(Serializable.class.getName()); } return false; }

Target:
private static boolean implementsSerializable(@Nullable Type type) { if (type == null || type.isUnknown()) { return false; } if (type.isPrimitive()) { return true; } if (type.isArray()) { return implementsSerializable(((Type.ArrayType) type).elementType()); } if (type.isClass() || ((JavaType) type).isTagged(JavaType.TYPEVAR)) { return type.erasure().isSubtypeOf("java.io.Serializable"); } return false; }
Source:
boolean isDataSourcesTableStale() { if ((null == db) || (null == sleuthKitCase)) { return false; } try { Set<Long> knownDataSourceIds= db.getKnownDataSourceIds(); List<DataSource> dataSources = sleuthKitCase.getDataSources(); Set<Long> caseDataSourceIds = new HashSet<>(); dataSources.forEach((dataSource) -> { caseDataSourceIds.add(dataSource.getId()); }); return !(knownDataSourceIds.containsAll(caseDataSourceIds) && caseDataSourceIds.containsAll(knownDataSourceIds)); } catch (TskCoreException ex) { LOGGER.log(Level.SEVERE, "Image Gallery failed to check if datasources table is stale.", ex); return false; } }

Target:
boolean isDataSourcesTableStale() { if ((null == getDatabase()) || (null == getSleuthKitCase())) { return false; } try { Set<Long> knownDataSourceIds= getDatabase().getDataSourceIds(); List<DataSource> dataSources = getSleuthKitCase().getDataSources(); Set<Long> caseDataSourceIds = new HashSet<>(); dataSources.forEach((dataSource) -> { caseDataSourceIds.add(dataSource.getId()); }); return !(knownDataSourceIds.containsAll(caseDataSourceIds) && caseDataSourceIds.containsAll(knownDataSourceIds)); } catch (TskCoreException ex) { LOGGER.log(Level.SEVERE, "Image Gallery failed to check if datasources table is stale.", ex); return false; } }
Source:
public Expression createExpression(String expression) { ObjectHelper.notNull(expression, "expression"); String beanName = expression; String method = null; if (expression.contains("?method=")) { beanName = ObjectHelper.before(expression, "?"); method = ObjectHelper.after(expression, "?method="); } else { int idx = expression.indexOf('.'); if (idx > 0) { beanName = expression.substring(0, idx); method = expression.substring(idx + 1); } else { int doubleColonIndex = expression.indexOf("::"); if (doubleColonIndex > 0) { beanName = expression.substring(0, doubleColonIndex); method = expression.substring(doubleColonIndex + 2); } } } return new BeanExpression(beanName, method); }

Target:
public Expression createExpression(String expression) { ObjectHelper.notNull(expression, "expression"); String beanName = expression; String method = null; if (expression.contains("?method=")) { beanName = ObjectHelper.before(expression, "?"); method = ObjectHelper.after(expression, "?method="); } else { int doubleColonIndex = expression.indexOf("::"); int beginOfParameterDeclaration = expression.indexOf("("); if (doubleColonIndex > 0 && (expression.indexOf("(") < 0 || doubleColonIndex < beginOfParameterDeclaration)) { beanName = expression.substring(0, doubleColonIndex); method = expression.substring(doubleColonIndex + 2); } else { int idx = expression.indexOf('.'); if (idx > 0) { beanName = expression.substring(0, idx); method = expression.substring(idx + 1); } } } return new BeanExpression(beanName, method); }
Source:
@Test public void conversionProblemOutgoingAsync() throws InterruptedException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new ToStringConverterFactory() { @Override public Converter<?, RequestBody> toRequestBody(Type type, Annotation[] annotations) { return new Converter<String, RequestBody>() { @Override public RequestBody convert(String value) throws IOException { throw new UnsupportedOperationException("I am broken!"); } }; } }) .build(); Service example = retrofit.create(Service.class); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); example.postString("Hi").enqueue(new Callback<String>() { @Override public void onResponse(Response<String> response, Retrofit retrofit) { throw new AssertionError(); } @Override public void onFailure(Throwable t) { failureRef.set(t); latch.countDown(); } }); assertTrue(latch.await(2, SECONDS)); Throwable failure = failureRef.get(); assertThat(failure).hasMessage("Can not create call for Service.postString(String), HTTP method = POST, relative path template = /"); assertThat(failure).hasCauseExactlyInstanceOf(UnsupportedOperationException.class); assertThat(failure.getCause()).hasMessage("I am broken!"); }

Target:
@Test public void conversionProblemOutgoingAsync() throws InterruptedException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new ToStringConverterFactory() { @Override public Converter<?, RequestBody> toRequestBody(Type type, Annotation[] annotations) { return new Converter<String, RequestBody>() { @Override public RequestBody convert(String value) throws IOException { throw new UnsupportedOperationException("I am broken!"); } }; } }) .build(); Service example = retrofit.create(Service.class); final AtomicReference<Throwable> failureRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); example.postString("Hi").enqueue(new Callback<String>() { @Override public void onResponse(Response<String> response, Retrofit retrofit) { throw new AssertionError(); } @Override public void onFailure(Throwable t) { failureRef.set(t); latch.countDown(); } }); assertTrue(latch.await(2, SECONDS)); Throwable failure = failureRef.get(); assertThat(failure).hasMessage("Can not create call for Service.postString(String), HTTP method = POST, relative path template = /"); assertThat(failure.getCause()).hasMessage("I am broken!") .isInstanceOf(UnsupportedOperationException.class); }
Source:
public void transform(StructuredRecord structuredRecord, Emitter<KeyValue<SolrInputField, SolrInputDocument>> emitter) throws Exception { String solrFieldName; SolrInputDocument document; SolrSearchSinkUtility.validateIdField(structuredRecord.getSchema(), config); SolrSearchSinkUtility.validateInputFieldsDataType(structuredRecord.getSchema()); if (structuredRecord.get(uniqueKey) == null) { return; } document = new SolrInputDocument(); for (Schema.Field field : structuredRecord.getSchema().getFields()) { solrFieldName = field.getName(); if (outputFieldMap.containsKey(solrFieldName)) { document.addField(outputFieldMap.get(solrFieldName), structuredRecord.get(solrFieldName)); } else { document.addField(solrFieldName, structuredRecord.get(solrFieldName)); } } solrClient.add(document); solrClient.commit(); emitter.emit(new KeyValue<>(document.getField(uniqueKey), document)); }

Target:
public void transform(StructuredRecord structuredRecord, Emitter<KeyValue<SolrInputField, SolrInputDocument>> emitter) throws Exception { String solrFieldName; SolrInputDocument document; config.verifySolrConfiguration(); config.validateIdField(structuredRecord.getSchema()); config.validateInputFieldsDataType(structuredRecord.getSchema()); if (structuredRecord.get(uniqueKey) == null) { return; } document = new SolrInputDocument(); for (Schema.Field field : structuredRecord.getSchema().getFields()) { solrFieldName = field.getName(); if (outputFieldMap.containsKey(solrFieldName)) { document.addField(outputFieldMap.get(solrFieldName), structuredRecord.get(solrFieldName)); } else { document.addField(solrFieldName, structuredRecord.get(solrFieldName)); } } solrClient.add(document); solrClient.commit(); emitter.emit(new KeyValue<>(document.getField(uniqueKey), document)); }
Source:
public Req understand(final Comment.Smart comment, final URI home) throws IOException { final String prefix = String.format("@%s", this.login); final Req req; final Matcher matcher = Pattern.compile( String.format(".*\\b?(%s\\b).*", prefix) ).matcher(comment.body().trim()); if (matcher.matches()) { if (matcher.start(1) == 0) { req = this.origin.understand(comment, home); } else { new Answer(comment).post( true, String.format( QnReferredTo.PHRASES .getString("QnReferredTo.mentioned"), prefix ) ); Logger.info( this, "mention found in #%d", comment.issue().number() ); req = Req.DONE; } } else { Logger.info( this, "comment #%d in %s#%d is not for me (no \"%s\" prefix)", comment.number(), comment.issue().repo().coordinates(), comment.issue().number(), prefix ); req = Req.EMPTY; } return req; }

Target:
public Req understand(final Comment.Smart comment, final URI home) throws IOException { final String prefix = String.format("@%s", this.login); final Req req; final Matcher matcher = Pattern.compile( String.format(QnReferredTo.MENTION_MATCHER, prefix) ).matcher(comment.body().trim()); if (matcher.matches()) { if (matcher.start(1) == 0) { req = this.origin.understand(comment, home); } else { new Answer(comment).post( true, String.format( QnReferredTo.PHRASES.getString( "QnReferredTo.mentioned" ), prefix ) ); Logger.info( this, "mention found in #%d", comment.issue().number() ); req = Req.DONE; } } else { Logger.info( this, "comment #%d in %s#%d is not for me (no \"%s\" prefix)", comment.number(), comment.issue().repo().coordinates(), comment.issue().number(), prefix ); req = Req.EMPTY; } return req; }
Source:
protected void testExecute_getRespondentsInCourse_shouldPass() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); loginAsInstructor(instructor1OfCourse1.googleId); testGettingRespondentsInCourse(); StudentAttributes student1InCourse1 = typicalBundle.students.get("student1InCourse1"); loginAsStudent(student1InCourse1.googleId); testGettingRespondentsInCourse(); }

Target:
protected void testExecute_getRespondentsInCourse_shouldPass() { InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1"); loginAsInstructor(instructor1OfCourse1.googleId); ______TS("At least 1 respondent"); assertTrue(logic.hasResponsesForCourse(instructor1OfCourse1.getCourseId())); String[] params = new String[] { Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId, }; GetHasResponsesAction getHasResponsesAction = getAction(params); JsonResult jsonResult = getJsonResult(getHasResponsesAction); HasResponsesData hasResponsesData = (HasResponsesData) jsonResult.getOutput(); assertEquals(HttpStatus.SC_OK, jsonResult.getStatusCode()); assertTrue(hasResponsesData.hasResponses()); ______TS("Course with 0 respondents"); InstructorAttributes instructor1OfCourse4 = typicalBundle.instructors.get("instructor1OfCourse4"); loginAsInstructor(instructor1OfCourse4.googleId); assertFalse(logic.hasResponsesForCourse(instructor1OfCourse4.getCourseId())); params = new String[] { Const.ParamsNames.COURSE_ID, instructor1OfCourse4.courseId, }; getHasResponsesAction = getAction(params); jsonResult = getJsonResult(getHasResponsesAction); hasResponsesData = (HasResponsesData) jsonResult.getOutput(); assertEquals(HttpStatus.SC_OK, jsonResult.getStatusCode()); assertFalse(hasResponsesData.hasResponses()); }
Source:
protected boolean mustCheckName(DetailAST ast) { final Scope theScope = calculateScope(ast); boolean checkName = true; if (ignoreOverridden && isOverriddenMethod(ast) || ast.getParent().getType() == TokenTypes.LITERAL_CATCH || CheckUtils.isReceiverParameter(ast) || !matchScope(theScope)) { checkName = false; } return checkName; }

Target:
protected boolean mustCheckName(DetailAST ast) { boolean checkName = true; final boolean isDefault = scope == Scope.ANONINNER && excludeScope == null; if (ignoreOverridden && isOverriddenMethod(ast) || ast.getParent().getType() == TokenTypes.LITERAL_CATCH || CheckUtils.isReceiverParameter(ast) || !isDefault && !matchScope(calculateScope(ast))) { checkName = false; } return checkName; }
Source:
private void rebalance() { if (null != sessionListSubscription) { final List<String> newSessions = sessionListSubscription.getData(); final String newHash = ZkSubscriptionClient.Topology.calculateSessionsHash(newSessions); zkClient.runLocked(() -> { final ZkSubscriptionClient.Topology topology = zkClient.getTopology(); if (!topology.isSameHash(newHash)) { log.info("Performing rebalance, hash changed: {}", newHash); final Partition[] changeset = rebalancer.apply(zkClient.listSessions(), topology.getPartitions()); if (changeset.length > 0) { zkClient.updatePartitionsConfiguration(newHash, changeset); } } else { log.info("Skipping rebalance, because hash is the same: {}", newHash); } }); } }

Target:
private void rebalance() { if (null != sessionListSubscription) { final List<String> newSessions = sessionListSubscription.getData(); final String sessionsHash = ZkSubscriptionClient.Topology.calculateSessionsHash(newSessions); zkClient.runLocked(() -> { final ZkSubscriptionClient.Topology topology = zkClient.getTopology(); if (!topology.isSameHash(sessionsHash)) { log.info("Performing rebalance, hash changed: {}", sessionsHash); final Collection<Session> newSessionsUnderLock = zkClient.listSessions(); final Partition[] changeset = rebalancer.apply(newSessionsUnderLock, topology.getPartitions()); if (changeset.length > 0) { final String actualHash = ZkSubscriptionClient.Topology.calculateSessionsHash( newSessionsUnderLock.stream().map(Session::getId).collect(Collectors.toList())); zkClient.updatePartitionsConfiguration(actualHash, changeset); } } else { log.info("Skipping rebalance, because hash is the same: {}", sessionsHash); } }); } }
Source:
protected int getParallelHostCount(UpgradeContext ctx, int defaultValue) { if (m_grouping.parallelScheduler != null) { int taskParallelism = m_grouping.parallelScheduler.maxDegreeOfParallelism; if (taskParallelism == ParallelScheduler.DEFAULT_MAX_DEGREE_OF_PARALLELISM) { taskParallelism = ctx.getDefaultMaxDegreeOfParallelism(); } } return defaultValue; }

Target:
protected int getParallelHostCount(UpgradeContext ctx, int defaultValue) { if (m_grouping.parallelScheduler != null) { int taskParallelism = m_grouping.parallelScheduler.maxDegreeOfParallelism; if (taskParallelism == ParallelScheduler.DEFAULT_MAX_DEGREE_OF_PARALLELISM) { taskParallelism = ctx.getDefaultMaxDegreeOfParallelism(); } return taskParallelism; } return defaultValue; }
Source:
private BufferedReadChannel getChannelForLogId(long entryLogId) throws IOException { BufferedReadChannel brc = getFromChannels(entryLogId); if (brc != null) { return brc; } FileChannel fc = null; try { fc = logid2FileChannel.get(entryLogId); } catch (ExecutionException e){ LOG.error("ExecutionException found in get fileChannel for log in logid2FileChannel cache", entryLogId); throw new IOException(e); } brc = new BufferedReadChannel(fc, conf.getReadBufferBytes()); putInReadChannels(entryLogId, brc); return brc; }

Target:
private EntryLogBufferedReadChannel getChannelForLogId(long entryLogId) throws IOException { try { EntryLogBufferedReadChannel brc; do { brc = logid2ReadChannel.get().get(entryLogId); if (!brc.cachedFileChannel.tryRetain()) { if (logid2ReadChannel.get().asMap().remove(entryLogId, brc)){ LOG.error("Dead fileChannel({}) forced out of cache." + "It must have been double-released somewhere.", brc.cachedFileChannel); } brc = null; } } while (brc == null); return brc; } catch (ExecutionException | UncheckedExecutionException ee) { if (ee.getCause() instanceof IOException) { throw (IOException) ee.getCause(); } else { throw new IOException("Failed to load file channel for entrylog " + entryLogId, ee); } } }
Source:
public Collection<CohortMembership> getMemberships() { if (memberships == null) { memberships = new TreeSet<>(); } return memberships; return memberships.stream().filter(m -> !m.isVoided()).collect(Collectors.toList()); }

Target:
public Collection<CohortMembership> getMemberships() { if (memberships == null) { memberships = new TreeSet<>(); } return memberships; }
Source:
public void start() { this.logger.info( "The DM is about to be launched." ); DmMessageProcessor messageProcessor = new DmMessageProcessor( this ); this.messagingClient = new RCDm( this ); this.messagingClient.associateMessageProcessor( messageProcessor ); this.timer = new Timer( "Roboconf's Management Timer", false ); this.timer.scheduleAtFixedRate( new CheckerMessagesTask( this, this.messagingClient ), 0, TIMER_PERIOD ); this.timer.scheduleAtFixedRate( new CheckerHeartbeatsTask( this ), 0, Constants.HEARTBEAT_PERIOD ); reconfigure(); try { this.messagingClient.listenToDebugMessages( ListenerCommand.START ); } catch ( IOException e ) { this.logger.log( Level.WARNING, "Cannot start to listen to the debug queue", e ); } this.logger.info( "The DM was launched." ); }

Target:
public void start() { this.logger.info( "The DM is about to be launched." ); DmMessageProcessor messageProcessor = new DmMessageProcessor( this ); this.messagingClient = new RCDm( this ); this.messagingClient.associateMessageProcessor( messageProcessor ); this.timer = new Timer( "Roboconf's Management Timer", false ); this.timer.scheduleAtFixedRate( new CheckerMessagesTask( this, this.messagingClient ), 0, TIMER_PERIOD ); this.timer.scheduleAtFixedRate( new CheckerHeartbeatsTask( this ), 0, Constants.HEARTBEAT_PERIOD ); reconfigure(); this.logger.info( "The DM was launched." ); }
Source:
public synchronized void pmHealthCheck() { if (!active) { try { log.info("Power Management Health Check started."); active = true; List<VDS> hosts = DbFacade.getInstance().getVdsDao().getAll(); for (VDS host : hosts) { if (host.isPmEnabled()) { pmHealthCheck(host); } } log.info("Power Management Health Check completed."); } finally { active = false; } } }

Target:
public void pmHealthCheck() { Lock lock = new ReentrantLock(); if (lock.tryLock()) { try { log.info("Power Management Health Check started."); List<VDS> hosts = DbFacade.getInstance().getVdsDao().getAll(); for (VDS host : hosts) { if (host.isPmEnabled()) { pmHealthCheck(host); } } log.info("Power Management Health Check completed."); } finally { lock.unlock(); } } }
Source:
private void printArray(PrintStream ps, TaggedValuePointable tvp) { ArrayPointable ap = pp.takeOne(ArrayPointable.class); try { tvp.getValue(ap); int len = ap.getEntryCount(); ps.append('['); for (int i = 0; i < len; i++) { ap.getEntry(i, tvp); print(tvp.getByteArray(), tvp.getStartOffset(), tvp.getLength(), ps); if (i != len - 1) { ps.append(','); } } ps.append(']'); } finally { pp.giveBack(ap); pp.giveBack(tvp); } }

Target:
private void printArray(PrintStream ps, TaggedValuePointable tvp) { ArrayPointable ap = pp.takeOne(ArrayPointable.class); try { tvp.getValue(ap); int len = ap.getEntryCount(); ps.append('['); for (int i = 0; i < len; i++) { ap.getEntry(i, tvp); printJsonValue(ps, tvp); if (i != len - 1) { ps.append(','); } } ps.append(']'); } finally { pp.giveBack(ap); } }
Source:
public void render(FormRenderingContext context) { layoutGenerator.clear(); formContent.clear(); if (context != null) { Panel panel = layoutGenerator.buildLayout(context); formContent.add(panel); } }

Target:
public void render(FormRenderingContext context) { layoutGenerator.clear(); formContent.clear(); if (context != null) { formContent.add(layoutGenerator.buildLayout(context)); } }
Source:
public void testWaitUntilJobInitializationFinished_doesNotThrowRuntimeException() throws Exception { final JobVertex testVertex = new JobVertex("testVertex"); testVertex.setInvokableClass(NoOpInvokable.class); JobGraph jobGraph = new JobGraph(TEST_JOB_ID, "testJob", testVertex); TestingDispatcher dispatcher = createAndStartDispatcher(); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherGateway.submitJob(jobGraph, TIMEOUT).get(); ClientUtils.waitUntilJobInitializationFinished(jobGraph.getJobID(), () -> dispatcherGateway.requestJobStatus(jobGraph.getJobID(), TIMEOUT).get(), () -> dispatcherGateway.requestJobResult(jobGraph.getJobID(), TIMEOUT).get(), ClassLoader.getSystemClassLoader()); dispatcher.completeJobExecution( ArchivedExecutionGraph.createFromInitializingJob(TEST_JOB_ID, "test", JobStatus.FAILED, new RuntimeException("yolo"), 1337)); org.apache.flink.runtime.testutils.CommonTestUtils.waitUntilCondition(() -> { JobStatus status = dispatcherGateway.requestJobStatus( jobGraph.getJobID(), TIMEOUT).get(); return status == JobStatus.FAILED; }, Deadline.fromNow( Duration.ofSeconds(10L)), 20L); ClientUtils.waitUntilJobInitializationFinished(jobGraph.getJobID(), () -> dispatcherGateway.requestJobStatus(jobGraph.getJobID(), TIMEOUT).get(), () -> dispatcherGateway.requestJobResult(jobGraph.getJobID(), TIMEOUT).get(), ClassLoader.getSystemClassLoader()); ArchivedExecutionGraph archivedExecutionGraph = dispatcherGateway.requestJob( TEST_JOB_ID, TIMEOUT).get(); Throwable exception = archivedExecutionGraph.getFailureInfo().getException().deserializeError( ClassLoader.getSystemClassLoader()); Assert.assertTrue(exception instanceof RuntimeException); }

Target:
public void testWaitUntilJobInitializationFinished_doesNotThrowRuntimeException() throws Exception { Iterator<JobStatus> statusSequenceIterator = Arrays.asList( JobStatus.INITIALIZING, JobStatus.INITIALIZING, JobStatus.FAILED).iterator(); ClientUtils.waitUntilJobInitializationFinished( statusSequenceIterator::next, () -> buildJobResult(new RuntimeException("Err")), ClassLoader.getSystemClassLoader()); }
Source:
Config generateConfig() { Map<String, String> config = new HashMap<>(); StreamSpec spec = getStreamSpec(); config.put(String.format(StreamConfig.SYSTEM_FOR_STREAM_ID(), spec.getId()), spec.getSystemName()); config.put(String.format(StreamConfig.PHYSICAL_NAME_FOR_STREAM_ID(), spec.getId()), spec.getPhysicalName()); if (isIntermediate()) { config.put(String.format(StreamConfig.IS_INTERMEDIATE_FOR_STREAM_ID(), spec.getId()), "true"); config.put(String.format(StreamConfig.CONSUMER_OFFSET_DEFAULT_FOR_STREAM_ID(), spec.getId()), "oldest"); config.put(String.format(StreamConfig.PRIORITY_FOR_STREAM_ID(), spec.getId()), "1"); } if (spec.isBounded()) { config.put(String.format(StreamConfig.IS_BOUNDED_FOR_STREAM_ID(), spec.getId()), "true"); } spec.getConfig().forEach((property, value) -> { config.put(String.format(StreamConfig.STREAM_ID_PREFIX(), spec.getId()) + property, value); }); return new MapConfig(config); }

Target:
Config generateConfig() { Map<String, String> config = new HashMap<>(); StreamSpec spec = getStreamSpec(); config.put(String.format(StreamConfig.SYSTEM_FOR_STREAM_ID(), spec.getId()), spec.getSystemName()); config.put(String.format(StreamConfig.PHYSICAL_NAME_FOR_STREAM_ID(), spec.getId()), spec.getPhysicalName()); if (isIntermediate()) { config.put(String.format(StreamConfig.IS_INTERMEDIATE_FOR_STREAM_ID(), spec.getId()), "true"); config.put(String.format(StreamConfig.CONSUMER_OFFSET_DEFAULT_FOR_STREAM_ID(), spec.getId()), "oldest"); config.put(String.format(StreamConfig.PRIORITY_FOR_STREAM_ID(), spec.getId()), String.valueOf(Integer.MAX_VALUE)); } if (spec.isBounded()) { config.put(String.format(StreamConfig.IS_BOUNDED_FOR_STREAM_ID(), spec.getId()), "true"); } spec.getConfig().forEach((property, value) -> { config.put(String.format(StreamConfig.STREAM_ID_PREFIX(), spec.getId()) + property, value); }); return new MapConfig(config); }
Source:
public static String getHostHeader(final HttpServletRequest request) { for (int i = 0; i < hostHeaders.length; ++i) { final Enumeration<String> headers = request.getHeaders(hostHeaders[i]); if (headers.hasMoreElements()) { return headers.nextElement(); } } return request.getServerName() + ":" + Integer.toString(request.getServerPort()); }

Target:
public static String getHostHeader(final HttpServletRequest request) { for (int i = 0; i < hostHeaders.length; ++i) { final String header = request.getHeader(hostHeaders[i]); if (header != null) { final String[] values = header.split(", *"); if (values.length >= 1) { return values[0]; } } } return request.getServerName() + ":" + Integer.toString(request.getServerPort()); }
Source:
public Map<String, Object> getProperties() { return this.properties; }

Target:
public Map<String, Object> getProperties() { return this.properties.size() == 0 ? null : this.properties; }
Source:
public void apply(final VariantContext variant, final ReadsContext readsContext, final ReferenceContext referenceContext, final FeatureContext featureContext) { if (variant.isFiltered()) return; if (variant.isIndel()) { indelFalsePositiveCount++; } else { snpFalsePositiveCount++; } }

Target:
public void apply(final VariantContext variant, final ReadsContext readsContext, final ReferenceContext referenceContext, final FeatureContext featureContext) { if (variant.isFiltered()) { return; } if (variant.isIndel()) { indelFalsePositiveCount.increment(); } else { snpFalsePositiveCount.increment(); } }
Source:
public String toString() { return "GCS File [content type=" + contentType + ", crc32c=" + crc32c + ", etag=" + etag + ", generation=" + generation + ", id=" + id + ", kind=" + kind + ", md5 hash=" + md5Hash + ", name=" + name + ", self link=" + selfLink + ", size=" + size + ", storage class=" + storageClass + ", time created=" + timeCreated + ", time storage class updated=" + timeStorageClassUpdated + "]"; }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("content type", contentType) .add("crc32", crc32c) .add("etag", etag) .add("generation", generation) .add("id", id) .add("kind", kind) .add("md5 hash", md5Hash) .add("name", name) .add("self link", selfLink) .add("size", size) .add("storage class", storageClass) .add("time created", timeCreated) .add("time storage class updated", timeStorageClassUpdated) .toString(); }
Source:
public static String prependIfNotBlank(final String str, final String prefix) { return isBlank(str) ? EMPTY : defaultString(prefix) + str; }

Target:
public static String prependIfNotBlank(final String str, final String prefix) { if (isEmpty(prefix) || isBlank(str)) { return str; } return prefix + str; }
Source:
public VdcActionParametersBase getParameters(Watchdog model, VmWatchdog entity) { WatchdogParameters parameters = new WatchdogParameters(); if (model.isSetAction()) { parameters.setAction(WatchdogMapper.map(model.getAction())); } else { parameters.setAction(entity.getAction()); } if (model.isSetModel()) { parameters.setModel(WatchdogMapper.map(model.getModel())); } else { parameters.setAction(entity.getAction()); } parameters.setId(instanceTypeId); parameters.setVm(false); return parameters; }

Target:
public VdcActionParametersBase getParameters(Watchdog model, VmWatchdog entity) { WatchdogParameters parameters = new WatchdogParameters(); if (model.isSetAction()) { parameters.setAction(WatchdogMapper.map(model.getAction())); } else { parameters.setAction(entity.getAction()); } if (model.isSetModel()) { parameters.setModel(WatchdogMapper.map(model.getModel())); } else { parameters.setModel(entity.getModel()); } parameters.setId(instanceTypeId); parameters.setVm(false); return parameters; }
Source:
private static AbstractFileSystem getAbstractFileSystem( UserGroupInformation user, final URI uri, final Configuration conf) throws UnsupportedFileSystemException, IOException { try { return user.doAs(new PrivilegedExceptionAction<AbstractFileSystem>() { @Override public AbstractFileSystem run() throws UnsupportedFileSystemException { return AbstractFileSystem.get(uri, conf); } }); } catch (RuntimeException ex) { Throwable cause = ex.getCause(); if (cause instanceof IOException) { throw (IOException) cause; } else { throw ex; } } catch (InterruptedException ex) { LOG.debug("Error", ex); Thread.currentThread().interrupt(); throw new IOException("Failed to get the AbstractFileSystem for path: " + uri, ex); } }

Target:
private static AbstractFileSystem getAbstractFileSystem( UserGroupInformation user, final URI uri, final Configuration conf) throws UnsupportedFileSystemException, IOException { try { return user.doAs(new PrivilegedExceptionAction<AbstractFileSystem>() { @Override public AbstractFileSystem run() throws UnsupportedFileSystemException { return AbstractFileSystem.get(uri, conf); } }); } catch (RuntimeException ex) { Throwable cause = ex.getCause(); if (cause instanceof IOException) { throw (IOException) cause; } else { throw ex; } } catch (InterruptedException ex) { LOG.debug("Thread interrupted", ex); Thread.currentThread().interrupt(); throw new InterruptedIOException( "Failed to get the AbstractFileSystem for path: " + uri); } }
Source:
public List<PropertyDto> selectGlobalPropertiesByKeyQuery(DbSession session, String keyQuery) { return getMapper(session).selectGlobalPropertiesByKeyQuery(buildLikeValue(keyQuery, WildcardPosition.BEFORE)); }

Target:
public List<PropertyDto> selectGlobalPropertiesByKeyQuery(DbSession session, String keyQuery) { return getMapper(session).selectGlobalPropertiesByKeyQuery(buildLikeValue(keyQuery, WildcardPosition.BEFORE_AND_AFTER)); }
Source:
private <T> T doStorageClientOperation(Callable<T> operation) { int attempts = 0; T result = null; while (attempts <= 1) { attempts++; try { result = operation.call(); break; } catch (BlobStorageException bsEx) { if (attempts == 1 && tryHandleExceptionAndHintRetry(bsEx)) { logger.info("Retrying blob store operation due to expired token"); continue; } throw bsEx; } catch (Exception ex) { throw new IllegalStateException("Unknown blob storage exception", ex); } } return result; }

Target:
private <T> T doStorageClientOperation(Callable<T> operation) { int attempts = 0; T result = null; while (attempts <= 1) { attempts++; try { result = operation.call(); break; } catch (BlobStorageException bsEx) { if (attempts == 1 && handleExceptionAndHintRetry(bsEx)) { logger.info("Retrying blob store operation due to exception: " + bsEx.toString()); azureMetrics.storageClientOperationRetryCount.inc(); continue; } throw bsEx; } catch (Exception ex) { azureMetrics.storageClientOperationExceptionCount.inc(); if (attempts == 1) { azureMetrics.storageClientFailureAfterRetryCount.inc(); } throw new IllegalStateException("Unknown blob storage exception", ex); } } return result; }
Source:
public void setWidth(RealParameter width) { this.width = width == null ? new RealLiteral(0.25) : width; if (width != null) { width.setContext(RealParameterContext.NON_NEGATIVE_CONTEXT); width.setParent(this); } }

Target:
public void setWidth(RealParameter width) { this.width = width == null ? new RealLiteral(DEFAULT_WIDTH) : width; if (width != null) { width.setContext(RealParameterContext.NON_NEGATIVE_CONTEXT); width.setParent(this); } }
Source:
DefaultSaml2AuthenticatedPrincipal(String name, Map<String, List<Object>> attributes) { this.name = name; this.attributes = attributes; }

Target:
public DefaultSaml2AuthenticatedPrincipal(String name, Map<String, List<Object>> attributes) { Assert.notNull(name, "name cannot be null"); Assert.notNull(attributes, "attributes cannot be null"); this.name = name; this.attributes = attributes; }