auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void buildCalciteFns() { for (SketchDescriptor sd : sketchClasses.values()) { RelProtoDataType sketchType = RelDataTypeImpl.proto(SqlTypeName.BINARY, true); SketchFunctionDescriptor sketchSFD = sd.fnMap.get(DATA_TO_SKETCH); SketchFunctionDescriptor unionSFD = sd.fnMap.get(UNION_SKETCH); SketchFunctionDescriptor estimateSFD = sd.fnMap.get(SKETCH_TO_ESTIMATE); if (sketchSFD == null || unionSFD == null) { continue; } HiveMergeableAggregate unionFn = new HiveMergeableAggregate(unionSFD.name, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(sketchType), InferTypes.ANY_NULLABLE, OperandTypes.family(), null); HiveMergeableAggregate sketchFn = new HiveMergeableAggregate(sketchSFD.name, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(sketchType), InferTypes.ANY_NULLABLE, OperandTypes.family(), unionFn); unionSFD.setCalciteFunction(unionFn); sketchSFD.setCalciteFunction(sketchFn); if (estimateSFD != null) { SqlFunction estimateFn = new HiveSqlFunction(estimateSFD.name, SqlKind.OTHER_FUNCTION, <START> ReturnTypes.explicit(SqlTypeName.DOUBLE), <END> InferTypes.ANY_NULLABLE, OperandTypes.family(), SqlFunctionCategory.USER_DEFINED_FUNCTION, true, false); estimateSFD.setCalciteFunction(estimateFn); } } }</code><technical_language>If this is a UDF, dynamically generate return type do for other UDFs</technical_language>

Target:
private void buildCalciteFns() { for (SketchDescriptor sd : sketchClasses.values()) { RelProtoDataType sketchType = RelDataTypeImpl.proto(SqlTypeName.BINARY, true); SketchFunctionDescriptor sketchSFD = sd.fnMap.get(DATA_TO_SKETCH); SketchFunctionDescriptor unionSFD = sd.fnMap.get(UNION_SKETCH); SketchFunctionDescriptor estimateSFD = sd.fnMap.get(SKETCH_TO_ESTIMATE); if (sketchSFD == null || unionSFD == null) { continue; } HiveMergeableAggregate unionFn = new HiveMergeableAggregate(unionSFD.name, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(sketchType), InferTypes.ANY_NULLABLE, OperandTypes.family(), null); HiveMergeableAggregate sketchFn = new HiveMergeableAggregate(sketchSFD.name, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(sketchType), InferTypes.ANY_NULLABLE, OperandTypes.family(), unionFn); unionSFD.setCalciteFunction(unionFn); sketchSFD.setCalciteFunction(sketchFn); if (estimateSFD != null && estimateSFD.getReturnRelDataType().isPresent()) { SqlFunction estimateFn = new HiveSqlFunction(estimateSFD.name, SqlKind.OTHER_FUNCTION, ReturnTypes.explicit(estimateSFD.getReturnRelDataType().get().getSqlTypeName()), InferTypes.ANY_NULLABLE, OperandTypes.family(), SqlFunctionCategory.USER_DEFINED_FUNCTION, true, false); estimateSFD.setCalciteFunction(estimateFn); } } }
Source:
<code>private void createLiteDownloadManager() { Handler handler = new Handler(Looper.getMainLooper()); liteDownloadManagerCommands = DownloadManagerBuilder .newInstance(this, handler, R.mipmap.ic_launcher_round) <START> .withAllowedConnectionType(ConnectionType.UNMETERED) <END> .build(); }</code><technical_language>remove this, I a problem I worked project a bunch of defined in Application changing download-manager knowing prefer vanilla in sample app</technical_language>

Target:
private void createLiteDownloadManager() { Handler handler = new Handler(Looper.getMainLooper()); liteDownloadManagerCommands = DownloadManagerBuilder .newInstance(this, handler, R.mipmap.ic_launcher_round) .build(); }
Source:
<code>private void readFromUrl(String url, final HttpOutputMessage output) throws IOException { <START> try (HttpResponse conn = requestFactory.request(0, url, null, null, null, null)) { <END> output.setStatus(conn.getResponseCode()); final String contentType = conn.getContentType(); if (contentType != null) { output.setContentType(contentType); } final String contentDisposition = conn.getHeaderField(HttpHeaders.CONTENT_DISPOSITION); if (contentDisposition != null) { output.addHttpHeader(HttpHeaders.CONTENT_DISPOSITION, contentDisposition); } try (InputStream in = firstNonNull(conn.getErrorStream(), conn.getInputStream()); OutputStream out = output.getOutputStream()) { ByteStreams.copy(in, out); } } }</code><technical_language>leave timeout avoid changes in app behavior</technical_language>

Target:
private void readFromUrl(String url, final HttpOutputMessage output) throws IOException { try (HttpResponse conn = requestFactory.target(url).setTimeout(60 * 1000).request()) { output.setStatus(conn.getResponseCode()); final String contentType = conn.getContentType(); if (contentType != null) { output.setContentType(contentType); } final String contentDisposition = conn.getHeaderField(HttpHeaders.CONTENT_DISPOSITION); if (contentDisposition != null) { output.addHttpHeader(HttpHeaders.CONTENT_DISPOSITION, contentDisposition); } try (InputStream in = conn.getInputStream(); OutputStream out = output.getOutputStream()) { ByteStreams.copy(in, out); } } }
Source:
<code>static LocaleResolver determineLocaleResolver(AbstractConfigurationImpl<?> hibernateSpecificConfig, Map<String, String> properties, ClassLoader externalClassLoader) { if ( hibernateSpecificConfig.getLocaleResolver() != null ) { LOG.usingLocaleResolver( hibernateSpecificConfig.getLocaleResolver().getClass() ); return hibernateSpecificConfig.getLocaleResolver(); } String localeResolverFqcn = properties.get( HibernateValidatorConfiguration.LOCALE_RESOLVER_CLASSNAME ); if ( localeResolverFqcn != null ) { try { @SuppressWarnings("unchecked") Class<? extends LocaleResolver> clazz = (Class<? extends LocaleResolver>) run( LoadClass.action( localeResolverFqcn, externalClassLoader ) ); LocaleResolver localeResolver = run( NewInstance.action( clazz, "locale resolver class" ) ); LOG.usingLocaleResolver( clazz ); return localeResolver; } catch (Exception e) { <START> throw LOG.getUnableToInstantiatePropertyNodeNameProviderClassException( localeResolverFqcn, e ); <END> } } return new DefaultLocaleResolver(); }</code><technical_language>I need a dedicated logging method here; this copy-pasted</technical_language>

