auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean canDoAction() { <START> if (getParameters() == null) { <END> return false; } else if (!QuotaHelper.getInstance().checkQuotaValidationForAddEdit(getParameters().getQuota(), getReturnValue().getCanDoActionMessages())) { return false; } return true; }</code><technical_language>i this check is needed, factory create command null params, if decide this check, add error message</technical_language>

Target:
protected boolean canDoAction() { return (!QuotaHelper.getInstance().checkQuotaValidationForAddEdit(getParameters().getQuota(), getReturnValue().getCanDoActionMessages())); }
Source:
<code>public boolean filter(Object context, Descriptor descriptor) { LOGGER.log(Level.FINER, "filtering {0}", descriptor.getId()); if (descriptor instanceof OrganizationFolder.DescriptorImpl && (context instanceof View || context instanceof ViewGroup)) { if (ExtensionList.lookup(MultiBranchProjectFactoryDescriptor.class).isEmpty()) { return false; } boolean haveOne = false; for (SCMNavigatorDescriptor d: ExtensionList.lookup(SCMNavigatorDescriptor.class)) { if (d instanceof SingleSCMNavigator.DescriptorImpl) { continue; } if (haveOne) { <START> return true; <END> } haveOne = true; } return false; } return true; }</code><technical_language>IMO reverted; discussion below</technical_language>

Target:
public boolean filter(Object context, Descriptor descriptor) { LOGGER.log(Level.FINER, "filtering {0}", descriptor.getId()); if (descriptor instanceof OrganizationFolder.DescriptorImpl && (context instanceof View || context instanceof ViewGroup)) { if (ExtensionList.lookup(MultiBranchProjectFactoryDescriptor.class).isEmpty()) { return false; } boolean haveOne = false; for (SCMNavigatorDescriptor d: ExtensionList.lookup(SCMNavigatorDescriptor.class)) { if (d instanceof SingleSCMNavigator.DescriptorImpl) { continue; } if (haveOne || d.newInstance((String) null) == null) { return true; } haveOne = true; } return false; } return true; }
Source:
<code>public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller == null || sourceObject == null) { return false; } Map<UUID, Cards> cardsToDiscard = new HashMap<>(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player == null) { continue; } Cards cards = new CardsImpl(); Target target = new TargetDiscard(0, 3, new FilterCard(), playerId); <START> player.chooseTarget(outcome, target, source, game); <END> cards.addAll(target.getTargets()); cardsToDiscard.put(playerId, cards); } for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { Cards cardsPlayer = cardsToDiscard.get(playerId); cardsToDiscard.put(playerId, player.discard(cardsPlayer, source, game)); } } for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player == null) { continue; } Cards cardsPlayer = cardsToDiscard.get(playerId); if (cardsPlayer != null) { player.damage(3 - cardsPlayer.size(), source.getId(), game); } } return true; }</code><technical_language>Outcome.Discard</technical_language>

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller == null || sourceObject == null) { return false; } Map<UUID, Cards> cardsToDiscard = new HashMap<>(); for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player == null) { continue; } Cards cards = new CardsImpl(); Target target = new TargetDiscard(0, 3, new FilterCard(), playerId); player.chooseTarget(Outcome.Discard, target, source, game); cards.addAll(target.getTargets()); cardsToDiscard.put(playerId, cards); } for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player != null) { Cards cardsPlayer = cardsToDiscard.get(playerId); cardsToDiscard.put(playerId, player.discard(cardsPlayer, source, game)); } } for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { Player player = game.getPlayer(playerId); if (player == null) { continue; } Cards cardsPlayer = cardsToDiscard.get(playerId); if (cardsPlayer != null) { player.damage(3 - cardsPlayer.size(), source.getId(), game); } } return true; }
Source:
<code>public RelBuilder filter(RexNode... predicates) { <START> return filter(ImmutableList.copyOf(predicates), Collections.emptyList()); <END> }</code><technical_language>Instead of a copy, Arrays.asList() work (copy done filter constructor)</technical_language>

Target:
public RelBuilder filter(RexNode... predicates) { return filter(ImmutableSet.of(), Arrays.asList(predicates)); }
Source:
<code>public void processElement(ProcessContext context) throws IOException { if (context.element() != null) { if (MapType.MAP.equals(properties.mapType.getValue())) { map(context.element(), context); } else { flatMap(context.element(), context); } } <START> interpreter.cleanup(); <END> }</code><technical_language>Putting a cleanup result in weird behavior, interpreter.exec(pythonFunction) longer called processElement</technical_language>

Target:
public void processElement(ProcessContext context) throws IOException { if (context.element() != null) { if (MapType.MAP.equals(properties.mapType.getValue())) { map(context.element(), context); } else { flatMap(context.element(), context); } } }
Source:
<code>public boolean execute(CommandSender sender, String label, String[] args) { if (!testPermission(sender)) return false; if (args.length == 0) { sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); return false; } final String stringTimeout = args[0]; int timeout; try { timeout = Integer.parseInt(stringTimeout); } catch (NumberFormatException ex) { sender.sendMessage(ChatColor.RED + "'" + stringTimeout + "' is not a valid number"); return false; } if (timeout <= 0) { <START> sender.sendMessage(ChatColor.RED + "Timeout has to be positive"); <END> return false; } Bukkit.getServer().setIdleTimeout(timeout); Bukkit.broadcastMessage("The idle timeout has been set to '" + timeout + "' minutes."); return true; }</code><technical_language>Replace this number entered (<Number>) is small, 0</technical_language>

