auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void queryIsRequired() { thrown.expect(BeanCreationException.class); thrown.expectMessage("Field error in object 'target' on field 'query': rejected value [null]"); AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); context.register(Conf.class); context.refresh(); }

Target:
public void queryIsRequired() { this.thrown.expect(BeanCreationException.class); this.thrown.expectMessage("Field error in object 'target' on field 'query': rejected value [null]"); this.context.register(Conf.class); this.context.refresh(); }
Source:
public void deleteSharedScope(String scopeName, String tenantDomain) throws APIManagementException { if (log.isDebugEnabled()) { log.debug("Deleting shared scope " + scopeName); } Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain); for (Map.Entry<String,KeyManagerDto> keyManagerEntry : tenantKeyManagers.entrySet()){ KeyManager keyManager = keyManagerEntry.getValue().getKeyManager(); if (keyManager != null){ try{ keyManager.deleteScope(scopeName); }catch (APIManagementException e){ log.error("Error while Deleting Shared Scope " + scopeName + " from KeyManager " + keyManagerEntry.getKey(), e); } } } apiMgtDAO.deleteSharedScope(scopeName, tenantDomain); scopesDAO.deleteScope(scopeName, APIUtil.getTenantIdFromTenantDomain(tenantDomain)); }

Target:
public void deleteSharedScope(String scopeName, String tenantDomain) throws APIManagementException { if (log.isDebugEnabled()) { log.debug("Deleting shared scope " + scopeName); } Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain); for (Map.Entry<String, KeyManagerDto> keyManagerEntry : tenantKeyManagers.entrySet()) { KeyManager keyManager = keyManagerEntry.getValue().getKeyManager(); if (keyManager != null) { try { keyManager.deleteScope(scopeName); } catch (APIManagementException e) { log.error("Error while Deleting Shared Scope " + scopeName + " from Key Manager " + keyManagerEntry.getKey(), e); } } } apiMgtDAO.deleteSharedScope(scopeName, tenantDomain); deleteScope(scopeName, APIUtil.getTenantIdFromTenantDomain(tenantDomain)); }
Source:
public void writeSelf(File file, long pos) { fLock.readLock().lock(); try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(fAttributeList.size()); String[] prevFullAttribute = null; for (Attribute entry : fAttributeList) { String[] curFullAttribute = entry.getFullAttribute(); String[] curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { e.printStackTrace(); fLock.readLock().unlock(); } }

Target:
public void writeSelf(File file, long pos) { fLock.readLock().lock(); try (FileOutputStream fos = new FileOutputStream(file, true); FileChannel fc = fos.getChannel();) { fc.position(pos); try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeInt(ATTRIB_TREE_MAGIC_NUMBER); List<String[]> list = new ArrayList<>(fAttributeList.size()); String[] prevFullAttribute = null; for (Attribute entry : fAttributeList) { String[] curFullAttribute = entry.getFullAttribute(); String[] curEncodedAttribute = encodeFullAttribute(prevFullAttribute, entry.getFullAttribute()); list.add(curEncodedAttribute); prevFullAttribute = curFullAttribute; } oos.writeObject(list); } } catch (IOException e) { e.printStackTrace(); } finally { fLock.readLock().unlock(); } }
Source:
public TableResult executeInternal(List<ModifyOperation> operations) { List<Transformation<?>> transformations = translate(operations); String jobName = extractJobName(operations); Pipeline pipeline = execEnv.createPipeline(transformations, tableConfig, jobName); try { JobClient jobClient = execEnv.executeAsync(pipeline); TableSchema.Builder builder = TableSchema.builder(); Object[] affectedRowCounts = new Long[operations.size()]; for (int i = 0; i < operations.size(); ++i) { String fieldName = "affected_rowcount"; if (operations.size() > 1) { fieldName = fieldName + "_" + i; } builder.field(fieldName, DataTypes.BIGINT()); affectedRowCounts[i] = -1L; } return TableResultImpl.builder() .jobClient(jobClient) .resultKind(ResultKind.SUCCESS_WITH_CONTENT) .tableSchema(builder.build()) .data(Collections.singletonList(Row.of(affectedRowCounts))) .build(); } catch (Exception e) { throw new TableException("Failed to execute sql", e); } }

Target:
public TableResult executeInternal(List<ModifyOperation> operations) { List<Transformation<?>> transformations = translate(operations); List<String> sinkIdentifierNames = extractSinkIdentifierNames(operations); String jobName = "insert_into_" + String.join(",", sinkIdentifierNames); Pipeline pipeline = execEnv.createPipeline(transformations, tableConfig, jobName); try { JobClient jobClient = execEnv.executeAsync(pipeline); TableSchema.Builder builder = TableSchema.builder(); Object[] affectedRowCounts = new Long[operations.size()]; for (int i = 0; i < operations.size(); ++i) { builder.field(sinkIdentifierNames.get(i), DataTypes.BIGINT()); affectedRowCounts[i] = -1L; } return TableResultImpl.builder() .jobClient(jobClient) .resultKind(ResultKind.SUCCESS_WITH_CONTENT) .tableSchema(builder.build()) .data(Collections.singletonList(Row.of(affectedRowCounts))) .build(); } catch (Exception e) { throw new TableException("Failed to execute sql", e); } }
Source:
public HashMap<String, String> getIntellijServicePrincipalDetails(String credFilePath) throws IOException { BufferedReader reader = null; HashMap<String, String> servicePrincipalDetails = new HashMap<>(8); try { reader = new BufferedReader(new FileReader(credFilePath)); String line = reader.readLine(); while (line != null) { String[] split = line.split("="); split[1] = split[1].replace("\\", ""); servicePrincipalDetails.put(split[0], split[1]); line = reader.readLine(); } } finally { if (reader != null) { reader.close(); } } return servicePrincipalDetails; }

Target:
public Map<String, String> getIntellijServicePrincipalDetails(String credFilePath) throws IOException { BufferedReader reader = null; HashMap<String, String> servicePrincipalDetails = new HashMap<>(8); try { reader = new BufferedReader(new FileReader(credFilePath)); String line = reader.readLine(); while (line != null) { String[] split = line.split("="); split[1] = split[1].replace("\\", ""); servicePrincipalDetails.put(split[0], split[1]); line = reader.readLine(); } } finally { if (reader != null) { reader.close(); } } return servicePrincipalDetails; }
Source:
public Slice slice(int index, int length) { if ((index == 0) && (length == length())) { return this; } checkIndexLength(index, length); if (length == 0) { return Slices.EMPTY_SLICE; } if (reference == COMPACT) { return new Slice(base, address + index, length, retainedSize, NOT_COMPACT); } else { return new Slice(base, address + index, length, retainedSize, reference); } }

