auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<String> getMapping(Request request, Response response) throws RecipientRewriteTableException { final MappingSource mappingSource = mappingSourceFrom(request); return Optional.ofNullable(recipientRewriteTable.getAllMappings().get(mappingSource)) .filter(mappings -> !mappings.isEmpty()) .filter(mappings -> mappings.contains(Mapping.Type.Domain)) .map(this::toDomainList) .orElseThrow(() -> ErrorResponder.builder() .statusCode(HttpStatus.NOT_FOUND_404) .type(ErrorResponder.ErrorType.NOT_FOUND) .message(String.format("Cannot find mappings for %s", mappingSource.getFixedDomain())) .haltError()); }

Target:
public List<String> getMapping(Request request, Response response) throws RecipientRewriteTableException { MappingSource mappingSource = mappingSourceFrom(request); return Optional.ofNullable(recipientRewriteTable.getUserDomainMappings(mappingSource).select(Mapping.Type.Domain)) .filter(mappings -> !mappings.isEmpty()) .filter(mappings -> mappings.contains(Mapping.Type.Domain)) .map(this::toDomainList) .orElseThrow(() -> ErrorResponder.builder() .statusCode(HttpStatus.NOT_FOUND_404) .type(ErrorResponder.ErrorType.NOT_FOUND) .message(String.format("Cannot find mappings for %s", mappingSource.getFixedDomain())) .haltError()); }
Source:
public static void exportClientCertificates(String archivePath, ApiTypeWrapper apiTypeWrapper, int tenantId, APIProvider provider, ExportFormat exportFormat) throws APIImportExportException { List<ClientCertificateDTO> certificateMetadataDTOS; try { if (!apiTypeWrapper.isAPIProduct()) { certificateMetadataDTOS = provider.searchClientCertificates(tenantId, null, apiTypeWrapper.getApi().getId()); } else { certificateMetadataDTOS = provider.searchClientCertificates(tenantId, null, apiTypeWrapper.getApiProduct().getId()); } if (!certificateMetadataDTOS.isEmpty()) { CommonUtil.createDirectory(archivePath + File.separator + APIImportExportConstants.META_INFO_DIRECTORY); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String element = gson.toJson(certificateMetadataDTOS, new TypeToken<ArrayList<ClientCertificateDTO>>() { }.getType()); switch (exportFormat) { case YAML: String yaml = CommonUtil.jsonToYaml(element); CommonUtil.writeFile(archivePath + APIImportExportConstants.YAML_CLIENT_CERTIFICATE_FILE, yaml); break; case JSON: CommonUtil.writeFile(archivePath + APIImportExportConstants.JSON_CLIENT_CERTIFICATE_FILE, element); } } } catch (IOException e) { String errorMessage = "Error while retrieving saving as YAML"; log.error(errorMessage, e); throw new APIImportExportException(errorMessage, e); } catch (APIManagementException e) { String errorMsg = "Error retrieving certificate meta data. tenantId [" + tenantId + "] api [" + tenantId + "]"; throw new APIImportExportException(errorMsg, e); } }

