auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean shouldAddImage(String uriStr) { <START> return uriStr != null && !isTokenString(uriStr) && isValidURI(uriStr); <END> }</code><technical_language>Do need !isTokenString isValidURI</technical_language>

Target:
private boolean shouldAddImage(String uriStr) { return uriStr != null && isValidURI(uriStr); }
Source:
<code>public void testApplicationSelectInsertWithAPI() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new KafkaApplication(kafka.getBroker(), testTopicData0, testTopicResult), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); kafka.publish(testTopicData0, Arrays.asList("15/02/2016 10:15:00 +0000,1,paint1,11", "15/02/2016 10:16:00 +0000,2,paint2,12", "15/02/2016 10:17:00 +0000,3,paint3,13", "15/02/2016 10:18:00 +0000,4,paint4,14", "15/02/2016 10:19:00 +0000,5,paint5,15", "15/02/2016 10:10:00 +0000,6,abcde6,16")); <START> String[] expectedLines = new String[]{"15/02/2016 10:18:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT4\r\n", <END> "15/02/2016 10:19:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT5\r\n"}; List<String> consume = kafka.consume(testTopicResult, 30000); Assert.assertTrue(Arrays.deepEquals(consume.toArray(new String[consume.size()]), expectedLines)); lc.shutdown(); } catch (Exception e) { e.printStackTrace(); Assert.fail("constraint violations: " + e); } }</code><technical_language>configure lineDelimiter in schema for CsvFormatter fix this</technical_language>

Target:
public void testApplicationSelectInsertWithAPI() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); lma.prepareDAG(new KafkaApplication(kafka.getBroker(), testTopicData0, testTopicResult), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); kafka.publish(testTopicData0, Arrays.asList("15/02/2016 10:15:00 +0000,1,paint1,11", "15/02/2016 10:16:00 +0000,2,paint2,12", "15/02/2016 10:17:00 +0000,3,paint3,13", "15/02/2016 10:18:00 +0000,4,paint4,14", "15/02/2016 10:19:00 +0000,5,paint5,15", "15/02/2016 10:10:00 +0000,6,abcde6,16")); String[] expectedLines = new String[]{"15/02/2016 10:18:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT4\r\n", "15/02/2016 10:19:00 +0000,15/02/2016 00:00:00 +0000,OILPAINT5\r\n"}; List<String> consume = kafka.consume(testTopicResult, 30000); Assert.assertTrue(Arrays.deepEquals(consume.toArray(new String[consume.size()]), expectedLines)); lc.shutdown(); } catch (Exception e) { Assert.fail("constraint violations: " + e); } }
Source:
<code>public List<Callable<DocumentRevsList>> createTasks(List<String> ids, Map<String, Collection<String>> revisions) { List<Callable<DocumentRevsList>> tasks = new ArrayList<Callable<DocumentRevsList>>(); for(String id : ids) { HashSet<String> possibleAncestors = new HashSet<String>(); for (String revId : revisions.get(id)) { List<String> thesePossibleAncestors = targetDb.getDbCore().getPossibleAncestorRevisionIDs(id, revId, 50); if (thesePossibleAncestors != null) { possibleAncestors.addAll(thesePossibleAncestors); } <START> } <END> tasks.add(GetRevisionTask.createGetRevisionTask(this.sourceDb, id, revisions.get(id), possibleAncestors)); } return tasks; }</code><technical_language>docPossibleAncestors revPossibleAncestors</technical_language>

Target:
public List<Callable<DocumentRevsList>> createTasks(List<String> ids, Map<String, Collection<String>> revisions) { List<Callable<DocumentRevsList>> tasks = new ArrayList<Callable<DocumentRevsList>>(); for(String id : ids) { HashSet<String> possibleAncestors = new HashSet<String>(); for (String revId : revisions.get(id)) { List<String> thesePossibleAncestors = targetDb.getDbCore().getPossibleAncestorRevisionIDs(id, revId, 50); if (thesePossibleAncestors != null) { possibleAncestors.addAll(thesePossibleAncestors); } } tasks.add(GetRevisionTask.createGetRevisionTask(this.sourceDb, id, revisions.get(id), possibleAncestors, config.pullAttachmentsInline)); } return tasks; }
Source:
<code>public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanent(this.getSourceId()); UUID controller = this.getControllerId(); if (enchantment != null && enchantment.getAttachedTo() != null && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { if (game.getCombat().getAttackerId() != controller) { <START> for (Effect effect: this.getEffects()) { <END> effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); } } return true; } return false; }</code><technical_language>is a simpler this.getEffects().setTargetPointer() method for this</technical_language>

Target:
public boolean checkTrigger(GameEvent event, Game game) { Permanent enchantment = game.getPermanentOrLKIBattlefield(this.getSourceId()); UUID controller = this.getControllerId(); if (enchantment != null && enchantment.getAttachedTo() != null && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) { if (!game.getCombat().getAttackerId().equals(controller)) { for (Effect effect: this.getEffects()) { effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId())); } } return true; } return false; }
Source:
<code>protected String configure(final String args[]) { configureSecurityManager(); configureRMAndProActiveHomes(); configureProActiveDefaultConfigurationFile(); try { <START> loadSigarIfRunningWithOneJar(); <END> } catch (Exception e) { logger.warn("Sigar will not be loaded, as it is not supported by the underlying OS."); } String nodeName = parseCommandLine(args); configureLogging(nodeName); logger.info("ProActive Node version is " + Version.PA_VERSION); logger.info("Using ProActive configuration file : " + System.getProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName())); selectNetworkInterface(); readAndSetTheRank(); return nodeName; }</code><technical_language>this sufficient, expect run PA nodes onejar (node.jar)</technical_language>

Target:
protected String configure(final String args[]) { configureSecurityManager(); configureRMAndProActiveHomes(); configureProActiveDefaultConfigurationFile(); loadSigarIfRunningWithOneJar(); String nodeName = parseCommandLine(args); configureLogging(nodeName); logger.info("ProActive Node version is " + Version.PA_VERSION); logger.info("Using ProActive configuration file : " + System.getProperty(CentralPAPropertyRepository.PA_CONFIGURATION_FILE.getName())); selectNetworkInterface(); readAndSetTheRank(); return nodeName; }
Source:
<code>public int put(CharSequence symbol) { if (symbol == null) { <START> offsetMem.putBool(HEADER_NULL_FLAG, true); <END> return SymbolTable.VALUE_IS_NULL; } if (cache != null) { int index = cache.keyIndex(symbol); return index < 0 ? cache.valueAt(index) : lookupPutAndCache(index, symbol); } return lookupAndPut(symbol); }</code><technical_language>this write cached i feel like, e.g. read of class member is faster write memory mapped file</technical_language>