Target:
public Slice slice(int index, int length) { if ((index == 0) && (length == length())) { return this; } checkIndexLength(index, length); if (length == 0) { return Slices.EMPTY_SLICE; } if (reference == COMPACT) { return new Slice(base, address + index, length, retainedSize, NOT_COMPACT); } return new Slice(base, address + index, length, retainedSize, reference); }
Source:
private void postProcessModule(Module module) { if (this.plugins != null) { for (Plugin plugin : this.plugins.values()) { if (plugin.supports(module.getType())) { plugin.postProcessModule(module); } } } }

Target:
private void postProcessModule(Module module) { for (Plugin plugin : this.getSupportedPlugins(module)) { plugin.postProcessModule(module); } }
Source:
public CommonCourt findOneAndInitialize(int id){ CommonCourt element = entityManager.find(CommonCourt.class, id); if (element != null) { element.accept(new InitializingVisitor()); } return element; }

Target:
public CommonCourt findOneAndInitialize(int id){ CommonCourt commonCourt = entityManager.find(CommonCourt.class, id); if (commonCourt != null) { commonCourt.accept(new InitializingVisitor()); } return commonCourt; }
Source:
public BasicAuthCallBackHandler(String credentials) { if (credentials == null) { log.trace("No credentials were provided with the request"); return; } int space = credentials.indexOf(SPACE); if (space <= 0) { log.trace("Request credentials were malformed; no space present in value for authorization header"); return; } String method = credentials.substring(0, space); if (!BASIC.equalsIgnoreCase(method)) { log.trace("Request credentials did not use basic authentication; ignoring"); return; } credentials = credentials.substring(space + 1); credentials = new String(Base64.getDecoder().decode(credentials), StandardCharsets.UTF_8); int i = credentials.indexOf(COLON); if (i <= 0) { log.trace("Request credentials were malformed; no colon present between username and password"); return; } username = credentials.substring(0, i); password = credentials.substring(i + 1); }

Target:
public BasicAuthCallBackHandler(String credentials) { if (credentials == null) { log.trace("No credentials were provided with the request"); return; } int space = credentials.indexOf(SPACE); if (space <= 0) { log.trace("Request credentials were malformed; no space present in value for authorization header"); return; } String method = credentials.substring(0, space); if (!BASIC.equalsIgnoreCase(method)) { log.trace("Request credentials used authentication, but only supported; ignoring", method, BASIC); return; } credentials = credentials.substring(space + 1); credentials = new String(Base64.getDecoder().decode(credentials), StandardCharsets.UTF_8); int i = credentials.indexOf(COLON); if (i <= 0) { log.trace("Request credentials were malformed; no colon present between username and password"); return; } username = credentials.substring(0, i); password = credentials.substring(i + 1); }
Source:
public DescribeConfigsResponse getErrorResponse(int throttleTimeMs, Throwable e) { return new DescribeConfigsResponse(new DescribeConfigsResponseData() .setThrottleTimeMs(throttleTimeMs) .setResults(data.resources().stream().map(r -> { Errors error = Errors.forException(e); return new DescribeConfigsResponseData.DescribeConfigsResult().setErrorCode(error.code()) .setErrorMessage(error.message()) .setResourceName(r.resourceName()) .setResourceType(r.resourceType()); }).collect(Collectors.toList()) )); }

Target:
public DescribeConfigsResponse getErrorResponse(int throttleTimeMs, Throwable e) { Errors error = Errors.forException(e); return new DescribeConfigsResponse(new DescribeConfigsResponseData() .setThrottleTimeMs(throttleTimeMs) .setResults(data.resources().stream().map(result -> { return new DescribeConfigsResponseData.DescribeConfigsResult().setErrorCode(error.code()) .setErrorMessage(error.message()) .setResourceName(result.resourceName()) .setResourceType(result.resourceType()); }).collect(Collectors.toList()) )); }
Source:
private void decodePosition(JsonObject object, Position position) { Set<Map.Entry<String, JsonValue>> params = object.entrySet(); Iterator<Map.Entry<String, JsonValue>> it = params.iterator(); while (it.hasNext()) { Map.Entry<String, JsonValue> param = it.next(); String paramName = param.getKey(); JsonValue paramValue = param.getValue(); if ("timestamp".equals(paramName)) { Date deviceTime = new Date((long) (((JsonNumber) paramValue).doubleValue() * 1000)); position.setTime(deviceTime); } else if (paramName.startsWith("position.")) { savePosition(paramName, paramValue, position); } else if (paramName.matches("din#[\\d]{1,2}")) { saveInput(paramName, paramValue, position); } else if (paramName.matches("dout#[\\d]{1,2}")) { saveOutput(paramName, paramValue, position); } else if (saveAlarm(paramName, paramValue, position) == 0 && saveParam(paramName, paramValue, position) == 0) { saveUnknownParam(param.getKey(), param.getValue(), position); } } if (position.getLatitude() == 0 && position.getLongitude() == 0) { getLastLocation(position, position.getDeviceTime()); } }

Target:
private void decodePosition(JsonObject object, Position position) { Set<Map.Entry<String, JsonValue>> params = object.entrySet(); Iterator<Map.Entry<String, JsonValue>> it = params.iterator(); while (it.hasNext()) { Map.Entry<String, JsonValue> param = it.next(); String paramName = param.getKey(); JsonValue paramValue = param.getValue(); int index = -1; if (paramName.contains("#")) { String[] parts = paramName.split("#"); paramName = parts[0]; index = Integer.parseInt(parts[1]); } if (!saveParam(paramName, index, paramValue, position)) { saveUnknownParam(param.getKey(), param.getValue(), position); } } if (position.getLatitude() == 0 && position.getLongitude() == 0) { getLastLocation(position, position.getDeviceTime()); } }
Source:
public void logTimings() { info().$("timings "). $("[compiler: ").$(compilerNanos). $(", count: ").$(recordCountNanos). $(", execute: ").$(nanosecondClock.getTicks() - executeStartNanos). $(']').$(); }