Target:
public static void exportClientCertificates(String archivePath, ApiTypeWrapper apiTypeWrapper, int tenantId, APIProvider provider, ExportFormat exportFormat) throws APIImportExportException { List<ClientCertificateDTO> certificateMetadataDTOS; try { if (apiTypeWrapper.isAPIProduct()) { certificateMetadataDTOS = provider.searchClientCertificates(tenantId, null, apiTypeWrapper.getApiProduct().getId()); } else { certificateMetadataDTOS = provider.searchClientCertificates(tenantId, null, apiTypeWrapper.getApi().getId()); } if (certificateMetadataDTOS.isEmpty()) { return; } CommonUtil.createDirectory(archivePath + File.separator + APIImportExportConstants.META_INFO_DIRECTORY); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String element = gson.toJson(certificateMetadataDTOS, new TypeToken<ArrayList<ClientCertificateDTO>>() { }.getType()); switch (exportFormat) { case YAML: CommonUtil.writeFile(archivePath + APIImportExportConstants.YAML_CLIENT_CERTIFICATE_FILE, CommonUtil.jsonToYaml(element)); break; case JSON: CommonUtil.writeFile(archivePath + APIImportExportConstants.JSON_CLIENT_CERTIFICATE_FILE, element); } } catch (IOException e) { String errorMessage = "Error while retrieving saving as YAML"; throw new APIImportExportException(errorMessage, e); } catch (APIManagementException e) { String errorMsg = "Error retrieving certificate meta data. tenantId [" + tenantId + "] api [" + tenantId + "]"; throw new APIImportExportException(errorMsg, e); } }
Source:
public LiveData<Resource<TwitterFeed>> getPosts(String query, int count, String source) { Publisher<Resource<TwitterFeed>> publisher = TwitterApi.getLoklakAPI().getTwitterFeed(query, count, source) .map(Resource::success) .onErrorReturn(throwable -> { Timber.e(throwable); return Resource.error(throwable.getMessage(), null); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .toFlowable(BackpressureStrategy.BUFFER); feedLiveData = LiveDataReactiveStreams.fromPublisher(publisher); return feedLiveData; }

Target:
public LiveData<Resource<TwitterFeed>> getPosts(String query, int count, String source) { if (feedLiveData == null) { Publisher<Resource<TwitterFeed>> publisher = TwitterApi.getLoklakAPI().getTwitterFeed(query, count, source) .map(Resource::success) .onErrorReturn(throwable -> { Timber.e(throwable); return Resource.error(throwable.getMessage(), null); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .toFlowable(BackpressureStrategy.BUFFER); feedLiveData = LiveDataReactiveStreams.fromPublisher(publisher); } return feedLiveData; }
Source:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { HttpServletRequest filteredRequest = request; HttpServletResponse filteredResponse = response; String contentEncoding = request.getHeader(HttpHeaders.CONTENT_ENCODING); if (contentEncoding != null && contentEncoding.contains("gzip")) { filteredRequest = new GzipHttpServletRequestWrapper(request); } String acceptEncoding = request.getHeader(HttpHeaders.ACCEPT_ENCODING); if (acceptEncoding != null && acceptEncoding.contains("gzip")) { filteredResponse = new GzipHttpServletResponseWrapper(response); } filterChain.doFilter(filteredRequest, filteredResponse); if (filteredResponse instanceof GzipHttpServletResponseWrapper) { ((GzipHttpServletResponseWrapper) filteredResponse).finish(); } }

Target:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { HttpServletRequest filteredRequest = request; HttpServletResponse filteredResponse = response; if (isGzipEncoding(request.getHeader(HttpHeaders.CONTENT_ENCODING))) { filteredRequest = new GzipHttpServletRequestWrapper(request); } if (isGzipEncoding(request.getHeader(HttpHeaders.ACCEPT_ENCODING))) { filteredResponse = new GzipHttpServletResponseWrapper(response); } filterChain.doFilter(filteredRequest, filteredResponse); if (filteredResponse instanceof GzipHttpServletResponseWrapper) { ((GzipHttpServletResponseWrapper) filteredResponse).finish(); } }
Source:
public I2CBus getBus(final int busNumber, final long lockAquireTimeout, final TimeUnit lockAquireTimeoutUnit) throws UnsupportedBusNumberException, IOException { Integer number = Integer.valueOf(busNumber); if(!devices.containsKey(number)) { throw new UnsupportedBusNumberException(); } I2CBusImpl result = new I2CBusImpl(busNumber, devices.get(number), lockAquireTimeout, lockAquireTimeoutUnit); result.open(); return result; }

Target:
public I2CBus getBus(final int busNumber, final long lockAquireTimeout, final TimeUnit lockAquireTimeoutUnit) throws UnsupportedBusNumberException, IOException { final File sysfs = new File("/sys/bus/i2c/devices/i2c-" + busNumber); if (!sysfs.exists() || !sysfs.isDirectory()) { throw new UnsupportedBusNumberException(); } final File devfs = new File("/dev/i2c-" + busNumber); if (!devfs.exists() || !devfs.canRead() || !devfs.canWrite()) { throw new UnsupportedBusNumberException(); } I2CBusImpl result = new I2CBusImpl(busNumber, devfs.getCanonicalPath(), lockAquireTimeout, lockAquireTimeoutUnit); result.open(); return result; }
Source:
private IFileStore doUpdate(IProgressMonitor monitor) throws IOException { SubMonitor subMon = SubMonitor.convert(monitor, 100); try { IRemoteFileManager fileManager = fRemoteConnection.getRemoteServices().getFileManager(fRemoteConnection); IFileStore directory = fileManager.getResource(getWorkingDir()); synchronized (this) { directory.mkdir(EFS.NONE, subMon.newChild(10)); } if (checkAndUploadPayload(directory, subMon.newChild(30))) { if (!subMon.isCanceled()) { unpackPayload(directory, subMon.newChild(30)); } } return directory; } catch (CoreException e) { throw new IOException(e.getMessage()); } finally { if (monitor != null) { monitor.done(); } } }

Target:
private IFileStore doUpdate(IProgressMonitor monitor) throws IOException { SubMonitor subMon = SubMonitor.convert(monitor, 100); try { IRemoteFileManager fileManager = fRemoteConnection.getRemoteServices().getFileManager(fRemoteConnection); IFileStore directory = fileManager.getResource(getWorkingDir()); directory.mkdir(EFS.NONE, subMon.newChild(10)); if (checkAndUploadPayload(directory, subMon.newChild(30))) { if (!subMon.isCanceled()) { unpackPayload(directory, subMon.newChild(30)); } } return directory; } catch (CoreException e) { throw new IOException(e.getMessage()); } finally { if (monitor != null) { monitor.done(); } } }
Source:
public void init() throws Exception { fileName = getPath("InputXpathQueryGenerator.java"); final File file = new File(fileName); rootAst = TestUtils.parseFile(file); }

Target:
public void init() throws Exception { final File file = new File(getPath("InputXpathQueryGenerator.java")); fileText = new FileText(file, StandardCharsets.UTF_8.name()); rootAst = TestUtils.parseFile(file); }
Source:
public String getCellLinkHrefFromDataTable(int row, int column) { WebElement tableElement = browser.driver.findElements(By.className("table")).get(0); WebElement trElement = tableElement.findElements(By.tagName("tr")).get(row); WebElement tdElement = trElement.findElements(By.tagName("td")).get(column); return tdElement.findElement(By.tagName("a")).getAttribute("href"); }

Target:
public String getCellLinkHrefFromDataTable(int row, int column) { return getCellLinkHrefFromDataTable(0, row, column); }
Source:
private static boolean containsNonNullFilter(Map<Subfield, TupleDomainFilter> columnFilters) { return columnFilters != null && !columnFilters.entrySet().stream().map(Map.Entry::getValue).allMatch(filter -> filter.testNull()); }

Target:
private static boolean containsNonNullFilter(Map<Subfield, TupleDomainFilter> columnFilters) { return columnFilters != null && !columnFilters.values().stream().allMatch(TupleDomainFilter::testNull); }
Source:
public Tree createListControl(Composite parent) { Tree table = (Tree) getTreeControl(); if (table == null) { listParent = parent; treeViewer = doCreateTreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION); table = treeViewer.getTree(); table.setFont(parent.getFont()); treeViewer.setComparator(new ViewerComparator()); treeViewer.addCheckStateListener(this); } else { } return table; }

Target:
public Tree createListControl(Composite parent) { Tree table = (Tree) getTreeControl(); if (table == null) { listParent = parent; treeViewer = doCreateTreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION); table = treeViewer.getTree(); table.setFont(parent.getFont()); treeViewer.setComparator(new ViewerComparator()); treeViewer.addCheckStateListener(this); } return table; }
Source:
public void process( RowData element, RuntimeContext ctx, RequestIndexer indexer) { switch (element.getRowKind()) { case INSERT: case UPDATE_AFTER: processUpsert(element, indexer); break; case DELETE: processDelete(element, indexer); break; default: throw new TableException("Unsupported message kind: " + element.getRowKind()); } }

Target:
public void process( RowData element, RuntimeContext ctx, RequestIndexer indexer) { switch (element.getRowKind()) { case INSERT: case UPDATE_AFTER: processUpsert(element, indexer); break; case UPDATE_BEFORE: case DELETE: processDelete(element, indexer); break; default: throw new TableException("Unsupported message kind: " + element.getRowKind()); } }
Source:
private Map<Method, Method> toFallbackMethod(Map<Method, MethodHandler> dispatch) { Map<Method, Method> result = new HashMap<Method, Method>(); for (Map.Entry<Method, MethodHandler> entry : dispatch.entrySet()) { Method key = entry.getKey(); key.setAccessible(true); result.put(key, key); } return result; }

Target:
private Map<Method, Method> toFallbackMethod(Map<Method, MethodHandler> dispatch) { Map<Method, Method> result = new HashMap<Method, Method>(); for (Method method : dispatch.keySet()) { method.setAccessible(true); result.put(method, method); } return result; }
Source:
public void visitObjectLiteral(ObjectLiteralTree tree) { HashMap<String, Tree> keys = new HashMap<>(); for (Tree property : tree.properties()) { if (property.is(Tree.Kind.PAIR_PROPERTY)) { visitPairProperty(keys, (PairPropertyTree) property); } if (property.is(Kind.IDENTIFIER_REFERENCE)) { IdentifierTree identifier = (IdentifierTree) property; addKey(keys, identifier.name(), (IdentifierTree)property); } } super.visitObjectLiteral(tree); }

Target:
public void visitObjectLiteral(ObjectLiteralTree tree) { Map<String, Tree> keys = new HashMap<>(); for (Tree property : tree.properties()) { if (property.is(Tree.Kind.PAIR_PROPERTY)) { visitPairProperty(keys, (PairPropertyTree) property); } if (property.is(Kind.IDENTIFIER_REFERENCE)) { IdentifierTree identifier = (IdentifierTree) property; addKey(keys, identifier.name(), (IdentifierTree)property); } } super.visitObjectLiteral(tree); }
Source:
protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RAS_Node node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { Collection<WorkerSlot> topologyUsedSlots = oneWorkerPerExecutor ? node.getUsedSlots(td.getId()) : null; for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (topologyUsedSlots == null || !topologyUsedSlots.contains(ws)) { if (node.wouldFit(ws, exec, td)) { return ws; } } } } } return null; }

