auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean shouldIgnore() { return coreFeature.getStorageConfiguration().isVCS() <START> || coreFeature.getStorageConfiguration().isVCSMySQL(); <END> }</code><technical_language>changed logic. Previously test ran if VCS MySQL. ignore if VCS MySQL. same</technical_language>

Target:
public boolean shouldIgnore() { return !coreFeature.getStorageConfiguration().isVCS() || coreFeature.getStorageConfiguration().isVCSMySQL(); }
Source:
<code>default DataStore getDataStore(MetaDataStore metaDataStore, AggregationDataStore aggregationDataStore, EntityManagerFactory entityManagerFactory) { <START> CancelSession cancelSession = new CancelSession(entityManagerFactory.get().unwrap(Session.class)); <END> DataStore jpaDataStore = new JpaDataStore( () -> { return entityManagerFactory.createEntityManager(); }, (em -> { return new NonJtaTransaction(em, cancelSession); })); DataStore dataStore = new MultiplexManager(jpaDataStore, metaDataStore, aggregationDataStore); return dataStore; }</code><technical_language>this a local variable multiple places</technical_language>

Target:
default DataStore getDataStore(MetaDataStore metaDataStore, AggregationDataStore aggregationDataStore, EntityManagerFactory entityManagerFactory) { DataStore jpaDataStore = new JpaDataStore( () -> { return entityManagerFactory.createEntityManager(); }, (em) -> { return new NonJtaTransaction(em, TXCANCEL); }); DataStore dataStore = new MultiplexManager(jpaDataStore, metaDataStore, aggregationDataStore); return dataStore; }
Source:
<code><START> protected void modified(Map<String, Object> config) { <END> if (config == null) return; final Object value = config.get("provider"); if (value instanceof String) { providerName = (String) value; } }</code><technical_language>Is modified called do need process config in activate() all? I this, implementation easier :-)</technical_language>

Target:
protected void modified(Map<String, Object> config) { applyConfig(config); }
Source:
<code>NodeCursor( Read read ) { <START> super( -1 ); <END> this.read = read; this.labelCursor = read.labelCursor(); }</code><technical_language>NO_ID</technical_language>