Target:
public void logTimings() { info().$("timings "). $("[compiler: ").$(compilerNanos). $(", count: ").$(recordCountNanos). $(", execute: ").$(nanosecondClock.getTicks() - executeStartNanos). $(", q=`").$(query). $("`]").$(); }
Source:
public void run() { AtomicBoolean unfinished = new AtomicBoolean(false); long yieldTimeMs = app.config.deleteyieldtime; try { TimestampType dateTarget = app.getTargetDate(); long rowTarget = app.getTargetRowsPerPartition(); if (app.config.historyseconds > 0) { app.client.callAllPartitionProcedure(new CallBack(unfinished), "DeleteAfterDate", dateTarget, app.config.deletechunksize); } else { app.client.callAllPartitionProcedure(new CallBack(unfinished), "DeleteOldestToTarget", rowTarget, app.config.deletechunksize); } if (unfinished.get()) { yieldTimeMs = 0; } } catch (Exception e) { failureCount.incrementAndGet(); } catch (Throwable t) { t.printStackTrace(); } finally { app.scheduler.schedule(this, yieldTimeMs, TimeUnit.MILLISECONDS); } }

Target:
public void run() { AtomicBoolean unfinished = new AtomicBoolean(false); long yieldTimeMs = app.config.deleteyieldtime; try { TimestampType dateTarget = app.getTargetDate(); long rowTarget = app.getTargetRowsPerPartition(); ClientResponseWithPartitionKey[] responses; if (app.config.historyseconds > 0) { responses = app.client.callAllPartitionProcedure("DeleteAfterDate", dateTarget, app.config.deletechunksize); } else { responses = app.client.callAllPartitionProcedure("DeleteOldestToTarget", rowTarget, app.config.deletechunksize); } app.updatePartitionCount(responses.length); for (ClientResponseWithPartitionKey resp: responses) { if (resp.getResponse().getStatus() == ClientResponse.SUCCESS) { long tuplesDeleted = resp.getResponse().getResults()[0].asScalarLong(); app.addToDeletedTuples(tuplesDeleted); if (tuplesDeleted >= app.config.deletechunksize) { unfinished.set(true); } } else { failureCount.incrementAndGet(); } } if (unfinished.get()) { yieldTimeMs = 0; } } catch (Exception e) { failureCount.incrementAndGet(); } catch (Throwable t) { t.printStackTrace(); } finally { app.scheduler.schedule(this, yieldTimeMs, TimeUnit.MILLISECONDS); } }
Source:
public Socket createSocket( final Socket socket, final String host, final int port, final boolean autoClose ) throws IOException, UnknownHostException { if (autoClose) { socket.close(); } SSLSocket sslSocket = (SSLSocket) socketfactory.createSocket(host, port); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { socketfactory.setHostname(sslSocket, host); } try { hostnameVerifier.verify(host, sslSocket); } catch (IOException iox) { if (autoClose) { try { sslSocket.close(); } catch (Exception x) { } } throw iox; } return sslSocket; }

Target:
public Socket createSocket( final Socket socket, final String host, final int port, final boolean autoClose ) throws IOException, UnknownHostException { SSLSocket sslSocket = (SSLSocket) socketfactory.createSocket( socket, host, port, autoClose ); setSocketHostname(sslSocket, host); hostnameVerifier.verify(host, sslSocket); return sslSocket; }
Source:
public void testRoundUp() { Assert.assertEquals(Duration.nanos(1).toMillisecondsRoundingAway(), 1); }

Target:
public void testRoundUp() { Assert.assertEquals(Duration.nanos(1).toMillisecondsRoundingUp(), 1); }
Source:
private ConstrainedExecutable parseExecutableType(String defaultPackage, List<ParameterType> parameterTypeList, CrossParameterType crossParameterType, ReturnValueType returnValueType, Executable executable) { List<ConstrainedParameter> parameterMetaData = constrainedParameterBuilder.buildConstrainedParameters( parameterTypeList, executable, defaultPackage ); Set<MetaConstraint<?>> crossParameterConstraints = parseCrossParameterConstraints( defaultPackage, crossParameterType, executable ); Set<MetaConstraint<?>> returnValueConstraints = new HashSet<>(); Set<MetaConstraint<?>> returnValueTypeArgumentConstraints = new HashSet<>(); List<CascadingTypeParameter> cascadingTypeParameters = new ArrayList<>(); Map<Class<?>, Class<?>> groupConversions = new HashMap<>(); CascadingTypeParameter cascadingMetaData = parseReturnValueType( returnValueType, executable, returnValueConstraints, returnValueTypeArgumentConstraints, cascadingTypeParameters, groupConversions, defaultPackage ); return new ConstrainedExecutable( ConfigurationSource.XML, executable, parameterMetaData, crossParameterConstraints, returnValueConstraints, returnValueTypeArgumentConstraints, cascadingMetaData ); }

Target:
private ConstrainedExecutable parseExecutableType(String defaultPackage, List<ParameterType> parameterTypeList, CrossParameterType crossParameterType, ReturnValueType returnValueType, Executable executable) { List<ConstrainedParameter> parameterMetaData = constrainedParameterBuilder.buildConstrainedParameters( parameterTypeList, executable, defaultPackage ); Set<MetaConstraint<?>> crossParameterConstraints = parseCrossParameterConstraints( defaultPackage, crossParameterType, executable ); Set<MetaConstraint<?>> returnValueConstraints = new HashSet<>(); Set<MetaConstraint<?>> returnValueTypeArgumentConstraints = new HashSet<>(); List<CascadingTypeParameter> cascadingTypeParameters = new ArrayList<>(); CascadingTypeParameter cascadingMetaData = parseReturnValueType( returnValueType, executable, returnValueConstraints, returnValueTypeArgumentConstraints, cascadingTypeParameters, defaultPackage ); return new ConstrainedExecutable( ConfigurationSource.XML, executable, parameterMetaData, crossParameterConstraints, returnValueConstraints, returnValueTypeArgumentConstraints, cascadingMetaData ); }
Source:
public Py4jScriptEngine() { super("Python"); }

Target:
public Py4jScriptEngine() { super("Python (Py4J)"); }
Source:
private List<String> queuesToNames() { return this.queues.stream() .map(q -> q.getActualName()) .collect(Collectors.toList()); }

