auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public @Nullable HostThread resolve(ITmfEvent event) { Object cpuObj = TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpuObj == null) { return null; } Integer cpu = (Integer) cpuObj; Iterable<KernelAnalysis> kernelModules = TmfTraceUtils .getAnalysisModulesOfClass(event.getTrace(), KernelAnalysis.class); for (KernelAnalysis analysis : kernelModules) { if (analysis == null) { continue; } Integer tid = KernelThreadInformationProvider.getThreadOnCpu( analysis, cpu, event.getTimestamp().getValue()); if (tid != null) { <START> return new HostThread(event.getTrace().getHostId(), tid); <END> } } return null; }</code><technical_language>In events table columns "Tid" display HostThread.toSting() includes a long Host ID. This is I expected for column. TID instead? confusing for (at for me)</technical_language>

Target:
public @Nullable Integer resolve(ITmfEvent event) { Object cpuObj = TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpuObj == null) { return null; } Integer cpu = (Integer) cpuObj; Iterable<KernelAnalysis> kernelModules = TmfTraceUtils .getAnalysisModulesOfClass(event.getTrace(), KernelAnalysis.class); for (KernelAnalysis analysis : kernelModules) { if (analysis == null) { continue; } Integer tid = KernelThreadInformationProvider.getThreadOnCpu( analysis, cpu, event.getTimestamp().getValue()); if (tid != null) { return tid; } } return null; }
Source:
<code>protected void init () { super.init(); entitySelectBox = new VisSelectBox<>(); entitySelectBox.getSelection().setProgrammaticChangeEvents(false); entitySelectBox.addListener(properties.getSharedSelectBoxChangeListener()); animSelectBox = new VisSelectBox<>(); animSelectBox.getSelection().setProgrammaticChangeEvents(false); animSelectBox.addListener(properties.getSharedSelectBoxChangeListener()); VisTable table = new VisTable(true); table.add(new VisLabel("Entity")); <START> table.add(entitySelectBox); <END> table.add(new VisLabel("Animation")); table.add(animSelectBox); add(table); }</code><technical_language>Add table.row() table.add(entitySelectBox); UI fit in Entity Properties panel. please run code formatter code changes (see CONTRIBUTING file)</technical_language>

Target:
protected void init () { super.init(); entitySelectBox = new VisSelectBox<>(); entitySelectBox.getSelection().setProgrammaticChangeEvents(false); entitySelectBox.addListener(properties.getSharedSelectBoxChangeListener()); animSelectBox = new VisSelectBox<>(); animSelectBox.getSelection().setProgrammaticChangeEvents(false); animSelectBox.addListener(properties.getSharedSelectBoxChangeListener()); VisTable table = new VisTable(true); table.add(new VisLabel("Entity")); table.add(entitySelectBox); table.row(); table.add(new VisLabel("Animation")); table.add(animSelectBox); add(table); }
Source:
<code>public void basicTest() throws InterruptedException, IOException, StoreException { <START> time.sleep(1 * Time.MsPerSec - 1); <END> MockId addedId = put(1, PUT_RECORD_SIZE, time.milliseconds()).get(0); time.sleep(1 * Time.MsPerSec); liveKeys.remove(addedId); expiredKeys.add(addedId); StoreInfo storeInfo = store.get(new ArrayList<>(liveKeys), EnumSet.noneOf(StoreGetOptions.class)); checkStoreInfo(storeInfo, liveKeys); MockMessageStoreHardDelete hd = (MockMessageStoreHardDelete) hardDelete; for (MockId id : deletedKeys) { hd.setMessageInfo(allKeys.get(id).getFirst()); verifyGetFailure(id, StoreErrorCodes.ID_Deleted); storeInfo = store.get(Collections.singletonList(id), EnumSet.of(StoreGetOptions.Store_Include_Deleted)); checkStoreInfo(storeInfo, Collections.singleton(id)); storeInfo = store.get(Collections.singletonList(id), EnumSet.allOf(StoreGetOptions.class)); checkStoreInfo(storeInfo, Collections.singleton(id)); } for (MockId id : expiredKeys) { verifyGetFailure(id, StoreErrorCodes.TTL_Expired); storeInfo = store.get(Collections.singletonList(id), EnumSet.of(StoreGetOptions.Store_Include_Expired)); checkStoreInfo(storeInfo, Collections.singleton(id)); storeInfo = store.get(Collections.singletonList(id), EnumSet.allOf(StoreGetOptions.class)); checkStoreInfo(storeInfo, Collections.singleton(id)); } delete(addedId); verifyGetFailure(getUniqueId(), StoreErrorCodes.ID_Not_Found); }</code><technical_language>is time advanced 999 ms a later? I follow intent here. adding for expiring 1s advancing time 2s enough? (as i see, unit changed ms s, I values need change)</technical_language>

Target:
public void basicTest() throws InterruptedException, IOException, StoreException { MockId addedId = put(1, PUT_RECORD_SIZE, time.seconds() + 1).get(0); time.sleep(2 * Time.MsPerSec); liveKeys.remove(addedId); expiredKeys.add(addedId); StoreInfo storeInfo = store.get(new ArrayList<>(liveKeys), EnumSet.noneOf(StoreGetOptions.class)); checkStoreInfo(storeInfo, liveKeys); MockMessageStoreHardDelete hd = (MockMessageStoreHardDelete) hardDelete; for (MockId id : deletedKeys) { hd.setMessageInfo(allKeys.get(id).getFirst()); verifyGetFailure(id, StoreErrorCodes.ID_Deleted); storeInfo = store.get(Collections.singletonList(id), EnumSet.of(StoreGetOptions.Store_Include_Deleted)); checkStoreInfo(storeInfo, Collections.singleton(id)); storeInfo = store.get(Collections.singletonList(id), EnumSet.allOf(StoreGetOptions.class)); checkStoreInfo(storeInfo, Collections.singleton(id)); } for (MockId id : expiredKeys) { verifyGetFailure(id, StoreErrorCodes.TTL_Expired); storeInfo = store.get(Collections.singletonList(id), EnumSet.of(StoreGetOptions.Store_Include_Expired)); checkStoreInfo(storeInfo, Collections.singleton(id)); storeInfo = store.get(Collections.singletonList(id), EnumSet.allOf(StoreGetOptions.class)); checkStoreInfo(storeInfo, Collections.singleton(id)); } delete(addedId); verifyGetFailure(getUniqueId(), StoreErrorCodes.ID_Not_Found); }
Source:
<code>public String build() { return new StringBuilder(URL_CATALOG).append("/buckets/") .append(this.catalogObject.getBucketName()) .append("/resources?") .append(paramPair(NAME_PARAM, this.catalogObject.getNodeSourceName())) .append("&") .append(paramPair(KIND_PARAM, this.catalogObject.getKind())) .append("&") .append(paramPair(COMMIT_MESSAGE_PARAM, this.catalogObject.getCommitMessage())) <START> .append("&") <END> .append(paramPair(OBJECT_CONTENT_TYPE_PARAM, this.catalogObject.getObjectContentType())) .toString(); }</code><technical_language>&s repetitive</technical_language>