Target:
public boolean execute(CommandSender sender, String label, String[] args) { if (!testPermission(sender)) return false; if (args.length == 0) { sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); return false; } final String stringTimeout = args[0]; int timeout; try { timeout = Integer.parseInt(stringTimeout); } catch (NumberFormatException ex) { sender.sendMessage(ChatColor.RED + "'" + stringTimeout + "' is not a valid number"); return false; } if (timeout <= 0) { sender.sendMessage(ChatColor.RED + "The number you have entered (" + timeout + ") is too small, it must be at least 1"); return false; } Bukkit.getServer().setIdleTimeout(timeout); sender.sendMessage("Successfully set the idle timeout to " + timeout + " minutes."); return true; }
Source:
<code>public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { Set<GrantedAuthority> authorities = getAuthorities(username); <START> UserDetails user = this.inMemoryUserDetailsManager.loadUserByUsername(username); <END> return new User(user.getUsername(), user.getPassword(), authorities); }</code><technical_language>work role of user? hard-coded? staff-members in DB. this design is in question create new staffmembers sample app including passwords anti-pattern leading wrong track. This fine though, I need some discussion others here</technical_language>

Target:
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { Set<GrantedAuthority> authorities = getAuthorities(username); UserDetails user; try { user = this.amBuilder.getDefaultUserDetailsService().loadUserByUsername(username); return new User(user.getUsername(), user.getPassword(), authorities); } catch (Exception e) { e.printStackTrace(); UsernameNotFoundException exception = new UsernameNotFoundException("Authentication failed.", e); LOG.warn("Failed to get user {}.", username, exception); throw exception; } }
Source:
<code>private void doComplete() { <START> if(!isCompleted) { <END> isCompleted = true; responseStatusCallback.responseSendSuccessfully(); ctx.notifyDownstream(RESPONSE_COMPLETE_EVENT); resume(); } }</code><technical_language>AtomicBoolean compareAndSet</technical_language>

Target:
private void doComplete() { if(isCompleted.compareAndSet(false, true)) { responseStatusCallback.responseSendSuccessfully(); ctx.notifyDownstream(RESPONSE_COMPLETE_EVENT); resume(); } }
Source:
<code>public void invite(InvitationDto dto, String from) throws MessagingException { User invitingUser = userRepository.findByUsername(from); Challenge challenge = challengeRepository.findOneWithOrganization(dto.getChallengeId()); if (challenge == null) { throw new IllegalArgumentException("invalid challenge"); } Organization organization = challenge.getOrganization(); boolean ok = false; for (OrganizationMember organizationMember : invitingUser.getOrganizations()) { if (organizationMember.isAdmin() && organizationMember.getKey().getOrganization().getId().equals(organization.getId())) { ok = true; break; } } if (!ok) { <START> throw new AccessDeniedException("unauthorized"); <END> } UserShowDto user = userService.findByEmail(dto.getEmail()); if (user == null) { UserCreateDto userCreateDto = new UserCreateDto(); userCreateDto.setEmail(dto.getEmail()); userCreateDto.setNick(new BigInteger(130, random).toString(32)); userCreateDto.setPassword(new BigInteger(130, random).toString(32)); userService.createFromDto(userCreateDto); } if (Arrays.asList(this.environment.getActiveProfiles()).contains("development")) { log.log(Level.ERROR, getUrl(challenge.getId())); } else { Map<String, Object> params = new HashMap<>(); params.put("organization", organization.getName()); params.put("url", getUrl(challenge.getId())); mailService.sendMail("user", dto.getEmail(), "Challenge invitation", "challenge-invite.html", params, Locale.ENGLISH); } }</code><technical_language>more meaningful message</technical_language>

Target:
public void invite(InvitationDto dto, String from) throws MessagingException { User invitingUser = userRepository.findByUsername(from); Challenge challenge = challengeRepository.findOneWithOrganization(dto.getChallengeId()); if (challenge == null) { throw new IllegalArgumentException("challenge.invalid"); } Organization organization = challenge.getOrganization(); boolean ok = false; for (OrganizationMember organizationMember : invitingUser.getOrganizations()) { if (organizationMember.isAdmin() && organizationMember.getKey().getOrganization().getId().equals(organization.getId())) { ok = true; break; } } if (!ok) { throw new AccessDeniedException("you are not an admin to the parent organization of the challenge"); } UserShowDto user = userService.findByEmail(dto.getEmail()); Map<String, Object> params = new HashMap<>(); if (user == null) { UserCreateDto userCreateDto = new UserCreateDto(); userCreateDto.setEmail(dto.getEmail()); userCreateDto.setNick(new BigInteger(130, random).toString(32)); userCreateDto.setPassword(new BigInteger(130, random).toString(32)); userService.createFromDto(userCreateDto); params.put("username", userCreateDto.getNick()); params.put("password", userCreateDto.getPassword()); } params.put("organization", organization.getName()); params.put("token", getToken(challenge.getId())); mailService.sendMail("user", dto.getEmail(), "Challenge invitation", "challenge-invite.html", params, Locale.ENGLISH); }
Source:
<code>public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { String reason = null; if (args.length >= 2) { reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); } { if (!TFM_AdminList.isSuperAdmin(sender)) { sender.sendMessage(TFM_Command.MSG_NO_PERMS); } if (!TFM_AdminList.isSuperAdmin(sender_p)) { if (args.length < 1) { sender_p.kickPlayer(ChatColor.RED + "You have been kicked by: " + sender.getName() + "-" + " No reason given"); } <START> } <END> else { sender.sendMessage("You cannot kick admins!"); } if (!TFM_AdminList.isSuperAdmin(sender_p)) { sender_p.kickPlayer(ChatColor.RED + reason + "- " + sender.getName()); TFM_Util.bcastMsg(sender.getName() + "-" + " Kicking" + sender_p.getName() + ChatColor.YELLOW + "- " + reason , ChatColor.RED); } } return true; }</code><technical_language>Formatting</technical_language>

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { String reason = null; if (args.length >= 2) { reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); } if (!TFM_AdminList.isSuperAdmin(sender)) { sender.sendMessage(TFM_Command.MSG_NO_PERMS); } if (!TFM_AdminList.isSuperAdmin(sender_p)) { if (args.length < 1) { sender_p.kickPlayer(ChatColor.RED + "You have been kicked by: " + sender.getName() + "-" + " No reason given"); } } else { sender.sendMessage("You cannot kick admins!"); } if (!TFM_AdminList.isSuperAdmin(sender_p)) { TFM_Util.adminAction("Kicked for ", reason, true); TFM_Util.bcastMsg(sender.getName() + "-" + " Kicking" + sender_p.getName() + ChatColor.YELLOW + "- " + reason , ChatColor.RED); } return true; }
Source:
<code>protected String executeSingle(ResourceBundle language, String[] labelFragments, Command command) throws InterpretationException { ArrayList<Item> items = getMatchingItems(language, labelFragments, command.getClass()); if (items.size() < 1) { <START> if ((command != null) && (getMatchingItems(language, labelFragments, null).size() >= 1)) { <END> throw new InterpretationException( language.getString(COMMAND_NOT_ACCEPTED).replace("<cmd>", command.toString())); } else { throw new InterpretationException(language.getString(NO_OBJECTS)); } } else if (items.size() > 1) { throw new InterpretationException(language.getString(MULTIPLE_OBJECTS)); } else { Item item = items.get(0); if (command instanceof State) { try { State newState = (State) command; State oldState = item.getStateAs(newState.getClass()); if (oldState.equals(newState)) { String template = language.getString(STATE_ALREADY_SINGULAR); String cmdName = "state_" + command.toString().toLowerCase(); String stateText = null; try { stateText = language.getString(cmdName); } catch (Exception e) { stateText = language.getString(STATE_CURRENT); } return template.replace("<state>", stateText); } } catch (Exception ex) { logger.debug("Failed constructing response: {}", ex.getMessage()); return language.getString(ERROR); } } eventPublisher.post(ItemEventFactory.createCommandEvent(item.getName(), command)); return language.getString(OK); } }</code><technical_language>command.getClass() is called, if command is null, reach this line all</technical_language>