Target:
public int put(CharSequence symbol) { if (symbol == null) { if (!nullValue) { nullValue = true; offsetMem.putBool(HEADER_NULL_FLAG, true); } return SymbolTable.VALUE_IS_NULL; } if (cache != null) { int index = cache.keyIndex(symbol); return index < 0 ? cache.valueAt(index) : lookupPutAndCache(index, symbol); } return lookupAndPut(symbol); }
Source:
<code>private void closeStream() { if (dataStream != null) { try { dataStream.close(); dataStream = null; } catch (IOException ex) { <START> logger.log(Level.WARNING, "SafariCookieReader unable to close DataInputStream for file {0} {1}", new Object[]{cookieFile.getName(), ex}); END> } } }</code><technical_language>exception fourth argument method is logged causing exception a full stack trace - throw debugging data. Also, class name changed, log message lead a debugging developer astray if paying close attention stack trace</technical_language>

Target:
private void closeStream() { if (dataStream != null) { try { dataStream.close(); dataStream = null; } catch (IOException ex) { String errorMessage = String.format("An error occurred trying to close stream for file %s", cookieFile.getName()); LOG.log(Level.WARNING, errorMessage, ex); } } }
Source:
<code>protected void initSelectedType() { VmInterfaceType selectedNicType = VmInterfaceType.forValue(getNic().getType()); final Collection<VmInterfaceType> vnicTypes = supportedVnicTypes == null ? new ArrayList<VmInterfaceType>() : supportedVnicTypes; if (selectedNicType == null || !vnicTypes.contains(selectedNicType)) { selectedNicType = getDeafultNicTypeByProfile(); } <START> if (getNicType().getItems() != vnicTypes) { <END> getNicType().setItems(vnicTypes, selectedNicType); } else { getNicType().setSelectedItem(selectedNicType); } }</code><technical_language>not- getNicType().getItems() != null</technical_language>

Target:
protected void initSelectedType() { VmInterfaceType selectedNicType = VmInterfaceType.forValue(getNic().getType()); final Collection<VmInterfaceType> vnicTypes = supportedVnicTypes == null ? new ArrayList<VmInterfaceType>() : supportedVnicTypes; if (selectedNicType == null || !vnicTypes.contains(selectedNicType)) { selectedNicType = getDeafultNicTypeByProfile(); } if (getNicType().getItems() == null) { getNicType().setItems(vnicTypes, selectedNicType); } else { getNicType().setSelectedItem(selectedNicType); } }
Source:
<code>private DNodeContainer getComponentDNodeContainer(final String componentName) { DNodeContainer container = componentDiagram.getDiagramElements().stream().filter(DNodeContainer.class::isInstance).map(DNodeContainer.class::cast) .filter(n -> isElementEqualsToComponent(n, <START> componentName)).findFirst().get(); <END> assertNotNull("The DNodeContainer for the component " + componentName + " should exist", container); return container; }</code><technical_language>remark before: a blind ".get()" Optional throw exception instead of returning null if optional is empty</technical_language>

Target:
private DNodeContainer getComponentDNodeContainer(final String componentName) { DNodeContainer container = componentDiagram.getDiagramElements().stream().filter(DNodeContainer.class::isInstance).map(DNodeContainer.class::cast) .filter(n -> isElementEqualsToComponent(n, componentName)).findFirst().orElse(null); assertNotNull("The DNodeContainer for the component " + componentName + " should exist", container); return container; }
Source:
<code>public String toString() { return "TaskStatusPlus{" + "id='" + id + '\'' + <START> "groupId='" + groupId + '\'' + <END> ", type='" + type + '\'' + ", createdTime=" + createdTime + ", queueInsertionTime=" + queueInsertionTime + ", statusCode=" + statusCode + ", duration=" + duration + ", location=" + location + ", dataSource='" + dataSource + '\'' + ", errorMsg='" + errorMsg + '\'' + '}'; }</code><technical_language>this a , match rest of pattern</technical_language>

Target:
public String toString() { return "TaskStatusPlus{" + "id='" + id + '\'' + ", groupId='" + groupId + '\'' + ", type='" + type + '\'' + ", createdTime=" + createdTime + ", queueInsertionTime=" + queueInsertionTime + ", statusCode=" + statusCode + ", duration=" + duration + ", location=" + location + ", dataSource='" + dataSource + '\'' + ", errorMsg='" + errorMsg + '\'' + '}'; }
Source:
<code>public void matchRemainder() { matchingRemainder = true; if (condition.isAlwaysFalse()) { currentIterator = extractor.iterable().iterator(); } else if (condition.isAlwaysTrue()) { currentIterator = Collections.emptyIterator(); } else { currentIterator = Iterators.filter( extractor.iterable().iterator(), <START> entry -> entry != null && !matchedKeys.contains(entry.getKey()) <END> ); } nextMatch(); }</code><technical_language>entry null</technical_language>

Target:
public void matchRemainder() { matchingRemainder = true; if (condition.isAlwaysFalse()) { currentIterator = extractor.iterable().iterator(); } else if (condition.isAlwaysTrue()) { currentIterator = Collections.emptyIterator(); } else { currentIterator = Iterators.filter( extractor.iterable().iterator(), entry -> !matchedKeys.contains(entry.getKey()) ); } nextMatch(); }
Source:
<code><START> protected void removeServices(OperationContext context, ServiceName parentService, ModelNode parentModel) <END> throws OperationFailedException { incrementAttachedCounter(context, REMOVE_COUNTER); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Integer counter = decrementAttachedCounter(context, REMOVE_COUNTER); if (counter == 0) { SubsystemRemove.INSTANCE.performRuntime(context, null, parentModel); } else if (counter < 0) { throw new OperationFailedException("The removeServices step got added more times than needed - " + "This shouldn't happen."); } } }, OperationContext.Stage.RUNTIME); }</code><technical_language>I this is good is (assuming works :)) need put this in Util yet. a need for - if do, refactor then. I assume this works EAP 6.4 7.0 7.1? if get itest in for this merging. @pilhuhn asked for agent release today need get merged today fix this problem release</technical_language>