Target:
private List<String> queuesToNames() { return this.queues.stream() .map(Queue::getActualName) .collect(Collectors.toList()); }
Source:
public String toString() { StringBuilder paramsValueBuilder = new StringBuilder(); paramsValueBuilder.append("{"); for (String key : mParams.keySet()) { paramsValueBuilder.append(key); paramsValueBuilder.append("="); paramsValueBuilder.append(mParams.get(key).toString()); paramsValueBuilder.append(","); } paramsValueBuilder.append("}"); return "IdpConfig{" + "mProviderId='" + mProviderId + '\'' + ", mScopes=" + mScopes + ", mParams=" + paramsValueBuilder.toString() + '}'; }

Target:
public String toString() { return "IdpConfig{" + "mProviderId='" + mProviderId + '\'' + ", mScopes=" + mScopes + ", mParams=" + mParams + '}'; }
Source:
public LayerNorm(SameDiff sameDiff, SDVariable input, SDVariable gain, SDVariable bias, int... dimensions) { super(null, sameDiff, new SDVariable[] {input, gain, bias}, false); this.dimensions = dimensions; addIArgument(dimensions); }

Target:
public LayerNorm(SameDiff sameDiff, SDVariable input, SDVariable gain, SDVariable bias, int... dimensions) { super(null, sameDiff, new SDVariable[] {input, gain, bias}, false); Preconditions.checkArgument(bias != null, "LayerNorm: Use constructor without bias argument if bias is null / not available."); setDimensions(dimensions); }
Source:
long getFontDescription () { long fontHandle = fontHandle (); if (OS.GTK3) { long context = OS.gtk_widget_get_style_context (fontHandle); if (OS.GTK_VERSION < OS.VERSION(3, 18, 0)) { return OS.gtk_style_context_get_font(context, OS.GTK_STATE_FLAG_NORMAL); } else { int styleState = OS.gtk_widget_get_state_flags(fontHandle); return OS.gtk_style_context_get_font(context, styleState); } } OS.gtk_widget_realize (fontHandle); return OS.gtk_style_get_font_desc (OS.gtk_widget_get_style (fontHandle)); }

Target:
long getFontDescription () { long fontHandle = fontHandle (); if (OS.GTK3) { long context = OS.gtk_widget_get_style_context (fontHandle); int styleState = OS.gtk_widget_get_state_flags(fontHandle); return OS.gtk_style_context_get_font(context, styleState); } OS.gtk_widget_realize (fontHandle); return OS.gtk_style_get_font_desc (OS.gtk_widget_get_style (fontHandle)); }
Source:
private <ScoreHolder extends AbstractScoreHolder<?>> List<RuleItemBuilder<?>> completeWithScoring( Global<ScoreHolder> scoreHolderGlobal, Block5<Drools, ScoreHolder, Object, Object, Object> consequenceImpl) { ConsequenceBuilder._4<ScoreHolder, Object, Object, Object> consequence = on(scoreHolderGlobal, aMetadata.getVariableDeclaration(), bMetadata.getVariableDeclaration(), cMetadata.getVariableDeclaration()) .execute(consequenceImpl); if (aMetadata instanceof DroolsInferredMetadata && bMetadata instanceof DroolsInferredMetadata && cMetadata instanceof DroolsInferredMetadata) { return Stream.of(cMetadata.buildPattern(), consequence) .collect(Collectors.toList()); } else { return Stream.of(aMetadata.buildPattern(), bMetadata.buildPattern(), cMetadata.buildPattern(), consequence) .collect(Collectors.toList()); } }

Target:
private <ScoreHolder extends AbstractScoreHolder<?>> List<RuleItemBuilder<?>> completeWithScoring( Global<ScoreHolder> scoreHolderGlobal, Block5<Drools, ScoreHolder, Object, Object, Object> consequenceImpl) { ConsequenceBuilder._4<ScoreHolder, Object, Object, Object> consequence = on(scoreHolderGlobal, aMetadata.getVariableDeclaration(), bMetadata.getVariableDeclaration(), cMetadata.getVariableDeclaration()) .execute(consequenceImpl); if (aMetadata instanceof DroolsInferredMetadata && bMetadata instanceof DroolsInferredMetadata && cMetadata instanceof DroolsInferredMetadata) { return Stream.of(cMetadata.buildPattern(), consequence) .collect(Collectors.toList()); } else { return Arrays.asList(aMetadata.buildPattern(), bMetadata.buildPattern(), cMetadata.buildPattern(), consequence); } }
Source:
public void testNetworkInterceptors() { ParseNetworkInterceptor interceptorA = mock(ParseNetworkInterceptor.class); ParseNetworkInterceptor interceptorB = mock(ParseNetworkInterceptor.class); Parse.Configuration.Builder builder = new Parse.Configuration.Builder(null); builder.addNetworkInterceptor(interceptorA); Parse.Configuration configurationA = builder.build(); builder.addNetworkInterceptor(interceptorB); Parse.Configuration configurationB = builder.build(); assertFalse(configurationA.interceptors.contains(interceptorB)); assertTrue(configurationB.interceptors.contains(interceptorB)); try { configurationA.interceptors.add(interceptorB); fail(); } catch (UnsupportedOperationException ex) { } }

Target:
public void testNetworkInterceptors() { ParseNetworkInterceptor interceptorA = mock(ParseNetworkInterceptor.class); ParseNetworkInterceptor interceptorB = mock(ParseNetworkInterceptor.class); Parse.Configuration.Builder builder = new Parse.Configuration.Builder(null); builder.addNetworkInterceptor(interceptorA); Parse.Configuration configurationA = builder.build(); builder.addNetworkInterceptor(interceptorB); Parse.Configuration configurationB = builder.build(); assertFalse(configurationA.interceptors.contains(interceptorB)); assertTrue(configurationB.interceptors.contains(interceptorB)); try { configurationA.interceptors.add(interceptorB); fail("Interceptors shouldn't be mutable."); } catch (UnsupportedOperationException ex) { } }
Source:
public Health health() { final long cpuCount = summaryCpuMetric.count(); final long cpuTotal = summaryCpuMetric.totalAmount(); final double currentCpuLoadPercent = cpuCount == 0 ? 0 : (cpuTotal / (double) cpuCount); if (currentCpuLoadPercent > maxCpuLoadPercent) { cpuLoadConsecutiveOccurrences++; } if (cpuLoadConsecutiveOccurrences >= maxCpuLoadConsecutiveOccurrences) { log.warn("CPU usage crossed the threshold of {}", currentCpuLoadPercent, maxCpuLoadPercent); return Health .outOfService() .withDetail(CPU_LOAD, currentCpuLoadPercent) .build(); } else { cpuLoadConsecutiveOccurrences = 0; return Health .up() .withDetail(CPU_LOAD, currentCpuLoadPercent) .build(); } }