Target:
public String build() { String urlEncodedCommitMessage = getUrlEncodedCommitMessageOrFail(); StringBuilder builder = new StringBuilder(URL_CATALOG).append("/buckets/") .append(this.catalogObjectAction.getBucketName()); if (this.catalogObjectAction.isRevised()) { builder.append("/resources/").append(this.catalogObjectAction.getNodeSourceName()).append("/revisions?"); appendParameters(builder, paramPair(COMMIT_MESSAGE_PARAM, urlEncodedCommitMessage)); } else { builder.append("/resources?"); appendParameters(builder, paramPair(NAME_PARAM, this.catalogObjectAction.getNodeSourceName()), paramPair(KIND_PARAM, this.catalogObjectAction.getKind()), paramPair(COMMIT_MESSAGE_PARAM, urlEncodedCommitMessage), paramPair(OBJECT_CONTENT_TYPE_PARAM, this.catalogObjectAction.getObjectContentType())); } return builder.toString(); }
Source:
<code>public String getName() { <START> return name.replaceAll("^\\s+|\\s+$", ""); <END> }</code><technical_language>I .trim() a regular expression; this more robust clearer</technical_language>

Target:
public String getName() { return name.trim(); }
Source:
<code><START> private static CONNECTClient<EntityExchangeManagementPortType> getClient() throws Exception { <END> String url = oProxyHelper.getAdapterEndPointFromConnectionManager(ENTITY_EXCHANGE_MANAGEMENT_SERVICE_NAME); ServicePortDescriptor<EntityExchangeManagementPortType> portDescriptor = new ExchangeManagementPortDescriptor(); return CONNECTCXFClientFactory.getInstance().getCONNECTClientUnsecured(portDescriptor, url, new AssertionType()); }</code><technical_language>Do want create a new client time call getClient? cache this some sort of singleton, alternative</technical_language>

Target:
private static CONNECTClient<EntityExchangeManagementPortType> getClient() throws ExchangeManagerException { if (null == client) { String url = oProxyHelper.getAdapterEndPointFromConnectionManager(ENTITY_EXCHANGE_MANAGEMENT_SERVICE_NAME); ServicePortDescriptor<EntityExchangeManagementPortType> portDescriptor = new ExchangeManagementPortDescriptor(); client = CONNECTCXFClientFactory.getInstance().getCONNECTClientUnsecured(portDescriptor, url, new AssertionType()); } return client; }
Source:
<code>public Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName) { <START> return tryGetSourceTable(tableName).map((t) -> { <END> RaptorTableHandle sourceTableHandle = (RaptorTableHandle) getTableHandle(t); if (sourceTableHandle != null) { return new ColumnRangesSystemTable(sourceTableHandle, dbi); } return null; }); }</code><technical_language>Nit: parenthesis needed for lambda parameter method is long, name parameter table</technical_language>

Target:
public Optional<SystemTable> getSystemTable(ConnectorSession session, SchemaTableName tableName) { return getSourceTable(tableName) .map(this::getTableHandle) .map(handle -> new ColumnRangesSystemTable(handle, dbi)); }
Source:
<code>private static String urlEncode(String s) { try { return URLEncoder.encode(s, Charsets.UTF_8.name()) <START> .replace("+", "%20").replace("*", "%2A").replace("%7E", "~"); <END> } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }</code><technical_language>switch this .replace("+", "%20") appears problematic character is space</technical_language>

