auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) { Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(messages, "'messages' must not be null"); Object mgm = this.doRetrieve(MESSAGE_GROUP_KEY_PREFIX + groupId); if (mgm != null) { Assert.isInstanceOf(MessageGroupMetadata.class, mgm); MessageGroupMetadata messageGroupMetadata = (MessageGroupMetadata) mgm; messageGroupMetadata.setLastModified(System.currentTimeMillis()); for (Message<?> messageToRemove : messages) { this.removeMessage(messageToRemove.getHeaders().getId()); } MessageGroup messageGroup = this.getSimpleMessageGroup(this.getMessageGroup(groupId)); this.doStore(MESSAGE_GROUP_KEY_PREFIX + groupId, new MessageGroupMetadata(messageGroup)); } }

Target:
public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) { Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(messages, "'messages' must not be null"); Object mgm = doRetrieve(MESSAGE_GROUP_KEY_PREFIX + groupId); if (mgm != null) { Assert.isInstanceOf(MessageGroupMetadata.class, mgm); MessageGroupMetadata messageGroupMetadata = (MessageGroupMetadata) mgm; for (Message<?> messageToRemove : messages) { UUID messageId = messageToRemove.getHeaders().getId(); messageGroupMetadata.remove(messageId); doRemove(MESSAGE_KEY_PREFIX + messageId); } messageGroupMetadata.setLastModified(System.currentTimeMillis()); doStore(MESSAGE_GROUP_KEY_PREFIX + groupId, messageGroupMetadata); } }
Source:
Mono<Response<Key>> updateKeyPropertiesWithResponse(KeyProperties keyProperties, Context context, KeyOperation... keyOperations) { Objects.requireNonNull(keyProperties, "The key input parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .setTags(keyProperties.getTags()) .setKeyOps(Arrays.asList(keyOperations)) .setKeyAttributes(new KeyRequestAttributes(keyProperties)); return service.updateKey(endpoint, keyProperties.getName(), keyProperties.getVersion(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> logger.info("Updating key - {}", keyProperties.getName())) .doOnSuccess(response -> logger.info("Updated key - {}", response.getValue().getName())) .doOnError(error -> logger.warning("Failed to update key - {}", keyProperties.getName(), error)); }

Target:
Mono<Response<Key>> updateKeyPropertiesWithResponse(KeyProperties keyProperties, Context context, KeyOperation... keyOperations) { Objects.requireNonNull(keyProperties, "The key properties input parameter cannot be null."); KeyRequestParameters parameters = new KeyRequestParameters() .setTags(keyProperties.getTags()) .setKeyAttributes(new KeyRequestAttributes(keyProperties)); if (keyOperations.length > 0) { parameters.setKeyOps(Arrays.asList(keyOperations)); } return service.updateKey(endpoint, keyProperties.getName(), keyProperties.getVersion(), API_VERSION, ACCEPT_LANGUAGE, parameters, CONTENT_TYPE_HEADER_VALUE, context) .doOnRequest(ignored -> logger.info("Updating key - {}", keyProperties.getName())) .doOnSuccess(response -> logger.info("Updated key - {}", response.getValue().getName())) .doOnError(error -> logger.warning("Failed to update key - {}", keyProperties.getName(), error)); }
Source:
public boolean doSupportKerberizedKafka() { return false; }

Target:
public boolean doSupportKerberizedKafka() { return true; }
Source:
private CommandResult<RuleViolation> checkBounds(final GraphCommandExecutionContext context) { final Element<? extends View<?>> element = getNodeNotNull(context); final Graph<DefinitionSet, Node> graph = (Graph<DefinitionSet, Node>) getGraph(context); final BoundsImpl newBounds = getTargetBounds(element); final GraphCommandResultBuilder result = new GraphCommandResultBuilder(); if (parentConstrained) { if (!GraphUtils.isRootNode(element, graph)) { final Bounds parentBounds = getParentBounds(element, graph); if (GraphUtils.checkBoundsExceeded(parentBounds, newBounds)) { ((View) element.getContent()).setBounds(newBounds); } else { result.addViolation(new BoundsExceededViolation(parentBounds) .setUUID(element.getUUID())); } } } else { if (GraphUtils.checkBoundsExceeded(graph, newBounds)) { ((View) element.getContent()).setBounds(newBounds); } else { final Bounds graphBounds = graph.getContent().getBounds(); result.addViolation(new BoundsExceededViolation(graphBounds) .setUUID(element.getUUID())); } } return result.build(); }

Target:
private CommandResult<RuleViolation> checkBounds(final GraphCommandExecutionContext context) { final Element<? extends View<?>> element = getNodeNotNull(context); final Graph<DefinitionSet, Node> graph = (Graph<DefinitionSet, Node>) getGraph(context); final BoundsImpl newBounds = getTargetBounds(element); final GraphCommandResultBuilder result = new GraphCommandResultBuilder(); final Bounds parentBounds = getParentBounds(element, graph); if (GraphUtils.checkBoundsExceeded(parentBounds, newBounds)) { ((View) element.getContent()).setBounds(newBounds); } else { result.addViolation(new BoundsExceededViolation(parentBounds) .setUUID(element.getUUID())); } return result.build(); }
Source:
private String resolveGroupDN(String searchFilter, String role, LDAPRoleContext context) throws UserStoreException { String roleSearchFilter = searchFilter.replace("?", escapeSpecialCharactersForFilter(role)); String membershipAttribute = realmConfig.getUserStoreProperty(LDAPConstants.MEMBERSHIP_ATTRIBUTE); String[] returningAttributes = new String[]{membershipAttribute}; String searchBase = context.getSearchBase(); DirContext mainDirContext = this.connectionSource.getContext(); try { NamingEnumeration<SearchResult> groupResults = searchInGroupBase(roleSearchFilter, returningAttributes, SearchControls.SUBTREE_SCOPE, mainDirContext, searchBase); SearchResult resultedGroup; String groupDN = null; if (groupResults.hasMore()) { resultedGroup = groupResults.next(); groupDN = resultedGroup.getName(); } return groupDN; } catch (NamingException e) { String errorMessage = "Error while resolving the GroupDN."; throw new UserStoreException(errorMessage, e); } finally { JNDIUtil.closeContext(mainDirContext); } }

Target:
private String resolveGroupDN(String searchFilter, String role, LDAPRoleContext context) throws UserStoreException { String roleSearchFilter = searchFilter.replace("?", escapeSpecialCharactersForFilter(role)); String[] returningAttributes = new String[]{}; String searchBase = context.getSearchBase(); DirContext mainDirContext = this.connectionSource.getContext(); try { NamingEnumeration<SearchResult> groupResults = searchInGroupBase(roleSearchFilter, returningAttributes, SearchControls.SUBTREE_SCOPE, mainDirContext, searchBase); SearchResult resultedGroup; String groupDN = null; if (groupResults.hasMore()) { resultedGroup = groupResults.next(); groupDN = resultedGroup.getName(); } return groupDN; } catch (NamingException e) { String errorMessage = "Error while resolving the GroupDN."; throw new UserStoreException(errorMessage, e); } finally { JNDIUtil.closeContext(mainDirContext); } }
Source:
private String createTempFile() throws IOException, IllegalStateException { String tempFile = System.getProperty("java.io.tmpdir") + "/test_file.txt"; FileWriter writer = new FileWriter(tempFile); writer.write("Lorem ipsum dolor sit amet ..."); writer.flush(); writer.close(); tempFiles.add(tempFile); return tempFile; }

Target:
private File createTempFile() throws IOException, IllegalStateException { File tempFile = File.createTempFile("test", null); FileWriter writer = new FileWriter(tempFile); writer.write("Lorem ipsum dolor sit amet ..."); writer.flush(); writer.close(); tempFiles.add(tempFile); return tempFile; }
Source:
private void assertGetResult(StorageDomain result) { assertNotNull(result); assertEquals(existingDomain, result); assertEquals("Wrong committed disk size", 8, result.getCommittedDiskSize()); assertEquals("Wrong actual disk size", 4, result.getActualImagesSize()); assertEquals("Wrong first metadata device", FixturesTool.LUN_ID_OF_DOMAIN_METADATA, result.getFirstMetadataDevice()); assertEquals("Wrong vg metadata device", FixturesTool.LUN_ID_OF_DOMAIN_VG_METADATA, result.getVgMetadataDevice()); assertEquals("Wrong shared status", StorageDomainSharedStatus.Active, result.getStorageDomainSharedStatus()); assertEquals("Wrong backup flag status", true, result.isBackup()); }

Target:
private void assertGetResult(StorageDomain result) { assertNotNull(result); assertEquals(existingDomain, result); assertEquals("Wrong committed disk size", 8, result.getCommittedDiskSize()); assertEquals("Wrong actual disk size", 4, result.getActualImagesSize()); assertEquals("Wrong first metadata device", FixturesTool.LUN_ID_OF_DOMAIN_METADATA, result.getFirstMetadataDevice()); assertEquals("Wrong vg metadata device", FixturesTool.LUN_ID_OF_DOMAIN_VG_METADATA, result.getVgMetadataDevice()); assertEquals("Wrong shared status", StorageDomainSharedStatus.Active, result.getStorageDomainSharedStatus()); assertEquals("Wrong backup flag status", false, result.isBackup()); }
Source:
public boolean validateOptions(Map<String,String> options) { if (options.containsKey(ALL_OPTION)) { try { combineAllColumns = Boolean.parseBoolean(options.get(ALL_OPTION)); } catch (Exception e) { throw new IllegalArgumentException("bad boolean " + ALL_OPTION + ":" + options.get(ALL_OPTION)); } if (combineAllColumns) return true; } if (!options.containsKey(COLUMNS_OPTION)) throw new IllegalArgumentException("options must include " + ALL_OPTION + " or " + COLUMNS_OPTION); String encodedColumns = options.get(COLUMNS_OPTION); if (encodedColumns.length() == 0) throw new IllegalArgumentException("empty columns specified in option " + COLUMNS_OPTION); for (String columns : Splitter.on(",").split(encodedColumns)) { if (!ColumnSet.isValidEncoding(columns)) throw new IllegalArgumentException("invalid column encoding " + encodedColumns); } if (options.containsKey(DELETE_HANDLING_ACTION_OPTION)) { DeleteHandlingAction.valueOf(options.get(DELETE_HANDLING_ACTION_OPTION)); } return true; }

Target:
public boolean validateOptions(Map<String,String> options) { if (options.containsKey(ALL_OPTION)) { try { combineAllColumns = Boolean.parseBoolean(options.get(ALL_OPTION)); } catch (Exception e) { throw new IllegalArgumentException("bad boolean " + ALL_OPTION + ":" + options.get(ALL_OPTION)); } if (combineAllColumns) return true; } if (!options.containsKey(COLUMNS_OPTION)) throw new IllegalArgumentException("options must include " + ALL_OPTION + " or " + COLUMNS_OPTION); String encodedColumns = options.get(COLUMNS_OPTION); if (encodedColumns.length() == 0) throw new IllegalArgumentException("empty columns specified in option " + COLUMNS_OPTION); for (String columns : Splitter.on(",").split(encodedColumns)) { if (!ColumnSet.isValidEncoding(columns)) throw new IllegalArgumentException("invalid column encoding " + encodedColumns); } return true; }
Source:
protected void writeProperty(JsonGenerator jg, Property prop) throws IOException { if (prop.isScalar()) { writeScalarProperty(jg, prop); } else if (prop.isList()) { writeListProperty(jg, prop); } else if (prop.isComplex()) { writeComplexProperty(jg, prop); } else if (prop instanceof BlobProperty) { writeBlobProperty(jg, prop); } else if (prop.isPhantom()) { jg.writeNull(); } }

Target:
protected void writeProperty(JsonGenerator jg, Property prop) throws IOException { if (prop.isScalar()) { writeScalarProperty(jg, prop); } else if (prop.isList()) { writeListProperty(jg, prop); } else if (prop instanceof BlobProperty) { writeBlobProperty(jg, prop); } else if (prop.isComplex()) { writeComplexProperty(jg, prop); } else if (prop.isPhantom()) { jg.writeNull(); } }
Source:
public void endVisit(CastExpression x, BlockScope scope) { try { SourceInfo info = makeSourceInfo(x); JExpression expression = pop(x.expression); JMultiCastOperation multiCastOp = null; if (x.resolvedType instanceof IntersectionTypeBinding18) { multiCastOp = new JMultiCastOperation(info, expression, getTypeMap().getBounds((IntersectionTypeBinding18) x.resolvedType)); } else { multiCastOp = new JMultiCastOperation(info, expression, getTypeMap().get(x.resolvedType)); } push(multiCastOp); } catch (JTypeLookupException e) { throw translateException(x, e); } catch (RuntimeException e) { throw translateException(x, e); } }

Target:
public void endVisit(CastExpression x, BlockScope scope) { try { SourceInfo info = makeSourceInfo(x); JExpression expression = pop(x.expression); JDynamicCastOperation castOp = null; if (x.resolvedType instanceof IntersectionTypeBinding18) { castOp = new JDynamicCastOperation(info, expression, getTypeMap().getBounds((IntersectionTypeBinding18) x.resolvedType)); } else { castOp = new JDynamicCastOperation(info, expression, getTypeMap().get(x.resolvedType)); } push(castOp); } catch (JTypeLookupException e) { throw translateException(x, e); } catch (RuntimeException e) { throw translateException(x, e); } }
Source:
public void populate() { PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); try { Resource[] bootstrap3Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_3_THEME_LOCATION); Resource[] bootstrap4Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_4_THEME_LOCATION); List<Resource> newThemes = Arrays.stream(bootstrap3Themes) .filter( theme -> dataService.getRepository(STYLE_SHEET).findOneById(theme.getFilename()) == null) .collect(Collectors.toList()); newThemes.forEach(nt -> addNewTheme(nt, bootstrap4Themes)); } catch (IOException e) { LOG.error("error populating bootstrap themes", e); } }