Target:
protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RAS_Node node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { Collection<WorkerSlot> topologyUsedSlots = oneExecutorPerWorker ? node.getUsedSlots(td.getId()) : Collections.emptySet(); for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (!topologyUsedSlots.contains(ws)) { if (node.wouldFit(ws, exec, td)) { return ws; } } } } } return null; }
Source:
public AmqpAnnotatedMessage(AmqpAnnotatedMessage message) { Objects.requireNonNull(message, "'message' cannot be null."); Objects.requireNonNull(message.getBody(), "'message.body' cannot be null."); AmqpBodyType bodyType = message.getBody().getBodyType(); switch (bodyType) { case DATA: amqpMessageBody = new AmqpDataBody((AmqpDataBody) message.getBody()); break; case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Body type not supported yet " + bodyType.toString())); default: logger.warning("Invalid body type {}.", bodyType); throw logger.logExceptionAsError(new IllegalStateException("Body type not valid " + bodyType.toString())); } applicationProperties = new HashMap<>(message.getApplicationProperties()); deliveryAnnotations = new HashMap<>(message.getDeliveryAnnotations()); messageAnnotations = new HashMap<>(message.getMessageAnnotations()); footer = new HashMap<>(message.getFooter()); header = new AmqpMessageHeader(message.getHeader()); properties = new AmqpMessageProperties(message.getProperties()); }

Target:
public AmqpAnnotatedMessage(AmqpAnnotatedMessage message) { Objects.requireNonNull(message, "'message' cannot be null."); Objects.requireNonNull(message.getBody(), "'message.body' cannot be null."); AmqpBodyType bodyType = message.getBody().getBodyType(); switch (bodyType) { case DATA: amqpMessageBody = new AmqpDataBody((AmqpDataBody) message.getBody()); break; case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Body type not supported yet " + bodyType.toString())); default: throw logger.logExceptionAsError(new IllegalStateException("Body type not valid " + bodyType.toString())); } applicationProperties = new HashMap<>(message.getApplicationProperties()); deliveryAnnotations = new HashMap<>(message.getDeliveryAnnotations()); messageAnnotations = new HashMap<>(message.getMessageAnnotations()); footer = new HashMap<>(message.getFooter()); header = new AmqpMessageHeader(message.getHeader()); properties = new AmqpMessageProperties(message.getProperties()); }
Source:
protected void onResume() { super.onResume(); if (userAuthenticationIsInvalid()) { startLoginActivity(true); Intent intent = getIntent(); if (intent.hasExtra(KEY_WIDGET_CLICK) && intent.getExtras() != null && intent.getExtras().getSerializable(KEY_WIDGET_CLICK) == NOTE_WIDGET_SIGN_IN_TAPPED) { AnalyticsTracker.track( NOTE_WIDGET_SIGN_IN_TAPPED, CATEGORY_WIDGET, "note_widget_sign_in_tapped" ); } } disableScreenshotsIfLocked(this); mNotesBucket.start(); mTagsBucket.start(); mNotesBucket.addOnNetworkChangeListener(this); mNotesBucket.addOnSaveObjectListener(this); mNotesBucket.addOnDeleteObjectListener(this); mTagsBucket.addListener(mTagsMenuUpdater); updateNavigationDrawerItems(); if (userIsUnauthorized()) { if (-1 == mTagsAdapter.getPosition(mSelectedTag)) { mSelectedTag = null; mDrawerList.setSelection(TagsAdapter.DEFAULT_ITEM_POSITION); } } setSelectedTagActive(); if (mCurrentNote != null && mShouldSelectNewNote) { onNoteSelected(mCurrentNote.getSimperiumKey(), 0, null, mCurrentNote.isMarkdownEnabled()); mShouldSelectNewNote = false; } if (mIsShowingMarkdown) { setMarkdownShowing(false); } }

Target:
protected void onResume() { super.onResume(); if (userAuthenticationIsInvalid()) { startLoginActivity(true); Intent intent = getIntent(); if (intent.hasExtra(KEY_WIDGET_CLICK) && intent.getExtras() != null && intent.getExtras().getSerializable(KEY_WIDGET_CLICK) == NOTE_WIDGET_SIGN_IN_TAPPED) { AnalyticsTracker.track( NOTE_WIDGET_SIGN_IN_TAPPED, CATEGORY_WIDGET, "note_widget_sign_in_tapped" ); } } disableScreenshotsIfLocked(this); mNotesBucket.start(); mTagsBucket.start(); mNotesBucket.addOnNetworkChangeListener(this); mNotesBucket.addOnSaveObjectListener(this); mNotesBucket.addOnDeleteObjectListener(this); mTagsBucket.addListener(mTagsMenuUpdater); updateNavigationDrawerItems(); if (userIsUnauthorized()) { if (-1 == mTagsAdapter.getPosition(mSelectedTag)) { mSelectedTag = null; mDrawerList.setSelection(TagsAdapter.DEFAULT_ITEM_POSITION); } } setSelectedTagActive(); if (mCurrentNote != null && mShouldSelectNewNote) { onNoteSelected(mCurrentNote.getSimperiumKey(), 0, null, mCurrentNote.isMarkdownEnabled()); mShouldSelectNewNote = false; } if (mIsShowingMarkdown) { setMarkdownShowing(false); } FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); if(DisplayUtils.isLargeScreenLandscape(this)) { if (mIsTabetFullscreen) { ft.hide(mNoteListFragment); } else { ft.show(mNoteListFragment); } } else { ft.show(mNoteListFragment); } ft.commitNow(); }
Source:
public List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws InternalErrorException, WrongAttributeAssignmentException { try { AttributeDefinition attributeDef = getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, attributeName); Attribute attribute = new Attribute(attributeDef); attribute.setValue(attributeValue); getPerunBl().getAttributesManagerBl().checkNamespace(sess, attribute, AttributesManager.NS_FACILITY_ATTR); if (!(getPerunBl().getAttributesManagerBl().isDefAttribute(sess, attribute) || getPerunBl().getAttributesManagerBl().isOptAttribute(sess, attribute))) throw new WrongAttributeAssignmentException("This method can process only def and opt attributes"); return getFacilitiesManagerImpl().getFacilitiesByAttribute(sess, attribute); } catch (AttributeNotExistsException e) { throw new ConsistencyErrorException("Attribute name:'" + attributeName + "', value:'" + attributeValue + "' not exists ", e); } }

Target:
public List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws InternalErrorException, WrongAttributeAssignmentException { try { AttributeDefinition attributeDef = getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, attributeName); if (Utils.isLargeAttribute(sess, attributeDef)) { throw new InternalErrorException("Attribute " + attributeName + " is large attribute, which is not supported."); } Attribute attribute = new Attribute(attributeDef); attribute.setValue(attributeValue); getPerunBl().getAttributesManagerBl().checkNamespace(sess, attribute, AttributesManager.NS_FACILITY_ATTR); if (!(getPerunBl().getAttributesManagerBl().isDefAttribute(sess, attribute) || getPerunBl().getAttributesManagerBl().isOptAttribute(sess, attribute))) throw new WrongAttributeAssignmentException("This method can process only def and opt attributes"); return getFacilitiesManagerImpl().getFacilitiesByAttribute(sess, attribute); } catch (AttributeNotExistsException e) { throw new ConsistencyErrorException("Attribute name:'" + attributeName + "', value:'" + attributeValue + "' not exists ", e); } }
Source:
public void testDisable() throws IOException { Admin admin = connection.getAdmin(); TableName tableName = IntegrationTests.TABLE_NAME; Table table = connection.getTable(TABLE_NAME); Get get = new Get("row".getBytes()); table.get(get); admin.disableTable(tableName); boolean throwsException = false; try { table.get(get); } catch (TableNotEnabledException e) { throwsException = true; } Assert.assertTrue(throwsException); admin.enableTable(tableName); table.get(get); }

Target:
public void testDisable() throws IOException { Admin admin = connection.getAdmin(); TableName tableName = TableName.valueOf("test_table-" + UUID.randomUUID().toString()); IntegrationTests.CreateTable(tableName); Table table = connection.getTable(tableName); Get get = new Get("row".getBytes()); table.get(get); admin.disableTable(tableName); boolean throwsException = false; try { table.get(get); } catch (TableNotEnabledException e) { throwsException = true; } Assert.assertTrue(throwsException); admin.enableTable(tableName); table.get(get); }
Source:
List<IRemoteTest> createIndividualTests(Set<TestInfo> testInfos, String configPath) { CLog.i("Creating individual tests for configuration: %s", configPath); List<IRemoteTest> tests = new ArrayList<>(); if (configPath == null) { throw new RuntimeException(String.format("Configuration path is null.")); } File configFie = new File(configPath); if (!configFie.exists()) { throw new RuntimeException( String.format("Configuration path: %s doesn't exits.", configPath)); } testInfos = dedupTestInfos(testInfos); for (TestInfo testInfo : testInfos) { super.cleanUpSuiteSetup(); super.clearModuleArgs(); super.clearConfigPaths(); super.addConfigPaths(configFie); parseOptions(testInfo); LinkedHashMap<String, IConfiguration> config = super.loadTests(); for (Map.Entry<String, IConfiguration> entry : config.entrySet()) { tests.addAll(entry.getValue().getTests()); } } return tests; }

Target:
List<IRemoteTest> createIndividualTests(Set<TestInfo> testInfos, String configPath) { CLog.i("Creating individual tests for configuration: %s", configPath); List<IRemoteTest> tests = new ArrayList<>(); assertNotNull(configPath); File configFie = new File(configPath); if (!configFie.exists()) { throw new RuntimeException( String.format("Configuration path: %s doesn't exits.", configPath)); } testInfos = dedupTestInfos(testInfos); for (TestInfo testInfo : testInfos) { super.cleanUpSuiteSetup(); super.clearModuleArgs(); super.clearConfigPaths(); super.addConfigPaths(configFie); parseOptions(testInfo); LinkedHashMap<String, IConfiguration> config = super.loadTests(); for (Map.Entry<String, IConfiguration> entry : config.entrySet()) { tests.addAll(entry.getValue().getTests()); } } return tests; }
Source:
static <T, R> WorkProcessor<R> transform(WorkProcessor<T> processor, Transformation<T, R> transformation) { return create(new WorkProcessor.Process<R>() { Optional<T> element = Optional.empty(); @Override public ProcessorState<R> process() { while (true) { if (!element.isPresent() && !processor.isFinished()) { if (processor.process()) { if (!processor.isFinished()) { element = Optional.of(processor.getResult()); } } else if (processor.isBlocked()) { return ProcessorState.blocked(processor.getBlockedFuture()); } else { return ProcessorState.yield(); } } ProcessorState<R> state = requireNonNull(transformation.process(element), "state is null"); if (state.needsMoreData) { checkState(!processor.isFinished(), "Cannot request more data when base processor is finished"); element = Optional.empty(); } if (state.type != ProcessorState.Type.NEEDS_MORE_DATA) { return state; } } } }); }

Target:
static <T, R> WorkProcessor<R> transform(WorkProcessor<T> processor, Transformation<T, R> transformation) { return create(new WorkProcessor.Process<R>() { Optional<T> element = Optional.empty(); @Override public ProcessorState<R> process() { while (true) { if (!element.isPresent() && !processor.isFinished()) { if (processor.process()) { if (!processor.isFinished()) { element = Optional.of(processor.getResult()); } } else if (processor.isBlocked()) { return ProcessorState.blocked(processor.getBlockedFuture()); } else { return ProcessorState.yield(); } } ProcessorState<R> state = requireNonNull(transformation.process(element), "state is null"); if (state.isNeedsMoreData()) { checkState(!processor.isFinished(), "Cannot request more data when base processor is finished"); element = Optional.empty(); } if (state.getType() != NEEDS_MORE_DATA) { return state; } } } }); }
Source:
public static void testGetAllActivitiesPaginated() throws MambuApiException{ String methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); ActivitiesService activitiesService = MambuAPIFactory.getActivitiesService(); Calendar toDate = Calendar.getInstance(); Calendar fromDate = Calendar.getInstance(); fromDate.add(Calendar.DAY_OF_MONTH, -10); List<JSONActivity> jsonActivities = activitiesService.getActivities(fromDate.getTime(), toDate.getTime(), null, null, 0, 5); printMambuEntityAndActivitiesDetails(null, null, jsonActivities, fromDate.getTime(), toDate.getTime()); }