Target:
static LocaleResolver determineLocaleResolver(AbstractConfigurationImpl<?> hibernateSpecificConfig, Map<String, String> properties, ClassLoader externalClassLoader) { if ( hibernateSpecificConfig.getLocaleResolver() != null ) { LOG.usingLocaleResolver( hibernateSpecificConfig.getLocaleResolver().getClass() ); return hibernateSpecificConfig.getLocaleResolver(); } String localeResolverFqcn = properties.get( HibernateValidatorConfiguration.LOCALE_RESOLVER_CLASSNAME ); if ( localeResolverFqcn != null ) { try { @SuppressWarnings("unchecked") Class<? extends LocaleResolver> clazz = (Class<? extends LocaleResolver>) run( LoadClass.action( localeResolverFqcn, externalClassLoader ) ); LocaleResolver localeResolver = run( NewInstance.action( clazz, "locale resolver class" ) ); LOG.usingLocaleResolver( clazz ); return localeResolver; } catch (Exception e) { throw LOG.getUnableToInstantiateLocaleResolverClassException( localeResolverFqcn, e ); } } return new DefaultLocaleResolver(); }
Source:
<code>public @Nullable Object getStyle(OutputElementStyle elementStyle, String property) { OutputElementStyle style = elementStyle; Stack<String> styleQueue = new Stack<>(); while (style != null) { Map<String, Object> styleValues = style.getStyleValues(); Object value = styleValues.get(property); if (value != null) { return value; } String parentKey = style.getParentKey(); if (parentKey != null) { String[] split = parentKey.split(","); styleQueue.addAll(Arrays.asList(split)); } <START> style = styleQueue.isEmpty() ? null : fStyleMap.get(styleQueue.pop()); <END> } return null; }</code><technical_language>I think, if a list A,B (invalid) parent of B exist (get() returns null) continue searching in A? "pop next style" extracted in a method takes stack current style/parentKey reused in other methods below</technical_language>

Target:
public @Nullable Object getStyle(OutputElementStyle elementStyle, String property) { OutputElementStyle style = elementStyle; Stack<String> styleQueue = new Stack<>(); while (style != null) { Map<String, Object> styleValues = style.getStyleValues(); Object value = styleValues.get(property); if (value != null) { return value; } style = popNextStyle(style, styleQueue); } return null; }
Source:
<code>public ResponseWrapper<VacationOverviewResponse> getHolidayOverview( @RequestParam("selectedDepartment") String selectedDepartment, @RequestParam("selectedYear") Integer selectedYear, @RequestParam("selectedMonth") Integer selectedMonth) { List<VacationOverview> holidayOverviewList = <START> vacationOverviewService.getVacationOverviews(selectedDepartment, selectedYear, selectedMonth); <END> for (VacationOverview v: holidayOverviewList){ v.setAbsences( absenceController.personsVacations(selectedYear, selectedMonth, v.getPersonID(), null).getResponse().getAbsences() ); } return new ResponseWrapper<>(new VacationOverviewResponse(holidayOverviewList)); }</code><technical_language>extend VacationOverviewService#getVacationOverviews return richer VacationOverviews? Or, if need be, introduce a proper service facade</technical_language>

Target:
public ResponseWrapper<VacationOverviewResponse> getHolidayOverview( @RequestParam("selectedDepartment") String selectedDepartment, @RequestParam("selectedYear") Integer selectedYear, @RequestParam("selectedMonth") Integer selectedMonth) { List<VacationOverview> holidayOverviewList = vacationOverviewService.getVacationOverviews(selectedDepartment, Optional.of(selectedYear), Optional.of(selectedMonth)); return new ResponseWrapper<>(new VacationOverviewResponse(holidayOverviewList)); }
Source:
<code>public CascadeExtractionFn( <START> @JsonProperty("extractionFns") ExtractionFn[] extractionFn) { <END> Preconditions.checkArgument(extractionFn != null, "extractionFns should not be null"); this.extractionFns = extractionFn; ChainedExtractionFn root = null; for (int idx = 0; idx < extractionFns.length; idx++) { if (extractionFns[idx] != null) { root = new ChainedExtractionFn(extractionFns[idx], root); } } this.chainedExtractionFn = root; }</code><technical_language>function parentheses/braces styling</technical_language>

Target:
public CascadeExtractionFn( @JsonProperty("extractionFns") ExtractionFn[] extractionFn ) { Preconditions.checkArgument(extractionFn != null, "extractionFns should not be null"); this.extractionFns = extractionFn; if (extractionFns.length == 0) { this.chainedExtractionFn = DEFAULT_CHAINED_EXTRACTION_FN; } else { ChainedExtractionFn root = null; for (int idx = 0; idx < extractionFns.length; idx++) { Preconditions.checkArgument(extractionFns[idx] != null, "empty function is not allowed"); root = new ChainedExtractionFn(extractionFns[idx], root); } this.chainedExtractionFn = root; } }
Source:
<code>protected Void doInBackground(Bundle... p1) { sourceFiles = p1[0].getParcelableArrayList(TAG_COPY_SOURCES); totalSize = FileUtils.getTotalBytes(sourceFiles, c); totalSourceFiles = sourceFiles.size(); progressHandler.setSourceSize(totalSourceFiles); progressHandler.setTotalSize(totalSize); progressHandler.setProgressListener((speed) -> publishResults(speed, false, move)); watcherUtil = new ServiceWatcherUtil(progressHandler); try { addFirstDatapoint(sourceFiles.get(0).getName(), sourceFiles.size(), totalSize, move); <START> } catch (IllegalStateException e) { <END> e.printStackTrace(); return null; } targetPath = p1[0].getString(TAG_COPY_TARGET); move = p1[0].getBoolean(TAG_COPY_MOVE); openMode = OpenMode.getOpenMode(p1[0].getInt(TAG_COPY_OPEN_MODE)); copy = new Copy(); copy.execute(sourceFiles, targetPath, move, openMode); if (copy.failedFOps.size() == 0) { for (HybridFileParcelable sourceFile : sourceFiles) { try { findAndReplaceEncryptedEntry(sourceFile); } catch (Exception e) { Toast.makeText(c, getString(R.string.encryption_fail_copy), Toast.LENGTH_SHORT).show(); } } } return null; }</code><technical_language>This Exception catched, thrown. underlying bug fixed</technical_language>