Target:
protected void removeServices(OperationContext context, ServiceName parentService, ModelNode parentModel) throws OperationFailedException { incrementAttachedCounter(context, REMOVE_COUNTER); context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { Integer counter = decrementAttachedCounter(context, REMOVE_COUNTER); if (counter == 0) { SubsystemRemove.INSTANCE.performRuntime(context, null, parentModel); } else if (counter < 0) { throw new OperationFailedException("The removeServices step got added more times than needed - " + "This shouldn't happen."); } WildflyCompatibilityUtils.operationContextStepCompleted(context); } }, OperationContext.Stage.RUNTIME); }
Source:
<code>void computeAndCreateTopicPartitions() throws InterruptedException, ExecutionException { Map<String, Long> partitionCounts = knownSourceTopicPartitions.stream() .collect(Collectors.groupingBy(x -> x.topic(), Collectors.counting())).entrySet().stream() .collect(Collectors.toMap(x -> formatRemoteTopic(x.getKey()), x -> x.getValue())); <START> Set<String> knownTargetTopics = knownTargetTopicPartitions.stream() <END> .map(x -> x.topic()) .distinct() .collect(Collectors.toSet()); List<NewTopic> newTopics = partitionCounts.entrySet().stream() .filter(x -> !knownTargetTopics.contains(x.getKey())) .map(x -> new NewTopic(x.getKey(), x.getValue().intValue(), (short) replicationFactor)) .collect(Collectors.toList()); Map<String, NewPartitions> newPartitions = partitionCounts.entrySet().stream() .filter(x -> knownTargetTopics.contains(x.getKey())) .collect(Collectors.toMap(x -> x.getKey(), x -> NewPartitions.increaseTo(x.getValue().intValue()))); createTopicPartitions(partitionCounts, newTopics, newPartitions); }</code><technical_language>This logic appears twice. extract a method</technical_language>

Target:
void computeAndCreateTopicPartitions() throws InterruptedException, ExecutionException { Map<String, Long> partitionCounts = knownSourceTopicPartitions.stream() .collect(Collectors.groupingBy(x -> x.topic(), Collectors.counting())).entrySet().stream() .collect(Collectors.toMap(x -> formatRemoteTopic(x.getKey()), x -> x.getValue())); Set<String> knownTargetTopics = toTopics(knownTargetTopicPartitions); List<NewTopic> newTopics = partitionCounts.entrySet().stream() .filter(x -> !knownTargetTopics.contains(x.getKey())) .map(x -> new NewTopic(x.getKey(), x.getValue().intValue(), (short) replicationFactor)) .collect(Collectors.toList()); Map<String, NewPartitions> newPartitions = partitionCounts.entrySet().stream() .filter(x -> knownTargetTopics.contains(x.getKey())) .collect(Collectors.toMap(x -> x.getKey(), x -> NewPartitions.increaseTo(x.getValue().intValue()))); createTopicPartitions(partitionCounts, newTopics, newPartitions); }
Source:
<code>public void createPatientFromSummaryNoAccess() throws Exception { <START> Object[] summary = {new Object()}; <END> when(this.stringResolver.resolve(Matchers.anyString())).thenReturn(null); when(this.access.hasAccess(Right.VIEW, null, null)).thenReturn(false); assertNull(this.mocker.getComponentUnderTest().createPatientSummary(summary, this.uriInfo)); }</code><technical_language>Object[] summary = new Object[7] null return currently is due summaryData.length != 7 condition failing</technical_language>

Target:
public void createPatientFromSummaryNoAccess() throws Exception { Object[] summary = {"", "", "", new Date(), "", "", new Date()}; when(this.stringResolver.resolve(Matchers.anyString())).thenReturn(null); when(this.access.hasAccess(Right.VIEW, null, null)).thenReturn(false); assertNull(this.mocker.getComponentUnderTest().createPatientSummary(summary, this.uriInfo)); }
Source:
<code>public void process(TransactionBase tx, Bytes row, Column col) { String r = row.toString(); String totalStr = tx.gets(r, STAT_TOTAL); if (totalStr == null) { return; } <START> Integer total = Ints.tryParse(totalStr); <END> if (total == null) { return; } String processedStr = tx.gets(r, STAT_PROCESSED); Integer processed = 0; if (processedStr != null) { processed = Ints.tryParse(tx.gets(r, STAT_PROCESSED)); if (processed == null) { processed = 0; } } tx.set(r, new Column("stat", "processed"), total + ""); TestUtil.increment(tx, "all", new Column("stat", "total"), total - processed); }</code><technical_language>this ignore corrupt data, null is above</technical_language>

Target:
public void process(TransactionBase tx, Bytes row, Column col) { String r = row.toString(); String totalStr = tx.gets(r, STAT_TOTAL); if (totalStr == null) { return; } Integer total = Integer.parseInt(totalStr); int processed = TestUtil.getOrDefault(tx, r, STAT_PROCESSED, 0); tx.set(r, new Column("stat", "processed"), total + ""); TestUtil.increment(tx, "all", new Column("stat", "total"), total - processed); }
Source:
<code>public void stripeAccountExists() { DatabaseFixtures .withDatabaseTestHelper(dbHelper) .aTestAccount() <START> .withAccountId(42) <END> .withPaymentProvider("stripe") .insert(); }</code><technical_language>this a long instead? e.g. 42L</technical_language>

Target:
public void stripeAccountExists() { DatabaseFixtures .withDatabaseTestHelper(dbHelper) .aTestAccount() .withAccountId(42L) .withPaymentProvider("stripe") .insert(); }
Source:
<code>public void testFilterProjectionExecutedConditionally() { <START> assertions.assertQuery("select sum(1 / a) filter (where a <> 0) from (values (1), (0)) t(a)", <END> "VALUES (BIGINT '1')"); }</code><technical_language>put argument in separate line</technical_language>