Target:
public Health health() { final long cpuCount = summaryCpuMetric.getCount(); final long cpuTotal = summaryCpuMetric.getTotalAmount(); final double currentCpuLoadPercent = cpuCount == 0 ? operatingSystemMXBean.getProcessCpuLoad() : (cpuTotal / (double) cpuCount); if (currentCpuLoadPercent > maxCpuLoadPercent) { cpuLoadConsecutiveOccurrences++; } else { cpuLoadConsecutiveOccurrences = 0; } if (cpuLoadConsecutiveOccurrences >= maxCpuLoadConsecutiveOccurrences) { log.warn("CPU usage crossed the threshold of {}", currentCpuLoadPercent, maxCpuLoadPercent); return Health .outOfService() .withDetail(CPU_LOAD, currentCpuLoadPercent) .build(); } else { return Health .up() .withDetail(CPU_LOAD, currentCpuLoadPercent) .build(); } }
Source:
public static void reportHistory(final CommandSender sender, final String username) { new BukkitRunnable() { @Override public void run() { UUID uuid; FHistory history = null; uuid = UUIDFetcher.fetch(username); if (uuid != null) { Gson gson = new GsonBuilder().create(); String compactUuid = uuid.toString().replace("-", ""); try { URL url = new URL("<LINK_0>" + compactUuid + "/names"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); FName[] oldNames = gson.fromJson(reader, FName[].class); reader.close(); conn.disconnect(); Arrays.sort(oldNames); history = new FHistory(uuid, oldNames); printHistory(sender, oldNames); } catch (Exception ex) { FLog.severe(ex); } if (history == null) { sender.sendMessage(ChatColor.RED + "Player not found!"); } } } }.runTaskAsynchronously(TotalFreedomMod.plugin()); }

Target:
public static void reportHistory(final CommandSender sender, final String username) { new BukkitRunnable() { @Override public void run() { UUID uuid = UUIDFetcher.fetch(username); if (uuid != null) { Gson gson = new GsonBuilder().create(); String compactUuid = uuid.toString().replace("-", ""); try { URL url = new URL("<LINK_0>" + compactUuid + "/names"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); FName[] oldNames = gson.fromJson(reader, FName[].class); if (oldNames == null) { FSync.playerMsg(sender, ChatColor.RED + "Player not found!"); return; } reader.close(); conn.disconnect(); Arrays.sort(oldNames); printHistory(sender, oldNames); } catch (Exception ex) { FSync.playerMsg(sender, ChatColor.RED + "Error, see logs for more details."); FLog.severe(ex); } } else { FSync.playerMsg(sender, ChatColor.RED + "Player not found!"); } } }.runTaskAsynchronously(TotalFreedomMod.plugin()); }
Source:
public boolean process() { if (result != null) { return true; } if (needRehash() && !tryRehash()) { return false; } int positionCount = block.getPositionCount(); verify(lastPosition < positionCount, "position count out of bound"); while (lastPosition < positionCount) { int groupId = putIfAbsent(lastPosition, block); BIGINT.writeLong(blockBuilder, groupId); lastPosition++; if (needRehash()) { break; } } if (lastPosition == positionCount) { result = new GroupByIdBlock(nextGroupId, blockBuilder.build()); return true; } return false; }

Target:
public boolean process() { int positionCount = block.getPositionCount(); checkState(lastPosition < positionCount, "position count out of bound"); checkState(!finished); if (needRehash() && !tryRehash()) { return false; } while (lastPosition < positionCount && !needRehash()) { BIGINT.writeLong(blockBuilder, putIfAbsent(lastPosition, block)); lastPosition++; } return lastPosition == positionCount; }
Source:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); init(); getOutputSchema(); pipelineConfigurer.getStageConfigurer().setOutputSchema(outputSchema); }

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); sourceConfig.validate(); if (!Strings.isNullOrEmpty(sourceConfig.outputSchema)) { pipelineConfigurer.getStageConfigurer().setOutputSchema(sourceConfig.getSchema()); } }
Source:
public void setAltAssoc(AltAST t, int alt) { ASSOC assoc = ASSOC.left; if ( t.getOptions()!=null ) { String a = t.getOptionString("assoc"); if ( a!=null ) { if ( a.equals(ASSOC.right.toString()) ) { assoc = ASSOC.right; } else if ( a.equals(ASSOC.left.toString()) ) { assoc = ASSOC.left; } else { tool.errMgr.toolError(ErrorType.ILLEGAL_OPTION_VALUE, t.getToken(), "assoc", assoc); } } } if ( altAssociativity.get(alt)!=null && altAssociativity.get(alt)!=assoc ) { tool.errMgr.toolError(ErrorType.ALL_OPS_NEED_SAME_ASSOC, alt); } altAssociativity.put(alt, assoc); }

Target:
public void setAltAssoc(AltAST t, int alt) { ASSOC assoc = ASSOC.left; if ( t.getOptions()!=null ) { String a = t.getOptionString("assoc"); if ( a!=null ) { if ( a.equals(ASSOC.right.toString()) ) { assoc = ASSOC.right; } else if ( a.equals(ASSOC.left.toString()) ) { assoc = ASSOC.left; } else { tool.errMgr.toolError(ErrorType.ILLEGAL_OPTION_VALUE, t.getOptionAST("assoc").getToken(), "assoc", assoc); } } } if ( altAssociativity.get(alt)!=null && altAssociativity.get(alt)!=assoc ) { tool.errMgr.toolError(ErrorType.ALL_OPS_NEED_SAME_ASSOC, alt); } altAssociativity.put(alt, assoc); }
Source:
private boolean checkFilterForBoolean(Filter filter, Boolean param) { OperatorType operatorType = OperatorType.fromString(filter.getOperator()); boolean result = false; boolean expressionValue = Boolean.parseBoolean(filter.getExpression()); if (operatorType != null) { switch (operatorType) { case EXIST: result = true; break; case AND: result = param && expressionValue; break; case OR: result = param || expressionValue; break; default: result = false; } } return result; }