Target:
private static String urlEncode(String s) { try { return URLEncoder.encode(s, Charsets.UTF_8.name()) .replace("+", "%20").replace("*", "%2A"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
Source:
<code>public ArrayList<Property> getProcessProperties() { if (Objects.isNull(processProperties)) { <START> return new ArrayList<>(); <END> } return processProperties; }</code><technical_language>assign this empty list return it</technical_language>

Target:
public ArrayList<Property> getProcessProperties() { if (Objects.isNull(processProperties)) { processProperties = new ArrayList<>(); } return processProperties; }
Source:
<code>public List<String> getDomains() throws DomainListException { <START> List<String> domains = getDomainListInternal(); <END> if (domains != null) { domains = new ArrayList<String>(domains); String hostName; try { hostName = getDNSServer().getHostName(getDNSServer().getLocalHost()); } catch (UnknownHostException ue) { hostName = "localhost"; } getLogger().info("Local host is: " + hostName); if (autoDetect && (!hostName.equals("localhost"))) { domains.add(hostName.toLowerCase(Locale.US)); } if (autoDetectIP) { domains.addAll(getDomainsIP(domains, dns, getLogger())); } if (getLogger().isInfoEnabled()) { for (String domain : domains) { getLogger().debug("Handling mail for: " + domain); } } } return ImmutableList.copyOf(domains); }</code><technical_language>I tend variable re-affectation.... I prefer a variable called "mutableDomains" created seing domains reused. way, nice spot</technical_language>

Target:
public List<String> getDomains() throws DomainListException { List<String> domains = getDomainListInternal(); if (domains != null) { ArrayList<String> mutableDomains = new ArrayList<String>(domains); String hostName; try { hostName = getDNSServer().getHostName(getDNSServer().getLocalHost()); } catch (UnknownHostException ue) { hostName = "localhost"; } getLogger().info("Local host is: " + hostName); if (autoDetect && (!hostName.equals("localhost"))) { mutableDomains.add(hostName.toLowerCase(Locale.US)); } if (autoDetectIP) { mutableDomains.addAll(getDomainsIP(mutableDomains, dns, getLogger())); } if (getLogger().isInfoEnabled()) { for (String domain : mutableDomains) { getLogger().debug("Handling mail for: " + domain); } } return ImmutableList.copyOf(mutableDomains); } return ImmutableList.of(); }
Source:
<code>public Result apply(JoinNode joinNode, Captures captures, Context context) { if (!(joinNode.getType() == INNER) || joinNode.getDistributionType().isPresent()) { return Result.empty(); } MultiJoinNode multiJoinNode = toMultiJoinNode(joinNode, context.getLookup(), JOIN_LIMIT); if (multiJoinNode.getSources().size() < 2) { return Result.empty(); } JoinEnumerator joinEnumerator = new JoinEnumerator( context.getSession(), context.getCostProvider(), costComparator, context.getIdAllocator(), multiJoinNode.getFilter(), context.getLookup()); JoinEnumerationResult result = joinEnumerator.chooseJoinOrder(multiJoinNode.getSources(), multiJoinNode.getOutputSymbols()); if (!result.getPlanNode().isPresent()) { return Result.empty(); } <START> if (result.getCost().hasUnknownComponents() || result.getCost().equals(INFINITE_COST)) { <END> return Result.empty(); } return Result.ofPlanNode(result.getPlanNode().get()); }</code><technical_language>Should't this logic part of JoinEnumerator#chooseJoinOrder return Optional<PlanNode> Optional.empty() returned join order decided (e.g. stats missing)</technical_language>

Target:
public Result apply(JoinNode joinNode, Captures captures, Context context) { MultiJoinNode multiJoinNode = toMultiJoinNode(joinNode, context.getLookup(), getMaxReorderedTables(context.getSession())); JoinEnumerator joinEnumerator = new JoinEnumerator( context.getSession(), context.getCostProvider(), costComparator, context.getIdAllocator(), multiJoinNode.getFilter(), context.getLookup(), context); JoinEnumerationResult result = joinEnumerator.chooseJoinOrder(multiJoinNode.getSources(), multiJoinNode.getOutputSymbols()); if (!result.getPlanNode().isPresent()) { return Result.empty(); } return Result.ofPlanNode(result.getPlanNode().get()); }
Source:
<code>public void testParseJDBCPassword() throws SqlException { String password = "Abd98*@80EFg"; <START> String raw = "No suitable driver found for jdbc:splice://dwbdtest1r1w3.wellpoint" + <END> ".com:1527/splicedb;user=af29891;password=" + password; assertEquals(password, SpliceClient.parseJDBCPassword(raw)); raw = "No suitable driver found for jdbc:splice://dwbdtest1r1w3.wellpoint" + ".com:1527/splicedb;password=" + password + ";user=af29891"; assertEquals(password, SpliceClient.parseJDBCPassword(raw)); }</code><technical_language>Please replace host name. generic names</technical_language>

Target:
public void testParseJDBCPassword() throws SqlException { String password = "Abd98*@80EFg"; String raw = "jdbc:splice://localhost.com:1527/splicedb;user=af29891;password=" + password; assertEquals(password, SpliceClient.parseJDBCPassword(raw)); raw = "jdbc:splice://localhost:1527/splicedb;password=" + password + ";user=af29891"; assertEquals(password, SpliceClient.parseJDBCPassword(raw)); }
Source:
<code>private boolean isCatalogAccessible(String catalogName) { return accessControl.filterCatalogs(session.getIdentity(), ImmutableSet.of(catalogName)).contains(catalogName) <START> && metadata.catalogExists(session, catalogName); <END> }</code><technical_language>i reverse -- check access control for existing catalogs. I access control impl problems for non-existing catalogs. (here & below)</technical_language>

Target:
private boolean isCatalogAccessible(String catalogName) { return metadata.catalogExists(session, catalogName) && accessControl.filterCatalogs(session.getIdentity(), ImmutableSet.of(catalogName)).contains(catalogName); }
Source:
<code>public SQLException(String sqlState, String message) { super(message); assert(sqlState.length() == 5); byte[] sqlStateBytes = null; try { <START> sqlStateBytes = sqlState.getBytes("UTF-8"); <END> } catch (UnsupportedEncodingException e1) { sqlStateBytes = new byte[5]; e1.printStackTrace(); assert(false); } assert(sqlStateBytes.length == 5); m_sqlState = sqlStateBytes; }</code><technical_language>If getBytes(StandardCharsets.UTF_8), avoid this exception clean this part</technical_language>

Target:
public SQLException(String sqlState, String message) { super(message); assert(sqlState.length() == 5); byte[] sqlStateBytes = null; sqlStateBytes = sqlState.getBytes(StandardCharsets.UTF_8); assert(sqlStateBytes.length == 5); m_sqlState = sqlStateBytes; }
Source:
<code>public Vector2 getOrientation () { <START> return position.set(vals[COS], vals[SIN]); <END> }</code><technical_language>Uumm, changing position here... Edit: Ah well, a problem. rename variable tmp :dancer: Edit2: Rethinking it, a problem, if getPosition() getOrientation() time. add output parameter</technical_language>

Target:
public Vector2 getOrientation () { return orientation.set(vals[COS], vals[SIN]); }
Source:
<code>public ITimeGraphEntry @Nullable getChildren(@Nullable Object parentElement) { if (parentElement instanceof CriticalPathEntry) { <START> List<@NonNull ? extends ITimeGraphEntry> children = ((CriticalPathEntry) parentElement).getChildren(); <END> return children.toArray(new TimeGraphEntry[children.size()]); } return null; }</code><technical_language>This change anything? if change declaration in ITimeGraphEntry List<@NonNull ? extends ITimeGraphEntry> getChildren(); returned getChildren() fits required declaration, more warning. (ok I noticed changed this, ok good!)</technical_language>

Target:
public ITimeGraphEntry @Nullable getChildren(@Nullable Object parentElement) { if (parentElement instanceof CriticalPathEntry) { List<? extends ITimeGraphEntry> children = ((CriticalPathEntry) parentElement).getChildren(); return children.toArray(new TimeGraphEntry[children.size()]); } return null; }
Source:
<code><START> public void createAndStoreCredentialFile(String username, String password) { <END> if (!PASchedulerProperties.SCHEDULER_CREATE_CREDENTIALS_WHEN_LOGIN.getValueAsBoolean()) { return; } try { byte[] credentialBytes = createCredentials(username, password); saveCredentialsFile(username, credentialBytes); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>I public methods in this class statically synchronized class. concurrency issues creating credential files attempts occur time (especially user)</technical_language>

Target:
public synchronized void createAndStoreCredentialFile(String username, String password) { if (!PASchedulerProperties.SCHEDULER_CREATE_CREDENTIALS_WHEN_LOGIN.getValueAsBoolean()) { return; } try { byte[] credentialBytes = createCredentials(username, password); saveCredentialsFile(username, credentialBytes); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>private void confirmResetStatistics() { if (!countAll) { ConfirmationDialog conDialog = new ConfirmationDialog( getActivity(), R.string.statistics_reset_data_title, R.string.statistics_reset_data_msg) { @Override public void onConfirmButtonPressed( <START> DialogInterface dialog) { <END> dialog.dismiss(); doResetStatistics(); } }; conDialog.createNewDialog().show(); } }</code><technical_language>Please do break this line</technical_language>

Target:
private void confirmResetStatistics() { if (!countAll) { ConfirmationDialog conDialog = new ConfirmationDialog( getActivity(), R.string.statistics_reset_data, R.string.statistics_reset_data_msg) { @Override public void onConfirmButtonPressed(DialogInterface dialog) { dialog.dismiss(); doResetStatistics(); } }; conDialog.createNewDialog().show(); } }
Source:
<code><START> public int read() throws IOException { <END> return length > processed++ ? Math.abs(random.nextInt()) : -1; }</code><technical_language>@Override please</technical_language>

Target:
public int read() throws IOException { return length > processed++ ? Math.abs(random.nextInt() & 0xFF) : -1; }
Source:
<code>public void setUp() throws Exception { PowerMockito.mockStatic(GdxNativesLoader.class); testSprite = new SingleSprite("testSprite"); <START> project = new Project(MockUtil.mockContextForProject(), "testProject"); <END> ProjectManager.getInstance().setCurrentProject(project); userVariable = new UserVariable(TEST_USERVARIABLE); project.addUserVariable(userVariable); StageActivity.webConnectionHolder = Mockito.mock(WebConnectionHolder.class); webConnectionFactory = Mockito.mock(WebConnectionFactory.class); webConnection = Mockito.mock(WebConnection.class); }</code><technical_language>this test require a project</technical_language>

Target:
public void setUp() throws Exception { mockStatic(GdxNativesLoader.class); testSprite = new SingleSprite("testSprite"); userVariable = new UserVariable(TEST_USERVARIABLE); StageActivity.stageListener = mock(StageListener.class); StageActivity.stageListener.webConnectionHolder = mock(WebConnectionHolder.class); webConnectionFactory = mock(WebConnectionFactory.class); webConnection = mock(WebConnection.class); }
Source:
<code>private boolean isMailWantedBy(String userEmail, String notificationPreferenceKey){ User user; try { user = (new ThriftClients()).makeUserClient().getByEmail(userEmail); } catch (TException e){ log.info("Problem fetching user:" + e); return false; } if(user != null) { if(!user.isSetWantsMailNotification()) { user.setWantsMailNotification(true); } <START> SW360Utils.setDefaultNotificationsPreferencesIfEmpty(user); <END> return user.isWantsMailNotification() && user.getNotificationPreferences().getOrDefault(notificationPreferenceKey, Boolean.FALSE) ; } return false; }</code><technical_language>This line line is migration code db-script is needed, right? fine! in place (maybe if-statement), in SW360Utils</technical_language>

Target:
private boolean isMailWantedBy(String userEmail, String notificationPreferenceKey){ User user; try { user = (new ThriftClients()).makeUserClient().getByEmail(userEmail); } catch (TException e){ log.info("Problem fetching user:" + e); return false; } if(user != null) { SW360Utils.initializeMailNotificationsPreferences(user); return user.isWantsMailNotification() && user.getNotificationPreferences().getOrDefault(notificationPreferenceKey, Boolean.FALSE) ; } return false; }
Source:
<code>public void onRenderTick(RenderWorldLastEvent event) { if(Minecraft.getMinecraft().player != null && !Minecraft.getMinecraft().player.isDead) { if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 || Minecraft.getMinecraft().currentScreen != null) { EntityPlayer p = Minecraft.getMinecraft().player; <START> if(!p.isInWater()) <END> updateSwimDataAngles(p); updateSwimRenderAngles(p); } } }</code><technical_language>This is sketchy. this encompass of these? one</technical_language>

Target:
public void onRenderTick(RenderWorldLastEvent event) { EntityPlayer p = Minecraft.getMinecraft().player; if (p != null && !p.isDead) { if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 || Minecraft.getMinecraft().currentScreen != null) { if (!p.isInWater()) { updateSwimDataAngles(p); } updateSwimRenderAngles(p); } } }
Source:
<code>public void onFollowTapped(View view, String blogName, final long blogId) { mDispatcher.dispatch(AccountActionBuilder.newFetchSubscriptionsAction()); Snackbar.make(view, Html.fromHtml(getString(R.string.reader_followed_blog_notifications, "<b>", blogName, "</b>")), Snackbar.LENGTH_LONG) .setAction(getString(R.string.reader_followed_blog_notifications_action), new View.OnClickListener() { @Override public void onClick(View view) { <START> AddOrDeleteSubscriptionPayload payload = new AddOrDeleteSubscriptionPayload( <END> String.valueOf(blogId), AddOrDeleteSubscriptionPayload.SubscriptionAction.NEW); mDispatcher.dispatch(newUpdateSubscriptionNotificationPostAction(payload)); } }) .setActionTextColor(getResources().getColor(R.color.color_accent)) .show(); }</code><technical_language>tracking this event reader list, track here</technical_language>

Target:
public void onFollowTapped(View view, String blogName, final long blogId) { mDispatcher.dispatch(AccountActionBuilder.newFetchSubscriptionsAction()); if (isAdded()) { String blog = TextUtils.isEmpty(blogName) ? getString(R.string.reader_followed_blog_notifications_this) : blogName; Snackbar.make(view, Html.fromHtml(getString(R.string.reader_followed_blog_notifications, "<b>", blog, "</b>")), AccessibilityUtils.getSnackbarDuration(getActivity())) .setAction(getString(R.string.reader_followed_blog_notifications_action), new View.OnClickListener() { @Override public void onClick(View view) { AnalyticsUtils.trackWithSiteId(Stat.FOLLOWED_BLOG_NOTIFICATIONS_READER_ENABLED, blogId); AddOrDeleteSubscriptionPayload payload = new AddOrDeleteSubscriptionPayload( String.valueOf(blogId), SubscriptionAction.NEW); mDispatcher.dispatch(newUpdateSubscriptionNotificationPostAction(payload)); ReaderBlogTable.setNotificationsEnabledByBlogId(blogId, true); } }) .setActionTextColor(getResources().getColor(R.color.color_accent)) .show(); } }
Source:
<code><START> private boolean isUserBrickAdapter(BaseAdapter baseAdapter) { <END> return baseAdapter instanceof UserBrickAdapter; }</code><technical_language>this method static i guess? more relevant: is this method necessary? i usage</technical_language>

Target:
private static boolean isUserBrickAdapter(BaseAdapter baseAdapter) { return baseAdapter instanceof UserBrickAdapter; }
Source:
<code>public InputStream nextElement() { int bytesRead; try { <START> bytesRead = inputStream.read(buffer, 0, buffer.length); <END> } catch (IOException e) { throw new ChunkedUploadException("read from input stream error", e); } byte[] chunk; if (bytesRead != -1) { chunk = constructSignedChunk(bytesRead, buffer); } else { chunk = constructSignedChunk(0, buffer); lastChunked = true; } return new ByteArrayInputStream(chunk); }</code><technical_language>call ByteStreams.readFully(InputStream, byte[])</technical_language>

Target:
public InputStream nextElement() { int bytesRead; try { bytesRead = ByteStreams.read(inputStream, buffer, 0, buffer.length); } catch (IOException e) { throw new ChunkedUploadException("read from input stream error", e); } byte[] chunk; if (bytesRead > 0) { chunk = constructSignedChunk(bytesRead, buffer); } else { chunk = constructSignedChunk(0, buffer); lastChunked = true; } return new ByteArrayInputStream(chunk); }
Source:
<code>RootReference<Long,Record<?,?>>[] collectUndoLogRootReferences() { BitSet opentransactions = openTransactions.get(); @SuppressWarnings("unchecked") RootReference<Long,Record<?,?>>[] undoLogRootReferences = <START> (RootReference<Long,Record<?,?>>[])new RootReference[opentransactions.length()]; <END> for (int i = opentransactions.nextSetBit(0); i >= 0; i = opentransactions.nextSetBit(i+1)) { MVMap<Long,Record<?,?>> undoLog = undoLogs[i]; if (undoLog != null) { RootReference<Long,Record<?,?>> rootReference = undoLog.getRoot(); if (rootReference.needFlush()) { return null; } undoLogRootReferences[i] = rootReference; } } return undoLogRootReferences; }</code><technical_language>This cast too</technical_language>

Target:
RootReference<Long,Record<?,?>>[] collectUndoLogRootReferences() { BitSet opentransactions = openTransactions.get(); @SuppressWarnings("unchecked") RootReference<Long,Record<?,?>>[] undoLogRootReferences = new RootReference[opentransactions.length()]; for (int i = opentransactions.nextSetBit(0); i >= 0; i = opentransactions.nextSetBit(i+1)) { MVMap<Long,Record<?,?>> undoLog = undoLogs[i]; if (undoLog != null) { RootReference<Long,Record<?,?>> rootReference = undoLog.getRoot(); if (rootReference.needFlush()) { return null; } undoLogRootReferences[i] = rootReference; } } return undoLogRootReferences; }
Source:
<code>private boolean validateContent(byte[] content) { for (int i = 0; i < content.length; i++) { if (content[i] != (byte) (i % (Byte.MAX_VALUE + 1))) { return false; } <START> ; <END> } return true; }</code><technical_language>Please remove maverick ";"</technical_language>

Target:
private boolean validateContent(byte[] content) { for (int i = 0; i < content.length; i++) { if (content[i] != (byte) (i % (Byte.MAX_VALUE + 1))) { return false; } } return true; }
Source:
<code>public void setFactionNameAndDefaults(String factionName) { this.factionName = factionName; FactionNpcDefault npcDefault = NpcDefaultsRegistry.getFactionNpcDefault(this); applyFactionNpcSettings(npcDefault); if (!getCustomEquipmentOverride()) { <START> npcDefault.applyEquipment(this); <END> } Range<Float> heightRange = npcDefault.getHeightRange(); float newHeight = heightRange.getMinimum() + world.rand.nextFloat() * (heightRange.getMaximum() - heightRange.getMinimum()); setSize((newHeight / 1.8f) * 0.6f * npcDefault.getThinness(), newHeight); }</code><technical_language>fix formatting (should indented) for PR</technical_language>

Target:
public void setFactionNameAndDefaults(String factionName) { this.factionName = factionName; FactionNpcDefault npcDefault = NpcDefaultsRegistry.getFactionNpcDefault(this); applyFactionNpcSettings(npcDefault); if (!getCustomEquipmentOverride()) { npcDefault.applyEquipment(this); } if (!AWNPCStatics.vanillaEquipmentDropRate) { inventoryArmorDropChances = new float[] {1.f, 1.f, 1.f, 1.f}; inventoryHandsDropChances = new float[] {1.f, 1.f}; } Range<Float> heightRange = npcDefault.getHeightRange(); float newHeight = heightRange.getMinimum() + world.rand.nextFloat() * (heightRange.getMaximum() - heightRange.getMinimum()); setSize((newHeight / 1.8f) * 0.6f * npcDefault.getThinness(), newHeight); }
Source:
<code>public List<MetricFamilySamples> collect() { List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); <START> addBufferPoolMetrics(mfs); <END> return mfs; }</code><technical_language>This function inlined</technical_language>

Target:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); GaugeMetricFamily used = new GaugeMetricFamily( "jvm_buffer_pool_used_bytes", "Used bytes of a given JVM buffer pool.", Collections.singletonList("pool")); mfs.add(used); GaugeMetricFamily capacity = new GaugeMetricFamily( "jvm_buffer_pool_capacity_bytes", "Bytes capacity of a given JVM buffer pool.", Collections.singletonList("pool")); mfs.add(capacity); GaugeMetricFamily buffers = new GaugeMetricFamily( "jvm_buffer_pool_used_buffers", "Used buffers of a given JVM buffer pool.", Collections.singletonList("pool")); mfs.add(buffers); for (final Object pool : bufferPoolMXBeans) { used.addMetric( Collections.singletonList(getName(pool)), callLongMethond(getMemoryUsed,pool)); capacity.addMetric( Collections.singletonList(getName(pool)), callLongMethond(getTotalCapacity,pool)); buffers.addMetric( Collections.singletonList(getName(pool)), callLongMethond(getCount,pool)); } return mfs; }
Source:
<code>public void testStreamWriter() throws IOException, ExecutionException, InterruptedException { streamClient.create(TEST_STREAM); streamClient.truncate(TEST_STREAM); StreamWriter writer = streamClient.createWriter(TEST_STREAM); int expectedEventsNum = 10; try { for (int i = 0; i < expectedEventsNum; i++) { writer.write("test" + i, Charset.forName("UTF8"), Collections.singletonMap("key", "value")).get(); } } finally { writer.close(); } List<JsonObject> streamEvents = streamClientTestHelper.getStreamEvents(TEST_STREAM); Assert.assertEquals(expectedEventsNum, streamEvents.size()); streamClient.truncate(TEST_STREAM); streamEvents = streamClientTestHelper.getStreamEvents(TEST_STREAM); <START> Assert.assertEquals(0, streamEvents.size()); <END> }</code><technical_language>I good check returned contents (to ensure match sent), in addition checking size matches</technical_language>

Target:
public void testStreamWriter() throws Exception { streamClient.create(TEST_STREAM); streamClient.truncate(TEST_STREAM); StreamWriter writer = streamClient.createWriter(TEST_STREAM); int expectedEventsNum = 10; try { for (int i = 0; i < expectedEventsNum; i++) { writer.write(EVENT_STR_PREFIX + i, Charset.forName("UTF8"), Collections.singletonMap("key", "value")).get(); } } finally { writer.close(); } List<String> streamEvents = streamReader.getDeliveredEvents(TEST_STREAM); Assert.assertEquals(expectedEventsNum, streamEvents.size()); for (int i = 0; i < expectedEventsNum; i++) { Assert.assertEquals(EVENT_STR_PREFIX + i, streamEvents.get(i)); } streamClient.truncate(TEST_STREAM); streamEvents = streamReader.getDeliveredEvents(TEST_STREAM); Assert.assertEquals(0, streamEvents.size()); }
Source:
<code><START> SaveTransaction(EngineEntityManager privateEntityManager, EntitySetDeltaRecorder deltaToSave, <END> Map<String, EntityData.PlayerStore> unloadedPlayers, Map<String, PlayerStoreBuilder> loadedPlayers, GlobalStoreBuilder globalStoreBuilder, Map<Vector3i, CompressedChunkBuilder> unloadedChunks, Map<Vector3i, ChunkImpl> loadedChunks, GameManifest gameManifest, boolean storeChunksInZips, StoragePathProvider storagePathProvider, Lock worldDirectoryWriteLock, RecordAndReplaySerializer recordAndReplaySerializer, RecordAndReplayUtils recordAndReplayUtils) { this.privateEntityManager = privateEntityManager; this.deltaToSave = deltaToSave; this.unloadedPlayers = unloadedPlayers; this.loadedPlayers = loadedPlayers; this.unloadedChunks = unloadedChunks; this.loadedChunks = loadedChunks; this.globalStoreBuilder = globalStoreBuilder; this.gameManifest = gameManifest; this.storeChunksInZips = storeChunksInZips; this.storagePathProvider = storagePathProvider; this.saveTransactionHelper = new SaveTransactionHelper(storagePathProvider); this.worldDirectoryWriteLock = worldDirectoryWriteLock; this.recordAndReplaySerializer = recordAndReplaySerializer; this.recordAndReplayUtils = recordAndReplayUtils; }</code><technical_language>Access change - *not* API violation in this case internal, dubious is needed/intentional</technical_language>

Target:
public SaveTransaction(EngineEntityManager privateEntityManager, EntitySetDeltaRecorder deltaToSave, Map<String, EntityData.PlayerStore> unloadedPlayers, Map<String, PlayerStoreBuilder> loadedPlayers, GlobalStoreBuilder globalStoreBuilder, Map<Vector3i, CompressedChunkBuilder> unloadedChunks, Map<Vector3i, ChunkImpl> loadedChunks, GameManifest gameManifest, boolean storeChunksInZips, StoragePathProvider storagePathProvider, Lock worldDirectoryWriteLock, RecordAndReplaySerializer recordAndReplaySerializer, RecordAndReplayUtils recordAndReplayUtils) { this.privateEntityManager = privateEntityManager; this.deltaToSave = deltaToSave; this.unloadedPlayers = unloadedPlayers; this.loadedPlayers = loadedPlayers; this.unloadedChunks = unloadedChunks; this.loadedChunks = loadedChunks; this.globalStoreBuilder = globalStoreBuilder; this.gameManifest = gameManifest; this.storeChunksInZips = storeChunksInZips; this.storagePathProvider = storagePathProvider; this.saveTransactionHelper = new SaveTransactionHelper(storagePathProvider); this.worldDirectoryWriteLock = worldDirectoryWriteLock; this.recordAndReplaySerializer = recordAndReplaySerializer; this.recordAndReplayUtils = recordAndReplayUtils; }
Source:
<code>public PlannerTool(final Database database, byte[] catalogHash) { assert(database != null); m_database = database; m_catalogHash = catalogHash; m_cache = AdHocCompilerCache.getCacheForCatalogHash(catalogHash); m_hsql = HSQLInterface.loadHsqldb(); String binDDL = m_database.getSchema(); String ddl = Encoder.decodeBase64AndDecompress(binDDL); String[] commands = ddl.split("\n"); for (String command : commands) { String decoded_cmd = Encoder.hexDecodeToString(command); decoded_cmd = decoded_cmd.trim(); if (decoded_cmd.length() == 0) continue; try { m_hsql.runDDLCommand(decoded_cmd); } catch (HSQLParseException e) { throw new RuntimeException("Error creating hsql: " + e.getMessage() + " in DDL statement: " + decoded_cmd); } } hostLog.debug("hsql loaded"); synchronized (PlannerTool.class) { if (m_plannerStats == null) { final StatsAgent statsAgent = VoltDB.instance().getStatsAgent(); if (statsAgent != null) { m_plannerStats = new PlannerStatsCollector(-1); <START> statsAgent.registerStatsSource(StatsSelector.PLANNER, -1, m_plannerStats); <END> } } } }</code><technical_language>a double-checked locking . check issue here? m_plannerStats volatile</technical_language>

Target:
public PlannerTool(final Database database, byte[] catalogHash) { assert(database != null); m_database = database; m_catalogHash = catalogHash; m_cache = AdHocCompilerCache.getCacheForCatalogHash(catalogHash); m_hsql = HSQLInterface.loadHsqldb(); String binDDL = m_database.getSchema(); String ddl = Encoder.decodeBase64AndDecompress(binDDL); String[] commands = ddl.split("\n"); for (String command : commands) { String decoded_cmd = Encoder.hexDecodeToString(command); decoded_cmd = decoded_cmd.trim(); if (decoded_cmd.length() == 0) continue; try { m_hsql.runDDLCommand(decoded_cmd); } catch (HSQLParseException e) { throw new RuntimeException("Error creating hsql: " + e.getMessage() + " in DDL statement: " + decoded_cmd); } } hostLog.debug("hsql loaded"); if (m_plannerStats == null) { synchronized (this.getClass()) { if (m_plannerStats == null) { final StatsAgent statsAgent = VoltDB.instance().getStatsAgent(); if (statsAgent != null) { m_plannerStats = new PlannerStatsCollector(-1); statsAgent.registerStatsSource(StatsSelector.PLANNER, -1, m_plannerStats); } } } } }
Source:
<code>public void testWriteTo() throws Exception { final Path tmpPath = Files.createTempFile("testfile", ".txt"); tmpPath.toFile().deleteOnExit(); try (final OutputStream outStream = Files.newOutputStream(tmpPath)) { outStream.write(0); outStream.write(1); outStream.write(2); outStream.write(3); } <START> try (final PathEntity httpentity = new PathEntity(tmpPath, ContentType.TEXT_PLAIN)) { <END> final ByteArrayOutputStream out = new ByteArrayOutputStream(); httpentity.writeTo(out); final byte[] bytes = out.toByteArray(); Assert.assertNotNull(bytes); Assert.assertEquals(Files.size(tmpPath), bytes.length); for (int i = 0; i < 4; i++) { Assert.assertEquals(i, bytes[i]); } if (!Files.deleteIfExists(tmpPath)) { Assert.fail("Failed to delete: " + tmpPath); } try { httpentity.writeTo(null); Assert.fail("NullPointerException should have been thrown"); } catch (final NullPointerException ex) { } } }</code><technical_language>case</technical_language>

Target:
public void testWriteTo() throws Exception { final Path tmpPath = Files.createTempFile("testfile", ".txt"); tmpPath.toFile().deleteOnExit(); try (final OutputStream outStream = Files.newOutputStream(tmpPath)) { outStream.write(0); outStream.write(1); outStream.write(2); outStream.write(3); } try (final PathEntity httpEntity = new PathEntity(tmpPath, ContentType.TEXT_PLAIN)) { final ByteArrayOutputStream out = new ByteArrayOutputStream(); httpEntity.writeTo(out); final byte[] bytes = out.toByteArray(); Assert.assertNotNull(bytes); Assert.assertEquals(Files.size(tmpPath), bytes.length); for (int i = 0; i < 4; i++) { Assert.assertEquals(i, bytes[i]); } if (!Files.deleteIfExists(tmpPath)) { Assert.fail("Failed to delete: " + tmpPath); } try { httpEntity.writeTo(null); Assert.fail("NullPointerException should have been thrown"); } catch (final NullPointerException ex) { } } }
Source:
<code>public SimpleEventHandlerInvoker(List<?> eventListeners, ParameterResolverFactory parameterResolverFactory, ListenerInvocationErrorHandler listenerInvocationErrorHandler, SequencingPolicy<? super EventMessage<?>> sequencingPolicy) { this(eventListeners, parameterResolverFactory, <START> new ClasspathHandlerDefinition(Thread.currentThread().getContextClassLoader()), <END> listenerInvocationErrorHandler, sequencingPolicy); }</code><technical_language>I change behavior of this constructor. Instead, leave AnnotationEventListenerAdapter choose a default HandlerDefinition. allow create instance based listener's class loader</technical_language>

Target:
public SimpleEventHandlerInvoker(List<?> eventListeners, ParameterResolverFactory parameterResolverFactory, ListenerInvocationErrorHandler listenerInvocationErrorHandler, SequencingPolicy<? super EventMessage<?>> sequencingPolicy) { this.eventListeners = eventListeners; this.wrappedEventListeners = eventListeners.stream() .map(listener -> listener instanceof EventListener ? (EventListener) listener : new AnnotationEventListenerAdapter(listener, parameterResolverFactory)) .collect(toCollection(ArrayList::new)); this.sequencingPolicy = sequencingPolicy; this.listenerInvocationErrorHandler = listenerInvocationErrorHandler; }
Source:
<code>private void addFieldDialog() { fieldNameInput = new EditText(this); fieldNameInput.setSingleLine(true); new MaterialDialog.Builder(this) .title(R.string.model_field_editor_add) .positiveText(R.string.dialog_ok) .customView(fieldNameInput, true) .callback(new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog dialog) { String fieldName = fieldNameInput.getText().toString() <START> .replaceAll("[\'\"\\n\\r\\[\\]\\(\\)]", ""); <END> if (fieldName.length() == 0) { showToast(getResources().getString(R.string.toast_empty_name)); } else if (containsField(fieldName)) { showToast(getResources().getString(R.string.toast_duplicate_field)); } else { try { col.modSchema(); DeckTask.launchDeckTask(DeckTask.TASK_TYPE_ADD_FIELD, mChangeFieldHandler, new DeckTask.TaskData(new Object[]{mod, fieldName})); } catch (ConfirmModSchemaException e) { ConfirmationDialog c = new ConfirmationDialog() { public void confirm() { col.modSchemaNoCheck(); String fieldName = fieldNameInput.getText().toString() .replaceAll("[\'\"\\n\\r\\[\\]\\(\\)]", ""); DeckTask.launchDeckTask(DeckTask.TASK_TYPE_ADD_FIELD, mChangeFieldHandler, new DeckTask.TaskData(new Object[]{mod, fieldName})); dismissContextMenu(); } public void cancel() { dismissContextMenu(); } }; c.setArgs(getResources().getString(R.string.full_sync_confirmation)); ModelFieldEditor.this.showDialogFragment(c); } col.getModels().update(mod); fullRefreshList(); } } }) .negativeText(R.string.dialog_cancel) .show(); }</code><technical_language>Is equivalent regular expression desktop client this is copying</technical_language>