Target:
public void testFilterProjectionExecutedConditionally() { assertions.assertQuery( "select sum(1 / a) filter (where a <> 0) from (values (1), (0)) t(a)", "VALUES (BIGINT '1')"); assertions.assertQuery( "WITH test AS (" + " SELECT * FROM (" + " VALUES" + " ('1', 'a', 'good')," + " ('2', 'b', 'good')," + " ('x', 'c', 'bad')" + " ) AS t (v, k, name)" + ")" + "SELECT" + " SUM(CAST(v AS BIGINT)) FILTER (WHERE name = 'good') AS col2\n" + "FROM test", "VALUES (BIGINT '3')"); }
Source:
<code>public void putTimeout() throws Exception { <START> mConf.set(PropertyKey.USER_CLIENT_CACHE_STORE_TIMEOUT, "10s"); <END> mPageStoreOptions = PageStoreOptions.create(mConf); HangingPageStore pageStore = new HangingPageStore(); mCacheManager = LocalCacheManager.create(mConf, mMetaStore, new TimeLimitedPageStore(pageStore, mPageStoreOptions.getTimeout()), mPageStoreOptions); assertTrue(mCacheManager.put(PAGE_ID1, PAGE1)); pageStore.setPutHanging(true); assertFalse(mCacheManager.put(PAGE_ID2, PAGE2)); pageStore.setPutHanging(false); }</code><technical_language>this test 10s? long? a timeout 1s good enough</technical_language>

Target:
public void putTimeout() throws Exception { HangingPageStore pageStore = new HangingPageStore(mPageStoreOptions); mConf.set(PropertyKey.USER_CLIENT_CACHE_TIMEOUT_DURATION, "2s"); mPageStoreOptions = PageStoreOptions.create(mConf); mCacheManager = LocalCacheManager.create(mConf, mMetaStore, new TimeBoundPageStore(pageStore, mPageStoreOptions)); assertTrue(mCacheManager.put(PAGE_ID1, PAGE1)); pageStore.setPutHanging(true); assertFalse(mCacheManager.put(PAGE_ID2, PAGE2)); pageStore.setPutHanging(false); }
Source:
<code>public InputStream getResourceStream(final String filePath) throws ResourceNotFoundException { if (!UtilMethods.isSet(filePath)) { throw new ResourceNotFoundException("cannot find resource"); } synchronized (filePath.intern()) { VelocityResourceKey key = new VelocityResourceKey(filePath); Logger.debug(this, "DotResourceLoader:\t: " + key); try { switch (key.type) { case CONTAINER: { return new ContainerLoader().writeObject(key); } case TEMPLATE: { return new TemplateLoader().writeObject(key); } case CONTENT: { return new ContentletLoader().writeObject(key); } case FIELD: { return new FieldLoader().writeObject(key); } case CONTENT_TYPE: { return new ContentTypeLoader().writeObject(key); } case SITE: { return new SiteLoader().writeObject(key); } case HTMLPAGE: { return new PageLoader().writeObject(key); } case VELOCITY_MACROS: { return VTLLoader.instance().writeObject(key); } case VTL: { return VTLLoader.instance().writeObject(key); } case VELOCITY_LEGACY_VL: { return VTLLoader.instance().writeObject(key); } default: { return IncludeLoader.instance().writeObject(key); } } } catch (Exception e) { <START> Logger.error(this, e.getMessage(), e); <END> CacheLocator.getVeloctyResourceCache().addMiss(key.path); throw new ResourceNotFoundException("Cannot parse velocity file : " + key.path, e); } } }</code><technical_language>improve error message please? Add info filePath</technical_language>

Target:
public InputStream getResourceStream(final String filePath) throws ResourceNotFoundException { if (!UtilMethods.isSet(filePath)) { throw new ResourceNotFoundException("cannot find resource"); } synchronized (filePath.intern()) { VelocityResourceKey key = new VelocityResourceKey(filePath); Logger.debug(this, "DotResourceLoader:\t: " + key); try { switch (key.type) { case CONTAINER: { return new ContainerLoader().writeObject(key); } case TEMPLATE: { return new TemplateLoader().writeObject(key); } case CONTENT: { return new ContentletLoader().writeObject(key); } case FIELD: { return new FieldLoader().writeObject(key); } case CONTENT_TYPE: { return new ContentTypeLoader().writeObject(key); } case SITE: { return new SiteLoader().writeObject(key); } case HTMLPAGE: { return new PageLoader().writeObject(key); } case VELOCITY_MACROS: { return VTLLoader.instance().writeObject(key); } case VTL: { return VTLLoader.instance().writeObject(key); } case VELOCITY_LEGACY_VL: { return VTLLoader.instance().writeObject(key); } default: { return IncludeLoader.instance().writeObject(key); } } } catch (Exception e) { Logger.error(this, "filePath: " + filePath + ", msg:" + e.getMessage(), e); CacheLocator.getVeloctyResourceCache().addMiss(key.path); throw new ResourceNotFoundException("Cannot parse velocity file : " + key.path, e); } } }
Source:
<code>public Overtime(Person person, LocalDate startDate, LocalDate endDate, BigDecimal numberOfHours) { Assert.notNull(person, "Person must be given."); Assert.notNull(startDate, "Start date must be given."); Assert.notNull(endDate, "End date must be given."); Assert.notNull(numberOfHours, "Number of hours must be given."); this.person = person; this.startDate = startDate; this.endDate = endDate; this.hours = numberOfHours; <START> this.lastModificationDate = ZonedDateTime.now(UTC).toLocalDate(); <END> }</code><technical_language>LocalDate.now(UTC);</technical_language>

Target:
public Overtime(Person person, LocalDate startDate, LocalDate endDate, BigDecimal numberOfHours) { Assert.notNull(person, "Person must be given."); Assert.notNull(startDate, "Start date must be given."); Assert.notNull(endDate, "End date must be given."); Assert.notNull(numberOfHours, "Number of hours must be given."); this.person = person; this.startDate = startDate; this.endDate = endDate; this.hours = numberOfHours; this.lastModificationDate = LocalDate.now(UTC); }
Source:
<code>public AzureKeyCredential update(String key) { Objects.requireNonNull(key); <START> if (key.isEmpty()) { <END> throw logger.logExceptionAsError(new IllegalArgumentException("'key' cannot be empty.")); } this.key = key; return this; }</code><technical_language>check of CoreUtil.isNullOrEmpty() here</technical_language>