Target:
public static void testGetAllActivitiesPaginated() throws MambuApiException{ String methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); ActivitiesService activitiesService = MambuAPIFactory.getActivitiesService(); Calendar toDate = Calendar.getInstance(); Calendar fromDate = Calendar.getInstance(); fromDate.add(Calendar.DAY_OF_MONTH, -10); List<JSONActivity> jsonActivities = activitiesService.getActivities(fromDate.getTime(), toDate.getTime(), 0, 5); printMambuEntityAndActivitiesDetails(null, null, jsonActivities, fromDate.getTime(), toDate.getTime()); }
Source:
public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents.isEmpty()) { setScopeAwareComponents(); } return scopeAwareComponents.stream(); }

Target:
public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents.isEmpty()) { lookupScopeAwareComponents(); } return scopeAwareComponents.stream(); }
Source:
public void insert(final List<ProcessedAccessRecord> batch) { transactionTemplate.execute(new TransactionCallback<Void>() { @Override public Void doInTransaction(TransactionStatus status) { template.batchUpdate(INSERT, new BatchPreparedStatementSetter() { @Override public int getBatchSize() { return batch.size(); } @Override public void setValues(PreparedStatement ps, int i) throws SQLException { ProcessedAccessRecord par = batch.get(i); ps.setString(1, par.getSessionId()); ps.setLong(2, par.getTimestamp()); if (par.getEntityId() != null) { ps.setLong(3, par.getEntityId()); ps.setLong(7, par.getEntityId()); } else { ps.setNull(3, Types.BIGINT); ps.setNull(7, Types.BIGINT); } ps.setString(4, par.getClient().name()); ps.setString(8, par.getClient().name()); if (par.getClientVersion() != null) { ps.setLong(5, par.getEntityId()); ps.setLong(9, par.getEntityId()); } else { ps.setNull(5, Types.CHAR); ps.setNull(9, Types.CHAR); } ps.setString(6, par.getNormalizedMethodSignature()); ps.setString(10, par.getNormalizedMethodSignature()); } }); return null; } }); }