Target:
public void populate() { PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); try { Resource[] bootstrap3Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_3_THEME_LOCATION); Resource[] bootstrap4Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_4_THEME_LOCATION); List<Resource> newThemes = Arrays.stream(bootstrap3Themes) .filter( theme -> dataService.getRepository(STYLE_SHEET).findOneById(theme.getFilename()) == null) .collect(Collectors.toList()); newThemes.forEach(nt -> addNewTheme(nt, bootstrap4Themes)); } catch (Exception e) { LOG.error("error populating bootstrap themes", e); } }
Source:
public synchronized void start() throws Exception { super.start(); addShutdownHook(new Thread(new Runnable() { @Override public void run() { try { final ProcessBuilder processBuilder = new ProcessBuilder(configuration.generateStopCommand()); processBuilder.inheritIO(); final Process p = processBuilder.start(); p.waitFor(); } catch (Exception e) { throw new IllegalStateException("Fuse container was not stopped", e); } } })); }

Target:
public synchronized void start() throws Exception { super.start(); addShutdownHook(new Thread(new Runnable() { @Override public void run() { try { final ProcessBuilder processBuilder = new ProcessBuilder(configuration.generateStopCommand()); processBuilder.inheritIO(); final Process p = processBuilder.start(); p.waitFor(); } catch (Exception e) { throw new IllegalStateException("Tomcat container was not stopped", e); } } })); }
Source:
private Guid createTemplate() { VmTemplate blankTemplate = DbFacade.getInstance().getVmTemplateDao().get(VmTemplateHandler.BLANK_VM_TEMPLATE_ID); VmStatic masterVm = new VmStatic(blankTemplate); DiskImage templateDiskImage = getEnclosingCommand().getParameters().getDiskImage(); String vmTemplateName = "GlanceTemplate-" + Guid.newGuid().toString().substring(0, 7); AddVmTemplateParameters parameters = new AddVmTemplateParameters(masterVm, vmTemplateName, templateDiskImage.getDiskDescription()); if (getEnclosingCommand().getParameters().getClusterId() != null) { masterVm.setVdsGroupId(getEnclosingCommand().getParameters().getClusterId()); } VdcReturnValueBase addVmTemplateReturnValue = Backend.getInstance().runInternalAction(VdcActionType.AddVmTemplate, parameters, ExecutionHandler.createDefaultContexForTasks(getEnclosingCommand().getExecutionContext())); return addVmTemplateReturnValue.getActionReturnValue() != null ? (Guid) addVmTemplateReturnValue.getActionReturnValue() : null; }