Target:
protected Void doInBackground(Bundle... p1) { sourceFiles = p1[0].getParcelableArrayList(TAG_COPY_SOURCES); totalSize = FileUtils.getTotalBytes(sourceFiles, c); totalSourceFiles = sourceFiles.size(); progressHandler.setSourceSize(totalSourceFiles); progressHandler.setTotalSize(totalSize); progressHandler.setProgressListener((speed) -> publishResults(speed, false, move)); watcherUtil = new ServiceWatcherUtil(progressHandler); addFirstDatapoint(sourceFiles.get(0).getName(), sourceFiles.size(), totalSize, move); targetPath = p1[0].getString(TAG_COPY_TARGET); move = p1[0].getBoolean(TAG_COPY_MOVE); openMode = OpenMode.getOpenMode(p1[0].getInt(TAG_COPY_OPEN_MODE)); copy = new Copy(); copy.execute(sourceFiles, targetPath, move, openMode); if (copy.failedFOps.size() == 0) { for (HybridFileParcelable sourceFile : sourceFiles) { try { findAndReplaceEncryptedEntry(sourceFile); } catch (Exception e) { Toast.makeText(c, getString(R.string.encryption_fail_copy), Toast.LENGTH_SHORT).show(); } } } return null; }
Source:
<code>public PrefilledCardHolderDetails getPrefilledCardHolderDetails() { <START> return prefilledCardHolderDetails; <END> }</code><technical_language>Do need Optional<> pattern ? easy Optional updating database is</technical_language>

Target:
public Optional<PrefilledCardHolderDetails> getPrefilledCardHolderDetails() { return Optional.ofNullable(prefilledCardHolderDetails); }
Source:
<code><START> public MessageContent(byte[] content, <END> ContentType contentType, Optional<CompiledSchema<Schema>> schema) { this.data = content; this.contentType = contentType; this.schema = schema; }</code><technical_language>I guess private if opt for builder pattern. present builder is useless, especially enforce schema is null. default Optional.empty() - other hand, do work in constructor</technical_language>

Target:
private MessageContent(byte[] content, ContentType contentType, Optional<CompiledSchema<Schema>> schema) { this.content = content; this.contentType = contentType; this.schema = schema; }
Source:
<code>public void testCreate() throws Exception { when(entityRef.fetchEntity()).thenReturn(entity); when(connection.getEntityRef(eq(EhcacheClientEntity.class), anyInt(), anyString())).thenReturn(entityRef); addMockUnlockedLock(connection, "VoltronReadWriteLock-EhcacheClientEntityFactory-AccessLock-test"); EhcacheClientEntityFactory factory = new EhcacheClientEntityFactory(connection); factory.create("test", null); <START> verify(entityRef).create(any(UUID.class)); <END> verify(entity).close(); }</code><technical_language>Wondering verify worked. create verfied any(ClusteredTierManagerConfiguration.class)</technical_language>

Target:
public void testCreate() throws Exception { when(entityRef.fetchEntity()).thenReturn(entity); when(connection.getEntityRef(eq(EhcacheClientEntity.class), anyInt(), anyString())).thenReturn(entityRef); addMockUnlockedLock(connection, "VoltronReadWriteLock-EhcacheClientEntityFactory-AccessLock-test"); EhcacheClientEntityFactory factory = new EhcacheClientEntityFactory(connection); factory.create("test", null); verify(entityRef).create(isA(ClusteredTierManagerConfiguration.class)); verify(entity).close(); }
Source:
<code>public QueryStats() { this.createTime = null; this.executionStartTime = null; this.lastHeartbeat = null; this.endTime = null; this.elapsedTime = null; this.queuedTime = null; <START> this.waitingTime = null; <END> this.analysisTime = null; this.distributedPlanningTime = null; this.totalPlanningTime = null; this.finishingTime = null; this.totalTasks = 0; this.runningTasks = 0; this.blockedDrivers = 0; this.completedTasks = 0; this.totalDrivers = 0; this.queuedDrivers = 0; this.runningDrivers = 0; this.completedDrivers = 0; this.cumulativeUserMemory = 0.0; this.userMemoryReservation = null; this.totalMemoryReservation = null; this.peakUserMemoryReservation = null; this.peakTotalMemoryReservation = null; this.peakTaskTotalMemory = null; this.scheduled = false; this.totalScheduledTime = null; this.totalCpuTime = null; this.totalUserTime = null; this.totalBlockedTime = null; this.fullyBlocked = false; this.blockedReasons = ImmutableSet.of(); this.rawInputDataSize = null; this.rawInputPositions = 0; this.processedInputDataSize = null; this.processedInputPositions = 0; this.outputDataSize = null; this.outputPositions = 0; this.physicalWrittenDataSize = null; this.stageGcStatistics = null; this.operatorSummaries = null; }</code><technical_language>for "waiting" items, I need add "resource" people ask "why I waiting I queued"</technical_language>

Target:
public QueryStats() { this.createTime = null; this.executionStartTime = null; this.lastHeartbeat = null; this.endTime = null; this.elapsedTime = null; this.queuedTime = null; this.resourceWaitingTime = null; this.analysisTime = null; this.distributedPlanningTime = null; this.totalPlanningTime = null; this.finishingTime = null; this.totalTasks = 0; this.runningTasks = 0; this.blockedDrivers = 0; this.completedTasks = 0; this.totalDrivers = 0; this.queuedDrivers = 0; this.runningDrivers = 0; this.completedDrivers = 0; this.cumulativeUserMemory = 0.0; this.userMemoryReservation = null; this.totalMemoryReservation = null; this.peakUserMemoryReservation = null; this.peakTotalMemoryReservation = null; this.peakTaskTotalMemory = null; this.scheduled = false; this.totalScheduledTime = null; this.totalCpuTime = null; this.totalUserTime = null; this.totalBlockedTime = null; this.fullyBlocked = false; this.blockedReasons = ImmutableSet.of(); this.rawInputDataSize = null; this.rawInputPositions = 0; this.processedInputDataSize = null; this.processedInputPositions = 0; this.outputDataSize = null; this.outputPositions = 0; this.physicalWrittenDataSize = null; this.stageGcStatistics = null; this.operatorSummaries = null; }
Source:
<code>public PostUploadNotifier(Post post, String title, String message) { mNotificationManager = (NotificationManager) SystemServiceFactory.get(mContext, Context.NOTIFICATION_SERVICE); <START> new Notification.Builder(getApplicationContext()); <END> mNotificationBuilder = new Notification.Builder(getApplicationContext()); mNotificationBuilder.setSmallIcon(android.R.drawable.stat_sys_upload); if (title != null) { mNotificationBuilder.setContentTitle(title); } if (message != null) { mNotificationBuilder.setContentText(message); } mNotificationId = (new Random()).nextInt() + post.getLocalTableBlogId(); startForeground(mNotificationId, mNotificationBuilder.build()); }</code><technical_language>Leftover code</technical_language>