Target:
public void insert(final List<ProcessedAccessRecord> batch) { transactionTemplate.execute(new TransactionCallback<Void>() { @Override public Void doInTransaction(TransactionStatus status) { template.batchUpdate(INSERT, new BatchPreparedStatementSetter() { @Override public int getBatchSize() { return batch.size(); } @Override public void setValues(PreparedStatement ps, int i) throws SQLException { ProcessedAccessRecord par = batch.get(i); ps.setString(INSERT_SESSION_ID_INDEX, par.getSessionId()); ps.setLong(INSERT_TIMESTAMP_INDEX, par.getTimestamp()); if (par.getEntityId() != null) { ps.setLong(INSERT_ENTITY_ID_INDEX, par.getEntityId()); ps.setLong(UPDATE_ENTITY_ID_INDEX, par.getEntityId()); } else { ps.setNull(INSERT_ENTITY_ID_INDEX, Types.BIGINT); ps.setNull(UPDATE_ENTITY_ID_INDEX, Types.BIGINT); } ps.setString(INSERT_CLIENT_INDEX, par.getClient().name()); ps.setString(UPDATE_CLIENT_INDEX, par.getClient().name()); if (par.getClientVersion() != null) { ps.setString(INSERT_CLIENT_VERSION_INDEX, par.getClientVersion()); ps.setString(UPDATE_CLIENT_VERSION_INDEX, par.getClientVersion()); } else { ps.setNull(INSERT_CLIENT_VERSION_INDEX, Types.CHAR); ps.setNull(UPDATE_CLIENT_VERSION_INDEX, Types.CHAR); } ps.setString(INSERT_NMS_INDEX, par.getNormalizedMethodSignature()); ps.setString(UPDATE_NMS_INDEX, par.getNormalizedMethodSignature()); } }); return null; } }); }
Source:
private boolean readAndHandle(InputStream inputStream, PodLogHandler handler) { if (inputStream == null) { LOG.debug( "Given InputStream for reading the logs for '{} {}' is null.", namespace, podName, containerName); return false; } try (BufferedReader in = new BufferedReader(new InputStreamReader(inputStream))) { String logMessage; while ((logMessage = in.readLine()) != null) { if (!this.isErrorMessage(logMessage)) { handler.handle(logMessage, containerName); } else { LOG.debug("error message [{}]", logMessage); LOG.debug( "failed to get the logs for [{} : {}], should try again if enough time.", podName, containerName); return false; } } } catch (IOException e) { LOG.debug( "End of watching log of [{} : : {}]. It could be either intended or some connection failure.", namespace, podName, containerName); LOG.trace("End of watching log of [{} : : {}]", namespace, podName, containerName, e); } return true; }