Target:
private Guid createTemplate() { VmTemplate blankTemplate = DbFacade.getInstance().getVmTemplateDao().get(VmTemplateHandler.BLANK_VM_TEMPLATE_ID); VmStatic masterVm = new VmStatic(blankTemplate); OsRepository osRepository = SimpleDependecyInjector.getInstance().get(OsRepository.class); DiskImage templateDiskImage = getEnclosingCommand().getParameters().getDiskImage(); String vmTemplateName = "GlanceTemplate-" + Guid.newGuid().toString().substring(0, 7); AddVmTemplateParameters parameters = new AddVmTemplateParameters(masterVm, vmTemplateName, templateDiskImage.getDiskDescription()); if (getEnclosingCommand().getParameters().getClusterId() != null) { masterVm.setVdsGroupId(getEnclosingCommand().getParameters().getClusterId()); VDSGroup vdsGroup = getVdsGroup(masterVm.getVdsGroupId()); masterVm.setOsId(osRepository.getDefaultOSes().get(vdsGroup.getArchitecture())); DisplayType defaultDisplayType = osRepository.getDisplayTypes(masterVm.getOsId(), vdsGroup.getcompatibility_version()).get(0); masterVm.setDefaultDisplayType(defaultDisplayType); } VdcReturnValueBase addVmTemplateReturnValue = Backend.getInstance().runInternalAction(VdcActionType.AddVmTemplate, parameters, ExecutionHandler.createDefaultContexForTasks(getEnclosingCommand().getExecutionContext())); return addVmTemplateReturnValue.getActionReturnValue() != null ? (Guid) addVmTemplateReturnValue.getActionReturnValue() : null; }
Source:
public CompletableFuture<Void> deleteSnapshot(String snapshotName) { return CompletableFuture.supplyAsync(() -> { String btSnapshotName = null; try { btSnapshotName = getClusterName().toSnapshotName(snapshotName); } catch (IOException e) { FutureUtils.failedFuture(e); } DeleteSnapshotRequest request = DeleteSnapshotRequest.newBuilder() .setName(btSnapshotName) .build(); return request; }).thenCompose( d -> FutureUtils.toCompletableFuture( bigtableTableAdminClient.deleteSnapshotAsync(d)).thenApply(r -> null)); }