Target:
public PostUploadNotifier(Post post, String title, String message) { mNotificationManager = (NotificationManager) SystemServiceFactory.get(mContext, Context.NOTIFICATION_SERVICE); mNotificationBuilder = new Notification.Builder(getApplicationContext()); mNotificationBuilder.setSmallIcon(android.R.drawable.stat_sys_upload); if (title != null) { mNotificationBuilder.setContentTitle(title); } if (message != null) { mNotificationBuilder.setContentText(message); } mNotificationId = (new Random()).nextInt() + post.getLocalTableBlogId(); startForeground(mNotificationId, mNotificationBuilder.build()); }
Source:
<code><START> public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { <END> if (bean instanceof IntegrationEvaluationContextAware) { StandardEvaluationContext evaluationContext = IntegrationContextUtils.getEvaluationContext(beanFactory); if (bean instanceof IntegrationObjectSupport) { ConversionService conversionService = ((IntegrationObjectSupport) bean).getConversionService(); if (conversionService != null) { evaluationContext.setTypeConverter(new StandardTypeConverter(conversionService)); } } ((IntegrationEvaluationContextAware) bean).setIntegrationEvaluationContext(evaluationContext); } return bean; }</code><technical_language>is a reason this is done _before_ initialization? curious, changes still... affects bean's conversionService</technical_language>

Target:
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof IntegrationEvaluationContextAware) { StandardEvaluationContext evaluationContext = IntegrationContextUtils.getEvaluationContext(this.beanFactory); ((IntegrationEvaluationContextAware) bean).setIntegrationEvaluationContext(evaluationContext); } return bean; }
Source:
<code>public User create(User newUser, boolean isTemporary) throws ConflictException, ServerException { requireNonNull(newUser, "Required non-null user"); final UserImpl user = new UserImpl(generate("user", ID_LENGTH), newUser.getEmail(), newUser.getName(), firstNonNull(newUser.getPassword(), generate("", PASSWORD_LENGTH)), newUser.getAliases()); try { userDao.create(user); profileManager.create(new ProfileImpl(user.getId(), newUser.getEmail())); preferencesManager.save(user.getId(), ImmutableMap.of("temporary", Boolean.toString(isTemporary), <START> "codenvy:created", Long.toString(currentTimeMillis()))); <END> } catch (ConflictException | ServerException x) { try { userDao.remove(user.getId()); profileManager.remove(user.getId()); preferencesManager.remove(user.getId()); } catch (ConflictException | ServerException rollbackEx) { LOG.error(format("An attempt to clean up resources due to user creation failure was unsuccessful." + "Now the system may be in inconsistent state. " + "User with id '%s' must not exist", user.getId()), rollbackEx); } throw x; } return user; }</code><technical_language>"codenvy"</technical_language>

Target:
public User create(User newUser, boolean isTemporary) throws ConflictException, ServerException { requireNonNull(newUser, "Required non-null user"); if (reservedNames.contains(newUser.getName().toLowerCase())) { throw new ConflictException(String.format("Username '%s' is reserved", newUser.getName())); } final UserImpl user = new UserImpl(generate("user", ID_LENGTH), newUser.getEmail(), newUser.getName(), firstNonNull(newUser.getPassword(), generate("", PASSWORD_LENGTH)), newUser.getAliases()); try { userDao.create(user); profileDao.create(new ProfileImpl(user.getId())); preferencesDao.setPreferences(user.getId(), ImmutableMap.of("temporary", Boolean.toString(isTemporary), "codenvy:created", Long.toString(currentTimeMillis()))); } catch (ConflictException | ServerException x) { try { userDao.remove(user.getId()); profileDao.remove(user.getId()); preferencesDao.remove(user.getId()); } catch (ConflictException | ServerException rollbackEx) { LOG.error(format("An attempt to clean up resources due to user creation failure was unsuccessful." + "Now the system may be in inconsistent state. " + "User with id '%s' must not exist", user.getId()), rollbackEx); } throw x; } return user; }
Source:
<code>private JEditorPane createDataCloudInformationText() { final DCHtmlBox editorPane = new DCHtmlBox(""); editorPane.setSize(500 - 30, Integer.MAX_VALUE); editorPane.setText( "<html>HI! Thank you for using DataCleaner." + " Are you aware that there are many cool features available online?" + " Just register on our <a href=\"<LINK_0>\">website</a> and you can immediately use" + " them to improve your data quality." + " (You will get free credits to spend.)" + "<p>Enter your credentials to:" + "<ul style=\"list-style-type:none\">" + " <li>\u2022 Validate your contacts addresses/emails." + " <li>\u2022 Parse names, phones, emails." + " <li>\u2022 Ensure you have recent addresses of your contacts." + "</ul>" + "<b>Your <a href=\"<LINK_0>\">datacleaner.org</a> credentials:</b>"); <START> editorPane.setEditable(false); <END> editorPane.setOpaque(false); return editorPane; }</code><technical_language>Minor remark: DCHtmlBox is editable default this is needed</technical_language>