Target:
private boolean readAndHandle(InputStream inputStream, PodLogHandler handler) { try (BufferedReader in = new BufferedReader(new InputStreamReader(inputStream))) { String logMessage; while ((logMessage = in.readLine()) != null) { if (!this.isErrorMessage(logMessage)) { handler.handle(logMessage, containerName); } else { LOG.debug("error message [{}]", logMessage); LOG.debug( "failed to get the logs for [{} : {}], should try again if enough time.", podName, containerName); return false; } } } catch (IOException e) { LOG.debug( "End of watching log of [{} : : {}]. It could be either intended or some connection failure.", namespace, podName, containerName); LOG.trace("End of watching log of [{} : : {}]", namespace, podName, containerName, e); } return true; }
Source:
protected String findMimeType(String uploadFileName) { String mimeType = URLConnection.guessContentTypeFromName(uploadFileName); if (StringUtils.isEmpty(mimeType)) { LOG.error("findMimeType, could not determine mime type from file name using URLConnection object. the file name is " + uploadFileName); String[] splitFileName = StringUtils.split(uploadFileName, "."); if (splitFileName != null) { int lastArrayElement = splitFileName.length - 1; if (lastArrayElement > -1) { mimeType = splitFileName[lastArrayElement]; LOG.info("findMimeType, determined mime type from file name's last extension value: " + mimeType); } else { LOG.error("findMimeType, could not parse the file name, setting mime type to empty string"); mimeType = StringUtils.EMPTY; } } } return StringUtils.lowerCase(mimeType); }

Target:
protected String findMimeType(String uploadFileName) { if (StringUtils.isBlank(uploadFileName)) { return StringUtils.EMPTY; } String mimeType = URLConnection.guessContentTypeFromName(uploadFileName); if (StringUtils.isBlank(mimeType)) { LOG.error("findMimeType, could not determine mime type from file name using URLConnection object. the file name is " + uploadFileName); String[] splitFileName = StringUtils.split(uploadFileName, "."); if (splitFileName != null) { int lastArrayElementIndex = splitFileName.length - 1; if (lastArrayElementIndex > -1) { mimeType = splitFileName[lastArrayElementIndex]; LOG.info("findMimeType, determined mime type from file name's last extension value: " + mimeType); } else { LOG.error("findMimeType, could not parse the file name, setting mime type to empty string"); mimeType = StringUtils.EMPTY; } } } return StringUtils.lowerCase(mimeType); }
Source:
public DB allocateDB(final int expiryMinutes) { final String versionPostgreSQLDriver = System.getProperty("version.postgresql"); if (StringUtils.isEmpty(versionPostgreSQLDriver)) { throw new IllegalArgumentException("version.postgresql must not be empty"); } final String user = System.getProperty("pgsql.user"); if (StringUtils.isEmpty(user)) { throw new IllegalArgumentException("pgsql.user must not be empty"); } final String password = System.getProperty("pgsql.password"); if (StringUtils.isEmpty(password)) { throw new IllegalArgumentException("pgsql.password must not be empty"); } final String servername = System.getProperty("pgsql.servername"); if (StringUtils.isEmpty(servername)) { throw new IllegalArgumentException("pgsql.servername must not be empty"); } final String portnumber = System.getProperty("pgsql.portnumber"); final int port; if (StringUtils.isEmpty(portnumber)) { throw new IllegalArgumentException("pgsql.portnumber must not be empty"); } else { port = Integer.parseInt(portnumber); if (port > 65535 || port < 1025) { throw new IllegalArgumentException("pgsql.portnumber out of expected range [1025, 65535]"); } } final String databasename = System.getProperty("pgsql.databasename"); if (StringUtils.isEmpty(databasename)) { throw new IllegalArgumentException("pgsql.databasename must not be empty"); } return new DB.Builder() .dsType("org.postgresql.xa.PGXADataSource") .dsUsername(user) .dsUser(user) .dsPassword(password) .dsDbName(databasename) .dsDbPort(String.valueOf(port)) .dsDbHostname(servername) .dsUrl(String.format("jdbc:postgresql://%s:%d/%s", servername, port, databasename)) .dsLoginTimeout("0") .dsFactory("org.postgresql.xa.PGXADataSourceFactory") .tdsType("javax.sql.XADataSource") .dbDriverArtifact("postgresql:postgresql:" + versionPostgreSQLDriver) .build(); }

Target:
public DB allocateDB(final int expiryMinutes) { final String versionPostgreSQLDriver = getProp("version.postgresql"); final String user = getProp("pgsql.user"); final String password = getProp("pgsql.password"); final String servername = getProp("pgsql.servername"); final String portnumber = getProp("pgsql.portnumber"); final int port = Integer.parseInt(portnumber); if (port > 65535 || port < 1025) { throw new IllegalArgumentException("pgsql.portnumber out of expected range [1025, 65535]"); } final String databasename = getProp("pgsql.databasename"); return new DB.Builder() .dsType("org.postgresql.xa.PGXADataSource") .dsUsername(user) .dsUser(user) .dsPassword(password) .dsDbName(databasename) .dsDbPort(String.valueOf(port)) .dsDbHostname(servername) .dsUrl(String.format("jdbc:postgresql://%s:%d/%s", servername, port, databasename)) .dsLoginTimeout("0") .dsFactory("org.postgresql.xa.PGXADataSourceFactory") .tdsType("javax.sql.XADataSource") .dbDriverArtifact("postgresql:postgresql:" + versionPostgreSQLDriver) .build(); }
Source:
public List<SurveyedLocale> getDataPointList(Long surveyId, Long deviceId) { List<DataPointAssignment> assList = dataPointAssignmentDao.listByDeviceAndSurvey(deviceId, surveyId); if (assList.isEmpty()) { SurveyAssignmentDao saDao = new SurveyAssignmentDao(); List<SurveyAssignment> allAssigmentsToDevice = saDao.listAllContainingDevice(deviceId); List<SurveyAssignment> filteredAssignments = allAssigmentsToDevice.stream().filter(assignment -> assignment.getSurveyId().equals(surveyId)).collect(Collectors.toList()); if (filteredAssignments.isEmpty()) { return Collections.emptyList(); } return surveyedLocaleDao.listLocalesBySurveyGroupId(surveyId); } Set<Long> pointSet = new HashSet<>(); for (DataPointAssignment ass : assList) { pointSet.addAll(ass.getDataPointIds()); } if (ALL_DATAPOINTS.equals(pointSet)) { return surveyedLocaleDao.listLocalesBySurveyGroupId(surveyId); } List<Long> pointList = new ArrayList<>(pointSet); return surveyedLocaleDao.listByKeys(pointList); }