Target:
public CompletableFuture<Void> deleteSnapshot(String snapshotName) { return CompletableFuture.supplyAsync(() -> { try { return DeleteSnapshotRequest.newBuilder() .setName(getClusterName().toSnapshotName(snapshotName)) .build(); } catch (IOException e) { throw new CompletionException(e); } }).thenCompose( d -> bigtableTableAdminClient.deleteSnapshotAsync(d).thenApply(r -> null)); }
Source:
public EndpointRegistry getEndpointRegistryByUUID(String regsitryId) throws APIManagementException { String query = SQLConstants.GET_ENDPOINT_REGISTRY_BY_UUID; EndpointRegistry endpointRegistry = new EndpointRegistry(); try (Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement ps = connection.prepareStatement(query)) { ps.setString(1, regsitryId); ps.executeQuery(); try (ResultSet rs = ps.executeQuery()) { if (rs.next()) { endpointRegistry.setUuid(rs.getString("UUID")); endpointRegistry.setName(rs.getString("REG_NAME")); endpointRegistry.setType(rs.getString("REG_TYPE")); endpointRegistry.setMode(rs.getString("MODE")); endpointRegistry.setOwner(rs.getString("REG_OWNER")); } } } catch (SQLException e) { handleException("Error while retrieving details of endpoint registry with Id: " + regsitryId, e); } return endpointRegistry; }

Target:
public EndpointRegistryInfo getEndpointRegistryByUUID(String regsitryId) throws APIManagementException { String query = SQLConstants.GET_ENDPOINT_REGISTRY_BY_UUID; try (Connection connection = APIMgtDBUtil.getConnection(); PreparedStatement ps = connection.prepareStatement(query)) { ps.setString(1, regsitryId); ps.executeQuery(); try (ResultSet rs = ps.executeQuery()) { if (rs.next()) { EndpointRegistryInfo endpointRegistry = new EndpointRegistryInfo(); endpointRegistry.setUuid(rs.getString("UUID")); endpointRegistry.setName(rs.getString("REG_NAME")); endpointRegistry.setType(rs.getString("REG_TYPE")); endpointRegistry.setMode(rs.getString("MODE")); endpointRegistry.setOwner(rs.getString("REG_OWNER")); return endpointRegistry; } } } catch (SQLException e) { handleException("Error while retrieving details of endpoint registry with Id: " + regsitryId, e); } return null; }
Source:
public static List<? extends SqlFunction> extractFunctions(Class<?> clazz) { if (WindowFunction.class.isAssignableFrom(clazz)) { @SuppressWarnings("unchecked") Class<? extends WindowFunction> windowClazz = (Class<? extends WindowFunction>) clazz; return WindowAnnotationsParser.parseFunctionDefinition(windowClazz); } if (clazz.isAnnotationPresent(AggregationFunction.class)) { return SqlAggregationFunction.createFunctionsByAnnotations(clazz); } if (clazz.isAnnotationPresent(ScalarFunction.class) || clazz.isAnnotationPresent(ScalarOperator.class)) { return ScalarFromAnnotationsParser.parseFunctionDefinition(clazz); } if (clazz.isAnnotationPresent(SqlInvokedScalarFunctions.class)) { return SqlInvokedScalarFromAnnotationsParser.parseFunctionDefinitions(clazz); } if (clazz.isAnnotationPresent(SqlInvokedScalarFunction.class)) { return SqlInvokedScalarFromAnnotationsParser.parseFunctionDefinition(clazz); } return ScalarFromAnnotationsParser.parseFunctionDefinitions(clazz); }

Target:
public static List<? extends SqlFunction> extractFunctions(Class<?> clazz) { if (WindowFunction.class.isAssignableFrom(clazz)) { @SuppressWarnings("unchecked") Class<? extends WindowFunction> windowClazz = (Class<? extends WindowFunction>) clazz; return WindowAnnotationsParser.parseFunctionDefinition(windowClazz); } if (clazz.isAnnotationPresent(AggregationFunction.class)) { return SqlAggregationFunction.createFunctionsByAnnotations(clazz); } if (clazz.isAnnotationPresent(ScalarFunction.class) || clazz.isAnnotationPresent(ScalarOperator.class)) { return ScalarFromAnnotationsParser.parseFunctionDefinition(clazz); } if (clazz.isAnnotationPresent(SqlInvokedScalarFunction.class)) { return SqlInvokedScalarFromAnnotationsParser.parseFunctionDefinition(clazz); } List<SqlFunction> scalarFunctions = ImmutableList.<SqlFunction>builder() .addAll(ScalarFromAnnotationsParser.parseFunctionDefinitions(clazz)) .addAll(SqlInvokedScalarFromAnnotationsParser.parseFunctionDefinitions(clazz)) .build(); checkArgument(!scalarFunctions.isEmpty(), "Class [%s] does not define any scalar functions", clazz.getName()); return scalarFunctions; }
Source:
public void updateTopic(TopicName topicName, PatchData patch) { Topic beforeUpdate = endpoints.topic().get(topicName.qualifiedName()); Topic reference = Patch.apply(beforeUpdate, patch); ofNullable(reference.getMessageSchema()).ifPresent(s -> assertThat(endpoints.schema().save(reference.getQualifiedName(), false, s).getStatus()).isEqualTo(CREATED.getStatusCode())); Response r = endpoints.topic().update(topicName.qualifiedName(), patch); System.out.println("---------------------"); System.out.println(r.readEntity(String.class)); System.out.println("---------------------"); assertThat(r.getStatus()).isEqualTo(OK.getStatusCode()); wait.untilTopicUpdated(reference); }