Target:
private JEditorPane createDataCloudInformationText() { final DCHtmlBox editorPane = new DCHtmlBox(""); editorPane.setSize(500 - 30, Integer.MAX_VALUE); editorPane.setText( "<html>HI! Thank you for using DataCleaner." + " Are you aware that there are many cool features available online?" + " Just register on our <a href=\"<LINK_0>\">website</a> and you can immediately use" + " them to improve your data quality." + " (You will get free credits to spend.)" + "<p>Enter your credentials to:" + "<ul style=\"list-style-type:none\">" + " <li>\u2022 Validate your contacts addresses/emails." + " <li>\u2022 Parse names, phones, emails." + " <li>\u2022 Ensure you have recent addresses of your contacts." + "</ul>" + "<b>Your <a href=\"<LINK_0>\">datacleaner.org</a> credentials:</b>"); editorPane.setOpaque(false); return editorPane; }
Source:
<code><START> public static String quoteString(String s) { <END> if (s == null) { return null; } if (!s.matches("^\".*\"$")) { return "\"" + s + "\""; } else { return s; } }</code><technical_language>Package private enough for testing. package for tests</technical_language>

Target:
static String quoteString(String s) { if (s == null) { return null; } if (!s.matches("^\".*\"$")) { return "\"" + s + "\""; } else { return s; } }
Source:
<code><START> private static boolean isWindowsOS() { return System.getProperty("os.name").contains("Windows");} <END></code><technical_language>I return of System.getProperty("os.name") normalized using: private static String normalize(String value) { if (value == null) { return ""; } return value.toLowerCase(Locale.US).replaceAll("[^a-z0-9]+", ""); }</technical_language>

Target:
private static boolean isWindowsOS() { String osName = System.getProperty("os.name"); return normalize(osName).contains("windows"); }
Source:
<code>public void shouldReturnSameWhenCallingMapOnLeft() { final Either<Integer, Object> actual = Either.left(1); <START> assertThat(actual.map(Object::toString)).isSameAs(actual); <END> }</code><technical_language>is method reference important here? If not, throw exception, clear called :)</technical_language>

Target:
public void shouldReturnSameWhenCallingMapOnLeft() { final Either<Integer, Object> actual = Left(1); assertThat(actual.map(v -> { throw new IllegalStateException(); })).isSameAs(actual); }
Source:
<code>public Optional<Path> getMountPoint() { <START> return Optional.empty(); <END> }</code><technical_language>a specific drive letter for WebDAV? Hence, Custom drive letter chooser</technical_language>

Target:
public Optional<Path> getMountPoint() { return Optional.ofNullable(mountPoint); }
Source:
<code>@Override public JDK getJDK() { if (jdk == null) { return getOwner().getJDK(); } else { <START> return Jenkins.getInstance().getJDK(jdk); <END> } }</code><technical_language>This code return null. a fall-back default JDK</technical_language>

Target:
@Override public JDK getJDK() { if (jdkForPromotion == null || "UseOwner".equals(jdkForPromotion)) { return getOwner().getJDK(); } else { return Jenkins.getInstance().getJDK(jdkForPromotion); } }
Source:
<code>public void run() { HTInterval[] currentIntervals; try { currentIntervals = intervalQueue.take(); <START> while (currentIntervals.length != 1 && currentIntervals[0].getStartTime() != -1) { <END> for (HTInterval currentInterval : currentIntervals) { if (currentInterval != null) { getSHT().insertInterval(currentInterval); } } currentIntervals = intervalQueue.take(); } getSHT().closeTree(currentIntervals[0].getEndTime()); return; } catch (InterruptedException e) { Activator.getDefault().logError("State History Tree interrupted!", e); } catch (TimeRangeException e) { Activator.getDefault().logError("Error starting the state system", e); } }</code><technical_language>checks redundant, "poison pill" in a chunk, a start time of -1 (right?). of them</technical_language>

Target:
public void run() { Iterable<HTInterval> currentIntervals; try { boolean done = false; currentIntervals = intervalQueue.take(); while (!done) { for (HTInterval currentInterval : currentIntervals) { if (currentInterval.getAttribute() == -1) { done = true; break; } getSHT().insertInterval(currentInterval); } if (!done) { currentIntervals = intervalQueue.take(); } } for (HTInterval currentInterval : currentIntervals) { getSHT().closeTree(currentInterval.getEndTime()); return; } } catch (InterruptedException e) { Activator.getDefault().logError("State History Tree interrupted!", e); } catch (TimeRangeException e) { Activator.getDefault().logError("Error starting the state system", e); } }
Source:
<code>private static String getQuotaRegexString(SearchObjectAutoCompleter search) { String query = ".*" + search.getDefaultSort(SearchObjects.QUOTA_OBJ_NAME) + ".*" + search.getRelatedTableNameWithOutTags(SearchObjects.QUOTA_OBJ_NAME) + ".* "; <START> System.out.println("VdsGroupRegExp: " + query); <END> return query; }</code><technical_language>Please remove printing stdout</technical_language>

Target:
private static String getQuotaRegexString(SearchObjectAutoCompleter search) { String query = ".*" + search.getDefaultSort(SearchObjects.QUOTA_OBJ_NAME) + ".*" + search.getRelatedTableNameWithOutTags(SearchObjects.QUOTA_OBJ_NAME) + ".* "; return query; }
Source:
<code>protected VmNetworkInterface setNetwork(NIC device, VmNetworkInterface ni) { if (device.isSetNetwork()) { <START> if (device.getNetwork().getId() != null || device.getNetwork().getName() != null) { <END> Guid clusterId = getEntity(VmTemplate.class, VdcQueryType.GetVmTemplate, new GetVmTemplateParameters(parentId), "id").getvds_group_id(); Network net = lookupClusterNetwork(clusterId, device.getNetwork().isSetId() ? asGuid(device.getNetwork() .getId()) : null, device.getNetwork().getName()); if (net != null) { ni.setNetworkName(net.getname()); } } else { ni.setNetworkName(null); } } return ni; }</code><technical_language>isSetId() / isSetName()</technical_language>