Target:
public List<SurveyedLocale> getDataPointList(Long surveyId, Long deviceId) { List<DataPointAssignment> assList = dataPointAssignmentDao.listByDeviceAndSurvey(deviceId, surveyId); if (assList.isEmpty()) { SurveyAssignmentDao saDao = new SurveyAssignmentDao(); List<SurveyAssignment> allAssigmentsToDevice = saDao.listAllContainingDevice(deviceId); List<SurveyAssignment> filteredAssignments = allAssigmentsToDevice.stream().filter(assignment -> assignment.getSurveyId().equals(surveyId)).collect(Collectors.toList()); if (filteredAssignments.isEmpty()) { log.log(Level.SEVERE, "No assignment found for surveyId: " + surveyId + " - deviceId: " + deviceId); return null; } return surveyedLocaleDao.listLocalesBySurveyGroupId(surveyId); } Set<Long> pointSet = new HashSet<>(); for (DataPointAssignment ass : assList) { pointSet.addAll(ass.getDataPointIds()); } if (ALL_DATAPOINTS.equals(pointSet)) { return surveyedLocaleDao.listLocalesBySurveyGroupId(surveyId); } List<Long> pointList = new ArrayList<>(pointSet); return surveyedLocaleDao.listByKeys(pointList); }
Source:
public String visit(SystemStreamPartition systemStreamPartition, StartpointTimestamp startpointTimestamp) { Preconditions.checkNotNull(startpointTimestamp, "Startpoint cannot be null"); Preconditions.checkNotNull(startpointTimestamp.getTimestampOffset(), "Timestamp field in startpoint cannot be null"); TopicPartition topicPartition = toTopicPartition(systemStreamPartition); Map<TopicPartition, Long> topicPartitionToTimestamp = ImmutableMap.of(topicPartition, startpointTimestamp.getTimestampOffset()); LOG.info("Finding offset for timestamp: in topic partition: {}.", startpointTimestamp.getTimestampOffset(), topicPartition); Map<TopicPartition, OffsetAndTimestamp> topicPartitionToOffsetTimestamps = threadSafeKafkaConsumer.execute(consumer -> consumer.offsetsForTimes(topicPartitionToTimestamp)); OffsetAndTimestamp offsetAndTimestamp = topicPartitionToOffsetTimestamps.get(topicPartition); if (offsetAndTimestamp != null) { return String.valueOf(offsetAndTimestamp.offset()); } else { return getEndOffset(systemStreamPartition); } }

Target:
public String visit(SystemStreamPartition systemStreamPartition, StartpointTimestamp startpointTimestamp) { Preconditions.checkNotNull(startpointTimestamp, "Startpoint cannot be null"); Preconditions.checkNotNull(startpointTimestamp.getTimestampOffset(), "Timestamp field in startpoint cannot be null"); TopicPartition topicPartition = toTopicPartition(systemStreamPartition); Map<TopicPartition, Long> topicPartitionToTimestamp = ImmutableMap.of(topicPartition, startpointTimestamp.getTimestampOffset()); LOG.info("Finding offset for timestamp: in topic partition: {}.", startpointTimestamp.getTimestampOffset(), topicPartition); Map<TopicPartition, OffsetAndTimestamp> topicPartitionToOffsetTimestamps = threadSafeKafkaConsumer.execute(consumer -> consumer.offsetsForTimes(topicPartitionToTimestamp)); OffsetAndTimestamp offsetAndTimestamp = topicPartitionToOffsetTimestamps.get(topicPartition); if (offsetAndTimestamp != null) { return String.valueOf(offsetAndTimestamp.offset()); } else { LOG.info("Offset for timestamp: does not exist for partition: {}. Falling back to end offset.", startpointTimestamp.getTimestampOffset(), topicPartition); return getEndOffset(systemStreamPartition); } }
Source:
@Test public void annotation() throws Exception { TypeSpec annotation = TypeSpec.annotationBuilder("MyAnnotation") .addModifiers(Modifier.PUBLIC) .addMethod(MethodSpec.methodBuilder("test") .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT) .initializer("$L", 0) .returns(int.class) .build()) .build(); assertThat(toString(annotation)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "public @interface MyAnnotation {\n" + " int test() default 0;\n" + "}\n" ); }

Target:
@Test public void annotation() throws Exception { TypeSpec annotation = TypeSpec.annotationBuilder("MyAnnotation") .addModifiers(Modifier.PUBLIC) .addMethod(MethodSpec.methodBuilder("test") .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT) .defaultValue("$L", 0) .returns(int.class) .build()) .build(); assertThat(toString(annotation)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "public @interface MyAnnotation {\n" + " int test() default 0;\n" + "}\n" ); }
Source:
protected String getId() { return "GNU C compiler 4 (ld)"; }

Target:
protected String getId() { return "GNU compiler 4 (ld)"; }
Source:
private MetadataInterface createMetadataForLogicalPageNumber(int currentPhysicalOrder, String defaultPagination) throws MetadataTypeNotAllowedException { MetadataTypeInterface metadataTypeInterface = this.myPrefs.getMetadataTypeByName("logicalPageNumber"); MetadataInterface metadataInterface = UghImplementation.INSTANCE.createMetadata(metadataTypeInterface); metadataInterface.setStringValue(determinePagination(currentPhysicalOrder, defaultPagination)); return metadataInterface; }

Target:
private MetadataInterface createMetadataForLogicalPageNumber(int currentPhysicalOrder, String defaultPagination) throws MetadataTypeNotAllowedException { MetadataTypeInterface metadataType = this.myPrefs.getMetadataTypeByName("logicalPageNumber"); MetadataInterface metadata = UghImplementation.INSTANCE.createMetadata(metadataType); metadata.setStringValue(determinePagination(currentPhysicalOrder, defaultPagination)); return metadata; }
Source:
private String getExternalSSOProvider(){ try { return properties.getProperty(USERGRID_EXTERNAL_PROVIDER); } catch(NullPointerException e ){ throw new IllegalArgumentException("External SSO provider is enabled but the provider name is empty"); } }