Target:
public void updateTopic(TopicName topicName, PatchData patch) { Topic beforeUpdate = endpoints.topic().get(topicName.qualifiedName()); Topic reference = Patch.apply(beforeUpdate, patch); ofNullable(reference.getMessageSchema()).ifPresent(s -> assertThat(endpoints.schema().save(reference.getQualifiedName(), false, s).getStatus()).isEqualTo(CREATED.getStatusCode())); assertThat(endpoints.topic().update(topicName.qualifiedName(), patch).getStatus()).isEqualTo(OK.getStatusCode()); wait.untilTopicUpdated(reference); }
Source:
public void returnsCorrectInputWithStream() throws Exception { final byte[] bytes = new Utf8String("Stream returnsCorrectInput!").asBytes(); MatcherAssert.assertThat( "Stream doesn't provide correct bytes", new BytesOf( new Body.TempFile(new Body.ByteArray(bytes)) ).asBytes(), new IsEqual<>(bytes) ); }

Target:
public void returnsCorrectInputWithStream() throws Exception { final byte[] bytes = new Utf8String("Stream returnsCorrectInput!").asBytes(); MatcherAssert.assertThat( "Body content of Body.TempFile doesn't provide the correct bytes", new BytesOf( new Body.TempFile(new Body.ByteArray(bytes)) ).asBytes(), new IsEqual<>(bytes) ); }
Source:
public SearchMandateConnectorResponseBuilder withMandates(List<MandateConnectorResponse> mandates) { this.mandates = mandates; return this; }

Target:
public SearchMandateConnectorResponseBuilder withMandates(List<MandateConnectorResponse> mandates) { this.mandates = List.copyOf(mandates); return this; }
Source:
public String getModelName(CloseableHttpResponse response) throws MLHttpClientException { try { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); JSONObject responseJson = new JSONObject(bufferedReader.readLine()); bufferedReader.close(); response.close(); return responseJson.getString("name"); } catch (IOException e) { throw new MLHttpClientException("Failed to get the name of model" , e); } catch (JSONException e) { throw new MLHttpClientException("Failed to get the name of model" , e); } }

Target:
public String getModelName(CloseableHttpResponse response) throws MLHttpClientException { try { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); JSONObject responseJson = new JSONObject(bufferedReader.readLine()); bufferedReader.close(); response.close(); return responseJson.getString("name"); } catch (Exception e) { throw new MLHttpClientException("Failed to get the name of model" , e); } }
Source:
public static CloudBigtableTableConfiguration BuildImportConfig(ImportOptions opts) { CloudBigtableTableConfiguration.Builder builder = new CloudBigtableTableConfiguration.Builder() .withProjectId(opts.getBigtableProject()) .withInstanceId(opts.getBigtableInstanceId()) .withTableId(opts.getBigtableTableId()); if (opts.getBigtableAppProfileId() != null) { builder.withAppProfileId(opts.getBigtableAppProfileId()); } if (opts.getBigtableWriteThrottleMs() != null) { builder.withConfiguration("google.bigtable.buffered.mutator.throttling.enable" , "true"); builder.withConfiguration( "google.bigtable.buffered.mutator.throttling.threshold.ms", opts.getBigtableWriteThrottleMs()); } return builder.build(); }

Target:
public static CloudBigtableTableConfiguration BuildImportConfig(ImportOptions opts) { CloudBigtableTableConfiguration.Builder builder = new CloudBigtableTableConfiguration.Builder() .withProjectId(opts.getBigtableProject()) .withInstanceId(opts.getBigtableInstanceId()) .withTableId(opts.getBigtableTableId()); if (opts.getBigtableAppProfileId() != null) { builder.withAppProfileId(opts.getBigtableAppProfileId()); } ValueProvider enableThrottling = ValueProvider.NestedValueProvider.of( opts.getMutationThrottleLatencyMs(), (Integer throttleMs) -> String.valueOf(throttleMs > 0)); builder.withConfiguration(BigtableOptionsFactory.BIGTABLE_BUFFERED_MUTATOR_ENABLE_THROTTLING, enableThrottling); builder.withConfiguration(BigtableOptionsFactory.BIGTABLE_BUFFERED_MUTATOR_THROTTLING_THRESHOLD_MILLIS, ValueProvider.NestedValueProvider.of(opts.getMutationThrottleLatencyMs(), String::valueOf)); return builder.build(); }
Source:
private Map<String, List<BlackboardArtifact>> buildMap() throws TskCoreException, SQLException { Map<String, List<BlackboardArtifact>> acctMap = new HashMap<>(); List<BlackboardArtifact> contactList = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT); for(BlackboardArtifact contactArtifact: contactList) { List<BlackboardAttribute> contactAttributes = contactArtifact.getAttributes(); for(BlackboardAttribute attribute: contactAttributes) { String typeName = attribute.getAttributeType().getTypeName(); if(typeName.startsWith("TSK_EMAIL") || typeName.startsWith("TSK_PHONE") || typeName.startsWith("TSK_NAME") || typeName.startsWith("TSK_ID")) { String accountID = attribute.getValueString(); List<BlackboardArtifact> artifactList = acctMap.get(accountID); if(artifactList == null) { artifactList = new ArrayList<>(); acctMap.put(accountID, artifactList); } if(!artifactList.contains(contactArtifact)) { artifactList.add(contactArtifact); } } } } return acctMap; }

Target:
private Map<String, List<BlackboardArtifact>> buildMap() throws TskCoreException, SQLException { Map<String, List<BlackboardArtifact>> acctMap = new HashMap<>(); List<BlackboardArtifact> contactList = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_CONTACT); for (BlackboardArtifact contactArtifact : contactList) { List<BlackboardAttribute> contactAttributes = contactArtifact.getAttributes(); for (BlackboardAttribute attribute : contactAttributes) { String typeName = attribute.getAttributeType().getTypeName(); if (typeName.startsWith("TSK_EMAIL") || typeName.startsWith("TSK_PHONE") || typeName.startsWith("TSK_NAME") || typeName.startsWith("TSK_ID")) { String accountID = attribute.getValueString(); List<BlackboardArtifact> artifactList = acctMap.getOrDefault(accountID, new ArrayList<>()); acctMap.put(accountID, artifactList); if (!artifactList.contains(contactArtifact)) { artifactList.add(contactArtifact); } } } } return acctMap; }
Source:
public SnapshotInfo backupSnapshot(SnapshotInfo snapshotInfo) { if (!snapshotInfo.getLocationType().equals(Snapshot.LocationType.SECONDARY)) { markAsBackedUp((SnapshotObject)snapshotInfo); return snapshotInfo; } Preconditions.checkState(Snapshot.LocationType.SECONDARY.equals(snapshotInfo.getLocationType())); HostVO host = getHost(snapshotInfo.getVolumeId()); boolean canStorageSystemCreateVolumeFromSnapshot = canStorageSystemCreateVolumeFromSnapshot(snapshotInfo.getBaseVolume().getPoolId()); boolean computeClusterSupportsResign = clusterDao.getSupportsResigning(host.getClusterId()); if (!canStorageSystemCreateVolumeFromSnapshot || !computeClusterSupportsResign) { String mesg = "Cannot archive snapshot: Either canStorageSystemCreateVolumeFromSnapshot or " + "computeClusterSupportsResign were false. "; s_logger.warn(mesg); throw new CloudRuntimeException(mesg); } return snapshotSvr.backupSnapshot(snapshotInfo); }