Target:
protected VmNetworkInterface setNetwork(NIC device, VmNetworkInterface ni) { if (device.isSetNetwork()) { if (device.isSetId() || device.isSetName()) { Guid clusterId = getEntity(VmTemplate.class, VdcQueryType.GetVmTemplate, new GetVmTemplateParameters(parentId), "id").getvds_group_id(); Network net = lookupClusterNetwork(clusterId, device.getNetwork().isSetId() ? asGuid(device.getNetwork() .getId()) : null, device.getNetwork().getName()); if (net != null) { ni.setNetworkName(net.getname()); } } else { ni.setNetworkName(null); } } return ni; }
Source:
<code><START> public Survey save(Survey survey) { <END> SurveyDB surveyDB = SurveyDB.findById(survey.getId()); if (surveyDB == null) { OrgUnitDB orgUnitDB = null; if (survey.getOrganisationUnit() != null) { orgUnitDB = OrgUnitDB.findByUID(survey.getOrganisationUnit().getUid()); } UserDB userDB = null; if (survey.getUserAccount() != null) { userDB = UserDB.findByUID(survey.getUserAccount().getUserUid()); } surveyDB = new SurveyDB(orgUnitDB, ProgramDB.getProgram(survey.getProgram().getId()), userDB, survey.getType()); surveyDB.save(); } surveyDB.setStatus(survey.getStatus()); surveyDB.update(); survey.setId(surveyDB.getId_survey()); return survey; }</code><technical_language>this change is necessary, a save method return void, survey is a primitive type is passes a reference</technical_language>

Target:
public long save(Survey survey) { SurveyDB surveyDB = SurveyDB.findById(survey.getId()); if (surveyDB == null) { OrgUnitDB orgUnitDB = null; if (survey.getOrganisationUnit() != null) { orgUnitDB = OrgUnitDB.findByUID(survey.getOrganisationUnit().getUid()); } UserDB userDB = null; if (survey.getUserAccount() != null) { userDB = UserDB.findByUID(survey.getUserAccount().getUserUid()); } surveyDB = new SurveyDB(orgUnitDB, ProgramDB.getProgram(survey.getProgram().getId()), userDB, survey.getType()); surveyDB.save(); } surveyDB.setStatus(survey.getStatus()); surveyDB.update(); return surveyDB.getId_survey(); }
Source:
<code>public Optional<ConnectorId> getCatalogHandle(Session session, String catalogName) { <START> return Optional.of(catalogHandle); <END> }</code><technical_language>check if catalog name matches name in handle return empty if not</technical_language>

Target:
public Optional<ConnectorId> getCatalogHandle(Session session, String catalogName) { if (catalogHandle.getCatalogName().equals(catalogName)) { return Optional.of(catalogHandle); } return Optional.empty(); }
Source:
<code>static PrivateKey loadPrivateKey(String keyPath) throws IOException, GeneralSecurityException { try (Reader reader = new FileReader(keyPath); PEMParser parser = new PEMParser(reader)) { Object readObject = parser.readObject(); if (readObject instanceof PEMKeyPair) { PEMKeyPair keyPair = (PEMKeyPair) readObject; return generatePrivateKey(keyPair.getPrivateKeyInfo()); } else if (readObject instanceof PrivateKeyInfo) { return generatePrivateKey((PrivateKeyInfo) readObject); } } <START> return null; <END> }</code><technical_language>I throw exception in case, a private key is mandatory for processing. stop issue of error context (i.e. read object type is wrong)</technical_language>

Target:
static PrivateKey loadPrivateKey(String keyPath) throws IOException, GeneralSecurityException { try (Reader reader = new FileReader(keyPath); PEMParser parser = new PEMParser(reader)) { Object readObject = parser.readObject(); if (readObject instanceof PEMKeyPair) { PEMKeyPair keyPair = (PEMKeyPair) readObject; return generatePrivateKey(keyPair.getPrivateKeyInfo()); } else if (readObject instanceof PrivateKeyInfo) { return generatePrivateKey((PrivateKeyInfo) readObject); } } throw new GeneralSecurityException("Cannot generate private key from file: " + keyPath); }
Source:
<code>public ValueAndTimestamp<R> get(final K key) { R newValue = null; final V1 value1 = getValueOrNull(valueGetter1.get(key)); final V2 value2 = getValueOrNull(valueGetter2.get(key)); if (value1 != null || value2 != null) { newValue = joiner.apply(value1, value2); } <START> return ValueAndTimestamp.make(newValue, -1L); <END> }</code><technical_language>Interesting. is this other joins, getter timestamps compute max</technical_language>

Target:
public ValueAndTimestamp<R> get(final K key) { R newValue = null; final ValueAndTimestamp<V1> valueAndTimestamp1 = valueGetter1.get(key); final V1 value1; final long timestamp1; if (valueAndTimestamp1 == null) { value1 = null; timestamp1 = UNKNOWN; } else { value1 = valueAndTimestamp1.value(); timestamp1 = valueAndTimestamp1.timestamp(); } final ValueAndTimestamp<V2> valueAndTimestamp2 = valueGetter2.get(key); final V2 value2; final long timestamp2; if (valueAndTimestamp2 == null) { value2 = null; timestamp2 = UNKNOWN; } else { value2 = valueAndTimestamp2.value(); timestamp2 = valueAndTimestamp2.timestamp(); } if (value1 != null || value2 != null) { newValue = joiner.apply(value1, value2); } return ValueAndTimestamp.make(newValue, Math.max(timestamp1, timestamp2)); }
Source:
<code>public void receiveSignature(PacketLineIn pckIn) throws IOException { try { StringBuilder sig = new StringBuilder(); String line = pckIn.readStringRaw(); while (!line.equals("-----END PGP SIGNATURE-----\n")) sig.append(line); signature = sig.toString(); commandList = commandlistBuilder.toString(); } catch (EOFException eof) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "broken push certificate signature")); } <START> writePushCertificate(); <END> verifySignedPushCommands(signature); }</code><technical_language>Drop this call. calling application verify write object for now</technical_language>