Target:
private void addFieldDialog() { mFieldNameInput = new EditText(this); mFieldNameInput.setSingleLine(true); new MaterialDialog.Builder(this) .title(R.string.model_field_editor_add) .positiveText(R.string.dialog_ok) .customView(mFieldNameInput, true) .callback(new MaterialDialog.ButtonCallback() { @Override public void onPositive(MaterialDialog dialog) { String fieldName = mFieldNameInput.getText().toString() .replaceAll("[\'\"\\n\\r\\[\\]\\(\\)]", ""); if (fieldName.length() == 0) { showToast(getResources().getString(R.string.toast_empty_name)); } else if (containsField(fieldName)) { showToast(getResources().getString(R.string.toast_duplicate_field)); } else { try { mCol.modSchema(); DeckTask.launchDeckTask(DeckTask.TASK_TYPE_ADD_FIELD, mChangeFieldHandler, new DeckTask.TaskData(new Object[]{mMod, fieldName})); } catch (ConfirmModSchemaException e) { ConfirmationDialog c = new ConfirmationDialog() { public void confirm() { mCol.modSchemaNoCheck(); String fieldName = mFieldNameInput.getText().toString() .replaceAll("[\'\"\\n\\r\\[\\]\\(\\)]", ""); DeckTask.launchDeckTask(DeckTask.TASK_TYPE_ADD_FIELD, mChangeFieldHandler, new DeckTask.TaskData(new Object[]{mMod, fieldName})); dismissContextMenu(); } public void cancel() { dismissContextMenu(); } }; c.setArgs(getResources().getString(R.string.full_sync_confirmation)); ModelFieldEditor.this.showDialogFragment(c); } mCol.getModels().update(mMod); fullRefreshList(); } } }) .negativeText(R.string.dialog_cancel) .show(); }
Source:
<code>public void ban(UUID uuid) { <START> return getClanPlayer(uuid); <END> }</code><technical_language>This is compile. return object in a void method</technical_language>