Target:
public AzureKeyCredential update(String key) { Objects.requireNonNull(key, "'key' cannot be null."); if (key.isEmpty()) { throw logger.logExceptionAsError(new IllegalArgumentException("'key' cannot be empty.")); } this.key = key; return this; }
Source:
<code>public void setup() { stubFor(get(urlEqualTo("/rest/v1.1/me/")) .inScenario("Sign up") <START> .whenScenarioStateIs("No")); <END> mAppContext = (WordPress) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext(); mMockedAppComponent = DaggerAppComponentTest.builder() .application(mAppContext) .build(); }</code><technical_language>well. need replace this equivalent JSON mock</technical_language>

Target:
public void setup() { mAppContext = (WordPress) InstrumentationRegistry.getInstrumentation().getTargetContext().getApplicationContext(); mMockedAppComponent = DaggerAppComponentTest.builder() .application(mAppContext) .build(); }
Source:
<code>public PageProcessorOutput process(ConnectorSession session, Page page) { dictionarySourceIdFunction.reset(); if (page.getPositionCount() == 0) { return EMPTY_PAGE_PROCESSOR_OUTPUT; } if (filter.isPresent()) { SelectedPositions selectedPositions = filter.get().filter(session, filter.get().getInputChannels().getInputChannels(page)); if (selectedPositions.isEmpty()) { return EMPTY_PAGE_PROCESSOR_OUTPUT; } if (projections.isEmpty()) { <START> return new PageProcessorOutput(() -> calculatePageRetainedSizeWithoutLoading(page), singletonIterator(new Page(selectedPositions.size()))); <END> } if (selectedPositions.size() != page.getPositionCount()) { PositionsPageProcessorIterator pages = new PositionsPageProcessorIterator(session, page, selectedPositions); return new PageProcessorOutput(pages::getRetainedSizeInBytes, pages); } } PositionsPageProcessorIterator pages = new PositionsPageProcessorIterator(session, page, positionsRange(0, page.getPositionCount())); return new PageProcessorOutput(pages::getRetainedSizeInBytes, pages); }</code><technical_language>"Page" in this method name is redundant takes a page. calculateRetainedSizeWithoutLoading(page)</technical_language>

Target:
public PageProcessorOutput process(ConnectorSession session, Page page) { dictionarySourceIdFunction.reset(); if (page.getPositionCount() == 0) { return EMPTY_PAGE_PROCESSOR_OUTPUT; } if (filter.isPresent()) { SelectedPositions selectedPositions = filter.get().filter(session, filter.get().getInputChannels().getInputChannels(page)); if (selectedPositions.isEmpty()) { return EMPTY_PAGE_PROCESSOR_OUTPUT; } if (projections.isEmpty()) { return new PageProcessorOutput(() -> calculateRetainedSizeWithoutLoading(page), singletonIterator(new Page(selectedPositions.size()))); } if (selectedPositions.size() != page.getPositionCount()) { PositionsPageProcessorIterator pages = new PositionsPageProcessorIterator(session, page, selectedPositions); return new PageProcessorOutput(pages::getRetainedSizeInBytes, pages); } } PositionsPageProcessorIterator pages = new PositionsPageProcessorIterator(session, page, positionsRange(0, page.getPositionCount())); return new PageProcessorOutput(pages::getRetainedSizeInBytes, pages); }
Source:
<code>@Override public void onStoryComposerLoadRequested(ArrayList<Object> mediaFiles, String blockId) { <START> LoadStoryFromStoriesPrefsUseCase loadStoryFromStoriesPrefsUseCase = new LoadStoryFromStoriesPrefsUseCase( <END> new StoryRepositoryWrapper(), mSite, mMediaStore, this ); ArrayList<String> mediaIds = loadStoryFromStoriesPrefsUseCase.getMediaIdsFromStoryBlockBridgeMediaFiles(mediaFiles); boolean allStorySlidesAreEditable = loadStoryFromStoriesPrefsUseCase.areAllStorySlidesEditable(mSite, mediaIds); boolean failedLoadingOrReCreatingStory = false; int storyIndex = StoryRepository.findStoryContainingStoryFrameItemsByIds(mediaIds); if (storyIndex == StoryRepository.DEFAULT_NONE_SELECTED) { ReCreateStoryResult result = loadStoryFromStoriesPrefsUseCase.loadOrReCreateStoryFromStoriesPrefs(mediaIds); failedLoadingOrReCreatingStory = result.getNoSlidesLoaded(); if (allStorySlidesAreEditable) { allStorySlidesAreEditable = result.getAllStorySlidesAreEditable(); } storyIndex = result.getStoryIndex(); } if (!failedLoadingOrReCreatingStory) { ActivityLauncher.editStoryForResult(this, mSite, storyIndex, allStorySlidesAreEditable, true); } else { AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this); builder.setTitle(getString(R.string.dialog_edit_story_unavailable_title)); builder.setMessage(getString(R.string.dialog_edit_story_unavailable_message)); builder.setPositiveButton(R.string.dialog_button_ok, (dialog, id) -> { dialog.dismiss(); }); AlertDialog dialog = builder.create(); dialog.show(); } }</code><technical_language>I this case injectable instead of instantiating improve testability. WDYT</technical_language>