Target:
public void receiveSignature(PacketLineIn pckIn) throws IOException { try { StringBuilder sig = new StringBuilder(); String line = pckIn.readStringRaw(); while (!line.equals("-----END PGP SIGNATURE-----\n")) sig.append(line); signature = sig.toString(); commandList = commandlistBuilder.toString(); } catch (EOFException eof) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "broken push certificate signature")); } }
Source:
<code>@Test public void conditionalHitUpdatesCache() throws Exception { server.enqueue(new MockResponse() .addHeader("Last-Modified: " + formatDate(0, TimeUnit.SECONDS)) .addHeader("Cache-Control: max-age=0") .setBody("A")); server.enqueue(new MockResponse() .addHeader("Cache-Control: max-age=30") .addHeader("Allow: GET, HEAD") .setResponseCode(HttpURLConnection.HTTP_NOT_MODIFIED)); server.enqueue(new MockResponse() .setBody("B")); long t0 = System.currentTimeMillis(); Response response1 = get(server.url("/a")); assertThat(response1.body().string()).isEqualTo("A"); assertThat(response1.header("Allow")).isNull(); assertThat((double) (response1.receivedResponseAtMillis() - t0)).isCloseTo( (double) 0, offset(250.0)); Thread.sleep(500); long t1 = System.currentTimeMillis(); Response response2 = get(server.url("/a")); assertThat(response2.code()).isEqualTo(HttpURLConnection.HTTP_OK); assertThat(response2.body().string()).isEqualTo("A"); assertThat(response2.header("Allow")).isEqualTo("GET, HEAD"); Long originalTimestamp = response2.receivedResponseAtMillis(); assertThat((double) (originalTimestamp - t1)).isCloseTo( (double) 0, offset(250.0)); <START> Thread.sleep(500); <END> Response response3 = get(server.url("/a")); assertThat(response3.body().string()).isEqualTo("A"); assertThat(response3.header("Allow")).isEqualTo("GET, HEAD"); assertThat(response3.receivedResponseAtMillis()).isEqualTo(originalTimestamp); assertThat(server.getRequestCount()).isEqualTo(2); }</code><technical_language>drop this 10? rename originalTimestamp updateTimestamp</technical_language>

Target:
@Test public void conditionalHitUpdatesCache() throws Exception { server.enqueue(new MockResponse() .addHeader("Last-Modified: " + formatDate(0, TimeUnit.SECONDS)) .addHeader("Cache-Control: max-age=0") .setBody("A")); server.enqueue(new MockResponse() .addHeader("Cache-Control: max-age=30") .addHeader("Allow: GET, HEAD") .setResponseCode(HttpURLConnection.HTTP_NOT_MODIFIED)); server.enqueue(new MockResponse() .setBody("B")); long t0 = System.currentTimeMillis(); Response response1 = get(server.url("/a")); assertThat(response1.body().string()).isEqualTo("A"); assertThat(response1.header("Allow")).isNull(); assertThat((double) (response1.receivedResponseAtMillis() - t0)).isCloseTo( (double) 0, offset(250.0)); Thread.sleep(500); long t1 = System.currentTimeMillis(); Response response2 = get(server.url("/a")); assertThat(response2.code()).isEqualTo(HttpURLConnection.HTTP_OK); assertThat(response2.body().string()).isEqualTo("A"); assertThat(response2.header("Allow")).isEqualTo("GET, HEAD"); Long updatedTimestamp = response2.receivedResponseAtMillis(); assertThat((double) (updatedTimestamp - t1)).isCloseTo( (double) 0, offset(250.0)); Thread.sleep(10); Response response3 = get(server.url("/a")); assertThat(response3.body().string()).isEqualTo("A"); assertThat(response3.header("Allow")).isEqualTo("GET, HEAD"); assertThat(response3.receivedResponseAtMillis()).isEqualTo(updatedTimestamp); assertThat(server.getRequestCount()).isEqualTo(2); }
Source:
<code>void execute(final RequestHandler.Callback callback, final Statement statement) { <START> if (cluster.isClosed()) { <END> throw new IllegalStateException("Parent cluster is closed. This session is no longer valid."); } if (isInit) new RequestHandler(this, callback, statement).sendRequest(); else this.initAsync() .addListener( new Runnable() { @Override public void run() { new RequestHandler(SessionManager.this, callback, statement).sendRequest(); } }, executor()); }</code><technical_language>Session is closed, check surface a specific error in case. error message "Could send request, <X> is closed." X is 'cluster' 'session'</technical_language>