Target:
public SnapshotInfo backupSnapshot(SnapshotInfo snapshotInfo) { Preconditions.checkArgument(snapshotInfo != null, "backupSnapshot expects a valid snapshot"); if (snapshotInfo.getLocationType() != Snapshot.LocationType.SECONDARY) { markAsBackedUp((SnapshotObject)snapshotInfo); return snapshotInfo; } HostVO host = getHost(snapshotInfo.getVolumeId()); boolean canStorageSystemCreateVolumeFromSnapshot = canStorageSystemCreateVolumeFromSnapshot(snapshotInfo.getBaseVolume().getPoolId()); boolean computeClusterSupportsResign = clusterDao.getSupportsResigning(host.getClusterId()); if (!canStorageSystemCreateVolumeFromSnapshot || !computeClusterSupportsResign) { String mesg = "Cannot archive snapshot: Either canStorageSystemCreateVolumeFromSnapshot or " + "computeClusterSupportsResign were false. "; s_logger.warn(mesg); throw new CloudRuntimeException(mesg); } return snapshotSvr.backupSnapshot(snapshotInfo); }
Source:
public void notifyChanged(Notification notification) { if (isFireLabelUpdateNotifications()) { if (!(notification instanceof IViewerNotification) || ((IViewerNotification)notification).isLabelUpdate()) { CopyOnWriteArrayList<ILabelProviderListener> labelProviderListenersList = new CopyOnWriteArrayList<>(); labelProviderListenersList.addAll(labelProviderListeners); for (ILabelProviderListener labelProviderListener : labelProviderListenersList) { labelProviderListener.labelProviderChanged(new LabelProviderChangedEvent(this, notification.getNotifier())); } } } }