Target:
private boolean checkFilterForBoolean(Filter filter, Boolean param) { OperatorType operatorType = OperatorType.fromString(filter.getOperator()); boolean result = false; boolean expressionValue = Boolean.parseBoolean(filter.getExpression()); if (operatorType != null) { switch (operatorType) { case EXIST: result = param; break; case AND: result = param && expressionValue; break; case OR: result = param || expressionValue; break; default: result = false; } } return result; }
Source:
public void getRadiologyOrdersByPatients_shouldReturnAllRadiologyOrdersAssociatedWithGivenPatients() { Patient patientWithTwoRadiologyOrders = patientService.getPatient(PATIENT_ID_WITH_FOUR_RADIOLOGY_ORDERS); Patient patientWithOneRadiologyOrder = patientService.getPatient(PATIENT_ID_WITH_ONE_RADIOLOGY_ORDER); List<Patient> patientsWithThreeRadiologyOrders = new ArrayList<Patient>(); patientsWithThreeRadiologyOrders.add(patientWithTwoRadiologyOrders); patientsWithThreeRadiologyOrders.add(patientWithOneRadiologyOrder); List<RadiologyOrder> radiologyOrders = radiologyService .getRadiologyOrdersByPatients(patientsWithThreeRadiologyOrders); assertThat(radiologyOrders.size(), is(7)); }

Target:
public void getRadiologyOrdersByPatients_shouldReturnAllRadiologyOrdersAssociatedWithGivenPatients() { Patient patientWithTwoRadiologyOrders = patientService.getPatient(PATIENT_ID_WITH_FOUR_RADIOLOGY_ORDERS); Patient patientWithOneRadiologyOrder = patientService.getPatient(PATIENT_ID_WITH_ONE_RADIOLOGY_ORDER); List<Patient> patientsWithThreeRadiologyOrders = new ArrayList<Patient>(); patientsWithThreeRadiologyOrders.add(patientWithTwoRadiologyOrders); patientsWithThreeRadiologyOrders.add(patientWithOneRadiologyOrder); List<RadiologyOrder> radiologyOrders = radiologyService .getRadiologyOrdersByPatients(patientsWithThreeRadiologyOrders); assertThat(radiologyOrders.size(), is(TOTAL_NUMBER_OF_RADIOLOGY_ORDERS)); }
Source:
public void whenPostEventTimesOutThenUpdateItemStatus() throws Exception { BatchItem item = new BatchItem(new JSONObject()); item.setPartition("1"); List<BatchItem> batch = new ArrayList<>(); batch.add(item); when(settings.getKafkaSendTimeoutMs()).thenReturn((long) 100); Mockito .doReturn(mock(Future.class)) .when(kafkaProducer) .send(any(), any()); try { kafkaTopicRepository.syncPostBatch(EXPECTED_PRODUCER_RECORD.topic(), batch); fail(); } catch (EventPublishingException e) { assertThat(item.getResponse().getPublishingStatus(), equalTo(EventPublishingStatus.FAILED)); assertThat(item.getResponse().getDetail(), equalTo("timed out")); } }

Target:
public void whenPostEventTimesOutThenUpdateItemStatus() throws Exception { final BatchItem item = new BatchItem(new JSONObject()); item.setPartition("1"); final List<BatchItem> batch = new ArrayList<>(); batch.add(item); when(settings.getKafkaSendTimeoutMs()).thenReturn((long) 100); Mockito .doReturn(mock(Future.class)) .when(kafkaProducer) .send(any(), any()); try { kafkaTopicRepository.syncPostBatch(EXPECTED_PRODUCER_RECORD.topic(), batch); fail(); } catch (EventPublishingException e) { assertThat(item.getResponse().getPublishingStatus(), equalTo(EventPublishingStatus.FAILED)); assertThat(item.getResponse().getDetail(), equalTo("timed out")); } }
Source:
public static synchronized UserTuneManager getInstanceFor(XMPPConnection connection) { UserTuneManager manager = INSTANCES.get(connection); if (manager == null) { manager = new UserTuneManager(connection); INSTANCES.put(connection, manager); } return manager; }

Target:
public static synchronized UserTuneManager getInstanceFor(XMPPConnection connection) throws NotLoggedInException { UserTuneManager manager = INSTANCES.get(connection); if (manager == null) { manager = new UserTuneManager(connection); INSTANCES.put(connection, manager); } return manager; }
Source:
private AnnotatedConstructor buildAnnotatedConstructorForDecorator(Decorator decorator) { List<AnnotationMapperReference> mapperReferencesForConstructor = new ArrayList<AnnotationMapperReference>(); for ( Field field : decorator.getFields() ) { if ( field instanceof AnnotationMapperReference ) { mapperReferencesForConstructor.add( (AnnotationMapperReference) field ); } } List<Annotation> mapperReferenceAnnotations = getMapperReferenceAnnotations(); removeReferenceAnnotations( mapperReferencesForConstructor, mapperReferenceAnnotations ); return new AnnotatedConstructor( decorator.getName(), mapperReferencesForConstructor, mapperReferenceAnnotations, additionalPublicEmptyConstructor() ); }

Target:
private AnnotatedConstructor buildAnnotatedConstructorForDecorator(Decorator decorator) { List<AnnotationMapperReference> mapperReferencesForConstructor = new ArrayList<AnnotationMapperReference>( decorator.getFields().size() ); for ( Field field : decorator.getFields() ) { if ( field instanceof AnnotationMapperReference ) { mapperReferencesForConstructor.add( (AnnotationMapperReference) field ); } } List<Annotation> mapperReferenceAnnotations = getMapperReferenceAnnotations(); removeDuplicateAnnotations( mapperReferencesForConstructor, mapperReferenceAnnotations ); return new AnnotatedConstructor( decorator.getName(), mapperReferencesForConstructor, mapperReferenceAnnotations, additionalPublicEmptyConstructor() ); }
Source:
public PerformanceRating getPerformance() { float percentage = Math.round(((((totalElapsedTime / 1000000.0) * 100.0F) / PerformanceSummary.MAX_TICK_DURATION) * 100.0F) / 100.0F); for (PerformanceRating rating : PerformanceRating.values()) { if (rating.test(percentage)) { return rating; } } return PerformanceRating.UNKNOWN; }