Target:
void execute(final RequestHandler.Callback callback, final Statement statement) { if (this.isClosed()) { callback.onException( null, new IllegalStateException("Could not send request, session is closed"), 0, 0); return; } if (isInit) new RequestHandler(this, callback, statement).sendRequest(); else this.initAsync() .addListener( new Runnable() { @Override public void run() { new RequestHandler(SessionManager.this, callback, statement).sendRequest(); } }, executor()); }
Source:
<code>public Response addAll( InputStream in, @Context final HttpServletRequest req ) { final String reqContentType = req.getContentType(); final boolean isSmile = SmileMediaTypes.APPLICATION_JACKSON_SMILE.equals(reqContentType); final String contentType = isSmile ? SmileMediaTypes.APPLICATION_JACKSON_SMILE : MediaType.APPLICATION_JSON; ObjectMapper objectMapper = isSmile ? smileMapper : jsonMapper; Collection<Map<String, Object>> events = null; try { events = objectMapper.readValue( in, new TypeReference<Collection<Map<String, Object>>>() { } ); } catch (IOException e) { <START> Throwables.propagate(e); <END> } log.debug("Adding %,d events to firehose: %s", events.size(), serviceName); final List<InputRow> rows = Lists.newArrayList(); for (final Map<String, Object> event : events) { rows.add(parser.parse(event)); } try { for (final InputRow row : rows) { boolean added = false; while (!closed && !added) { added = buffer.offer(row, 500, TimeUnit.MILLISECONDS); } if (!added) { throw new IllegalStateException("Cannot add events to closed firehose!"); } } return Response.ok( objectMapper.writeValueAsString(ImmutableMap.of("eventCount", events.size())), contentType ).build(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw Throwables.propagate(e); } catch (JsonProcessingException e) { throw Throwables.propagate(e); } }</code><technical_language>wrap this? log locally return message in a map of "error"->e.getMessage</technical_language>

Target:
public Response addAll( InputStream in, @Context final HttpServletRequest req ) { final String reqContentType = req.getContentType(); final boolean isSmile = SmileMediaTypes.APPLICATION_JACKSON_SMILE.equals(reqContentType); final String contentType = isSmile ? SmileMediaTypes.APPLICATION_JACKSON_SMILE : MediaType.APPLICATION_JSON; ObjectMapper objectMapper = isSmile ? smileMapper : jsonMapper; Collection<Map<String, Object>> events = null; try { events = objectMapper.readValue( in, new TypeReference<Collection<Map<String, Object>>>() { } ); } catch (IOException e) { return Response.serverError().entity(ImmutableMap.<String, Object>of("error", e.getMessage())).build(); } log.debug("Adding %,d events to firehose: %s", events.size(), serviceName); final List<InputRow> rows = Lists.newArrayList(); for (final Map<String, Object> event : events) { rows.add(parser.parse(event)); } try { for (final InputRow row : rows) { boolean added = false; while (!closed && !added) { added = buffer.offer(row, 500, TimeUnit.MILLISECONDS); } if (!added) { throw new IllegalStateException("Cannot add events to closed firehose!"); } } return Response.ok( objectMapper.writeValueAsString(ImmutableMap.of("eventCount", events.size())), contentType ).build(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw Throwables.propagate(e); } catch (JsonProcessingException e) { throw Throwables.propagate(e); } }
Source:
<code>public ParseOperator(final T2 to, OperatorBase.IFunction operator) { super("parse_" + L10NHelpers.localize(to.getTranslationKey()) <START> , "parse_" + to.getTranslationKey() <END> , constructInputVariables(1, ValueTypes.STRING) , to , new IFunction() { @Override public IValue evaluate(SafeVariablesGetter variables) throws EvaluationException { return operator.evaluate(variables); } }, IConfigRenderPattern.PREFIX_1); this.to = to; }</code><technical_language>convention in this codebase is place commas end of line</technical_language>

Target:
public ParseOperator(final T2 to, OperatorBase.IFunction operator) { super("parse_" + L10NHelpers.localize(to.getTranslationKey()), "parse_" + to.getTranslationKey(), constructInputVariables(1, ValueTypes.STRING), to, operator, IConfigRenderPattern.PREFIX_1_LONG); this.to = to; }
Source:
<code>private void checkAndHandleIfChannelNotFound(final MbusChannelElementsResponseDto mbusChannelElementsResponseDto) throws FunctionalException { if (!mbusChannelElementsResponseDto.isChannelFound()) { <START> throw new FunctionalException(FunctionalExceptionType.NO_MBUS_DEVICE_CHANNEL_FOUND, <END> ComponentType.DOMAIN_SMART_METERING, new MBusChannelNotFoundException(this.buildErrorMessage(mbusChannelElementsResponseDto))); } }</code><technical_language>this exception explain mbus device gateway device</technical_language>

Target:
private void checkAndHandleIfChannelNotFound(final MbusChannelElementsResponseDto mbusChannelElementsResponseDto) throws FunctionalException { if (!mbusChannelElementsResponseDto.isChannelFound()) { throw new FunctionalException(FunctionalExceptionType.NO_MBUS_DEVICE_CHANNEL_FOUND, ComponentType.DOMAIN_SMART_METERING, new MBusChannelNotFoundException( String.valueOf(mbusChannelElementsResponseDto.getRetrievedChannelElements()))); } }
Source:
<code>public Iterable<Contents> listObjects(final String bucket, final String keyPrefix, final String nextMarker, final int maxKeys) throws IOException { <START> return new LazyObjectIterable(client, bucket, keyPrefix, nextMarker, maxKeys, 5); <END> }</code><technical_language>5? dont want this is called DefaultRetries something</technical_language>

Target:
public Iterable<Contents> listObjects(final String bucket, final String keyPrefix, final String nextMarker, final int maxKeys) throws IOException { return new LazyObjectIterable(client, bucket, keyPrefix, nextMarker, maxKeys, DEFAULT_LIST_OBJECTS_RETRIES); }
Source:
<code>public File getOutputFileToWrite(Obs obs) throws IOException { String t = obs.getComplexData().getTitle(); String extension = getExtension(t); String title = obs.getComplexData().getTitle(); File dir = OpenmrsUtil.getDirectoryInApplicationDataDirectory(Context.getAdministrationService().getGlobalProperty( OpenmrsConstants.GLOBAL_PROPERTY_COMPLEX_OBS_DIR)); File outputFile; if (null == title) { String now = longfmt.format(new Date()); outputFile = new File(dir, now); } else { title = title.replace("." + extension, ""); outputFile = new File(dir, title + "." + extension); } String tmp; if (outputFile.exists() || StringUtils.isNotBlank(obs.getComplexData().getMimeType())) { tmp = String.valueOf(outputFile.getAbsolutePath().replace("." + extension, "")); String mimetype = ""; if (StringUtils.isNotBlank(obs.getComplexData().getMimeType())) { mimetype = "_" + obs.getComplexData().getMimeType().replace("/", "-slash-"); } String twoDigitNumber = ""; if (new File(tmp + mimetype + "." + extension).exists()) { <START> for (int i = 1; obs.getObsId() == null && i < 100; i++) { <END> twoDigitNumber = "_" + nf.format(Integer.valueOf(i)); if (!new File(tmp + mimetype + twoDigitNumber + "." + extension).exists()) { break; } } } String filename = tmp + mimetype + twoDigitNumber; outputFile = new File(filename + "." + extension); } return outputFile; }</code><technical_language>Is this change mime type? is dealing else</technical_language>

Target:
public File getOutputFileToWrite(Obs obs) throws IOException { String t = obs.getComplexData().getTitle(); String extension = getExtension(t); String title = obs.getComplexData().getTitle(); File dir = OpenmrsUtil.getDirectoryInApplicationDataDirectory(Context.getAdministrationService().getGlobalProperty( OpenmrsConstants.GLOBAL_PROPERTY_COMPLEX_OBS_DIR)); File outputfile = null; if (null == title) { String now = longfmt.format(new Date()); outputfile = new File(dir, now); } else { title = title.replace("." + extension, ""); outputfile = new File(dir, title + "." + extension); } String mimetype = ""; if (StringUtils.isNotBlank(obs.getComplexData().getMimeType())) { mimetype = "_" + obs.getComplexData().getMimeType().replace("/", "-slash-"); outputfile = new File(dir, title + mimetype + "." + extension); } int i = 0; String tmp = null; while (obs.getObsId() == null && outputfile.exists() && i < 100) { tmp = null; tmp = String.valueOf(outputfile.getAbsolutePath().replace("." + extension, "")); outputfile = null; String filename = (i < 1) ? tmp + "_" + nf.format(Integer.valueOf(++i)) : tmp.replace(nf.format(Integer .valueOf(i)), nf.format(Integer.valueOf(++i))); outputfile = new File(filename + "." + extension); } return outputfile; }