Target:
@Override public void onStoryComposerLoadRequested(ArrayList<Object> mediaFiles, String blockId) { ReCreateStoryResult result = mLoadStoryFromStoriesPrefsUseCase .loadStoryFromMemoryOrRecreateFromPrefs(mSite, mediaFiles); if (!result.getNoSlidesLoaded()) { ActivityLauncher.editStoryForResult( this, mSite, result.getStoryIndex(), result.getAllStorySlidesAreEditable(), true ); } else { if (mNetworkErrorOnLastMediaFetchAttempt) { AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this); builder.setTitle(getString(R.string.dialog_edit_story_unavailable_title)); builder.setMessage(getString(R.string.dialog_edit_story_unavailable_message)); builder.setPositiveButton(R.string.dialog_button_ok, (dialog, id) -> { fetchMediaList(); dialog.dismiss(); }); AlertDialog dialog = builder.create(); dialog.show(); } else { AlertDialog.Builder builder = new MaterialAlertDialogBuilder(this); builder.setTitle(getString(R.string.dialog_edit_story_unrecoverable_title)); builder.setMessage(getString(R.string.dialog_edit_story_unrecoverable_message)); builder.setPositiveButton(R.string.dialog_button_ok, (dialog, id) -> { dialog.dismiss(); }); AlertDialog dialog = builder.create(); dialog.show(); } } }
Source:
<code>public void prepareForMasterPasswordChange(char[] oldPassword, char[] newPassword) throws IOException{ Resource dir = getResource().parent(); Resource newKSFile = dir.get(PREPARED_FILE_NAME); if (newKSFile.getType() != Type.UNDEFINED) { newKSFile.delete(); } try { KeyStore oldKS=KeyStore.getInstance(KEYSTORETYPE); <START> InputStream fin = getResource().in(); <END> oldKS.load(fin, oldPassword); fin.close(); KeyStore newKS = KeyStore.getInstance(KEYSTORETYPE); newKS.load(null, newPassword); KeyStore.PasswordProtection protectionparam = new KeyStore.PasswordProtection(newPassword); Enumeration<String> enumeration = oldKS.aliases(); while (enumeration.hasMoreElements()) { String alias =enumeration.nextElement(); Key key = oldKS.getKey(alias, oldPassword); KeyStore.Entry entry =null; if (key instanceof SecretKey) entry = new KeyStore.SecretKeyEntry((SecretKey)key); if (key instanceof PrivateKey) entry = new KeyStore.PrivateKeyEntry((PrivateKey)key, oldKS.getCertificateChain(alias)); if (key instanceof PublicKey) entry = new KeyStore.TrustedCertificateEntry(oldKS.getCertificate(alias)); if (entry == null) LOGGER.warning("Unknown key in store, alias: "+alias+ " class: "+ key.getClass().getName()); else newKS.setEntry(alias, entry, protectionparam); } OutputStream fos = newKSFile.out(); newKS.store(fos, newPassword); fos.close(); } catch (Exception ex) { throw new IOException(ex); } }</code><technical_language>try-with-resources, resource leak</technical_language>

Target:
public void prepareForMasterPasswordChange(char[] oldPassword, char[] newPassword) throws IOException{ Resource dir = getResource().parent(); Resource newKSFile = dir.get(PREPARED_FILE_NAME); if (newKSFile.getType() != Type.UNDEFINED) { newKSFile.delete(); } try { KeyStore oldKS=KeyStore.getInstance(KEYSTORETYPE); try (InputStream fin = getResource().in()) { oldKS.load(fin, oldPassword); } KeyStore newKS = KeyStore.getInstance(KEYSTORETYPE); newKS.load(null, newPassword); KeyStore.PasswordProtection protectionparam = new KeyStore.PasswordProtection(newPassword); Enumeration<String> enumeration = oldKS.aliases(); while (enumeration.hasMoreElements()) { String alias =enumeration.nextElement(); Key key = oldKS.getKey(alias, oldPassword); KeyStore.Entry entry =null; if (key instanceof SecretKey) entry = new KeyStore.SecretKeyEntry((SecretKey)key); if (key instanceof PrivateKey) entry = new KeyStore.PrivateKeyEntry((PrivateKey)key, oldKS.getCertificateChain(alias)); if (key instanceof PublicKey) entry = new KeyStore.TrustedCertificateEntry(oldKS.getCertificate(alias)); if (entry == null) LOGGER.warning("Unknown key in store, alias: "+alias+ " class: "+ key.getClass().getName()); else newKS.setEntry(alias, entry, protectionparam); } try (OutputStream fos = newKSFile.out()) { newKS.store(fos, newPassword); } } catch (Exception ex) { throw new IOException(ex); } }
Source:
<code>public @Nullable SerialPortIdentifier getIdentifier(String name) { if (registry == null) { return null; } URI portUri = URI.create(name); SerialPortProvider portCreator = registry.getPortProviderForPortName(portUri); if (portCreator == null) { <START> logger.warn("No SerialPortProvider found for: " + name); <END> return null; } return portCreator.getPortIdentifier(portUri); }</code><technical_language>parameterized logging, string concatenation</technical_language>

Target:
public @Nullable SerialPortIdentifier getIdentifier(String name) { if (registry == null) { return null; } URI portUri = URI.create(name); SerialPortProvider portCreator = registry.getPortProviderForPortName(portUri); if (portCreator == null) { logger.warn("No SerialPortProvider found for: {}", name); return null; } return portCreator.getPortIdentifier(portUri); }
Source:
<code>public UserRemovedFromBlackListOfSecurityTeam(User user, SecurityTeam securityTeam) { this.user = user; this.securityTeam = securityTeam; <START> this.message = formatMessage("%s remove from blacklist of '%s'.", user, securityTeam); <END> }</code><technical_language>%s in apostrophes</technical_language>

Target:
public UserRemovedFromBlackListOfSecurityTeam(User user, SecurityTeam securityTeam) { this.user = user; this.securityTeam = securityTeam; this.message = formatMessage("%s remove from blacklist of %s.", user, securityTeam); }
Source:
<code>public Note merge(Note base, Note ours, Note theirs, ObjectReader reader, ObjectInserter inserter) throws IOException { if (ours == null) { return theirs; } if (theirs == null) { return ours; } if (ours.getData().equals(theirs.getData())) { return ours; } ObjectLoader lo = reader.open(ours.getData()); byte[] sep = new byte[] {'\n'}; ObjectLoader lt = reader.open(theirs.getData()); try (ByteArrayInputStream b = new ByteArrayInputStream(sep); UnionInputStream union = new UnionInputStream( <START> lo.openStream(), b, lt.openStream())) { <END> ObjectId noteData = inserter.insert(Constants.OBJ_BLOB, lo.getSize() + sep.length + lt.getSize(), union); return new Note(ours, noteData); } }</code><technical_language>need 4 assignments here, for of {lo,lt}.openStream() well</technical_language>

Target:
public Note merge(Note base, Note ours, Note theirs, ObjectReader reader, ObjectInserter inserter) throws IOException { if (ours == null) { return theirs; } if (theirs == null) { return ours; } if (ours.getData().equals(theirs.getData())) { return ours; } ObjectLoader lo = reader.open(ours.getData()); byte[] sep = new byte[] {'\n'}; ObjectLoader lt = reader.open(theirs.getData()); try (ObjectStream os = lo.openStream(); ByteArrayInputStream b = new ByteArrayInputStream(sep); ObjectStream ts = lt.openStream(); UnionInputStream union = new UnionInputStream(os, b, ts)) { ObjectId noteData = inserter.insert(Constants.OBJ_BLOB, lo.getSize() + sep.length + lt.getSize(), union); return new Note(ours, noteData); } }
Source:
<code>public List<PageUpdateCommand> notifyAndGetUpdateCommands(ResourceSetChangeEvent resourceSetChangeEvent) { return <START> null; <END> }</code><technical_language>return empty list instead of null in a case</technical_language>