Target:
protected String executeSingle(ResourceBundle language, String[] labelFragments, Command command) throws InterpretationException { ArrayList<Item> items = getMatchingItems(language, labelFragments, command.getClass()); if (items.size() < 1) { if (getMatchingItems(language, labelFragments, null).size() >= 1) { throw new InterpretationException( language.getString(COMMAND_NOT_ACCEPTED).replace("<cmd>", command.toString())); } else { throw new InterpretationException(language.getString(NO_OBJECTS)); } } else if (items.size() > 1) { throw new InterpretationException(language.getString(MULTIPLE_OBJECTS)); } else { Item item = items.get(0); if (command instanceof State) { try { State newState = (State) command; State oldState = item.getStateAs(newState.getClass()); if (oldState.equals(newState)) { String template = language.getString(STATE_ALREADY_SINGULAR); String cmdName = "state_" + command.toString().toLowerCase(); String stateText = null; try { stateText = language.getString(cmdName); } catch (Exception e) { stateText = language.getString(STATE_CURRENT); } return template.replace("<state>", stateText); } } catch (Exception ex) { logger.debug("Failed constructing response: {}", ex.getMessage()); return language.getString(ERROR); } } eventPublisher.post(ItemEventFactory.createCommandEvent(item.getName(), command)); return language.getString(OK); } }
Source:
<code>protected void endStepJobCommitted() { <START> endStepJob(JobExecutionStatus.FINISHED, getStepMessageMap(JobExecutionStatus.FINISHED, " "), true); <END> }</code><technical_language>sending space</technical_language>