Target:
NodeCursor( Read read ) { super( NO_ID ); this.read = read; this.labelCursor = read.labelCursor(); }
Source:
<code>public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) { Set<DistributionModuleGroup> hs = new HashSet<>(); DistributionModuleGroup dmgSpark16 = new DistributionModuleGroup( CDH5100Constant.SPARK_KAFKA_CLIENT_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new NestedComponentCondition(new MultiComponentCondition( new SparkStreamingLinkedNodeCondition(distribution, version, SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition(), BooleanOperator.AND, spark16Condition))); hs.add(dmgSpark16); DistributionModuleGroup dmgSpark21 = new DistributionModuleGroup( CDH5100Constant.SPARK2_KAFKA_CLIENT_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new NestedComponentCondition( new MultiComponentCondition( new SparkStreamingLinkedNodeCondition(distribution, version, SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition(), BooleanOperator.AND, spark21Condition))); <START> hs.add(dmgSpark16); <END> hs.add(dmgSpark21); return hs; }</code><technical_language>add spark 1.6 a time</technical_language>

Target:
public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) { Set<DistributionModuleGroup> hs = new HashSet<>(); DistributionModuleGroup dmgSpark16 = new DistributionModuleGroup( CDH5100Constant.SPARK_KAFKA_CLIENT_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new NestedComponentCondition(new MultiComponentCondition( new SparkStreamingLinkedNodeCondition(distribution, version, SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition(), BooleanOperator.AND, spark16Condition))); hs.add(dmgSpark16); DistributionModuleGroup dmgSpark21 = new DistributionModuleGroup( CDH5100Constant.SPARK2_KAFKA_CLIENT_MRREQUIRED_MODULE_GROUP.getModuleName(), true, new NestedComponentCondition( new MultiComponentCondition( new SparkStreamingLinkedNodeCondition(distribution, version, SparkStreamingConstant.KAFKA_SPARKCONFIGURATION_LINKEDPARAMETER).getCondition(), BooleanOperator.AND, spark21Condition))); hs.add(dmgSpark21); return hs; }
Source:
<code>protected String getPath(String filename) throws IOException { return super.getPath("checks" + File.separator + "whitespace" + File.separator <START> + "IteratorPad" + File.separator <END> + filename); }</code><technical_language>lowercase for package names</technical_language>

Target:
protected String getPath(String filename) throws IOException { return super.getPath("checks" + File.separator + "whitespace" + File.separator + "iteratorpad" + File.separator + filename); }
Source:
<code>private String getStorageKey(boolean perInstance) { <START> return (perInstance ? m_instance : "") + (m_category != "" ? "." + m_category : ""); END> }</code><technical_language>For strings, equals() compare, == !=</technical_language>

Target:
private String getStorageKey(boolean perInstance) { return (perInstance ? m_instance : "") + (!m_category.equals("") ? "." + m_category : ""); }
Source:
<code>public void testLongParseDefaultSuccess() { Long num = NumberParser.parseLong("Non Long", 1L); assertTrue(num == 1L); num = NumberParser.parseLong("0", 1L); <START> assertTrue(num == 0L); <END> }</code><technical_language>tests in method? for testFloatParseDefaultSuccess</technical_language>

Target:
public void testLongParseDefaultSuccess() { long num = NumberParser.parseLong("Non Long", 1L); assertEquals(1L, num); }
Source:
<code>private static void validateFormatOptions(ReadableConfig tableOptions) { final boolean hasQuoteCharacter = tableOptions.getOptional(QUOTE_CHARACTER).isPresent(); final boolean isDisabledQuoteCharacter = tableOptions.get(DISABLE_QUOTE_CHARACTER); if (isDisabledQuoteCharacter && hasQuoteCharacter){ throw new ValidationException( "Format cannot define a quote character and disabled quote character at the same time."); } validateCharacterVal(tableOptions, FIELD_DELIMITER); validateCharacterVal(tableOptions, QUOTE_CHARACTER); <START> validateCharacterVal(tableOptions, ESCAPE_CHARACTER); <END> }</code><technical_language>ARRAY_ELEMENT_DELIMITER is a single character in CsvValidator</technical_language>

Target:
private static void validateFormatOptions(ReadableConfig tableOptions) { final boolean hasQuoteCharacter = tableOptions.getOptional(QUOTE_CHARACTER).isPresent(); final boolean isDisabledQuoteCharacter = tableOptions.get(DISABLE_QUOTE_CHARACTER); if (isDisabledQuoteCharacter && hasQuoteCharacter){ throw new ValidationException( "Format cannot define a quote character and disabled quote character at the same time."); } validateCharacterVal(tableOptions, FIELD_DELIMITER); validateCharacterVal(tableOptions, ARRAY_ELEMENT_DELIMITER); validateCharacterVal(tableOptions, QUOTE_CHARACTER); validateCharacterVal(tableOptions, ESCAPE_CHARACTER); tableOptions.getOptional(LINE_DELIMITER).ifPresent(delimiter -> { Set<String> allowedValues = new HashSet<>(Arrays.asList("\r", "\n", "\r\n", "")); if (!allowedValues.contains(delimiter)) { throw new ValidationException( String.format("Invalid value for option '%s.%s'. Supported values are %s, but was: %s", IDENTIFIER, LINE_DELIMITER.key(), "[\\r, \\n, \\r\\n, \"\"]", delimiter)); } }); }
Source:
<code>@Override public void flush() { <START> flush(FlushMode.IDLE); <END> }</code><technical_language>Lets change default GRACEFULLY</technical_language>

Target:
public void flush() { flush(FlushMode.IDLE); }
Source:
<code>public void load(NBTTagCompound nbt) { super.load(nbt); if(nbt.hasKey("process")) { process.load(nbt.getCompoundTag("process")); } if(host.world().isRemote) { if(nbt.hasKey("node")) { NBTTagCompound nodeNBT = nbt.getCompoundTag("node"); if(nodeNBT.hasKey("address")) { clientAddress = nodeNBT.getString("address"); getHandler().setProcess(clientAddress, process, System.currentTimeMillis()); } } } else { if(nbt.hasKey("bbuffer")) { buildBuffer = Instruction.fromNBT(nbt.getTagList("bbuffer", Constants.NBT.TAG_COMPOUND)); buildDelay = 0; for (Instruction inst : buildBuffer) { if(inst instanceof Delay) { buildDelay += ((Delay)inst).delay; } } } if(nbt.hasKey("nbuffer")) { <START> nextBuffer = Instruction.fromNBT(nbt.getTagList("bbuffer", Constants.NBT.TAG_COMPOUND)); <END> nextDelay = 0; for (Instruction inst : nextBuffer) { if(inst instanceof Delay) { nextDelay += ((Delay)inst).delay; } } } if(nbt.hasKey("volume")) { soundVolume = nbt.getByte("volume"); } } }</code><technical_language>nbuffer here</technical_language>

Target:
public void load(NBTTagCompound nbt) { super.load(nbt); if(nbt.hasKey("process")) { process.load(nbt.getCompoundTag("process")); } if(host.world().isRemote) { if(nbt.hasKey("node")) { NBTTagCompound nodeNBT = nbt.getCompoundTag("node"); if(nodeNBT.hasKey("address")) { clientAddress = nodeNBT.getString("address"); SyncHandler.getHandler().setProcess(clientAddress, process, System.currentTimeMillis()); } } } else { if(nbt.hasKey("bbuffer")) { buildBuffer = Instruction.fromNBT(nbt.getTagList("bbuffer", Constants.NBT.TAG_COMPOUND)); buildDelay = 0; for (Instruction inst : buildBuffer) { if(inst instanceof Delay) { buildDelay += ((Delay)inst).delay; } } } if(nbt.hasKey("nbuffer")) { nextBuffer = Instruction.fromNBT(nbt.getTagList("nbuffer", Constants.NBT.TAG_COMPOUND)); nextDelay = 0; for (Instruction inst : nextBuffer) { if(inst instanceof Delay) { nextDelay += ((Delay)inst).delay; } } } if(nbt.hasKey("volume")) { soundVolume = nbt.getByte("volume"); } } }
Source:
<code>public String validate(String validationType, String value){ if( "nonempty".equalsIgnoreCase(validationType)){ if( isEmpty(value) ) <START> return i18n.text("required_field_empty_msg"); <END> } else if("isDate".equalsIgnoreCase(validationType)){ if( isDate( value)) return SUCCESS; else return "must be in valid date format mm/dd/yyyy."; } else if( validationType.indexOf("datatype:") == 0 ) { String datatypeURI = validationType.substring(9); String errorMsg = validateAgainstDatatype( value, datatypeURI ); if ( errorMsg == null ) { return SUCCESS; } else { return errorMsg; } } else if ("httpUrl".equalsIgnoreCase(validationType)){ if(! value.startsWith("http://") && ! value.startsWith("https://") ){ return "This URL must start with http:// or https://"; }else{ return SUCCESS; } } else if( "dateNotPast".equalsIgnoreCase(validationType)){ Calendar c = Calendar.getInstance(); Calendar inputC = Calendar.getInstance(); String yearParamStr, monthParamStr, dayParamStr; int yearDash = value.indexOf("-"); int monthDash = value.lastIndexOf("-"); if(yearDash != -1 && yearDash != monthDash) { yearParamStr = value.substring(0, yearDash); monthParamStr = value.substring(yearDash + 1, monthDash); dayParamStr = value.substring(monthDash + 1, value.length()); inputC.set(Integer.parseInt(yearParamStr), Integer.parseInt(monthParamStr) - 1, Integer.parseInt(dayParamStr)); if(inputC.before(c)) { return i18n.text("data_not_past_msg"); } else { return SUCCESS; } } } return null; }</code><technical_language>constant inplace of this String. <LINK_0></technical_language>

Target:
public String validate(String validationType, String value){ if( "nonempty".equalsIgnoreCase(validationType)){ if( isEmpty(value) ) return i18n.text(REQUIRED_FIELD_EMPTY_MSG); } else if("isDate".equalsIgnoreCase(validationType)){ if( isDate( value)) return SUCCESS; else return "must be in valid date format mm/dd/yyyy."; } else if( validationType.indexOf("datatype:") == 0 ) { String datatypeURI = validationType.substring(9); String errorMsg = validateAgainstDatatype( value, datatypeURI ); if ( errorMsg == null ) { return SUCCESS; } else { return errorMsg; } } else if ("httpUrl".equalsIgnoreCase(validationType)){ if(! value.startsWith("http://") && ! value.startsWith("https://") ){ return "This URL must start with http:// or https://"; }else{ return SUCCESS; } } else if( "dateNotPast".equalsIgnoreCase(validationType)){ Calendar c = Calendar.getInstance(); Calendar inputC = Calendar.getInstance(); String yearParamStr, monthParamStr, dayParamStr; int yearDash = value.indexOf("-"); int monthDash = value.lastIndexOf("-"); if(yearDash != -1 && yearDash != monthDash) { yearParamStr = value.substring(0, yearDash); monthParamStr = value.substring(yearDash + 1, monthDash); dayParamStr = value.substring(monthDash + 1, value.length()); inputC.set(Integer.parseInt(yearParamStr), Integer.parseInt(monthParamStr) - 1, Integer.parseInt(dayParamStr)); if(inputC.before(c)) { return i18n.text(DATA_NOT_PAST_MSG); } else { return SUCCESS; } } } return null; }
Source:
<code>public static SupportStatus getServerSupportStatus() { if (supportStatus == null) { for (String clazz : dangerousServerClasses) { try { Class.forName(clazz); return supportStatus = SupportStatus.DANGEROUS; } catch (final ClassNotFoundException ignored) { } } try { Class.forName("net.minecraftforge.common.MinecraftForge"); return supportStatus = SupportStatus.UNSTABLE; } catch (final ClassNotFoundException ignored) { } if (ReflUtil.getNMSClass("MinecraftServer") == null) { <START> return supportStatus = SupportStatus.UNSTABLE; <END> } if (!supportedVersions.contains(getServerBukkitVersion())) { return supportStatus = SupportStatus.OUTDATED; } return supportStatus = PaperLib.isPaper() ? SupportStatus.FULL : SupportStatus.LIMITED; } return supportStatus; }</code><technical_language>UNSTABLE message is for Forge hybrid servers, this trigger other impls Glowstone</technical_language>

Target:
public static SupportStatus getServerSupportStatus() { if (supportStatus == null) { for (Map.Entry<String, SupportStatus> entry : unsupportedServerClasses.entrySet()) { final boolean inverted = entry.getKey().contains("!"); final String clazz = entry.getKey().replace("!", ""); try { Class.forName(clazz); if (!inverted) { return supportStatus = entry.getValue(); } } catch (final ClassNotFoundException ignored) { if (inverted) { return supportStatus = entry.getValue(); } } } if (!supportedVersions.contains(getServerBukkitVersion())) { return supportStatus = SupportStatus.OUTDATED; } return supportStatus = PaperLib.isPaper() ? SupportStatus.FULL : SupportStatus.LIMITED; } return supportStatus; }
Source:
<code>public String deploy(Artifact artifact) throws CarbonDeploymentException { logger.info("Deploying : " + artifact.getName()); <START> if (artifact.getName().contains("sample1.txt")) { <END> sample1Deployed = false; } else if (artifact.getName().contains("sample2.txt")) { sample2Deployed = false; } throw new CarbonDeploymentException("Error while deploying : " + artifact.getName()); }</code><technical_language>NPE calling contains artifact.getName() ? checking for nullity calling .contains</technical_language>

Target:
public String deploy(Artifact artifact) throws CarbonDeploymentException { logger.info("Deploying : " + artifact.getName()); if (artifact.getName() != null && artifact.getName().contains("sample1.txt")) { sample1Deployed = false; } else if (artifact.getName() != null && artifact.getName().contains("sample2.txt")) { sample2Deployed = false; } throw new CarbonDeploymentException("Error while deploying : " + artifact.getName()); }
Source:
<code>private Response handleInternal(final CacheRpcCommand cmd, final ComponentRegistry cr) throws Throwable { CommandsFactory commandsFactory = cr.getCommandsFactory(); commandsFactory.initializeReplicableCommand(cmd, true); try { if (trace) log.tracef("Calling perform() on %s", cmd); ResponseGenerator respGen = cr.getResponseGenerator(); if(cmd instanceof CancellableCommand){ cancelService.register(Thread.currentThread(), ((CancellableCommand)cmd).getUUID()); } Object retval = cmd.perform(null); <START> Response response = retval instanceof Response ? (Response) retval : respGen.getResponse(cmd, retval); <END> log.tracef("About to send back response %s for command %s", response, cmd); return response; } catch (Exception e) { log.error("Exception executing command", e); return new ExceptionResponse(e); } finally { if(cmd instanceof CancellableCommand){ cancelService.unregister(((CancellableCommand)cmd).getUUID()); } } }</code><technical_language>I remove conditional here, CacheRpcCommands return a Response value, return a Response depend wrapped in another Response anyway</technical_language>

Target:
private Response handleInternal(final CacheRpcCommand cmd, final ComponentRegistry cr) throws Throwable { try { if (trace) log.tracef("Calling perform() on %s", cmd); ResponseGenerator respGen = cr.getResponseGenerator(); if(cmd instanceof CancellableCommand){ cancelService.register(Thread.currentThread(), ((CancellableCommand)cmd).getUUID()); } Object retval = cmd.perform(null); Response response = respGen.getResponse(cmd, retval); log.tracef("About to send back response %s for command %s", response, cmd); return response; } catch (Exception e) { log.error("Exception executing command", e); return new ExceptionResponse(e); } finally { if(cmd instanceof CancellableCommand){ cancelService.unregister(((CancellableCommand)cmd).getUUID()); } } }
Source:
<code><START> public Response updateFlow(@PathParam("id") String id, AuthenticationFlowRepresentation flow) { <END> auth.realm().requireManageRealm(); AuthenticationFlowRepresentation existingFlow = getFlow(id); if (flow.getAlias() == null || flow.getAlias().isEmpty()) { return ErrorResponse.exists("Failed to update flow with empty alias name"); } AuthenticationFlowModel checkFlow = realm.getFlowByAlias(flow.getAlias()); if (checkFlow != null) { if (!checkFlow.getDescription().equals(flow.getDescription()) && checkFlow.getId().equals(flow.getId())) { checkFlow.setDescription(flow.getDescription()); } else { return ErrorResponse.exists("Flow alias name already exists"); } } else { checkFlow = realm.getAuthenticationFlowById(flow.getId()); checkFlow.setAlias(flow.getAlias()); if (!flow.getDescription().equals(checkFlow.getDescription())) { checkFlow.setDescription(flow.getDescription()); } } flow.setId(existingFlow.getId()); realm.updateAuthenticationFlow(RepresentationToModel.toModel(flow)); adminEvent.operation(OperationType.UPDATE).resourcePath(session.getContext().getUri()).representation(flow).success(); return Response.accepted(flow).build(); }</code><technical_language>Is this change needed? If @Produces is required, good @Consumes well</technical_language>

Target:
public Response updateFlow(@PathParam("id") String id, AuthenticationFlowRepresentation flow) { auth.realm().requireManageRealm(); AuthenticationFlowRepresentation existingFlow = getFlow(id); if (flow.getAlias() == null || flow.getAlias().isEmpty()) { return ErrorResponse.exists("Failed to update flow with empty alias name"); } AuthenticationFlowModel checkFlow = realm.getAuthenticationFlowById(id); if (checkFlow == null) { session.getTransactionManager().setRollbackOnly(); throw new NotFoundException("Illegal execution"); } if (realm.getFlowByAlias(flow.getAlias()) != null && !checkFlow.getAlias().equals(flow.getAlias())) { return ErrorResponse.exists("Flow alias name already exists"); } if (!checkFlow.getAlias().equals(flow.getAlias())) { checkFlow.setAlias(flow.getAlias()); } if (!checkFlow.getDescription().equals(flow.getDescription())) { checkFlow.setDescription(flow.getDescription()); } flow.setId(existingFlow.getId()); realm.updateAuthenticationFlow(RepresentationToModel.toModel(flow)); adminEvent.operation(OperationType.UPDATE).resourcePath(session.getContext().getUri()).representation(flow).success(); return Response.accepted(flow).build(); }
Source:
<code>public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (!(item instanceof NumberItem)) { throw new BindingConfigParseException( "item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "', only NumberItems are allowed - please check your *.items configuration"); } if (bindingConfig.length() != 4) { throw new BindingConfigParseException( "The configured address must consist of just 2 bytes housecode"); <START> } <END> }</code><technical_language>this method is intended validate ItemType. Configuration validation executed in processBindingConfiguration()</technical_language>

Target:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (!(item instanceof NumberItem)) { throw new BindingConfigParseException( "item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "', only NumberItems are allowed - please check your *.items configuration"); } }
Source:
<code>public boolean isActionAllowed(String action) { EMap<String, ActionInfo> actionsAvailable = getActions(); if (actionsAvailable != null) { ActionInfo actionInfo = actionsAvailable.get(action); if (actionInfo != null) { <START> <END> return true; } } return false; }</code><technical_language>This modifies behaviour for actions, "enabled" one. applies actions</technical_language>

Target:
public boolean isActionAllowed(String action) { EMap<String, ActionInfo> actionsAvailable = getActions(); if (actionsAvailable != null) { ActionInfo actionInfo = actionsAvailable.get(action); if (actionInfo != null) { if (action.equals(ActionConstants.REBASE.getName())) { return true; } return actionInfo.isEnabled(); } } return false; }
Source:
<code>public void writeTo(BufferedSink sink) { int readCount; Iterator<OnDatatransferProgressListener> it; try { mChannel.position(mOffset); long size = mFile.length(); if (size == 0) { size = -1; } long maxCount = Math.min(mOffset + mChunkSize, mChannel.size()); while (mChannel.position() < maxCount) { Log_OC.v("Sink buffer size: " + sink.buffer().size()); readCount = mChannel.read(mBuffer); Log_OC.v("Read " + readCount + " bytes from file channel to " + mBuffer.toString()); sink.buffer().write(mBuffer.array(), 0, readCount); sink.flush(); Log_OC.v("Write " + readCount + " bytes to sink buffer with size " + sink.buffer().size()); mBuffer.clear(); if (mTransferred < maxCount) { mTransferred += readCount; } synchronized (mDataTransferListeners) { it = mDataTransferListeners.iterator(); while (it.hasNext()) { it.next().onTransferProgress(readCount, mTransferred, size, mFile.getAbsolutePath()); } } } <START> Log_OC.v("Chunk with size $mChunkSize written in request body"); <END> } catch (Exception exception) { Log_OC.e(exception.getMessage()); } }</code><technical_language>This is a kotlin file , Log_OC.v("Chunk size $mChunkSize written in request body"); is Log_OC.v("Chunk size " + mChunkSize + " written in request body");</technical_language>

Target:
public void writeTo(BufferedSink sink) { int readCount; Iterator<OnDatatransferProgressListener> it; try { mChannel.position(mOffset); long size = mFile.length(); if (size == 0) { size = -1; } long maxCount = Math.min(mOffset + mChunkSize, mChannel.size()); while (mChannel.position() < maxCount) { Log_OC.v("Sink buffer size: " + sink.buffer().size()); readCount = mChannel.read(mBuffer); Log_OC.v("Read " + readCount + " bytes from file channel to " + mBuffer.toString()); sink.buffer().write(mBuffer.array(), 0, readCount); sink.flush(); Log_OC.v("Write " + readCount + " bytes to sink buffer with size " + sink.buffer().size()); mBuffer.clear(); if (mTransferred < maxCount) { mTransferred += readCount; } synchronized (mDataTransferListeners) { it = mDataTransferListeners.iterator(); while (it.hasNext()) { it.next().onTransferProgress(readCount, mTransferred, size, mFile.getAbsolutePath()); } } } Log_OC.v("Chunk with size " + mChunkSize + " written in request body"); } catch (Exception exception) { Log_OC.e(exception.getMessage()); } }
Source:
<code>private void considerAddingAConsumer() { synchronized(consumersMonitor) { if (this.consumers.size() < this.maxConcurrentConsumers) { long now = System.currentTimeMillis(); <START> if (this.lastConsumerStarted + 10000 < now) { <END> if (logger.isDebugEnabled()) { logger.debug("Starting a new consumer"); } this.addAndStartConsumers(1); this.lastConsumerStarted = now; } } } }</code><technical_language>new consumer start earlier 10 sec if of consumers 'got tired' more 10 message</technical_language>

Target:
private void considerAddingAConsumer() { synchronized(consumersMonitor) { if (this.consumers != null && this.maxConcurrentConsumers != null && this.consumers.size() < this.maxConcurrentConsumers) { long now = System.currentTimeMillis(); if (this.lastConsumerStarted + startConsumerMinInterval < now) { if (logger.isDebugEnabled()) { logger.debug("Starting a new consumer"); } this.addAndStartConsumers(1); this.lastConsumerStarted = now; } } } }
Source:
<code>public Connector create(String catalogName, Map<String, String> config, ConnectorContext context) { <START> requireNonNull(catalogName, "connectorId is null"); <END> requireNonNull(config, "requiredConfig is null"); requireNonNull(context, "context is null"); try { Bootstrap app = new Bootstrap(new JsonModule(), new AccumuloModule(catalogName, context.getTypeManager())); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(AccumuloConnector.class); } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }</code><technical_language>update mesg</technical_language>

Target:
public Connector create(String catalogName, Map<String, String> config, ConnectorContext context) { requireNonNull(catalogName, "catalogName is null"); requireNonNull(config, "requiredConfig is null"); requireNonNull(context, "context is null"); try { Bootstrap app = new Bootstrap(new JsonModule(), new AccumuloModule(catalogName, context.getTypeManager())); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperties(config) .initialize(); return injector.getInstance(AccumuloConnector.class); } catch (Exception e) { throwIfUnchecked(e); throw new RuntimeException(e); } }
Source:
<code>BibEntry getEntryByDOI(String doi) { <START> for (BibEntry b : databaseContext.getEntries()) { Optional<String> o = b.getField(StandardField.DOI); if (o.isPresent() && o.get().equals(doi)) { return b; } } return null; <END> }</code><technical_language>suggestion return databaseContext.getEntries().stream() .map(bibEntry -> bibEntry.getField(StandardField.DOI)) .filter(Optional::isPresent) .map(Optional::get) .filter(bibEntryDoi.equals(doi)) .findFirst();</technical_language>

Target:
Optional<BibEntry> getEntryByDOI(String doi) { return databaseContext.getEntries().stream(). filter(entry -> doi.equals(entry.getField(StandardField.DOI).orElse(""))).findFirst(); }
Source:
<code>public void printClassWithoutJavaDocButWithComment() { String code = " public class A { \n CompilationUnit cu = JavaParser.parse(code); PrettyPrinterConfiguration ignoreJavaDoc = new PrettyPrinterConfiguration().setPrintJavaDoc(false); String content = cu.toString(ignoreJavaDoc); assertEquals("public class A {\n <START> } <END></code><technical_language>Utils.EOL constant instead of \n test fail Windows :-(</technical_language>

Target:
public void printClassWithoutJavaDocButWithComment() { String code = String.format(" public class A { %s CompilationUnit cu = JavaParser.parse(code); PrettyPrinterConfiguration ignoreJavaDoc = new PrettyPrinterConfiguration().setPrintJavaDoc(false); String content = cu.toString(ignoreJavaDoc); assertEquals(String.format("public class A {%s }
Source:
<code>private void createMetadataArtifact(AbstractFile aFile, Map<String, String> metadata) { String moduleName = KeywordSearchIngestModule.class.getName(); Collection<BlackboardAttribute> attributes = new ArrayList<>(); Collection<BlackboardArtifact> bbartifacts = new ArrayList<>(); for (Map.Entry<String, String> entry : metadata.entrySet()) { if (METADATA_TYPES_MAP.containsKey(entry.getKey())) { BlackboardAttribute bba = checkAttribute(entry.getKey(), entry.getValue()); if (bba != null) { attributes.add(bba); } } } if (!attributes.isEmpty()) { try { BlackboardArtifact bbart = aFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_METADATA); bbart.addAttributes(attributes); bbartifacts.add(bbart); } catch (TskCoreException ex) { <START> logger.log(Level.WARNING, String.format("Error creatinkg or adding artifact."), ex); END> return; } if (!bbartifacts.isEmpty()) { try{ Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().postArtifacts(bbartifacts, moduleName); } catch (NoCurrentCaseException | Blackboard.BlackboardException ex) { logger.log(Level.WARNING, "Unable to post blackboard artifacts", ex); return; } } } }</code><technical_language>typo</technical_language>

Target:
private void createMetadataArtifact(AbstractFile aFile, Map<String, String> metadata) { String moduleName = KeywordSearchIngestModule.class.getName(); Collection<BlackboardAttribute> attributes = new ArrayList<>(); Collection<BlackboardArtifact> bbartifacts = new ArrayList<>(); for (Map.Entry<String, String> entry : metadata.entrySet()) { if (METADATA_TYPES_MAP.containsKey(entry.getKey())) { BlackboardAttribute bba = checkAttribute(entry.getKey(), entry.getValue()); if (bba != null) { attributes.add(bba); } } } if (!attributes.isEmpty()) { try { BlackboardArtifact bbart = aFile.newArtifact(BlackboardArtifact.ARTIFACT_TYPE.TSK_METADATA); bbart.addAttributes(attributes); bbartifacts.add(bbart); } catch (TskCoreException ex) { logger.log(Level.WARNING, String.format("Error creating or adding metadata artifact for file %s.", aFile.getParentPath() + aFile.getName()), ex); return; } if (!bbartifacts.isEmpty()) { try{ Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard().postArtifacts(bbartifacts, moduleName); } catch (NoCurrentCaseException | Blackboard.BlackboardException ex) { logger.log(Level.WARNING, String.format("Unable to post blackboard artifacts for file $s.", aFile.getParentPath() + aFile.getName()) , ex); return; } } } }
Source:
<code>public StandaloneDeployer addDomain(File domain) throws MojoFailureException { try { log.debug(String.format("Deploying domain : %s", domain)); mule.deployDomain(domain.getAbsolutePath()); return this; } catch (MuleControllerException e) { log.error("Couldn't deploy domain: " + domain); <START> throw new MojoFailureException("Couldn't deploy domain: " + domain); <END> } }</code><technical_language>Please replace this exception</technical_language>

Target:
public StandaloneDeployer addDomain(File domain) throws DeploymentException { checkNotNull(domain, "Domain cannot be null"); try { log.debug(String.format("Deploying domain : %s", domain)); mule.deployDomain(domain.getAbsolutePath()); return this; } catch (MuleControllerException e) { log.error("Couldn't deploy domain: " + domain); throw new DeploymentException("Couldn't deploy domain: " + domain); } }
Source:
<code>public void writeFloat(final double value) throws IOException { prepareValue(); <START> if (value == ((double) ((float) value))) { <END> updateLength(5); buffer.writeUInt8(FLOAT_TYPE | 4); buffer.writeUInt32(floatToRawIntBits((float) value)); } else { updateLength(9); buffer.writeUInt8(FLOAT_TYPE | 8); buffer.writeUInt64(doubleToRawLongBits(value)); } finishValue(); }</code><technical_language>Minor nit, code a legacy style convention follow (braces line)</technical_language>

Target:
public void writeFloat(final double value) throws IOException { prepareValue(); if (isFloatBinary32Enabled && value == ((double) ((float) value))) { updateLength(5); buffer.writeUInt8(FLOAT_TYPE | 4); buffer.writeUInt32(floatToRawIntBits((float) value)); } else { updateLength(9); buffer.writeUInt8(FLOAT_TYPE | 8); buffer.writeUInt64(doubleToRawLongBits(value)); } finishValue(); }
Source:
<code>public void testFinalQueryInfoSetOnAbort() throws Exception { try (DistributedQueryRunner queryRunner = createQueryRunner(TEST_SESSION)) { QueryId queryId = startQuery("SELECT COUNT(*) FROM tpch.sf1000.lineitem", queryRunner); <START> SettableFuture<QueryInfo> futureFinalQueryInfo = SettableFuture.create(); <END> queryRunner.getCoordinator().addFinalQueryInfoListener(queryId, futureFinalQueryInfo::set); Thread.sleep(1_000); queryRunner.getCoordinator().getQueryManager().cancelQuery(queryId); QueryInfo finalQueryInfo = tryGetFutureValue(futureFinalQueryInfo, 10, SECONDS) .orElseThrow(() -> new AssertionError("Final query info never set")); assertTrue(finalQueryInfo.isFinalQueryInfo()); } }</code><technical_language>nit: futureFinalQueryInfo -> finalQueryInfoFuture</technical_language>

Target:
public void testFinalQueryInfoSetOnAbort() throws Exception { try (DistributedQueryRunner queryRunner = createQueryRunner(TEST_SESSION)) { QueryId queryId = startQuery("SELECT COUNT(*) FROM tpch.sf1000.lineitem", queryRunner); SettableFuture<QueryInfo> finalQueryInfoFuture = SettableFuture.create(); queryRunner.getCoordinator().addFinalQueryInfoListener(queryId, finalQueryInfoFuture::set); Thread.sleep(1_000); queryRunner.getCoordinator().getQueryManager().cancelQuery(queryId); QueryInfo finalQueryInfo = tryGetFutureValue(finalQueryInfoFuture, 10, SECONDS) .orElseThrow(() -> new AssertionError("Final query info never set")); assertTrue(finalQueryInfo.isFinalQueryInfo()); } }
Source:
<code>public void testConcurrentNormalJobsWithFastOnes() { final ValidationThreadPool pool = new ValidationThreadPool(VALIDATION_THREAD_COUNT); final IJobManager manager = Job.getJobManager(); final List<Promise<Object>> validationPromises = Lists.newArrayList(); for (int i = 0; i < 10; i++) { <START> validationPromises.add(pool.submit(CheckType.NORMAL, createValidatableRunnable(CheckType.FAST, manager))); <END> if (i % 2 == 0) { validationPromises.add(pool.submit(CheckType.FAST, createValidatableRunnable(CheckType.FAST, manager))); } } Promise.all(validationPromises).getSync(); }</code><technical_language>NORMAL FAST</technical_language>

Target:
public void testConcurrentNormalJobsWithFastOnes() { final IJobManager manager = Job.getJobManager(); final List<Promise<Object>> validationPromises = Lists.newArrayList(); for (int i = 0; i < 10; i++) { validationPromises.add(pool.submit(CheckType.NORMAL, createValidatableRunnable(CheckType.NORMAL, manager))); if (i % 2 == 0) { validationPromises.add(pool.submit(CheckType.FAST, createValidatableRunnable(CheckType.FAST, manager))); } } Promise.all(validationPromises).getSync(); }
Source:
<code>public boolean process() { checkState(!finished); finished = prerequisite.process(); if (!finished) { return false; } <START> finished = true; <END> result = transform.apply(prerequisite.getResult()); return true; }</code><technical_language>This line is no-op</technical_language>

Target:
public boolean process() { checkState(!finished); finished = prerequisite.process(); if (!finished) { return false; } result = transform.apply(prerequisite.getResult()); return true; }
Source:
<code>public void clear() { File[] files = new File(getMapStorePath()).listFiles(getFilenameFilter()); if (files != null) { for (File file : files) { try { Files.delete(file.toPath()); } catch (IOException e) { <START> LOGGER.debug("File was unable to be deleted: {}", file.getAbsolutePath()); <END> } } } }</code><technical_language>Is this a problem restart? log higher debug</technical_language>

Target:
public void clear() { File[] files = new File(getMapStorePath()).listFiles(getFilenameFilter()); if (files != null) { for (File file : files) { try { Files.delete(file.toPath()); } catch (IOException e) { LOGGER.debug("File was unable to be deleted: {}", file.getAbsolutePath(), e); LOGGER.warn( "Unable to delete file [{}]. Turn logging to debug for more info.", file.getAbsolutePath()); } } } }
Source:
<code>public void testReceivedJobMessageWithWrongJobID() { exception.expect(IllegalStateException.class); JobMessage message = mock(JobMessage.class); when(message.getJobID()).thenReturn(JOB_ID); try { <START> jobHandler.onJobMessage(message); <END> } finally { verify(jobSpy, atLeast(0)).getState(); verify(jobSpy, atLeast(0)).getJobID(); verifyNoMoreInteractions(jobSpy); } }</code><technical_language>if this is supposed throw exception (which i guess of this), add a fail statement stating exception this thrown</technical_language>

Target:
public void testReceivedJobMessageWithWrongJobID() { JobMessage message = mock(JobMessage.class); when(message.getJobID()).thenReturn(JOB_ID); exception.expect(IllegalStateException.class); try { jobHandler.onJobMessage(message); } finally { verify(jobSpy, atLeast(0)).getState(); verify(jobSpy, atLeast(0)).getJobID(); verifyNoMoreInteractions(jobSpy); } }
Source:
<code>public void messageBasedProcessor() throws IOException { sendMessages(); for (int i = 0; i < numMessages; i++) { <START> Message<?> outputMessage = outputChannel.receive(); <END> assertEquals("ping-pong", outputMessage.getPayload()); } }</code><technical_language>want provide a timeout test hang</technical_language>

Target:
public void messageBasedProcessor() throws IOException { sendMessages(); for (int i = 0; i < numMessages; i++) { Message<?> outputMessage = outputChannel.receive(500); assertEquals("ping-pong", outputMessage.getPayload()); } }
Source:
<code>public static TableSchema.Builder builderWithGivenSchema(TableSchema oriSchema) { TableSchema.Builder builder = TableSchema.builder() <START> .fields(oriSchema.getFieldNames(), oriSchema.getFieldDataTypes()); <END> for (WatermarkSpec wms : oriSchema.getWatermarkSpecs()) { builder.watermark( wms.getRowtimeAttribute(), wms.getWatermarkExpr(), wms.getWatermarkExprOutputType()); } oriSchema.getPrimaryKey() .map(pk -> builder.primaryKey(pk.getName(), pk.getColumns().toArray(new String[0]))); return builder; }</code><technical_language>This loses computed column information</technical_language>

Target:
public static TableSchema.Builder builderWithGivenSchema(TableSchema oriSchema) { TableSchema.Builder builder = builderWithGivenColumns(oriSchema.getTableColumns()); for (WatermarkSpec wms : oriSchema.getWatermarkSpecs()) { builder.watermark( wms.getRowtimeAttribute(), wms.getWatermarkExpr(), wms.getWatermarkExprOutputType()); } oriSchema.getPrimaryKey() .map(pk -> builder.primaryKey(pk.getName(), pk.getColumns().toArray(new String[0]))); return builder; }
Source:
<code>private void removeTemplateBackup() { ArrayList<VdcActionParametersBase> prms = new ArrayList<VdcActionParametersBase>(); <START> for (Object a : getSelectedItems()) { <END> VmTemplate template = (VmTemplate) a; prms.add(new VmTemplateImportExportParameters(template.getId(), getEntity().getId(), pool.getId())); } Frontend.getInstance().runMultipleAction(VdcActionType.RemoveVmTemplateFromImportExport, prms); cancel(); }</code><technical_language>please rename variable</technical_language>

Target:
private void removeTemplateBackup() { ArrayList<VdcActionParametersBase> prms = new ArrayList<VdcActionParametersBase>(); for (Object selectedItem : getSelectedItems()) { VmTemplate template = (VmTemplate) selectedItem; prms.add(new VmTemplateImportExportParameters(template.getId(), getEntity().getId(), pool.getId())); } Frontend.getInstance().runMultipleAction(VdcActionType.RemoveVmTemplateFromImportExport, prms); cancel(); }
Source:
<code>public static boolean isLocal(Project project, String path) { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); String srcRoot = env.getSourceRootPath(); if (path.startsWith(srcRoot)) { <START> if (env.hasProjects()) { <END> String relPath = path.substring(srcRoot.length()); if (project != null && project.equals(Project.getProject(relPath))) { return true; } } else { return true; } } return false; }</code><technical_language>do project != null check avoid substring operation</technical_language>

Target:
public static boolean isLocal(Project project, String path) { RuntimeEnvironment env = RuntimeEnvironment.getInstance(); String srcRoot = env.getSourceRootPath(); if (path.startsWith(srcRoot)) { if (env.hasProjects()) { if (project != null && project.equals(Project.getProject(path.substring(srcRoot.length())))) { return true; } } else { return true; } } return false; }
Source:
<code>public DataContainer(List<String> resourcePaths) { <START> load("mimicker.yml"); <END> for (String path : resourcePaths) { load(path); } }</code><technical_language>nice this a method instead withDefaultResources, in no-args constructor explicitly constructor inherit opinion default</technical_language>

Target:
public DataContainer(List<String> resourcePaths) { for (String path : resourcePaths) { load(path); } }
Source:
<code>protected ICommand getAfterSetCommand(SetRequest request) { CompositeCommand compositeCommand = new <START> CompositeCommand("Set CapsulePart"); <END> EStructuralFeature feature = request.getFeature(); if (UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature)) { Object newValue = request.getValue(); EObject elementToEdit = request.getElementToEdit(); if (elementToEdit instanceof Property && newValue instanceof Type) { Property property = (Property) elementToEdit; Type newType = (Type) newValue; if (CapsulePartUtils.generateCycle(newType, property)) { LiteralInteger newLowerValue = UMLFactory.eINSTANCE.createLiteralInteger(); newLowerValue.setValue(0); ICommand setLowerBoundsCommand = new SetValueCommand(new SetRequest(request.getElementToEdit(), UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue(), newLowerValue)); compositeCommand.add(setLowerBoundsCommand); } if ((Strings.isNullOrEmpty((property).getName()) || NewElementUtil.isCreatedElement(property))) { String name = newType.getName(); if (!Strings.isNullOrEmpty(name)) { String newName = NewElementUtil.getUniqueName(property, newType); ICommand setNameCommand = new SetValueCommand(new SetRequest(request.getElementToEdit(), UMLPackage.eINSTANCE.getNamedElement_Name(), newName)); compositeCommand.add(setNameCommand); } } } } return compositeCommand.isEmpty() ? super.getAfterSetCommand(request) : compositeCommand; }</code><technical_language>This a complete label. "Set CapsulePart Type"</technical_language>

Target:
protected ICommand getAfterSetCommand(SetRequest request) { CompositeCommand compositeCommand = new CompositeCommand("Set CapsulePart Type"); EStructuralFeature feature = request.getFeature(); if (UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature)) { Object newValue = request.getValue(); EObject elementToEdit = request.getElementToEdit(); if (elementToEdit instanceof Property && newValue instanceof Type) { Property property = (Property) elementToEdit; Type newType = (Type) newValue; if (CapsulePartUtils.completesCycle(newType, property)) { LiteralInteger newLowerValue = (LiteralInteger) ModelUtils.create((EObject) null, UMLPackage.Literals.LITERAL_INTEGER); newLowerValue.setValue(0); ICommand setLowerBoundsCommand = new SetValueCommand(new SetRequest(request.getElementToEdit(), UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue(), newLowerValue)); compositeCommand.add(setLowerBoundsCommand); } if ((Strings.isNullOrEmpty((property).getName()) || NewElementUtil.isCreatedElement(property))) { String name = newType.getName(); if (!Strings.isNullOrEmpty(name)) { String newName = NewElementUtil.getUniqueName(property, newType); ICommand setNameCommand = new SetValueCommand(new SetRequest(request.getElementToEdit(), UMLPackage.eINSTANCE.getNamedElement_Name(), newName)); compositeCommand.add(setNameCommand); } } } } return compositeCommand.isEmpty() ? super.getAfterSetCommand(request) : compositeCommand; }
Source:
<code><START> private static boolean renameIndexFiles( <END> final FileSystem outputFS, final Path indexZipFilePath, final Path finalIndexZipFilePath ) throws IOException { return ((DataPusher) RetryProxy.create( DataPusher.class, new DataPusher() { @Override public long push() throws IOException { try { final boolean needRename; if (outputFS.exists(finalIndexZipFilePath)) { final FileStatus zipFile = outputFS.getFileStatus(indexZipFilePath); final FileStatus finalIndexZipFile = outputFS.getFileStatus(finalIndexZipFilePath); if (zipFile.getModificationTime() >= finalIndexZipFile.getModificationTime() || zipFile.getLen() != finalIndexZipFile.getLen()) { log.info( "File[%s / %s / %sB] existed, but wasn't the same as [%s / %s / %sB]", finalIndexZipFile.getPath(), new DateTime(finalIndexZipFile.getModificationTime()), finalIndexZipFile.getLen(), zipFile.getPath(), new DateTime(zipFile.getModificationTime()), zipFile.getLen() ); outputFS.delete(finalIndexZipFilePath, false); needRename = true; } else { log.info( "File[%s / %s / %sB] existed and will be kept", finalIndexZipFile.getPath(), new DateTime(finalIndexZipFile.getModificationTime()), finalIndexZipFile.getLen() ); needRename = false; } } else { needRename = true; } return (needRename && !outputFS.rename(indexZipFilePath, finalIndexZipFilePath)) ? 0 : 1; } catch (IOException | RuntimeException exception) { log.error(exception, "Exception in rename retry loop"); throw exception; } } }, RetryPolicies.exponentialBackoffRetry(NUM_RETRIES, SECONDS_BETWEEN_RETRIES, TimeUnit.SECONDS) )).push() == 1; }</code><technical_language>minor thing, If static util methods moved JobHelper, reused other jobs required</technical_language>

Target:
private static boolean renameIndexFiles( final FileSystem outputFS, final Path indexZipFilePath, final Path finalIndexZipFilePath ) { try { return RetryUtils.retry( new Callable<Boolean>() { @Override public Boolean call() throws Exception { final boolean needRename; if (outputFS.exists(finalIndexZipFilePath)) { final FileStatus zipFile = outputFS.getFileStatus(indexZipFilePath); final FileStatus finalIndexZipFile = outputFS.getFileStatus(finalIndexZipFilePath); if (zipFile.getModificationTime() >= finalIndexZipFile.getModificationTime() || zipFile.getLen() != finalIndexZipFile.getLen()) { log.info( "File[%s / %s / %sB] existed, but wasn't the same as [%s / %s / %sB]", finalIndexZipFile.getPath(), new DateTime(finalIndexZipFile.getModificationTime()), finalIndexZipFile.getLen(), zipFile.getPath(), new DateTime(zipFile.getModificationTime()), zipFile.getLen() ); outputFS.delete(finalIndexZipFilePath, false); needRename = true; } else { log.info( "File[%s / %s / %sB] existed and will be kept", finalIndexZipFile.getPath(), new DateTime(finalIndexZipFile.getModificationTime()), finalIndexZipFile.getLen() ); needRename = false; } } else { needRename = true; } if (needRename) { log.info("Attempting rename from [%s] to [%s]", indexZipFilePath, finalIndexZipFilePath); return outputFS.rename(indexZipFilePath, finalIndexZipFilePath); } else { return true; } } }, FileUtils.IS_EXCEPTION, NUM_RETRIES ); } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code>public static boolean isDeterministic(RexNode expr) { boolean deterministic = true; RexVisitor<Void> visitor = new RexVisitorImpl<Void>(true) { @Override public Void visitCall(org.apache.calcite.rex.RexCall call) { if (!call.getOperator().isDeterministic()) { <START> throw new Util.FoundOne(call); <END> } return super.visitCall(call); } }; try { expr.accept(visitor); } catch (Util.FoundOne e) { deterministic = false; } return deterministic; }</code><technical_language>This static. Do generate exceptions execution</technical_language>

Target:
public static boolean isDeterministic(RexNode expr) { try { RexVisitor<Void> visitor = new RexVisitorImpl<Void>(true) { @Override public Void visitCall(RexCall call) { if (!call.getOperator().isDeterministic()) { throw new Util.FoundOne(call); } return null; } }; expr.accept(visitor); return true; } catch (Util.FoundOne e) { Util.swallow(e, null); return false; } }
Source:
<code>protected void configureMessageConverters(final List<HttpMessageConverter<?>> converters) { <START> StringHttpMessageConverter stringConverter = new StringHttpMessageConverter(); <END> stringConverter.setWriteAcceptCharset(false); converters.add(new ByteArrayHttpMessageConverter()); converters.add(stringConverter); converters.add(new ResourceHttpMessageConverter()); converters.add(new SourceHttpMessageConverter<>()); converters.add(mappingJackson2HttpMessageConverter()); super.configureMessageConverters(converters); }</code><technical_language>final</technical_language>

Target:
protected void configureMessageConverters(final List<HttpMessageConverter<?>> converters) { final StringHttpMessageConverter stringConverter = new StringHttpMessageConverter(); stringConverter.setWriteAcceptCharset(false); converters.add(new ByteArrayHttpMessageConverter()); converters.add(stringConverter); converters.add(new ResourceHttpMessageConverter()); converters.add(new SourceHttpMessageConverter<>()); converters.add(mappingJackson2HttpMessageConverter()); super.configureMessageConverters(converters); }