Target:
public void ban(UUID uuid) { ClanPlayer cp = getClanPlayer(uuid); Clan clan = null; if (cp != null) { clan = cp.getClan(); } if (clan != null) { if (clan.getSize() == 1) { clan.disband(); } else { cp.setClan(null); cp.addPastClan(clan.getColorTag() + (cp.isLeader() ? ChatColor.DARK_RED + "*" : "")); cp.setLeader(false); cp.setJoinDate(0); clan.removeMember(uuid); plugin.getStorageManager().updateClanPlayer(cp); plugin.getStorageManager().updateClan(clan); } } plugin.getSettingsManager().addBanned(uuid); }
Source:
<code>public void deleteEncounterFormDataAndRelatedPatientData(List<FormData> formDataList) throws FormDeleteException{ try { for (FormData formData : formDataList) { if (isCompleteFormData(formData)) { Encounter encounter = encounterService.getEncounterByFormDataUuid(formData.getUuid()); if (encounter != null) { List<Observation> observations = observationService.getObservationsByEncounter(encounter.getUuid()); observationService.deleteObservations(observations); encounterService.deleteEncounter(encounter); } } <START> System.out.println("Deleting formdata: "+formData.getUserUuid()); <END> formService.deleteFormData(formData); } }catch(IOException e){ throw new FormDeleteException(e); } }</code><technical_language>replace log</technical_language>