Target:
protected void endStepJobCommitted() { endStepJob(JobExecutionStatus.FINISHED, getStepMessageMap(JobExecutionStatus.FINISHED, null), true); }
Source:
<code>private boolean validateResource(IResource resource) { boolean isValid = false; if (resource instanceof IContainer) { try { final IResource[] members = ((IContainer) resource).members(); for (IResource member : members) { isValid = validateResource(member); if (isValid) { break; } } } catch (final CoreException e) { } } else if (resource.getType() == IResource.FILE) { <START> for (int i = 0; i < extensions.size(); i++) { <END> if (extensions.get(i).equalsIgnoreCase(resource.getFileExtension())) { isValid = true; break; } } } return isValid; }</code><technical_language>for (String ext : extensions) { is more common line 488</technical_language>

Target:
private boolean validateResource(IResource resource) { boolean isValid = false; if (resource instanceof IContainer) { try { final IResource[] members = ((IContainer) resource).members(); for (IResource member : members) { isValid = validateResource(member); if (isValid) { break; } } } catch (final CoreException e) { } } else if (resource.getType() == IResource.FILE) { for (String ext : extensions) { if (ext.equalsIgnoreCase(resource.getFileExtension())) { isValid = true; break; } } } return isValid; }
Source:
<code><START> public OseePreparedStatement getBatchStatement(JdbcConnection connection, String query, int batchIncrementSize) throws SQLException { <END> PreparedStatement preparedStatement = ((JdbcConnectionImpl) connection).prepareStatement(query); return new OseePreparedStatement(preparedStatement, batchIncrementSize); }</code><technical_language>this similar other parts of API if connection == null get call get Connection if instance</technical_language>

Target:
public OseePreparedStatement getBatchStatement(JdbcConnection connection, String query, int batchIncrementSize) { try { PreparedStatement preparedStatement = ((JdbcConnectionImpl) connection).prepareStatement(query); return new OseePreparedStatement(preparedStatement, batchIncrementSize); } catch (SQLException ex) { throw newJdbcException(ex); } }
Source:
<code>public static Tuple<DocumentField, DocumentField> randomDocumentField(XContentType xContentType, boolean isMetafield, Predicate<String> excludeMetaFieldFilter) { if (isMetafield) { String metaField = randomValueOtherThanMany(excludeMetaFieldFilter, <START> () -> randomFrom(MapperService.META_FIELDS_BEFORE_7DOT8)); <END> DocumentField documentField; if (metaField.equals(IgnoredFieldMapper.NAME)) { int numValues = randomIntBetween(1, 3); List<Object> ignoredFields = new ArrayList<>(numValues); for (int i = 0; i < numValues; i++) { ignoredFields.add(randomAlphaOfLengthBetween(3, 10)); } documentField = new DocumentField(metaField, ignoredFields); } else { documentField = new DocumentField(metaField, Collections.singletonList(randomAlphaOfLengthBetween(3, 10))); } return Tuple.tuple(documentField, documentField); } else { String fieldName = randomAlphaOfLengthBetween(3, 10); Tuple<List<Object>, List<Object>> tuple = RandomObjects.randomStoredFieldValues(random(), xContentType); DocumentField input = new DocumentField(fieldName, tuple.v1()); DocumentField expected = new DocumentField(fieldName, tuple.v2()); return Tuple.tuple(input, expected); } }</code><technical_language>a question: is this necessary? I "old" collection of meta field names is reading "old" nodes? built-in fields master</technical_language>

Target:
public static Tuple<DocumentField, DocumentField> randomDocumentField(XContentType xContentType, boolean isMetafield, Predicate<String> excludeMetaFieldFilter) { if (isMetafield) { String metaField = randomValueOtherThanMany(excludeMetaFieldFilter, () -> randomFrom(IndicesModule.getBuiltInMetadataFields())); DocumentField documentField; if (metaField.equals(IgnoredFieldMapper.NAME)) { int numValues = randomIntBetween(1, 3); List<Object> ignoredFields = new ArrayList<>(numValues); for (int i = 0; i < numValues; i++) { ignoredFields.add(randomAlphaOfLengthBetween(3, 10)); } documentField = new DocumentField(metaField, ignoredFields); } else { documentField = new DocumentField(metaField, Collections.singletonList(randomAlphaOfLengthBetween(3, 10))); } return Tuple.tuple(documentField, documentField); } else { String fieldName = randomAlphaOfLengthBetween(3, 10); Tuple<List<Object>, List<Object>> tuple = RandomObjects.randomStoredFieldValues(random(), xContentType); DocumentField input = new DocumentField(fieldName, tuple.v1()); DocumentField expected = new DocumentField(fieldName, tuple.v2()); return Tuple.tuple(input, expected); } }
Source:
<code>protected ContextBuilder builder(Properties overrides) { overrides.setProperty(Constants.PROPERTY_MAX_RETRIES, "1"); MockWebServer defaultServer = regionToServers.get(DEFAULT_REGION); return ContextBuilder.newBuilder(new EC2ApiMetadata()) .credentials(ACCESS_KEY, SECRET_KEY) <START> .endpoint("http://" + defaultServer.getHostName() + ":" + defaultServer.getPort()) <END> .overrides(overrides) .modules(modules); }</code><technical_language>careful hostnames. this crashes build servers. I tend localhost directly</technical_language>

Target:
protected ContextBuilder builder(Properties overrides) { overrides.setProperty(Constants.PROPERTY_MAX_RETRIES, "1"); MockWebServer defaultServer = regionToServers.get(DEFAULT_REGION); return ContextBuilder.newBuilder(new EC2ApiMetadata()) .credentials(ACCESS_KEY, SECRET_KEY) .endpoint(defaultServer.getUrl("").toString()) .overrides(overrides) .modules(modules); }
Source:
<code>public void close() throws IOException { try { super.close(); } finally { Log.d(K9MailLib.LOG_TAG, "deleting temp file"); boolean fileDeleteResult = mFile.delete(); <START> if (!fileDeleteResult) Log.i(K9MailLib.LOG_TAG, "fail to delete temp file"); <END> } }</code><technical_language>real need save lines here. Put logging a new line</technical_language>

Target:
public void close() throws IOException { try { super.close(); } finally { Log.d(K9MailLib.LOG_TAG, "deleting " + mFile.getName() + " file"); boolean fileSuccessfullyDeleted = mFile.delete(); if (!fileSuccessfullyDeleted){ Log.i(K9MailLib.LOG_TAG, "fail to delete " + mFile.getName() + " file"); } } }
Source:
<code>public boolean fileRowCountMatchesHeaderRowCount(ConcurRequestExtractFile requestExtractFile) { int countEntryDetailLines = 0; <START> List<ConcurRequestExtractRequestDetailFileLine> requestDetailLines = requestExtractFile.getRequestDetails(); <END> for (ConcurRequestExtractRequestDetailFileLine detailLine : requestDetailLines) { countEntryDetailLines = countEntryDetailLines + detailLine.getRequestEntryDetails().size(); } if ((requestDetailLines.size() + countEntryDetailLines) == requestExtractFile.getRecordCount()) { return true; } else { LOG.error("Header row count validation failed. Header record count was =" +requestExtractFile.getRecordCount()+"= while file line count was =" +(requestDetailLines.size() + countEntryDetailLines)+ "="); return false; } }</code><technical_language>this code extracted in a separate method in getTotalEntryDetailLines(). Also, is for this requestExtractFile.getRequestDetails() null</technical_language>

Target:
private boolean fileRowCountMatchesHeaderRowCount(ConcurRequestExtractFile requestExtractFile) { int fileLineCount = getTotalRequestFileRowCount(requestExtractFile); if (fileLineCount == requestExtractFile.getRecordCount()) { return true; } else { LOG.error("Header row count validation failed. Header record count was =" + requestExtractFile.getRecordCount() + "= while file line count was =" + fileLineCount + "="); return false; } }
Source:
<code>public void testErrorPrecedenceWithSpecialCase() throws Exception { doPut(); Map<ServerErrorCode, RouterErrorCode> serverErrorToRouterError = new HashMap<>(); serverErrorToRouterError.put(ServerErrorCode.Blob_Deleted, RouterErrorCode.BlobDeleted); serverErrorToRouterError.put(ServerErrorCode.Blob_Expired, RouterErrorCode.BlobExpired); serverErrorToRouterError.put(ServerErrorCode.Blob_Authorization_Failure, RouterErrorCode.BlobAuthorizationFailure); for (Map.Entry<ServerErrorCode, RouterErrorCode> entry : serverErrorToRouterError.entrySet()) { Map<ServerErrorCode, Integer> errorCounts = new HashMap<>(); errorCounts.put(ServerErrorCode.Blob_Not_Found, replicasCount - 1); errorCounts.put(entry.getKey(), 1); <START> System.out.println(errorCounts); <END> testWithErrorCodes(errorCounts, mockServerLayout, entry.getValue(), getErrorCodeChecker); } }</code><technical_language>Do need print out? If not, remove this line</technical_language>

Target:
public void testErrorPrecedenceWithSpecialCase() throws Exception { doPut(); Map<ServerErrorCode, RouterErrorCode> serverErrorToRouterError = new HashMap<>(); serverErrorToRouterError.put(ServerErrorCode.Blob_Deleted, RouterErrorCode.BlobDeleted); serverErrorToRouterError.put(ServerErrorCode.Blob_Expired, RouterErrorCode.BlobExpired); serverErrorToRouterError.put(ServerErrorCode.Blob_Authorization_Failure, RouterErrorCode.BlobAuthorizationFailure); for (Map.Entry<ServerErrorCode, RouterErrorCode> entry : serverErrorToRouterError.entrySet()) { Map<ServerErrorCode, Integer> errorCounts = new HashMap<>(); errorCounts.put(ServerErrorCode.Blob_Not_Found, replicasCount - 1); errorCounts.put(entry.getKey(), 1); testWithErrorCodes(errorCounts, mockServerLayout, entry.getValue(), getErrorCodeChecker); } }
Source:
<code>static void install(OperationContext context, List<String> exposedSubsystems) { ImmutableManagementResourceRegistration rootResourceRegistration = context.getRootResourceRegistration(); Resource rootResource = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); ServiceBuilder<?> serviceBuilder = context.getServiceTarget().addService(MicroProfileMetricsSubsystemDefinition.WILDFLY_REGISTRATION_SERVICE); final ServiceName modelControllerName = Services.JBOSS_SERVER_CONTROLLER; <START> Supplier<ModelController> modelController = serviceBuilder.requires(modelControllerName); <END> serviceBuilder.requires(CONFIG_PROVIDER); MetricsRegistrationService service = new MetricsRegistrationService(rootResourceRegistration, rootResource, modelController, exposedSubsystems); serviceBuilder.setInstance(service) .install(); }</code><technical_language>Subsystems longer ModelController directly. create in-vm client a factory provided capability: <LINK_0></technical_language>