Target:
public void notifyChanged(Notification notification) { if (isFireLabelUpdateNotifications()) { if (!(notification instanceof IViewerNotification) || ((IViewerNotification)notification).isLabelUpdate()) { List<ILabelProviderListener> localCopy = new ArrayList<>(labelProviderListeners); for (ILabelProviderListener labelProviderListener : localCopy) { labelProviderListener.labelProviderChanged(new LabelProviderChangedEvent(this, notification.getNotifier())); } } } }
Source:
private void populateWrapperSupplier(ServletConfig config) { if (requestSupplier != null) { return; } String wrapperSupplierName = config.getInitParameter(WRAPPER_SUPPLIER_PARAM_NAME); if (StringUtils.isNotBlank(wrapperSupplierName)) { try { Class<?> wrapperClass = Class.forName(wrapperSupplierName); if (BiFunction.class.isAssignableFrom(wrapperClass)) { requestSupplier = (BiFunction<HttpServletRequest, String, HttpServletRequestWrapper>) wrapperClass.newInstance(); } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { LOGGER.debug( "Error converting to BiFunction<HttpServletRequest, String, HttpServletRequestWrapper>; " + "falling back to default", wrapperSupplierName, e); } } if (requestSupplier == null) { requestSupplier = DEFAULT_REQ_FUNC; } }

Target:
private synchronized void populateWrapperSupplier(ServletConfig config) { if (requestSupplier != null) { return; } String wrapperSupplierName = config.getInitParameter(WRAPPER_SUPPLIER_PARAM_NAME); if (StringUtils.isNotBlank(wrapperSupplierName)) { try { Class<?> wrapperClass = Class.forName(wrapperSupplierName); if (BiFunction.class.isAssignableFrom(wrapperClass)) { requestSupplier = (BiFunction<HttpServletRequest, String, HttpServletRequestWrapper>) wrapperClass.newInstance(); } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { LOGGER.debug( "Error converting to BiFunction<HttpServletRequest, String, HttpServletRequestWrapper>; " + "falling back to default", wrapperSupplierName, e); } } if (requestSupplier == null) { requestSupplier = DEFAULT_REQ_FUNC; } }
Source:
public List<Label> mapAffinityLabels(Map<String, String> affinityLabelMap, String vmName, List<Label> affinityLabelsFromParam) { if (affinityLabelsFromParam == null) { return Collections.emptyList(); } List<Label> affinityLabelsToAdd = new ArrayList<>(); affinityLabelsFromParam.forEach(affinityLabel -> { log.info("Mapping affinity label '{}' for vm '{}'.", affinityLabel, vmName); String mappedAffinityLabelName = affinityLabelMap.get(affinityLabel); if (mappedAffinityLabelName == null) { affinityLabelsToAdd.add(affinityLabel); log.warn("Mapping for affinity label '{}' not found, will use the affinity label name from OVF", affinityLabel.getName()); } else { if (labelDao.getByName(mappedAffinityLabelName) == null) { affinityLabelsToAdd.add(affinityLabel); } else { log.info("Mapping for affinity label '{}' found, attempting to map to '{}'", affinityLabel.getName(), mappedAffinityLabelName); Label mappedAffinityLabel = labelDao.getByName(mappedAffinityLabelName); affinityLabelsToAdd.add(Optional.ofNullable(mappedAffinityLabel).orElse(affinityLabel)); } } }); return affinityLabelsToAdd; }

Target:
public List<Label> mapAffinityLabels(Map<String, String> affinityLabelMap, String vmName, List<Label> affinityLabelsFromParam) { if (affinityLabelsFromParam == null) { return Collections.emptyList(); } List<Label> affinityLabelsToAdd = new ArrayList<>(); affinityLabelsFromParam.forEach(affinityLabel -> { log.info("Mapping affinity label '{}' for vm '{}'.", affinityLabel, vmName); String mappedAffinityLabelName = affinityLabelMap.get(affinityLabel); if (mappedAffinityLabelName == null) { affinityLabelsToAdd.add(affinityLabel); log.warn("Mapping for affinity label '{}' not found, will use the affinity label name from OVF", affinityLabel.getName()); } else { if (labelDao.getByName(mappedAffinityLabelName) == null) { log.warn("Mapping for affinity label '{}' not found, will use the affinity label name from OVF", affinityLabel.getName()); affinityLabelsToAdd.add(affinityLabel); } else { log.info("Mapping for affinity label '{}' found, attempting to map to '{}'", affinityLabel.getName(), mappedAffinityLabelName); Label mappedAffinityLabel = labelDao.getByName(mappedAffinityLabelName); affinityLabelsToAdd.add(Optional.ofNullable(mappedAffinityLabel).orElse(affinityLabel)); } } }); return affinityLabelsToAdd; }
Source:
public void processEvent(Event event) { log.debug(String.format("Event: %s", event.getName())); for (String recipient : recipients) { log.debug(String.format("Recipient: %s", recipient)); for (FilterEntry entry : notify) { if (( entry.getEventName() == null || entry.getEventName().equals(event.getName()) ) && ( entry.getAddress() == null || entry.getAddress().equals(recipient) )) { log.debug(String.format("Entry match((%s)): %s", entry.isExclude() ? "exclude" : "include", entry)); if (!entry.isExclude()) { Transport transport = transports.get(entry.getTransport()); if (transport == null) { log.debug(String.format("Ignoring recipient '%s' as transport not registered", recipient)); } else { transport.dispatchEvent(event, entry.getAddress()); } } break; } } } }

Target:
public void processEvent(Event event) { log.debug(String.format("Event: %s", event.getName())); for (Recipient recipient : recipients) { log.debug(String.format("Recipient: %s", recipient)); for (FilterEntry entry : notify) { if (( entry.getEventName() == null || entry.getEventName().equals(event.getName()) ) && ( entry.getRecipient() == null || entry.getRecipient().equals(recipient) )) { log.debug(String.format("Entry match((%s)): %s", entry.isExclude() ? "exclude" : "include", entry)); if (!entry.isExclude()) { Transport transport = transports.get(recipient.getTransport()); if (transport == null) { log.debug(String.format("Ignoring recipient '%s' as transport not registered", recipient)); } else { transport.dispatchEvent(event, recipient.getName()); } } break; } } } }
Source:
public void send(@RequestBody @Valid ContactRequest contactRequest) throws MessagingException { log.debug("send {}'s contact type with subject {}, body {}", contactRequest.motive, contactRequest.subject, contactRequest.body); String senderEmail = userInfoService.currentUser().getEmail(); String carbonCopy = null; if (contactRequest.copyToSender){ carbonCopy = senderEmail; } String subject = String.format("[%s by %s]%s",contactRequest.motive, userInfoService.currentUser().getNickname(), contactRequest.subject); mailService.sendMail("contact@ozwillo.com", carbonCopy, senderEmail, subject, contactRequest.body); }

Target:
public void send(@RequestBody @Valid ContactRequest contactRequest) throws MessagingException { log.debug("send {}'s contact type with subject {}, body {}", contactRequest.motive, contactRequest.subject, contactRequest.body); String senderEmail = userInfoService.currentUser().getEmail(); String carbonCopy = null; if (contactRequest.copyToSender){ carbonCopy = senderEmail; } String subject = String.format("[%s by %s]%s",contactRequest.motive, userInfoService.currentUser().getNickname(), contactRequest.subject); mailService.sendMail(mailContact, carbonCopy, senderEmail, subject, contactRequest.body); }
Source:
public void testEffectivelyReadOnlyHidesAddRemoveButtons() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption { mockDataset(); when(getvControl().isAddRemoveDisabled()).thenReturn(false); when(getvControl().isEffectivelyEnabled()).thenReturn(true); when(getvControl().isEffectivelyReadonly()).thenReturn(true); when(getvControl().isVisible()).thenReturn(true); getShell().open(); final Control rendered = renderControl(new SWTGridCell(0, 2, getRenderer())); getRenderer().finalizeRendering(getShell()); assertControl(rendered); final GridTableViewerComposite tableViewerComposite = (GridTableViewerComposite) rendered; final Composite gridComposite = Composite.class.cast(tableViewerComposite.getChildren()[0]); final Composite buttonComposite = (Composite) Composite.class.cast(gridComposite.getChildren()[0]) .getChildren()[2]; assertEquals(0, buttonComposite.getChildren().length); final GridControlSWTRenderer swtRenderer = GridControlSWTRenderer.class.cast(getRenderer()); final Optional<Control> addRowButton = swtRenderer.getControlForAction(AddRowAction.ACTION_ID); final Optional<Control> removeRowButton = swtRenderer.getControlForAction(RemoveRowAction.ACTION_ID); final Optional<Control> duplicateRowButton = swtRenderer.getControlForAction(DuplicateRowAction.ACTION_ID); assertTrue(!addRowButton.isPresent()); assertTrue(!removeRowButton.isPresent()); assertTrue(!duplicateRowButton.isPresent()); }

Target:
public void testEffectivelyReadOnlyHidesAddRemoveButtons() throws DatabindingFailedException, NoRendererFoundException, NoPropertyDescriptorFoundExeption { mockDataset(); when(getvControl().isAddRemoveDisabled()).thenReturn(false); when(getvControl().isEffectivelyEnabled()).thenReturn(true); when(getvControl().isEffectivelyReadonly()).thenReturn(true); when(getvControl().isVisible()).thenReturn(true); getShell().open(); final Control rendered = renderControl(new SWTGridCell(0, 2, getRenderer())); getRenderer().finalizeRendering(getShell()); assertControl(rendered); final GridTableViewerComposite tableViewerComposite = (GridTableViewerComposite) rendered; final Composite gridComposite = Composite.class.cast(tableViewerComposite.getChildren()[0]); final Composite buttonComposite = (Composite) Composite.class.cast(gridComposite.getChildren()[0]) .getChildren()[2]; assertEquals(0, buttonComposite.getChildren().length); final GridControlSWTRenderer swtRenderer = GridControlSWTRenderer.class.cast(getRenderer()); final Optional<Control> addRowButton = swtRenderer.getControlForAction(AddRowAction.ACTION_ID); final Optional<Control> removeRowButton = swtRenderer.getControlForAction(RemoveRowAction.ACTION_ID); final Optional<Control> duplicateRowButton = swtRenderer.getControlForAction(DuplicateRowAction.ACTION_ID); assertFalse(addRowButton.isPresent()); assertFalse(removeRowButton.isPresent()); assertFalse(duplicateRowButton.isPresent()); }
Source:
public void testCraiFromFile() throws IOException { final List<CRAIEntry> index = new ArrayList<CRAIEntry>(); final CRAIEntry entry = new CRAIEntry(); entry.sequenceId = 0; entry.alignmentStart = 1; entry.alignmentSpan = 2; entry.sliceOffset = 3; entry.sliceSize = 4; entry.containerStartOffset = 5; index.add(entry); final File file = File.createTempFile("test", ".crai"); file.deleteOnExit(); final FileOutputStream fos = new FileOutputStream(file); final GZIPOutputStream gos = new GZIPOutputStream(fos); CRAIIndex.writeIndex(gos, index); gos.close(); final SAMSequenceDictionary dictionary = new SAMSequenceDictionary(); dictionary.addSequence(new SAMSequenceRecord("1", 100)); final SeekableStream baiStream = CRAIIndex.openCraiFileAsBaiStream(new SeekableBufferedStream(new SeekableFileStream(file)), dictionary); Assert.assertNotNull(baiStream); final DiskBasedBAMFileIndex bamIndex = new DiskBasedBAMFileIndex(baiStream, dictionary); final BAMFileSpan span = bamIndex.getSpanOverlapping(entry.sequenceId, entry.alignmentStart, entry.alignmentStart); Assert.assertNotNull(span); final long[] coordinateArray = span.toCoordinateArray(); Assert.assertEquals(coordinateArray.length, 2); Assert.assertEquals(coordinateArray[0] >> 16, entry.containerStartOffset); Assert.assertEquals(coordinateArray[1] & 0xFFFF, 1); }

Target:
public void testCraiFromFile() throws IOException { doCRAITest(this::getBaiStreamFromFile); }
Source:
private String getFriendsPath( SourcePathResolver sourcePathResolver, ImmutableList<SourcePath> friendPathsSourcePaths) { ImmutableSortedSet<String> absoluteFriendPaths = ImmutableSortedSet.copyOf( friendPathsSourcePaths .stream() .map(path -> sourcePathResolver.getAbsolutePath(path).toString()) .collect(Collectors.toSet())); return "-Xfriend-paths=" + absoluteFriendPaths.stream().reduce("", (path1, path2) -> path1 + "," + path2); }

Target:
private String getFriendsPath( SourcePathResolver sourcePathResolver, ImmutableList<SourcePath> friendPathsSourcePaths) { if (friendPathsSourcePaths.isEmpty()) { return ""; } ImmutableSortedSet<String> absoluteFriendPaths = ImmutableSortedSet.copyOf( friendPathsSourcePaths .stream() .map(path -> sourcePathResolver.getAbsolutePath(path).toString()) .collect(Collectors.toSet())); return "-Xfriend-paths=" + absoluteFriendPaths.stream().reduce("", (path1, path2) -> path1 + "," + path2); }
Source:
private AuthenticateResponse authenticate(URL authenticationUrl, String requestBody) throws Exception { Request request = new Request.Builder() .url(authenticationUrl) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .post(RequestBody.create(JSON, requestBody)) .build(); RealmLog.debug("Authenticate: " + requestBody); Call call = client.newCall(request); Response response = call.execute(); return AuthenticateResponse.from(response); }

Target:
private AuthenticateResponse authenticate(URL authenticationUrl, String requestBody) throws Exception { Request request = new Request.Builder() .url(authenticationUrl) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .post(RequestBody.create(JSON, requestBody)) .build(); Call call = client.newCall(request); Response response = call.execute(); return AuthenticateResponse.from(response); }
Source:
public void changeMessageCommitFormatMultipleParagraph() throws Exception { Change c = newChange(); ChangeUpdate update = newUpdate(c, changeOwner); update.setChangeMessage("Just a little code change.\n" + "Testing new line\n" + "\n" + "Testing multiple paragraphs."); update.commit(); assertEquals("refs/changes/01/1/meta", update.getRefName()); RevWalk walk = new RevWalk(repo); try { RevCommit commit = walk.parseCommit(update.getRevision()); walk.parseBody(commit); assertEquals("Update patch set 1\n" + "\n" + "Just a little code change.\nTesting new line\n" + "\n" + "Testing multiple paragraphs.\n" + "\n" + "Patch-set: 1\n", commit.getFullMessage()); } finally { walk.release(); } }

Target:
public void changeMessageCommitFormatMultipleParagraph() throws Exception { Change c = newChange(); ChangeUpdate update = newUpdate(c, changeOwner); update.setChangeMessage("Just a little code change.\n" + "Testing new line\n" + "\n" + "Testing multiple paragraphs."); update.commit(); assertEquals("refs/changes/01/1/meta", update.getRefName()); RevWalk walk = new RevWalk(repo); try { RevCommit commit = walk.parseCommit(update.getRevision()); walk.parseBody(commit); assertEquals("Update patch set 1\n" + "\n" + "Just a little code change.\n" + "Testing new line\n" + "\n" + "Testing multiple paragraphs.\n" + "\n" + "Patch-set: 1\n", commit.getFullMessage()); } finally { walk.release(); } }
Source:
protected void UpdateDetailsAvailability() { super.UpdateDetailsAvailability(); for (EntityModel detailModel : getDetailModels()) { if (detailModel instanceof ClusterServiceModel) { detailModel.setIsAvailable(((VDSGroup) getSelectedItem()).supportsGlusterService()); } } }

Target:
protected void UpdateDetailsAvailability() { super.UpdateDetailsAvailability(); getClusterServiceModel().setIsAvailable(((VDSGroup) getSelectedItem()).supportsGlusterService()); }