Target:
public PerformanceRating getPerformance() { float percentage = getPercentageOfTick(); for (PerformanceRating rating : PerformanceRating.values()) { if (rating.test(percentage)) { return rating; } } return PerformanceRating.UNKNOWN; }
Source:
public void testExecuteInvalidTable() throws Exception { GroupRequest groupRequest = new GroupRequest(); groupRequest.setTable(TestUtils.TEST_TABLE_NAME + "-dummy-32"); groupRequest.setNesting(Arrays.asList("os", "device", "version")); queryExecutor.execute(groupRequest); }

Target:
public void testExecuteInvalidTable() throws Exception { GroupRequest groupRequest = new GroupRequest(); groupRequest.setTable(TestUtils.TEST_TABLE_NAME + "-dummy-32"); groupRequest.setNesting(Arrays.asList("os", "device", "version")); try { queryExecutor.execute(groupRequest); } catch (QueryStoreException e) { assertEquals(QueryStoreException.ErrorCode.NO_SUCH_TABLE, e.getErrorCode()); throw e; } }
Source:
public static Guid GetEntityGuid(Object entity) { if (entity instanceof VM) { return ((VM) entity).getId(); } else if (entity instanceof storage_pool) { return ((storage_pool) entity).getId(); } else if (entity instanceof VDSGroup) { return ((VDSGroup) entity).getId(); } else if (entity instanceof VDS) { return ((VDS) entity).getId(); } else if (entity instanceof storage_domains) { return ((storage_domains) entity).getId(); } else if (entity instanceof VmTemplate) { return ((VmTemplate) entity).getId(); } else if (entity instanceof vm_pools) { return ((vm_pools) entity).getvm_pool_id(); } else if (entity instanceof DbUser) { return ((DbUser) entity).getuser_id(); } else if (entity instanceof Quota) { return ((Quota) entity).getId(); } else if (entity instanceof DiskImage) { return ((DiskImage) entity).getId(); } else if (entity instanceof GlusterVolumeEntity) { return ((GlusterVolumeEntity) entity).getId(); } else if (entity instanceof Network) { return ((Network) entity).getId(); } else if (entity instanceof NetworkView) { return ((NetworkView) entity).getId(); } return new Guid(); }

Target:
public static Guid GetEntityGuid(Object entity) { if (entity instanceof VM) { return ((VM) entity).getId(); } else if (entity instanceof storage_pool) { return ((storage_pool) entity).getId(); } else if (entity instanceof VDSGroup) { return ((VDSGroup) entity).getId(); } else if (entity instanceof VDS) { return ((VDS) entity).getId(); } else if (entity instanceof storage_domains) { return ((storage_domains) entity).getId(); } else if (entity instanceof VmTemplate) { return ((VmTemplate) entity).getId(); } else if (entity instanceof vm_pools) { return ((vm_pools) entity).getvm_pool_id(); } else if (entity instanceof DbUser) { return ((DbUser) entity).getuser_id(); } else if (entity instanceof Quota) { return ((Quota) entity).getId(); } else if (entity instanceof DiskImage) { return ((DiskImage) entity).getId(); } else if (entity instanceof GlusterVolumeEntity) { return ((GlusterVolumeEntity) entity).getId(); } else if (entity instanceof Network) { return ((Network) entity).getId(); } return new Guid(); }
Source:
public void loadSettings() { settings = new RendererSettings(); String defaultRenderer = System.getProperty(DEFAULT_RENDERER_PROPERTY, ""); String offlineStr = System.getProperty(OFFLINE_RENDERER_PROPERTY, "false"); boolean offline; try { offline = Boolean.parseBoolean(offlineStr); } catch(Exception e) { offline = false; } settings.setDefaultRenderer(defaultRenderer); settings.setOffline(offline); }

Target:
public void loadSettings() { String defaultRenderer = System.getProperty(DEFAULT_RENDERER_PROPERTY, ""); String offlineStr = System.getProperty(OFFLINE_RENDERER_PROPERTY, "false"); boolean offline= Boolean.parseBoolean(offlineStr); settings = new RendererSettings(defaultRenderer, offline); }
Source:
public <T> Set<T> including(Set<T> set, T object) { if (set.contains(object)) { return Sets.newLinkedHashSet(set); } else { Set<T> result = Sets.newLinkedHashSet(set); result.add(object); return result; } }

Target:
public <T> Set<T> including(Set<T> set, T object) { if (set.contains(object)) { return set; } else { Set<T> result = Sets.newLinkedHashSet(set); result.add(object); return result; } }
Source:
ListenableFuture<Void> eventReceived(T event) { if (state == State.STOPPED) { logger.trace("{} debouncer is stopped, rejecting event: {}", name, event); return MoreFutures.VOID_SUCCESS; } checkNotNull(event); logger.trace("{} debouncer: event received {}", name, event); if (eventCount.incrementAndGet() > maxQueuedEvents) { long now = System.nanoTime(); if (now > lastOverflowWarning + OVERFLOW_WARNING_INTERVAL) { lastOverflowWarning = now; logger.warn("{} debouncer enqueued more than events, rejecting new events. " + "This should not happen and is likely a sign that something is wrong.", name, maxQueuedEvents); } eventCount.decrementAndGet(); return MoreFutures.VOID_SUCCESS; } Entry<T> entry = new Entry<T>(event); try { events.add(entry); } catch (RuntimeException e) { eventCount.decrementAndGet(); throw e; } if (state == State.RUNNING) { int count = eventCount.get(); if (count < maxPendingEvents()) { scheduleDelayedDelivery(); } else if (count == maxPendingEvents()) { scheduleImmediateDelivery(); } } else if (state == State.STOPPED) { entry.future.set(null); } return entry.future; }