Target:
static void install(OperationContext context, List<String> exposedSubsystems) { ImmutableManagementResourceRegistration rootResourceRegistration = context.getRootResourceRegistration(); Resource rootResource = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); ServiceBuilder<?> serviceBuilder = context.getServiceTarget().addService(WILDFLY_REGISTRATION_SERVICE); Supplier<ModelControllerClientFactory> modelControllerClientFactory = serviceBuilder.requires(context.getCapabilityServiceName(CLIENT_FACTORY_CAPABILITY, ModelControllerClientFactory.class)); Supplier<Executor> managementExecutor = serviceBuilder.requires(context.getCapabilityServiceName(MANAGEMENT_EXECUTOR, Executor.class)); serviceBuilder.requires(CONFIG_PROVIDER); MetricsRegistrationService service = new MetricsRegistrationService(rootResourceRegistration, rootResource, modelControllerClientFactory, managementExecutor, exposedSubsystems); serviceBuilder.setInstance(service) .install(); }
Source:
<code>public JobOrder instantiateForInsert() { JobOrder entity = new JobOrder(); <START> entity.setEmploymentType("W2"); <END> entity.setStartDate(new DateTime()); return entity; }</code><technical_language>W2 is Candidate.employeeType! Easy mistake, change this 'Contract' 'Permanent' something. reason I care is client's systems work in field</technical_language>

Target:
public JobOrder instantiateForInsert() { JobOrder entity = new JobOrder(); entity.setEmploymentType("Contract"); entity.setStartDate(new DateTime()); entity.setClientCorporation(new ClientCorporation(1)); entity.setClientContact(new ClientContact(1)); entity.setOwner(new CorporateUser(1)); return entity; }
Source:
<code>public int read(byte[] b, int off, int len) throws IOException { Memory readBuffer = new Memory(len); WinBase.OVERLAPPED olap = new WinBase.OVERLAPPED(); olap.hEvent = readerWaitable; olap.write(); boolean immediate = API.ReadFile(handle, readBuffer, len, null, olap.getPointer()); if (!immediate) { int lastError = API.GetLastError(); if (lastError != WinError.ERROR_IO_PENDING) { throw new IOException("ReadFile() failed: " + lastError); } } <START> IntByReference r = new IntByReference(); <END> if (!API.GetOverlappedResult(handle, olap.getPointer(), r, true)) { int lastError = API.GetLastError(); throw new IOException("GetOverlappedResult() failed for read operation: " + lastError); } int actualLen = r.getValue(); byte[] byteArray = readBuffer.getByteArray(0, actualLen); System.arraycopy(byteArray, 0, b, off, actualLen); return actualLen; }</code><technical_language>rename read r? name properly</technical_language>

Target:
public int read(byte[] b, int off, int len) throws IOException { Memory readBuffer = new Memory(len); WinBase.OVERLAPPED olap = new WinBase.OVERLAPPED(); olap.hEvent = readerWaitable; olap.write(); boolean immediate = API.ReadFile(handle, readBuffer, len, null, olap.getPointer()); if (!immediate) { int lastError = API.GetLastError(); if (lastError != WinError.ERROR_IO_PENDING) { throw new IOException("ReadFile() failed: " + lastError); } } IntByReference r = new IntByReference(); if (!API.GetOverlappedResult(handle, olap.getPointer(), r, true)) { int lastError = API.GetLastError(); throw new IOException("GetOverlappedResult() failed for read operation: " + lastError); } int actualLen = r.getValue(); if (requireStrictLength && (actualLen != len)) { throw new IOException("ReadFile() read less bytes than requested: expected " + len + " bytes, but read " + actualLen + " bytes"); } byte[] byteArray = readBuffer.getByteArray(0, actualLen); System.arraycopy(byteArray, 0, b, off, actualLen); return actualLen; }
Source:
<code>public void testCannotRebaseChangeAlreadyUpToDate() throws Exception { try { reviewHarness.client.rebase(reviewHarness.shortId, 1, new NullProgressMonitor()); fail("Expected to fail when rebasing a change that is already up to date"); } catch (GerritException e) { <START> assertThat(e.getMessage(), is("Change is already up to date.\n")); <END> } }</code><technical_language>This is breaking pre 2.9 tests. check string matches \n</technical_language>