Target:
public PageUpdateCommand notifyAndGetUpdateCommands(ResourceSetChangeEvent resourceSetChangeEvent) { return null; }
Source:
<code>public <T extends Comparable<? super T>> void assertLessThan(AssertionInfo info, T actual, T other) { <START> this.assertLessThan(info, actual, other, ShouldBeLess::shouldBeLess); <END> }</code><technical_language>minor: remove this</technical_language>

Target:
public <T extends Comparable<? super T>> void assertLessThan(AssertionInfo info, T actual, T other) { assertLessThan(info, actual, other, ShouldBeLess::shouldBeLess); }
Source:
<code>public Weld addExtensions(Class<? extends Extension>... extensionClasses) { Object[] constructorParams = new Object[] {}; for (Class<? extends Extension> extensionClass : extensionClasses) { try { <START> Extension extension = extensionClass.getDeclaredConstructor(new Class[] {}).newInstance(constructorParams); <END> addExtension(extension); } catch (Exception ex) { CommonLogger.LOG.unableToInstantiate(extensionClass, constructorParams, ex); } } return this; }</code><technical_language>Please org.jboss.weld.environment.se.SecurityActions.newInstance(Class<T>) instead.</technical_language>

Target:
public Weld addExtensions(Class<? extends Extension>... extensionClasses) { for (Class<? extends Extension> extensionClass : extensionClasses) { try { Extension extension = SecurityActions.newInstance(extensionClass); addExtension(extension); } catch (Exception ex) { CommonLogger.LOG.unableToInstantiate(extensionClass, new Object[] {}, ex); } } return this; }
Source:
<code>public boolean onHttpResponseReceive(HttpMessage msg) { if (options.isEnabled() && msg.getResponseHeader().isHtml()) { try { String html = msg.getResponseBody().toString(); Source document = new Source(html); List<Element> heads = document.getAllElements("head"); Element head = heads.isEmpty() ? null : heads.get(0); if (head != null && msg.getHistoryRef() != null) { String host = msg.getRequestHeader().getHeader("host"); String frontEndApiUrl = API.getInstance().getCallBackUrl(this.api, "https://" + host); int historyReferenceId = msg.getHistoryRef().getHistoryId(); StringBuilder injectedContentBuilder = new StringBuilder(200) .append("<script src='") .append(frontEndApiUrl) .append("?action=getFile") .append("&filename=front-end-scanner.js") .append("&historyReferenceId=") .append(historyReferenceId) .append("'></script>"); String injectedContent = injectedContentBuilder.toString(); OutputDocument newResponseBody = new OutputDocument(document); int insertPosition = head.getChildElements().get(0).getBegin(); newResponseBody.insert(insertPosition, injectedContent); msg.getResponseBody().setBody(newResponseBody.toString()); <START> <END> int newLength = msg.getResponseBody().length(); msg.getResponseHeader().setContentLength(newLength); } else { LOGGER.debug("<head></head> is missing in the response"); } } catch (Exception e) { LOGGER.error(e.getMessage(), e); } } return true; }</code><technical_language>a head injected body start tag if exist break other things</technical_language>

Target:
public boolean onHttpResponseReceive(HttpMessage msg) { if (options.isEnabled() && msg.getResponseHeader().isHtml()) { try { String html = msg.getResponseBody().toString(); if (msg.getHistoryRef() != null) { String host = msg.getRequestHeader().getHeader("host"); String frontEndApiUrl = API.getInstance().getCallBackUrl(this.api, "https://" + host); int historyReferenceId = msg.getHistoryRef().getHistoryId(); String scriptToInject = getScriptToInject(frontEndApiUrl, historyReferenceId); OutputDocument newResponseBody = makeNewDocument(html, scriptToInject); msg.getResponseBody().setBody(newResponseBody.toString()); int newLength = msg.getResponseBody().length(); msg.getResponseHeader().setContentLength(newLength); for (String header : CSP_HEADERS) { msg.getResponseHeader().setHeader(header, null); } } else { LOGGER.debug("No historyRef found in the HttpMessage."); } } catch (Exception e) { LOGGER.error(e.getMessage(), e); } } return true; }
Source:
<code>public HeaderWriterFilter(List<HeaderWriter> headerWriters) { Assert.notEmpty(headerWriters, "headerWriters cannot be null or empty"); <START> compositeHeaderWriter = new CompositeHeaderWriter(headerWriters); <END> }</code><technical_language>Please this for member variables</technical_language>

Target:
public HeaderWriterFilter(List<HeaderWriter> headerWriters) { Assert.notEmpty(headerWriters, "headerWriters cannot be null or empty"); this.headerWriter = new CompositeHeaderWriter(headerWriters); }
Source:
<code>private void printCommands( Consumer<String> output ) { <START> Map<AdminCommandSection,List<AdminCommand.Provider>> groupedProviders = groupProvidersBySegment(); <END> AdminCommandSection.general() .printAllCommandsUnderSection( output, groupedProviders.remove( AdminCommandSection.general() ) ); groupedProviders.entrySet().stream() .sorted( Comparator.comparing( groupedProvider -> groupedProvider.getKey().printable() ) ) .forEach(entry -> entry.getKey().printAllCommandsUnderSection( output, entry.getValue() ) ); }</code><technical_language>a mix of terminology. Section everywhere</technical_language>