Target:
ListenableFuture<Void> eventReceived(T event) { if (state == State.STOPPED) { logger.trace("{} debouncer is stopped, rejecting event: {}", name, event); return MoreFutures.VOID_SUCCESS; } checkNotNull(event); logger.trace("{} debouncer: event received {}", name, event); if (eventCount.incrementAndGet() > maxQueuedEvents) { long now = System.nanoTime(); if (now > lastOverflowWarning + OVERFLOW_WARNING_INTERVAL) { lastOverflowWarning = now; logger.warn("{} debouncer enqueued more than events, rejecting new events. " + "This should not happen and is likely a sign that something is wrong.", name, maxQueuedEvents); } eventCount.decrementAndGet(); return MoreFutures.VOID_SUCCESS; } Entry<T> entry = new Entry<T>(event); try { events.add(entry); } catch (RuntimeException e) { eventCount.decrementAndGet(); throw e; } if (state == State.RUNNING) { int count = eventCount.get(); int maxPendingEvents = maxPendingEvents(); if (count < maxPendingEvents) { scheduleDelayedDelivery(); } else if (count == maxPendingEvents) { scheduleImmediateDelivery(); } } else if (state == State.STOPPED) { entry.future.set(null); } return entry.future; }
Source:
public void onReceive(Context context, Intent intent) { final StumblerBundle bundle = intent.getParcelableExtra(Reporter.NEW_BUNDLE_ARG_BUNDLE); mStorage.insert(bundle.getGpsPosition()); }

Target:
public void onReceive(Context context, Intent intent) { if (Prefs.getInstance(context).getBearerToken() != null) { final StumblerBundle bundle = intent.getParcelableExtra(Reporter.NEW_BUNDLE_ARG_BUNDLE); mStorage.insert(bundle.getGpsPosition()); } }
Source:
void validate(boolean isCalendarFolder, int permissionIndex) throws ServiceValidationException, ServiceLocalException { if (!this.userId.isValid()) { throw new ServiceValidationException(String.format( "The UserId in the folder permission at index %d is invalid. The StandardUser, PrimarySmtpAddress, or SID property must be set.", permissionIndex)); } if (!isCalendarFolder) { if ((this.readItems == FolderPermissionReadAccess.TimeAndSubjectAndLocation) || (this.readItems == FolderPermissionReadAccess. TimeOnly)) { throw new ServiceLocalException(String.format( "Permission read access value %s cannot be used with non-calendar folder.", this.readItems)); } if ((this.permissionLevel == FolderPermissionLevel.FreeBusyTimeAndSubjectAndLocation) || (this.permissionLevel == FolderPermissionLevel. FreeBusyTimeOnly)) { throw new ServiceLocalException(String.format( "Permission level value %s cannot be used with non-calendar folder.", this.permissionLevel)); } } }

Target:
void validate(boolean isCalendarFolder, int permissionIndex) throws ServiceValidationException, ServiceLocalException { if (!this.userId.isValid()) { throw new ServiceValidationException(String.format( "The UserId in the folder permission at index %d is invalid. " + "The StandardUser, PrimarySmtpAddress, or SID property must be set.", permissionIndex)); } if (!isCalendarFolder) { if ((this.readItems == FolderPermissionReadAccess.TimeAndSubjectAndLocation) || (this.readItems == FolderPermissionReadAccess. TimeOnly)) { throw new ServiceLocalException(String.format( "Permission read access value %s cannot be used with non-calendar folder.", this.readItems)); } if ((this.permissionLevel == FolderPermissionLevel.FreeBusyTimeAndSubjectAndLocation) || (this.permissionLevel == FolderPermissionLevel. FreeBusyTimeOnly)) { throw new ServiceLocalException(String.format( "Permission level value %s cannot be used with non-calendar folder.", this.permissionLevel)); } } }
Source:
public int restartModule(IModule[] module, IProgressMonitor monitor) throws CoreException { IPath archiveDestination = getModuleDeployRoot(module); IFilesystemController controller = getFilesystemController(); if( ServerModelUtilities.isBinaryModule(module[module.length-1]) || getDeploymentOptions().prefersZippedDeployments()) { controller.touchResource(archiveDestination, monitor); } else { JSTPublisherXMLToucher.getInstance().touch(archiveDestination, module[0], controller); } return IServer.STATE_STARTED; }

Target:
public int restartModule(IModule[] module, IProgressMonitor monitor) throws CoreException { if( !canRestartModule(module)) { return getServer().getModuleState(module); } IPath archiveDestination = getModuleDeployRoot(module); IFilesystemController controller = getFilesystemController(); if( ServerModelUtilities.isBinaryModule(module[module.length-1]) || getDeploymentOptions().prefersZippedDeployments()) { controller.touchResource(archiveDestination, monitor); } else { JSTPublisherXMLToucher.getInstance().touch(archiveDestination, module[0], controller); } return IServer.STATE_STARTED; }
Source:
private void writeErrorReport(List<RassXmlFileParseResult> errorResults) { initializeNewReport(RassConstants.RASS_PARSE_ERRORS_BASE_FILENAME); reportWriterService.writeFormattedMessageLine("RASS Error Report"); reportWriterService.writeNewLines(1); reportWriterService.writeFormattedMessageLine( "Unexpected errors were encountered when attempting to read the following RASS XML files."); reportWriterService.writeFormattedMessageLine( "The failures were likely the result of incorrect XML formatting."); reportWriterService.writeFormattedMessageLine( "Specific details are available in the RASS batch job logs."); reportWriterService.writeNewLines(1); for (RassXmlFileParseResult errorResult : errorResults) { String xmlFileName = getFileNameWithoutPath(errorResult.getRassXmlFileName()); reportWriterService.writeFormattedMessageLine(xmlFileName); } finalizeReportForCurrentFile(); }

Target:
private void writeErrorReport(List<RassXmlFileParseResult> errorResults) { initializeNewReport(RassConstants.RASS_PARSE_ERRORS_BASE_FILENAME); reportWriterService.writeFormattedMessageLine("RASS Error Report"); reportWriterService.writeNewLines(1); writeFormattedMessageLineForConfigProperty(RassKeyConstants.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE1); writeFormattedMessageLineForConfigProperty(RassKeyConstants.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE2); writeFormattedMessageLineForConfigProperty(RassKeyConstants.MESSAGE_RASS_REPORT_ERROR_HEADER_LINE3); reportWriterService.writeNewLines(1); for (RassXmlFileParseResult errorResult : errorResults) { String xmlFileName = getFileNameWithoutPath(errorResult.getRassXmlFileName()); reportWriterService.writeFormattedMessageLine(xmlFileName); } finalizeReportForCurrentFile(); }