Target:
public void testCannotRebaseChangeAlreadyUpToDate() throws Exception { try { reviewHarness.client.rebase(reviewHarness.shortId, 1, new NullProgressMonitor()); fail("Expected to fail when rebasing a change that is already up to date"); } catch (GerritException e) { String message = CharMatcher.JAVA_ISO_CONTROL.removeFrom(e.getMessage()); assertThat(message, is("Change is already up to date.")); } }
Source:
<code>private void assertNotSame(Location loc1, Location loc2) { Assert.assertNotNull(loc1); Assert.assertNotNull(loc2); <START> Assert.assertTrue(loc2 instanceof PortForwardManager, "loc1="+loc1); <END> Assert.assertTrue(loc2 instanceof PortForwardManager, "loc2="+loc2); Assert.assertNotSame(loc1, loc2); Assert.assertNotEquals(((PortForwardManager)loc1).getId(), ((PortForwardManager)loc2).getId()); }</code><technical_language>assert loc1</technical_language>

Target:
private void assertNotSame(Location loc1, Location loc2) { Assert.assertNotNull(loc1); Assert.assertNotNull(loc2); Assert.assertTrue(loc1 instanceof PortForwardManager, "loc1="+loc1); Assert.assertTrue(loc2 instanceof PortForwardManager, "loc2="+loc2); Assert.assertNotSame(loc1, loc2); Assert.assertNotEquals(((PortForwardManager)loc1).getId(), ((PortForwardManager)loc2).getId()); }
Source:
<code>private DbUser buildUser(boolean externalSsoEnabled, T params, String authzName) { DbUser dbUser = dbUserDao.getByExternalId(authzName, params.getPrincipalId()); DbUser user = new DbUser(dbUser); user.setId(dbUser == null ? Guid.newGuid() : dbUser.getId()); user.setExternalId(params.getPrincipalId()); user.setDomain(authzName); user.setEmail(params.getEmail()); user.setFirstName(params.getFirstName()); user.setLastName(params.getLastName()); user.setNamespace(params.getNamespace()); user.setLoginName(params.getPrincipalName()); List<Guid> groupIds = new ArrayList<>(); Map<String, ExtMap> groupRecords = new HashMap<>(); flatGroups((Collection<ExtMap>) params.getGroupIds(), groupRecords); for (Map.Entry<String, ExtMap> group: groupRecords.entrySet()) { String name = group.getValue().get(Authz.GroupRecord.NAME); String domain = <START> name.equals("ovirt-administrator") <END> ? "" : authzName; DbGroup dbGroup = externalSsoEnabled ? dbGroupDao.getByNameAndDomain(name, domain) : dbGroupDao.getByExternalId(authzName, group.getKey()); if (dbGroup != null) { dbGroup.setName(name); dbGroupDao.update(dbGroup); groupIds.add(dbGroup.getId()); } } user.setGroupIds(groupIds); user.setAdmin( !roleDao.getAnyAdminRoleForUserAndGroups( user.getId(), StringUtils.join(user.getGroupIds(), ",") ).isEmpty() ); if (dbUser == null) { dbUserDao.save(user); } else if (!dbUser.equals(user)) { dbUserDao.update(user); } return user; }</code><technical_language>I this some kind of constant</technical_language>

Target:
private DbUser buildUser(boolean externalSsoEnabled, T params, String authzName) { DbUser dbUser = dbUserDao.getByExternalId(authzName, params.getPrincipalId()); DbUser user = new DbUser(dbUser); user.setId(dbUser == null ? Guid.newGuid() : dbUser.getId()); user.setExternalId(params.getPrincipalId()); user.setDomain(authzName); user.setEmail(params.getEmail()); user.setFirstName(params.getFirstName()); user.setLastName(params.getLastName()); user.setNamespace(params.getNamespace()); user.setLoginName(params.getPrincipalName()); List<Guid> groupIds = new ArrayList<>(); Map<String, ExtMap> groupRecords = new HashMap<>(); flatGroups((Collection<ExtMap>) params.getGroupIds(), groupRecords); for (Map.Entry<String, ExtMap> group: groupRecords.entrySet()) { String name = group.getValue().get(Authz.GroupRecord.NAME); String domain = name.equals(OVIRT_ADMINISTRATOR) ? "" : authzName; DbGroup dbGroup = externalSsoEnabled ? dbGroupDao.getByNameAndDomain(name, domain) : dbGroupDao.getByExternalId(authzName, group.getKey()); if (dbGroup != null) { dbGroup.setName(name); dbGroupDao.update(dbGroup); groupIds.add(dbGroup.getId()); } } user.setGroupIds(groupIds); user.setAdmin( !roleDao.getAnyAdminRoleForUserAndGroups( user.getId(), StringUtils.join(user.getGroupIds(), ",") ).isEmpty() ); if (dbUser == null) { dbUserDao.save(user); } else if (!dbUser.equals(user)) { dbUserDao.update(user); } return user; }
Source:
<code>private String buildMarkdown() { try { <START> StringBuilder htmlErrorReport = new StringBuilder(); <END> final String userComment = userCommentBox.getText().toString(); if (!userComment.isEmpty()) { htmlErrorReport.append(userComment).append("\n"); } htmlErrorReport .append("## Exception") .append("\n* __User Action:__ ") .append(getUserActionString(errorInfo.userAction)) .append("\n* __Request:__ ").append(errorInfo.request) .append("\n* __Content Country:__ ").append(getContentCountryString()) .append("\n* __Content Language:__ ").append(getContentLanguageString()) .append("\n* __App Language:__ ").append(getAppLanguage()) .append("\n* __Service:__ ").append(errorInfo.serviceName) .append("\n* __Version:__ ").append(BuildConfig.VERSION_NAME) .append("\n* __OS:__ ").append(getOsString()).append("\n"); if (errorList.length > 1) { htmlErrorReport .append("<details><summary><b>Exceptions (") .append(errorList.length) .append(")</b></summary><p>\n"); } for (int i = 0; i < errorList.length; i++) { htmlErrorReport.append("<details><summary><b>Crash log "); if (errorList.length > 1) { htmlErrorReport.append(i + 1); } htmlErrorReport.append("</b>") .append("</summary><p>\n") .append("\n```\n").append(errorList[i]).append("\n```\n") .append("</details>\n"); } if (errorList.length > 1) { htmlErrorReport.append("</p></details>\n"); } htmlErrorReport.append("<hr>\n"); return htmlErrorReport.toString(); } catch (Throwable e) { Log.e(TAG, "Error while erroring: Could not build markdown"); e.printStackTrace(); return ""; } }</code><technical_language>final</technical_language>