Target:
private void printCommands( Consumer<String> output ) { Map<AdminCommandSection,List<AdminCommand.Provider>> groupedProviders = groupProvidersBySection(); AdminCommandSection.general() .printAllCommandsUnderSection( output, groupedProviders.remove( AdminCommandSection.general() ) ); groupedProviders.entrySet().stream() .sorted( Comparator.comparing( groupedProvider -> groupedProvider.getKey().printable() ) ) .forEach(entry -> entry.getKey().printAllCommandsUnderSection( output, entry.getValue() ) ); }
Source:
<code>public ContainerRequest filter(ContainerRequest request) { if (getAuthConfig().isEnabled()) { final String resourceName; if (request.getPath().startsWith("druid/broker/v1")) { resourceName = "BROKER"; } else if (request.getPath().startsWith("druid/coordinator/v1")) { resourceName = "COORDINATOR"; } else if (request.getPath().startsWith("druid/historical/v1")) { resourceName = "HISTORICAL"; } else if (request.getPath().startsWith("druid/indexer/v1")) { resourceName = "OVERLORD"; } else if (request.getPath().startsWith("druid/coordinator/v1/rules")) { resourceName = "RULES"; } else if (request.getPath().startsWith("druid/coordinator/v1/tiers")) { resourceName = "TIER"; } else if (request.getPath().startsWith("druid/worker/v1")) { resourceName = "WORKER"; } else if (request.getPath().startsWith("druid/coordinator/v1/servers")) { resourceName = "SERVER"; } else if (request.getPath().startsWith("status")) { resourceName = "STATUS"; <START> } else { <END> throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST).entity( String.format( "Do not know how to authorize this request path [%s] with StateResourceFilter", request.getPath() ) ).build() ); } final AuthorizationInfo authorizationInfo = (AuthorizationInfo) getReq().getAttribute(AuthConfig.DRUID_AUTH_TOKEN); Preconditions.checkNotNull( authorizationInfo, "Security is enabled but no authorization info found in the request" ); final Access authResult = authorizationInfo.isAuthorized( new Resource(resourceName, ResourceType.STATE), getAction(request) ); if (!authResult.isAllowed()) { throw new WebApplicationException( Response.status(Response.Status.FORBIDDEN) .entity(String.format("Access-Check-Result: %s", authResult.toString())) .build() ); } } return request; }</code><technical_language>resourceName for states e.g. "state" instead of specific requires conditional hardcoding of URLs? if need give a name</technical_language>

Target:
public ContainerRequest filter(ContainerRequest request) { if (getAuthConfig().isEnabled()) { final String resourceName = "STATE"; final AuthorizationInfo authorizationInfo = (AuthorizationInfo) getReq().getAttribute(AuthConfig.DRUID_AUTH_TOKEN); Preconditions.checkNotNull( authorizationInfo, "Security is enabled but no authorization info found in the request" ); final Access authResult = authorizationInfo.isAuthorized( new Resource(resourceName, ResourceType.STATE), getAction(request) ); if (!authResult.isAllowed()) { throw new WebApplicationException( Response.status(Response.Status.FORBIDDEN) .entity(String.format("Access-Check-Result: %s", authResult.toString())) .build() ); } } return request; }
Source:
<code>DiscoveryOptionsResource(Resource delegate) { if (delegate == null) { throw HostControllerLogger.ROOT_LOGGER.nullVar("delegate"); <START> } <END> this.delegate = delegate; }</code><technical_language>need change this; FYI. put in a of early in AS7 days, assert delegate != null; If this is null a programming error, a mistake in user input</technical_language>

Target:
DiscoveryOptionsResource(Resource delegate) { assert delegate != null : "delegate is null"; this.delegate = delegate; }
Source:
<code>private SiteMap.LinkElement getSiteMapLinkElement(Page page){ <START> ValueMap map = page.adaptTo(ValueMap.class); <END> String updationFreq = map.get("updationFreq", "daily"); String priority = map.get("priority","0.5"); String lastModifiedDate = getDateAsString( page.getLastModified().getTime(), "yyyy-MM-dd'T'hh:mm:ss XXX"); return new SiteMap.LinkElement(page.getPath()+".html", lastModifiedDate, updationFreq, priority); }</code><technical_language>I want, page.getProperties() .. ValueMap of cq:Page node</technical_language>

Target:
private SiteMap.LinkElement getSiteMapLinkElement(Page page){ ValueMap map = page.getProperties(); String updationFreq = map.get(PAGE_PROP_UPD_FREQ, PAGE_PROP_UPD_FREQ_DEFAULT); String priority = map.get(PRIORITY,PAGE_PROP_PRIORITY_DEFAULT); String lastModifiedDate = getDateAsString( page.getLastModified().getTime(), DEFAULT_DATE_FORMAT); return new SiteMap.LinkElement(page.getPath()+"."+DEFAULT_LINK_EXTENSION, lastModifiedDate, updationFreq, priority); }
Source:
<code>public boolean push(Context ctx,List<Survey> surveys){ Log.d(TAG, "Starting PUSH process..."); if(isPushing) return false; isPushing =true; context=ctx; if(surveys==null || surveys.size()==0){ postException(new Exception(context.getString(R.string.progress_push_no_survey))); isPushing =false; return false; } try { postProgress(context.getString(R.string.progress_push_preparing_survey)); Log.d(TAG, "Preparing survey for pushing..."); <START> PullDhisSDKDataSource.wipeDataBase(); <END> convertToSDK(surveys); isPushing =EventExtended.getAllEvents().size()>0; if(!isPushing) return false; postProgress(context.getString(R.string.progress_push_posting_survey)); Log.d(TAG, "Pushing survey data to server..."); SdkPushController.sendEventChanges(); }catch (Exception ex) { Log.e(TAG, "push: " + ex.getLocalizedMessage()); unregister(); postException(ex); isPushing =false; return false; } return true; }</code><technical_language>@idelcano is correct PushController invoked PullShisSDKDataSource. If is necessary remove sdk tables this remove is distinct in pull if remove sdk tables is equal in pull push in other class. I a doubt, is necessary removed programs, org unit in push process</technical_language>

Target:
public boolean push(Context ctx,List<Survey> surveys){ Log.d(TAG, "Starting PUSH process..."); if(isPushing) return false; isPushing =true; context=ctx; if(surveys==null || surveys.size()==0){ postException(new Exception(context.getString(R.string.progress_push_no_survey))); isPushing =false; return false; } try { postProgress(context.getString(R.string.progress_push_preparing_survey)); Log.d(TAG, "Preparing survey for pushing..."); Delete.tables( EventFlow.class, TrackedEntityDataValueFlow.class, StateFlow.class ); convertToSDK(surveys); isPushing =EventExtended.getAllEvents().size()>0; if(!isPushing) return false; postProgress(context.getString(R.string.progress_push_posting_survey)); Log.d(TAG, "Pushing survey data to server..."); SdkPushController.sendEventChanges(); }catch (Exception ex) { Log.e(TAG, "push: " + ex.getLocalizedMessage()); postException(ex); isPushing =false; return false; } return true; }