Target:
private String getExternalSSOProvider(){ return properties.getProperty(USERGRID_EXTERNAL_PROVIDER); }
Source:
protected void updateWorkflowsTable(List<Workflow> data) { this.workflowsTable.clear(); this.workflowsSearchInProgressMessage.setVisible(false); if (data != null && data.size() > 0) { for (Workflow workflowBean : data) { this.workflowsTable.addRow(workflowBean); } this.workflowsTable.setVisible(true); } else { this.workflowsNoDataMessage.setVisible(true); } }

Target:
protected void updateWorkflowsTable(List<Workflow> data) { this.workflowsTable.clear(); this.workflowsSearchInProgressMessage.setVisible(false); if (data != null && data.size() > 0) { this.workflowsTable.setValue(data); this.workflowsTable.setVisible(true); } else { this.workflowsNoDataMessage.setVisible(true); } }
Source:
private boolean doesAlertExist(String citationNumber, String phoneNumber){ Map<String, Object> parameterMap = new HashMap<String, Object>(); parameterMap.put("citationNumber", citationNumber); parameterMap.put("phoneNumber", phoneNumber); String sql = "SELECT * FROM sms_alerts WHERE citation_number = :citationNumber AND phone_number = :phoneNumber"; try{ jdbcTemplate.queryForObject(sql, parameterMap, new SMSAlertSQLMapper()); return true; }catch(IncorrectResultSizeDataAccessException irsdae){ return false; }catch(Exception e){ LogSystem.LogDBException(e); return false; } }

Target:
private boolean doesAlertExist(String citationNumber, String phoneNumber){ Map<String, Object> parameterMap = new HashMap<String, Object>(); parameterMap.put("citationNumber", citationNumber); parameterMap.put("phoneNumber", phoneNumber); try{ jdbcTemplate.queryForObject(getSql("SMSAlert/check-for-existing-SMSAlert.sql"), parameterMap, new SMSAlertSQLMapper()); return true; }catch(IncorrectResultSizeDataAccessException irsdae){ return false; }catch(Exception e){ LogSystem.LogDBException(e); return false; } }
Source:
protected ILogData read(final long address, long readStartTime) { try { if (System.currentTimeMillis() - readStartTime < runtime.getParameters().getHoleFillTimeout().toMillis()) { return runtime.getAddressSpaceView().read(address); } return runtime.getAddressSpaceView() .read(Collections.singleton(address)) .get(address); } catch (TrimmedException te) { processTrimmedException(te); throw te; } }

Target:
protected ILogData read(final long address, long readStartTime) { try { if (System.currentTimeMillis() - readStartTime < runtime.getParameters().getHoleFillTimeout().toMillis()) { return runtime.getAddressSpaceView().read(address); } return runtime.getAddressSpaceView() .read(Collections.singleton(address), false, false) .get(address); } catch (TrimmedException te) { processTrimmedException(te); throw te; } }
Source:
protected boolean isMavenBuild(final AbstractBuild<?, ?> build) { AbstractBuild aBuild = (AbstractBuild) build; if (aBuild.getProject() instanceof Project) { Project<?, ?> project = (Project<?, ?>) aBuild.getProject(); for (Builder builder : project.getBuilders()) { if (builder instanceof Maven) { return true; } } } return false; }

Target:
protected boolean isMavenBuild(final AbstractBuild<?, ?> build) { if (build.getProject() instanceof Project) { Project<?, ?> project = (Project<?, ?>)build.getProject(); for (Builder builder : project.getBuilders()) { if (builder instanceof Maven) { return true; } } } return false; }
Source:
public void start() { LOG.info("Start TaskScheduler"); isLeaf = stage.getMasterPlan().isLeaf(stage.getBlock()); if (!isLeaf) { candidateWorkers.addAll(getWorkerIds(getLeafTaskHosts())); } else { List<ExecutionBlock> executionBlockList = stage.getMasterPlan().getChilds(stage.getBlock()); for (ExecutionBlock executionBlock : executionBlockList) { Stage childStage = stage.getContext().getStage(executionBlock.getId()); candidateWorkers.addAll(childStage.getAssignedWorkerMap().keySet()); } } this.schedulingThread = new Thread() { public void run() { while (!isStopped && !Thread.currentThread().isInterrupted()) { try { schedule(); } catch (Throwable e) { LOG.fatal(e.getMessage(), e); stage.abort(StageState.ERROR); break; } } LOG.info("TaskScheduler schedulingThread stopped"); } }; this.schedulingThread.start(); super.start(); }

Target:
public void start() { LOG.info("Start TaskScheduler"); maximumRequestContainer = tajoConf.getInt(REQUEST_MAX_NUM, stage.getContext().getWorkerMap().size() * 2); isLeaf = stage.getMasterPlan().isLeaf(stage.getBlock()); if (isLeaf) { candidateWorkers.addAll(getWorkerIds(getLeafTaskHosts())); } else { List<ExecutionBlock> executionBlockList = stage.getMasterPlan().getChilds(stage.getBlock()); for (ExecutionBlock executionBlock : executionBlockList) { Stage childStage = stage.getContext().getStage(executionBlock.getId()); candidateWorkers.addAll(childStage.getAssignedWorkerMap().keySet()); } } this.schedulingThread = new Thread() { public void run() { while (!isStopped && !Thread.currentThread().isInterrupted()) { try { schedule(); } catch (InterruptedException e) { if (isStopped) { break; } else { LOG.fatal(e.getMessage(), e); stage.abort(StageState.ERROR); } } catch (Throwable e) { LOG.fatal(e.getMessage(), e); stage.abort(StageState.ERROR); break; } } LOG.info("TaskScheduler schedulingThread stopped"); } }; this.schedulingThread.start(); super.start(); }
Source:
protected void decorateIdentity(List<Object> identifiers) { identifiers.add(columnNameLineNumber); identifiers.add(skipEmptyLines); identifiers.add(skipEmptyColumns); identifiers.add(detectColumnTypes); }

Target:
protected void decorateIdentity(List<Object> identifiers) { identifiers.add(columnNameLineNumber); identifiers.add(skipEmptyLines); identifiers.add(skipEmptyColumns); identifiers.add(detectColumnTypes); identifiers.add(numberOfLinesToScan); }