Target:
private String buildMarkdown() { try { final StringBuilder htmlErrorReport = new StringBuilder(); final String userComment = userCommentBox.getText().toString(); if (!userComment.isEmpty()) { htmlErrorReport.append(userComment).append("\n"); } htmlErrorReport .append("## Exception") .append("\n* __User Action:__ ") .append(getUserActionString(errorInfo.userAction)) .append("\n* __Request:__ ").append(errorInfo.request) .append("\n* __Content Country:__ ").append(getContentCountryString()) .append("\n* __Content Language:__ ").append(getContentLanguageString()) .append("\n* __App Language:__ ").append(getAppLanguage()) .append("\n* __Service:__ ").append(errorInfo.serviceName) .append("\n* __Version:__ ").append(BuildConfig.VERSION_NAME) .append("\n* __OS:__ ").append(getOsString()).append("\n"); if (errorList.length > 1) { htmlErrorReport .append("<details><summary><b>Exceptions (") .append(errorList.length) .append(")</b></summary><p>\n"); } for (int i = 0; i < errorList.length; i++) { htmlErrorReport.append("<details><summary><b>Crash log "); if (errorList.length > 1) { htmlErrorReport.append(i + 1); } htmlErrorReport.append("</b>") .append("</summary><p>\n") .append("\n```\n").append(errorList[i]).append("\n```\n") .append("</details>\n"); } if (errorList.length > 1) { htmlErrorReport.append("</p></details>\n"); } htmlErrorReport.append("<hr>\n"); return htmlErrorReport.toString(); } catch (Throwable e) { Log.e(TAG, "Error while erroring: Could not build markdown"); e.printStackTrace(); return ""; } }
Source:
<code>public Map<Tree, SymbolicBooleanConstraint> evaluateMethod(ExecutionState state, MethodTree tree) { result.clear(); if (tree.block() != null) { try { evaluateStatement(ImmutableList.of(state), tree.block()); <START> } catch (SymbolicExecutionException e) { <END> result.clear(); } } return result; }</code><technical_language>Well, I defect detected is pretty explanatory :) Moreover, wondering if this exception runtime... is for control flow a checked exception WDYT</technical_language>

Target:
public Map<Tree, SymbolicBooleanConstraint> evaluateMethod(ExecutionState state, MethodTree tree) { result.clear(); if (tree.block() != null) { try { evaluateStatement(ImmutableList.of(state), tree.block()); } catch (SymbolicExecutionException e) { LOGGER.info("analysis of " + tree + " failed: " + e.getMessage(), e); result.clear(); } } return result; }
Source:
<code><START> public MenuItem(String name, String url) { <END> this.url = url; this.name = name; }</code><technical_language>above. Example: String target</technical_language>

Target:
public MenuItem(String name, String url) { this(name, url, "_blank"); }
Source:
<code>public void callFinalizePublishCommandAsynchronously(Long datasetId, CommandContext ctxt, DataverseRequest request, boolean isPidPrePublished) { logger.fine("Running FinalizeDatasetPublicationCommand, asynchronously"); Dataset theDataset = find(datasetId); try { commandEngine.submit(new FinalizeDatasetPublicationCommand(theDataset, request, isPidPrePublished)); } catch (CommandException cex) { logger.warning("CommandException caught when executing the asynchronous portion of the Dataset Publication Command."); <START> } <END> }</code><technical_language>if this submit fails, logging required</technical_language>

Target:
public void callFinalizePublishCommandAsynchronously(Long datasetId, CommandContext ctxt, DataverseRequest request, boolean isPidPrePublished) { try { Thread.sleep(1000); } catch (Exception ex) { logger.warning("Failed to sleep for a second."); } logger.fine("Running FinalizeDatasetPublicationCommand, asynchronously"); Dataset theDataset = find(datasetId); try { commandEngine.submit(new FinalizeDatasetPublicationCommand(theDataset, request, isPidPrePublished)); } catch (CommandException cex) { logger.warning("CommandException caught when executing the asynchronous portion of the Dataset Publication Command."); } }
Source:
<code>public static FeedbackSessionsForm getFsFormForExistingFs(FeedbackSessionAttributes existingFs, FeedbackSessionsAdditionalSettingsFormSegment additionalSettings, String fsDeleteLink, String fsEditCopyLink) { FeedbackSessionsForm fsForm = new FeedbackSessionsForm(); fsForm.fsDeleteLink = fsDeleteLink; fsForm.copyToLink = fsEditCopyLink; fsForm.courseId = existingFs.getCourseId(); fsForm.isFsNameEditable = false; fsForm.fsName = existingFs.getFeedbackSessionName(); fsForm.isCourseIdEditable = false; fsForm.isFeedbackSessionTypeEditable = false; fsForm.isEditFsButtonsVisible = true; fsForm.timezoneSelectField = PageData.getTimeZoneOptionsAsElementTags(existingFs.getTimeZone()); fsForm.instructions = SanitizationHelper.sanitizeForRichText(existingFs.getInstructions().getValue()); <START> fsForm.fsStartDate = TimeHelper.formatDateForSessionForm(existingFs.getStartTimeLocal()); <END> fsForm.fsStartTimeOptions = PageData.getTimeOptionsAsElementTags(existingFs.getStartTimeLocal()); fsForm.fsEndDate = TimeHelper.formatDateForSessionForm(existingFs.getEndTimeLocal()); fsForm.fsEndTimeOptions = PageData.getTimeOptionsAsElementTags(existingFs.getEndTimeLocal()); fsForm.gracePeriodOptions = PageData.getGracePeriodOptionsAsElementTags(existingFs.getGracePeriod()); fsForm.isSubmitButtonDisabled = false; fsForm.isSubmitButtonVisible = false; fsForm.formSubmitActionLink = Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_SAVE; fsForm.submitButtonText = "Save Changes"; fsForm.additionalSettings = additionalSettings; return fsForm; }</code><technical_language>Unrelated whitespace change</technical_language>