Target:
public void deleteEncounterFormDataAndRelatedPatientData(List<FormData> formDataList) throws FormDeleteException{ try { for (FormData formData : formDataList) { if (isCompleteFormData(formData)) { Encounter encounter = encounterService.getEncounterByFormDataUuid(formData.getUuid()); if (encounter != null) { List<Observation> observations = observationService.getObservationsByEncounter(encounter.getUuid()); observationService.deleteObservations(observations); encounterService.deleteEncounter(encounter); } } formService.deleteFormData(formData); } }catch(IOException e){ throw new FormDeleteException(e); } }
Source:
<code>public double calculateEntropy() { <START> double[] samples = reservoir.stream().toArray(); <END> return calculateEntropyFromSamples(samples); }</code><technical_language>replace stream() method getSamples() inline samples variable: public double[] getSamples() { return Arrays.copyOf(samples, count); } @Override public double calculateEntropy() { return calculate(reservoir.getSamples()); }</technical_language>

Target:
public double calculateEntropy() { return calculateFromSamples(reservoir.getSamples()); }
Source:
<code>public void testWriteReadNullValuesAvro() throws Exception { <START> String tablePath = getTempOutputDirectory() + "null_test_location_avro"; <END> methodWatcher.executeUpdate(String.format("create external table null_test_avro (col1 int, col2 varchar(24))" + " STORED AS AVRO LOCATION '%s'",tablePath)); int insertCount = methodWatcher.executeUpdate(String.format("insert into null_test_avro values (1,null)," + "(2,'YYYY')," + "(3,'ZZZZ')")); Assert.assertEquals("insertCount is wrong",3,insertCount); ResultSet rs = methodWatcher.executeQuery("select * from null_test_avro where col2 is null"); Assert.assertEquals("COL1 |COL2 |\n" + "------------\n" + " 1 |NULL |",TestUtils.FormattedResult.ResultFactory.toString(rs)); ResultSet rs2 = methodWatcher.executeQuery("select * from null_test_avro where col2 is not null"); Assert.assertEquals("COL1 |COL2 |\n" + "------------\n" + " 2 |YYYY |\n" + " 3 |ZZZZ |",TestUtils.FormattedResult.ResultFactory.toString(rs2)); Assert.assertTrue(String.format("Table %s hasn't been created",tablePath), new File(tablePath).exists()); }</code><technical_language>I "null_test_location_avro" "/null_test_location_avro", otherwise, temporary directory "SpliceUnitTest_temp_xxxxnull_test_location_avro" instead of "SpliceUnitTest_temp_xxxxn/ull_test_location_avro". test call deleteTempDirectory() able delete this directory. else good me</technical_language>