Target:
public static FeedbackSessionsForm getFsFormForExistingFs(FeedbackSessionAttributes existingFs, FeedbackSessionsAdditionalSettingsFormSegment additionalSettings, String fsDeleteLink, String fsEditCopyLink) { FeedbackSessionsForm fsForm = new FeedbackSessionsForm(); fsForm.fsDeleteLink = fsDeleteLink; fsForm.copyToLink = fsEditCopyLink; fsForm.courseId = existingFs.getCourseId(); fsForm.isFsNameEditable = false; fsForm.fsName = existingFs.getFeedbackSessionName(); fsForm.isCourseIdEditable = false; fsForm.isFeedbackSessionTypeEditable = false; fsForm.isEditFsButtonsVisible = true; fsForm.timezoneSelectField = PageData.getTimeZoneOptionsAsElementTags(existingFs.getTimeZone()); fsForm.instructions = SanitizationHelper.sanitizeForRichText(existingFs.getInstructions().getValue()); fsForm.fsStartDate = TimeHelper.formatDateForSessionsForm(existingFs.getStartTimeLocal()); fsForm.fsStartTimeOptions = PageData.getTimeOptionsAsElementTags(existingFs.getStartTimeLocal()); fsForm.fsEndDate = TimeHelper.formatDateForSessionsForm(existingFs.getEndTimeLocal()); fsForm.fsEndTimeOptions = PageData.getTimeOptionsAsElementTags(existingFs.getEndTimeLocal()); fsForm.gracePeriodOptions = PageData.getGracePeriodOptionsAsElementTags(existingFs.getGracePeriod()); fsForm.isSubmitButtonDisabled = false; fsForm.isSubmitButtonVisible = false; fsForm.formSubmitActionLink = Const.ActionURIs.INSTRUCTOR_FEEDBACK_EDIT_SAVE; fsForm.submitButtonText = "Save Changes"; fsForm.additionalSettings = additionalSettings; return fsForm; }
Source:
<code>int computeIndexingBin() { if (getAlignmentStart() > GenomicIndexUtil.BIN_GENOMIC_SPAN || getAlignmentEnd() > GenomicIndexUtil.BIN_GENOMIC_SPAN) { throw new IllegalStateException("Read position too high for BAI bin indexing."); } final int alignmentStart = getAlignmentStart()-1; <START> int alignmentEnd = getAlignmentEnd(); <END> if (alignmentEnd <= 0) { alignmentEnd = alignmentStart + 1; } return GenomicIndexUtil.regionToBin(alignmentStart, alignmentEnd) & (int) BinaryCodec.MAX_USHORT; }</code><technical_language>Move lines getAlignmentStart() getAlignmentEnd() called twice</technical_language>

Target:
int computeIndexingBin() { final int alignmentStart = getAlignmentStart() - 1; int alignmentEnd = getAlignmentEnd(); if (alignmentEnd <= 0) { alignmentEnd = alignmentStart + 1; } if (alignmentStart > GenomicIndexUtil.BIN_GENOMIC_SPAN || alignmentEnd > GenomicIndexUtil.BIN_GENOMIC_SPAN) { throw new IllegalStateException("Read position too high for BAI bin indexing."); } return GenomicIndexUtil.regionToBin(alignmentStart, alignmentEnd) & (int) BinaryCodec.MAX_USHORT; }
Source:
<code>public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { BlockPos pos = data.readBlockPos(); VisualFXType visualFX = VisualFXType.values()[data.readByte()]; SoundFXType soundFX = SoundFXType.values()[data.readByte()]; World world = player.world; <START> IBlockState blockState = world.getBlockState(pos); <END> Block block = blockState.getBlock(); if (visualFX == VisualFXType.BLOCK_BREAK) { Minecraft.getMinecraft().effectRenderer.addBlockDestroyEffects(pos, blockState); } if (soundFX != SoundFXType.NONE) { SoundType soundType = block.getSoundType(blockState, world, pos, null); if (soundFX == SoundFXType.BLOCK_BREAK) { world.playSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, soundType.getBreakSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F, false); } else if (soundFX == SoundFXType.BLOCK_PLACE) { world.playSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, soundType.getPlaceSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F, false); } } }</code><technical_language>performance difference is a concern, is a race condition place/break a block immediately fire some FX packets. client updated world match server this packet, get wrong blockState here</technical_language>

Target:
public void onPacketData(PacketBufferForestry data, EntityPlayer player) throws IOException { BlockPos pos = data.readBlockPos(); VisualFXType visualFX = VisualFXType.values()[data.readByte()]; SoundFXType soundFX = SoundFXType.values()[data.readByte()]; World world = player.world; IBlockState blockState = NBTUtil.readBlockState(data.readCompoundTag()); Block block = blockState.getBlock(); if (visualFX == VisualFXType.BLOCK_BREAK) { Minecraft.getMinecraft().effectRenderer.addBlockDestroyEffects(pos, blockState); } if (soundFX != SoundFXType.NONE) { SoundType soundType = block.getSoundType(blockState, world, pos, null); if (soundFX == SoundFXType.BLOCK_BREAK) { world.playSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, soundType.getBreakSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F, false); } else if (soundFX == SoundFXType.BLOCK_PLACE) { world.playSound(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, soundType.getPlaceSound(), SoundCategory.BLOCKS, (soundType.getVolume() + 1.0F) / 2.0F, soundType.getPitch() * 0.8F, false); } } }