Target:
public void testWriteReadNullValuesAvro() throws Exception { String tablePath = getExternalResourceDirectory()+"null_test_location_avro"; methodWatcher.executeUpdate(String.format("create external table null_test_avro (col1 int, col2 varchar(24))" + " STORED AS AVRO LOCATION '%s'",tablePath)); int insertCount = methodWatcher.executeUpdate(String.format("insert into null_test_avro values (1,null)," + "(2,'YYYY')," + "(3,'ZZZZ')")); Assert.assertEquals("insertCount is wrong",3,insertCount); ResultSet rs = methodWatcher.executeQuery("select * from null_test_avro where col2 is null"); Assert.assertEquals("COL1 |COL2 |\n" + "------------\n" + " 1 |NULL |",TestUtils.FormattedResult.ResultFactory.toString(rs)); ResultSet rs2 = methodWatcher.executeQuery("select * from null_test_avro where col2 is not null"); Assert.assertEquals("COL1 |COL2 |\n" + "------------\n" + " 2 |YYYY |\n" + " 3 |ZZZZ |",TestUtils.FormattedResult.ResultFactory.toString(rs2)); Assert.assertTrue(String.format("Table %s hasn't been created",tablePath), new File(tablePath).exists()); }
Source:
<code>public boolean needsInput() { <START> if (unfinishedWork.isPresent() && !processUnfinishedWork()) { <END> return false; } return !finished; }</code><technical_language>inline: java return !finished && (!unfinishedWork.isPresent() || processUnfinishedWork());</technical_language>

Target:
public boolean needsInput() { return !finished && (unfinishedWork == null || processUnfinishedWork()); }