auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public MotechUser findByUserName(String userName) { if (userName == null) { return null; } MotechUser retrievedUser = dataService.findByUserName(userName.toLowerCase()); if (retrievedUser != null && retrievedUser.getRoles() == null) { return findByUserName(userName); } <START> return retrievedUser; <END> }</code><technical_language>is solution. Try getDetachedField retrieve roles object</technical_language>

Target:
public MotechUser findByUserName(String userName) { MotechUser retrievedUser = null; if (userName != null) { retrievedUser = dataService.findByUserName(userName.toLowerCase()); if (retrievedUser != null && retrievedUser.getRoles() == null) { retrievedUser.setRoles((List<String>) dataService.getDetachedField(retrievedUser, "roles")); } } return retrievedUser; }
Source:
<code>private void validateSingleTableInput(AnalysisJob job) { <START> SourceColumnFinder sourceColumnFinder = new SourceColumnFinder(); <END> sourceColumnFinder.addSources(job); validateSingleTableInput(sourceColumnFinder, job.getTransformerJobs()); validateSingleTableInput(sourceColumnFinder, job.getFilterJobs()); validateSingleTableInput(sourceColumnFinder, job.getAnalyzerJobs()); }</code><technical_language>final</technical_language>

Target:
private void validateSingleTableInput(AnalysisJob job) { final SourceColumnFinder sourceColumnFinder = new SourceColumnFinder(); sourceColumnFinder.addSources(job); validateSingleTableInput(sourceColumnFinder, job.getTransformerJobs()); validateSingleTableInput(sourceColumnFinder, job.getFilterJobs()); validateSingleTableInput(sourceColumnFinder, job.getAnalyzerJobs()); }
Source:
<code>protected Location getLocation(@Nullable Collection<? extends Location> locations) { if (locations==null || locations.isEmpty()) locations = entity().getLocations(); if (locations.isEmpty()) { MachineProvisioningLocation<?> provisioner = entity().getAttribute(SoftwareProcess.PROVISIONING_LOCATION); if (provisioner!=null) locations = Arrays.<Location>asList(provisioner); } if (locations.isEmpty()) { Entity parent = entity().getParent(); <START> if (parent!=null) locations = parent.getLocations(); <END> } if (locations.size() > 1) { Collection<Location> locationsNonProvisioning = LocationFunctions.filter(locations, LocationFunctions.isNotOfType(MachineProvisioningLocation.class)); if (locationsNonProvisioning.size()==1) locations = locationsNonProvisioning; } if (locations.size() != 1 || Iterables.getOnlyElement(locations)==null) throw new IllegalArgumentException("Ambiguous locations detected when starting "+entity()+": "+locations); return Iterables.getOnlyElement(locations); }</code><technical_language>reasoning for parent's locations</technical_language>

Target:
protected Location getLocation(@Nullable Collection<? extends Location> locations) { if (locations==null || locations.isEmpty()) locations = entity().getLocations(); if (locations.isEmpty()) { MachineProvisioningLocation<?> provisioner = entity().getAttribute(SoftwareProcess.PROVISIONING_LOCATION); if (provisioner!=null) locations = Arrays.<Location>asList(provisioner); } locations = Locations.getLocationsCheckingAncestors(locations, entity()); Optional<MachineLocation> ml = Locations.findUniqueMachineLocation(locations); if (ml.isPresent()) return ml.get(); if (locations.size() != 1 || Iterables.getOnlyElement(locations)==null) throw new IllegalArgumentException("Ambiguous locations detected when starting "+entity()+": "+locations); return Iterables.getOnlyElement(locations); }
Source:
<code>public void setAuthorizations(DualListModel<Authorization> authorizations) { try { <START> List<Authorization> assignedAuthorizations = new ArrayList<>(); <END> for (Object object : authorizations.getTarget()) { assignedAuthorizations .add(serviceManager.getAuthorizationService().getById(Integer.parseInt((String) object))); } this.myBenutzergruppe.setAuthorizations(assignedAuthorizations); } catch (DAOException e) { logger.error(e.getMessage()); } }</code><technical_language>This method simplified that: java public void setAuthorizations(DualListModel<Authorization> authorizations) { List<Authorization> assignedAuthorizations = new ArrayList<>(); for (Authorization object : authorizations.getTarget()) { assignedAuthorizations.add(object); } this.myBenutzergruppe.setAuthorizations(assignedAuthorizations); }</technical_language>

Target:
public void setAuthorizations(DualListModel<Authorization> authorizations) { authorizations.getTarget().removeIf(Objects::isNull); this.myBenutzergruppe.setAuthorizations(authorizations.getTarget()); }
Source:
<code>protected void testAccessControl() throws Exception { FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1"); String[] submissionParams = new String[]{ Const.ParamsNames.COURSE_ID, fs.getCourseId(), <START> Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName() <END> }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); }</code><technical_language>Add param for userlist params valid</technical_language>

Target:
protected void testAccessControl() throws Exception { FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1"); StudentAttributes studentNotSubmitFeedback = typicalBundle.students.get("student5InCourse1"); String[] submissionParams = new String[]{ Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.SUBMISSION_REMIND_USERLIST, studentNotSubmitFeedback.getEmail() }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); verifyUnaccessibleWithoutModifySessionPrivilege(submissionParams); }
Source:
<code>private boolean areContextsReady(ServiceReference[] refs) { if (refs != null && refs.length > expectedContexts) { <START> LOGGER.info("Tested bundles contexts:"); <END> for (ServiceReference ref : refs) { LOGGER.info(ref.toString()); } return true; } return false; }</code><technical_language>Log of this line, Arrays.toString()</technical_language>

Target:
private boolean areContextsReady(ServiceReference[] refs) { if (refs != null && refs.length >= expectedContexts) { LOGGER.info("Tested bundle contexts: {}", Arrays.toString(refs)); return true; } return false; }
Source:
<code>public VaultEnvironmentRepository(ObjectProvider<HttpServletRequest> request, EnvironmentWatch watch, RestTemplate rest, VaultEnvironmentProperties properties, ConfigTokenProvider tokenProvider) { this.request = request; this.watch = watch; this.backend = properties.getBackend(); this.defaultKey = properties.getDefaultKey(); this.host = properties.getHost(); this.order = properties.getOrder(); this.port = properties.getPort(); this.profileSeparator = properties.getProfileSeparator(); this.scheme = properties.getScheme(); this.namespace = properties.getNamespace(); String baseUrl = String.format("%s://%s:%s", this.scheme, this.host, this.port); this.accessStrategy = VaultKvAccessStrategyFactory.forVersion(rest, baseUrl, properties.getKvVersion()); <START> if (tokenProvider == null) { <END> this.tokenProvider = new HttpRequestConfigTokenProvider(request); } else { this.tokenProvider = tokenProvider; } }</code><technical_language>Instead of passing null in constructor pass a new HttpRequestConfigTokenProvider</technical_language>

Target:
public VaultEnvironmentRepository(ObjectProvider<HttpServletRequest> request, EnvironmentWatch watch, RestTemplate rest, VaultEnvironmentProperties properties, ConfigTokenProvider tokenProvider) { this.request = request; this.watch = watch; this.tokenProvider = tokenProvider; this.backend = properties.getBackend(); this.defaultKey = properties.getDefaultKey(); this.host = properties.getHost(); this.order = properties.getOrder(); this.port = properties.getPort(); this.profileSeparator = properties.getProfileSeparator(); this.scheme = properties.getScheme(); this.namespace = properties.getNamespace(); String baseUrl = String.format("%s://%s:%s", this.scheme, this.host, this.port); this.accessStrategy = VaultKvAccessStrategyFactory.forVersion(rest, baseUrl, properties.getKvVersion()); }
Source:
<code><START> int getWidth() { <END> return this.width; }</code><technical_language>public</technical_language>

Target:
public int getWidth() { return this.width; }
Source:
<code>public static void stop(String ifaceName) throws KuraException { try { if (!s_isIntelEdison) { int pid = getPid(ifaceName); if (pid >= 0) { s_logger.info("stopping wpa_suplicant for the interface, pid={}", ifaceName, pid); <START> boolean exists = LinuxProcessUtil.stop(pid); <END> if (!exists) { s_logger.warn("stopping wpa_supplicant for the inetrface, pid={} has failed", ifaceName, pid); } else { exists = LinuxProcessUtil.waitProcess(pid, 500, 5000); } if (exists) { s_logger.info("stopping wpa_supplicant for the interface - killing pid={}", ifaceName, pid); exists = LinuxProcessUtil.kill(pid); if (!exists) { s_logger.warn("stopping wpa_supplicant for the interface - killing pid={} has failed", ifaceName, pid); } else { exists = LinuxProcessUtil.waitProcess(pid, 500, 5000); } } if (exists) { s_logger.warn("Failed to stop hostapd for the interface", ifaceName); } } } else { LinuxProcessUtil.start("systemctl stop hostapd"); } if (ifaceName != null) { LinuxNetworkUtil.disableInterface(ifaceName); Thread.sleep(1000); } } catch (Exception e) { throw KuraException.internalError(e); } }</code><technical_language>this part of code is in HostapdManager.java, in PppLinux.disconnect I is this code centralized in LinuxProcessUtil other utility class</technical_language>

Target:
public static void stop(String ifaceName) throws KuraException { try { if (!s_isIntelEdison) { LinuxProcessUtil.stopAndKill(getPid(ifaceName)); } else { LinuxProcessUtil.start("systemctl stop hostapd"); } if (ifaceName != null) { LinuxNetworkUtil.disableInterface(ifaceName); Thread.sleep(1000); } } catch (Exception e) { throw KuraException.internalError(e); } }
Source:
<code>public double getTotalHours() { final long ms = getTotalAward().toMillis(); <START> return ((double) ms) / 3600000.0; <END> }</code><technical_language>Duration.ofHours(1).toMillis maybe</technical_language>

Target:
public double getTotalHours() { return toHours(getTotalAward()); }
Source:
<code><START> public void selectAll() { <END> press(KeyCode.SHIFT).press(KeyCode.HOME).release(KeyCode.HOME).release(KeyCode.SHIFT); }</code><technical_language>Is verify NumLock is turned throw exception if is on</technical_language>

Target:
public void selectAll() { pushKeys(new KeyCodeCombination(KeyCode.A, KeyCombination.SHORTCUT_DOWN)); }
Source:
<code>private static String execute( String[] commands, Map<String, String> environmentVariables, boolean log) throws IOException { ProcessBuilder pb = new ProcessBuilder(commands); pb.environment().putAll(environmentVariables); pb.redirectErrorStream(true); Process p = pb.start(); InputStream in = new BufferedInputStream(p.getInputStream()); StringBuilder out = new StringBuilder(); String s; if (log) { <START> LOG.info(String.format("Execute the commnad: %s", String.join(" ", commands))); <END> } try (BufferedReader br = new BufferedReader(new InputStreamReader(in))) { while ((s = br.readLine()) != null) { out.append(s).append("\n"); if (log) { LOG.info(s); } } } try { if (p.waitFor() != 0) { throw new IOException(String.format( "Execute the command:\n%s\nfailed:\n%s", String.join(" ", commands), out)); } } catch (InterruptedException e) { } return out.toString(); }</code><technical_language>typo: command</technical_language>

Target:
private static String execute( String[] commands, Map<String, String> environmentVariables, boolean log) throws IOException { ProcessBuilder pb = new ProcessBuilder(commands); pb.environment().putAll(environmentVariables); pb.redirectErrorStream(true); Process p = pb.start(); InputStream in = new BufferedInputStream(p.getInputStream()); StringBuilder out = new StringBuilder(); String s; if (log) { LOG.info(String.format("Execute command: %s", String.join(" ", commands))); } try (BufferedReader br = new BufferedReader(new InputStreamReader(in))) { while ((s = br.readLine()) != null) { out.append(s).append("\n"); if (log) { LOG.info(s); } } } try { if (p.waitFor() != 0) { throw new IOException(String.format( "Execute the command:\n%s\nfailed:\n%s", String.join(" ", commands), out)); } } catch (InterruptedException e) { } return out.toString(); }
Source:
<code>public int hashCode() { <START> final int prime = 31; int result = 1; result = prime * result + scope.hashCode(); result = prime * result + doneAt.hashCode(); return result; <END> }</code><technical_language>use: return Objects.hashCode(scope, doneAt);</technical_language>

Target:
public int hashCode() { return Objects.hash(scope, doneAt); }
Source:
<code>public Cohort(String name, String description, Collection patientsOrIds) { this(name, description, (Integer[]) null); if (patientsOrIds != null) { for (Object o : patientsOrIds) { if (o instanceof Patient) { CohortMember cohortMember = new CohortMember(this, (Patient) o, new Date()); members.add(cohortMember); } else if (o instanceof Integer) { CohortMember cohortMember = new CohortMember(this, new Patient((Integer) o), new Date()); members.add(cohortMember); } } <START> } <END> }</code><technical_language>This method deprecated, in theory Constructor method takes in patient id(s) argument deprecated</technical_language>

Target:
public Cohort(String name, String description, Collection patientsOrIds) { this(name, description, (Integer[]) null); if (patientsOrIds != null) { for (Object o : patientsOrIds) { if (o instanceof Patient) { addMembership(new CohortMembership((Patient) o)); } else if (o instanceof Integer) { addMembership(new CohortMembership(new Patient((Integer) o))); } } } }
Source:
<code>public String doValidation(){ <START> for(int i = 0; i < fields.size(); i++){ <END> if(fields.get(i).errorStyleName != null){ fields.get(i).uiField.removeStyleName(fields.get(i).errorStyleName.toString()); } } for(int i = 0; i < fields.size(); i++){ ValidatorInterface<String> validator = (ValidatorInterface<String>)validatorFactory(fields.get(i).validatorReferenceName); validator.setConfiguration(fields.get(i).config); boolean valid = validator.isValid( ((AdvancedTextbox)fields.get(i).uiField).getValue() ); if(!valid){ if(fields.get(i).errorStyleName != null){ fields.get(i).uiField.addStyleName(fields.get(i).errorStyleName.toString()); } if (fields.get(i).errorMessage != null){ return fields.get(i).errorMessage; } else { return validator.getDefaultValidationMessage(); } } } return null; }</code><technical_language>add a space if open brace. Update</technical_language>

Target:
public String doValidation(){ int fieldSize = fields.size(); for (int i = 0; i < fieldSize; i++){ if (fields.get(i).errorStyleName != null){ fields.get(i).uiField.removeStyleName(fields.get(i).errorStyleName.toString()); } } for (int i = 0; i < fieldSize; i++){ ValidatorInterface<String> validator = (ValidatorInterface<String>)validatorFactory(fields.get(i).validatorReferenceName); validator.setConfiguration(fields.get(i).config); boolean valid = validator.isValid(((AdvancedTextbox)fields.get(i).uiField).getValue()); if (!valid){ if (fields.get(i).errorStyleName != null){ fields.get(i).uiField.addStyleName(fields.get(i).errorStyleName.toString()); } if (fields.get(i).errorMessage != null){ return fields.get(i).errorMessage; } else { return validator.getDefaultValidationMessage(); } } } return null; }
Source:
<code>public void setUp() throws Exception { utils = ResourceUtils.create(this, "mycontext"); BasicHttpProcessor httpProcessor = new BasicHttpProcessor(); httpProcessor.addInterceptor(new ResponseServer()); httpProcessor.addInterceptor(new ResponseContent()); httpProcessor.addInterceptor(new ResponseConnControl()); httpProcessor.addInterceptor(new RequestBasicAuth()); httpProcessor.addInterceptor(new ResponseBasicUnauthorized()); server = new LocalTestServer(httpProcessor, null); server.register("/simple", new SimpleResponseHandler("OK")); server.register("/empty", new SimpleResponseHandler(HttpStatus.SC_NO_CONTENT, "")); server.register("/missing", new SimpleResponseHandler(HttpStatus.SC_NOT_FOUND, "Missing")); server.register("/redirect", new SimpleResponseHandler(HttpStatus.SC_MOVED_TEMPORARILY, "Redirect", new BasicHeader("Location", "/simple"))); server.register("/cycle", new SimpleResponseHandler(HttpStatus.SC_MOVED_TEMPORARILY, "Redirect", new BasicHeader("Location", "/cycle"))); server.register("/secure", new SimpleResponseHandler(HttpStatus.SC_MOVED_TEMPORARILY, "Redirect", new BasicHeader("Location", "<LINK_0>"))); <START> server.register("/auth", new AuthHandler("test", "test", "OK")); <END> server.start(); InetSocketAddress addr = server.getServiceAddress(); baseUrl = "http://" + addr.getHostName() + ":" + addr.getPort(); }</code><technical_language>server.register("/auth_naughty_chars", new AuthHandler("m@ry:/", "p@assword:/", "OK")); ... test (url-encoding username password test decoding)</technical_language>

Target:
public void setUp() throws Exception { utils = ResourceUtils.create(this, "mycontext"); BasicHttpProcessor httpProcessor = new BasicHttpProcessor(); httpProcessor.addInterceptor(new ResponseServer()); httpProcessor.addInterceptor(new ResponseContent()); httpProcessor.addInterceptor(new ResponseConnControl()); httpProcessor.addInterceptor(new RequestBasicAuth()); httpProcessor.addInterceptor(new ResponseBasicUnauthorized()); server = new LocalTestServer(httpProcessor, null); server.register("/simple", new SimpleResponseHandler("OK")); server.register("/empty", new SimpleResponseHandler(HttpStatus.SC_NO_CONTENT, "")); server.register("/missing", new SimpleResponseHandler(HttpStatus.SC_NOT_FOUND, "Missing")); server.register("/redirect", new SimpleResponseHandler(HttpStatus.SC_MOVED_TEMPORARILY, "Redirect", new BasicHeader("Location", "/simple"))); server.register("/cycle", new SimpleResponseHandler(HttpStatus.SC_MOVED_TEMPORARILY, "Redirect", new BasicHeader("Location", "/cycle"))); server.register("/secure", new SimpleResponseHandler(HttpStatus.SC_MOVED_TEMPORARILY, "Redirect", new BasicHeader("Location", "<LINK_0>"))); server.register("/auth", new AuthHandler("test", "test", "OK")); server.register("/auth_escape", new AuthHandler("test@me:/", "test", "OK")); server.register("/auth_escape2", new AuthHandler("test@me:test", "", "OK")); server.register("/no_credentials", new CheckNoCredentials()); server.start(); InetSocketAddress addr = server.getServiceAddress(); baseUrl = "http://" + addr.getHostName() + ":" + addr.getPort(); }
Source:
<code>public static OutputStream createFileOutputStream(String filename, SecretKeySpec symetricKey) throws FileNotFoundException { final File path = new File(filename); FileOutputStream fos = new FileOutputStream(path); if (symetricKey == null) { return fos; } else { try { Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, symetricKey); <START> return new CipherOutputStream(fos, cipher); <END> } catch (InvalidKeyException e) { e.printStackTrace(); Logger.log(AndroidLogger.TYPE_ERROR_CRYPTO, "Invalid key: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); Logger.log(AndroidLogger.TYPE_ERROR_CRYPTO, "Unavailable Crypto algorithm: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } catch (NoSuchPaddingException e) { e.printStackTrace(); Logger.log(AndroidLogger.TYPE_ERROR_CRYPTO, "Bad Padding: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } } }</code><technical_language>odd buffer read below, write here. Is a reason don't</technical_language>

Target:
public static OutputStream createFileOutputStream(String filename, SecretKeySpec symetricKey) throws FileNotFoundException { final File path = new File(filename); FileOutputStream fos = new FileOutputStream(path); if (symetricKey == null) { return fos; } else { try { Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, symetricKey); return new BufferedOutputStream(new CipherOutputStream(fos, cipher)); } catch (InvalidKeyException e) { e.printStackTrace(); Logger.log(AndroidLogger.TYPE_ERROR_CRYPTO, "Invalid key: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); Logger.log(AndroidLogger.TYPE_ERROR_CRYPTO, "Unavailable Crypto algorithm: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } catch (NoSuchPaddingException e) { e.printStackTrace(); Logger.log(AndroidLogger.TYPE_ERROR_CRYPTO, "Bad Padding: " + e.getMessage()); throw new RuntimeException(e.getMessage()); } } }
Source:
<code>private ResultSet getTableMetaData( String schema, String table ) throws KettleDatabaseException { ResultSet tables = null; if ( getDatabaseMetaData() == null ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, "Database.Error.UnableToGetDbMeta" ) ); } try { <START> tables = databaseMeta.getDatabaseInterface().getTables( <END> getDatabaseMetaData(), databaseMeta, schema, table, TABLE_TYPES_TO_GET ); } catch ( SQLException e ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, "Database.Error.UnableToGetTableNames" ), e ); } if ( tables == null ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, "Database.Error.UnableToGetTableNames" ) ); } return tables; }</code><technical_language>databaseMeta.getDatabaseInterface().getTables(getDatabaseMetaData(), databaseMeta, ... is a mouthful. I wonder- sense add a .getTables method DatabaseMeta is a pass databaseinterface? call simplified like: databaseMeta.getTables(getDatabaseMetaData(),schema, table, TABLE_TYPES_TO_GET ); a bit confusing "databaseMeta" "getDatabaseMetaData", visually scans a bit better</technical_language>

Target:
private ResultSet getTableMetaData( String schema, String table ) throws KettleDatabaseException { ResultSet tables = null; if ( getDatabaseMetaData() == null ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, "Database.Error.UnableToGetDbMeta" ) ); } try { tables = databaseMeta.getTables( getDatabaseMetaData(), schema, table, TABLE_TYPES_TO_GET ); } catch ( SQLException e ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, "Database.Error.UnableToGetTableNames" ), e ); } if ( tables == null ) { throw new KettleDatabaseException( BaseMessages.getString( PKG, "Database.Error.UnableToGetTableNames" ) ); } return tables; }
Source:
<code>private void addProjectReference(Map<String,String> entryInfos) { String repoLocation = (String) entryInfos.get(KEY_REPO); String path = (String) entryInfos.get(KEY_PATH); String projectName = (String) entryInfos.get(KEY_ELEMENT_NAME); String tag = (String) entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG); if (repoLocation != null && projectName != null) { String sourceUrl = asReference(repoLocation, path, projectName, tag); <START> if (sourceUrl != null) { <END> entryInfos.put(Constants.KEY_SOURCE_REFERENCES, sourceUrl); } } }</code><technical_language>style nit: braces single line blocks</technical_language>

Target:
private void addProjectReference(Map<String, String> entryInfos) { final String repoLocation = entryInfos.get(KEY_REPO); final String path = entryInfos.get(KEY_PATH); final String projectName = entryInfos.get(KEY_ELEMENT_NAME); final String tag = entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG); if (repoLocation != null && projectName != null) { final String sourceUrl = asReference(repoLocation, path, projectName, tag); if (sourceUrl != null) { entryInfos.put(Constants.KEY_SOURCE_REFERENCES, sourceUrl); } } }
Source:
<code>private void notifyPostSelectDoubleClick() { <START> notify(SWT.MouseDown, createMouseEvent(1, SWT.NONE, 2)); <END> notify(SWT.MouseDoubleClick, createMouseEvent(1, SWT.NONE, 2)); notify(SWT.DefaultSelection); notify(SWT.MouseUp, createMouseEvent(1, SWT.BUTTON1, 2)); notify(SWT.Deactivate, super.createEvent()); notify(SWT.FocusOut, super.createEvent()); notify(SWT.MouseExit, createMouseEvent(0, SWT.NONE, 0)); }</code><technical_language>In testing Linux I another SWT.Selection MouseDown MouseDoubleClick</technical_language>

Target:
private void notifyPostSelectDoubleClick() { notify(SWT.MouseDown, createMouseEvent(1, SWT.NONE, 2)); notify(SWT.MouseDoubleClick, createMouseEvent(1, SWT.NONE, 2)); notify(SWT.DefaultSelection); notify(SWT.MouseUp, createMouseEvent(1, SWT.BUTTON1, 2)); }
Source:
<code><START> private static boolean hasNotGoneThroughAuthorisation(ChargeEntity charge) { <END> return charge.getEvents().stream() .map(ChargeEventEntity::getStatus) .noneMatch(status -> postAuthorisationReadyStates.contains(status)); }</code><technical_language>Is PaymentGatewayStateTransitions graph find successor nodes ? Hardcoding list inconsistent for future changes graph getTransitionsForStatus(AUTHORISATION_READY); PaymentGatewayStateTransitions public <T extends Event> List<ChargeStatus> getTransitionsForStatus(ChargeStatus fromStatus) { return graph.successors(fromStatus) .stream() .collect(Collectors.toList()); }</technical_language>

Target:
private static boolean hasNotGoneThroughAuthorisation(ChargeEntity charge) { return charge.getEvents().stream() .map(ChargeEventEntity::getStatus) .noneMatch(PaymentCreatedEventDetails::containsPostAuthorisationReadyStatus); }
Source:
<code><START> private boolean canCreateBlockCompresedIndexedFastaSequence(final Path path) { <END> try (final InputStream stream = new BufferedInputStream(Files.newInputStream(path))) { if(BlockCompressedInputStream.isValidFile(stream)) { return Files.exists(GZIIndex.resolveIndexNameForBgzipFile(path)); } } catch (IOException e) { return false; } return false; }</code><technical_language>this static</technical_language>

Target:
private static boolean canCreateBlockCompresedIndexedFastaSequence(final Path path) { try (final InputStream stream = new BufferedInputStream(Files.newInputStream(path))) { if(BlockCompressedInputStream.isValidFile(stream)) { return Files.exists(GZIIndex.resolveIndexNameForBgzipFile(path)); } } catch (IOException e) { return false; } return false; }
Source:
<code>public String getTestSrc() { <START> return testSrcs.get(0); <END> }</code><technical_language>require srcs non-empty, require testSrcs non-empty. this line throw exception</technical_language>

Target:
public String getTestSrc() { return testSrcs.isEmpty() ? null : testSrcs.get(0); }
Source:
<code><START> public void testSelectInformationSchemaColumns() <END> { assertQuery( "SELECT table_schema FROM information_schema.columns WHERE table_schema = 'tpch' ORDER BY table_schema LIMIT 1", "VALUES 'tpch'"); assertQuery( "SELECT table_name FROM information_schema.columns WHERE table_name = 'orders' ORDER BY table_name LIMIT 1", "VALUES 'orders'"); }</code><technical_language>need a catalog filter, information_schema is specific a single catalog</technical_language>

Target:
public void testSelectInformationSchemaColumns() { String catalog = getSession().getCatalog().get(); String schema = getSession().getSchema().get(); String schemaPattern = schema.replaceAll(".$", "_"); @Language("SQL") String ordersTableWithColumns = "VALUES " + "('orders', 'orderkey'), " + "('orders', 'custkey'), " + "('orders', 'orderstatus'), " + "('orders', 'totalprice'), " + "('orders', 'orderdate'), " + "('orders', 'orderpriority'), " + "('orders', 'clerk'), " + "('orders', 'shippriority'), " + "('orders', 'comment')"; assertQuery("SELECT table_schema FROM information_schema.columns WHERE table_schema = '" + schema + "' GROUP BY table_schema", "VALUES '" + schema + "'"); assertQuery("SELECT table_name FROM information_schema.columns WHERE table_name = 'orders' GROUP BY table_name", "VALUES 'orders'"); assertQuery("SELECT table_name, column_name FROM information_schema.columns WHERE table_schema = '" + schema + "' AND table_name = 'orders'", ordersTableWithColumns); assertQuery("SELECT table_name, column_name FROM information_schema.columns WHERE table_schema = '" + schema + "' AND table_name LIKE '%rders'", ordersTableWithColumns); assertQuery("SELECT table_name, column_name FROM information_schema.columns WHERE table_schema LIKE '" + schemaPattern + "' AND table_name LIKE '_rder_'", ordersTableWithColumns); assertQuery( "SELECT table_name, column_name FROM information_schema.columns " + "WHERE table_catalog = '" + catalog + "' AND table_schema = '" + schema + "' AND table_name LIKE '%orders%'", ordersTableWithColumns); assertQuery("SELECT column_name FROM information_schema.columns WHERE table_catalog = 'something_else'", "SELECT '' WHERE false"); }
Source:
<code>private long copyPackBypassCache(PackOutputStream out, DfsReader ctx, MessageDigest md) throws IOException { try (ReadableChannel rc = ctx.db.openFile(packDesc, PACK)) { ByteBuffer buf = newCopyBuffer(out, rc, ctx); long position = 12; long remaining = length - (12 + 20); while (0 < remaining) { DfsBlock b = cache.get(key, alignToBlock(position)); if (b != null) { int ptr = (int) (position - b.start); int n = (int) Math.min(b.size() - ptr, remaining); b.write(out, position, n, md); position += n; remaining -= n; rc.position(position); continue; } buf.position(0); int n = read(rc, buf); <START> if (n <= 0) { <END> setInvalid(); throw new IOException(MessageFormat.format( JGitText.get().packfileIsTruncated, getPackName())); } if (n > remaining) n = (int) remaining; out.write(buf.array(), 0, n); if (md != null) md.update(buf.array(), 0, n); position += n; remaining -= n; } return position; } }</code><technical_language>Similar issue here, I need set file invalid IOException thrown in this loop</technical_language>

Target:
private long copyPackBypassCache(PackOutputStream out, DfsReader ctx, MessageDigest md) throws IOException { try (ReadableChannel rc = ctx.db.openFile(packDesc, PACK)) { ByteBuffer buf = newCopyBuffer(out, rc, ctx); long position = 12; long remaining = length - (12 + 20); while (0 < remaining) { DfsBlock b = cache.get(key, alignToBlock(position)); if (b != null) { int ptr = (int) (position - b.start); int n = (int) Math.min(b.size() - ptr, remaining); b.write(out, position, n, md); position += n; remaining -= n; rc.position(position); continue; } buf.position(0); int n = read(rc, buf); if (n <= 0) throw packfileIsTruncated(); else if (n > remaining) n = (int) remaining; out.write(buf.array(), 0, n); if (md != null) md.update(buf.array(), 0, n); position += n; remaining -= n; } return position; } }
Source:
<code>public void testCacheEventNotificationServiceConfigurationTest() throws Exception { final URL resource = XmlConfigurationTest.class.getResource("/configs/ehcache-cacheEventNotification.xml"); XmlConfiguration xmlConfig = new XmlConfiguration(resource); assertThat(xmlConfig.getCacheConfigurations().size(), is(2)); Collection<?> configuration = xmlConfig.getCacheConfigurations().get("bar").getServiceConfigurations(); checkEventNotificationConfigurationExists(configuration); Collection<?> templateConfiguration = xmlConfig.getCacheConfigurations().get("foo").getServiceConfigurations(); <START> checkEventNotificationConfigurationExists(templateConfiguration); <END> DefaultCacheEventNotificationServiceConfiguration factoryConfiguration = null; for (Object o : configuration) { if(o instanceof DefaultCacheEventNotificationServiceConfiguration) { factoryConfiguration = (DefaultCacheEventNotificationServiceConfiguration)o; } } assertNotNull(factoryConfiguration); assertThat(factoryConfiguration.getNumberOfEventProcessingQueues(), is(5)); }</code><technical_language>replace logic / checks assertThat org.ehcache.spi.ServiceLocator#findSingletonAmongst</technical_language>

Target:
public void testCacheEventNotificationServiceConfigurationTest() throws Exception { final URL resource = XmlConfigurationTest.class.getResource("/configs/ehcache-cacheEventNotification.xml"); XmlConfiguration xmlConfig = new XmlConfiguration(resource); assertThat(xmlConfig.getCacheConfigurations().size(), is(2)); DefaultCacheEventNotificationServiceConfiguration factoryConfiguration = ServiceLocator.findSingletonAmongst( DefaultCacheEventNotificationServiceConfiguration.class, xmlConfig.getCacheConfigurations().get("foo") .getServiceConfigurations().toArray()); assertNotNull(factoryConfiguration); assertThat(factoryConfiguration.getNumberOfEventProcessingQueues(), is(5)); }
Source:
<code>public void writeData(SliceOutput sliceOutput) { for (long offset : stripeOffsets) { sliceOutput.writeLong(offset); <START> } <END> }</code><technical_language>I doing. treading footer a "stripe" adding offset offset of footer. work, is a confusing. more explicit. add offsets for existing stripes, add size of footer in bytes a long of file. Similar ORC</technical_language>

Target:
public void writeData(SliceOutput sliceOutput) { for (long offset : stripeOffsets) { sliceOutput.writeLong(offset); } sliceOutput.writeInt(toIntExact(size())); }
Source:
<code><START> public void accept(GcsEvent gcsEvent, Context context) throws RuntimeException { <END> String bucket = gcsEvent.getBucket(); if (bucket == null) { throw new IllegalArgumentException("Missing bucket parameter"); } String filename = gcsEvent.getName(); if (filename == null) { throw new IllegalArgumentException("Missing name parameter"); } detectText(bucket, filename); }</code><technical_language>This method a bit tiny pointless a teaching example - a single significant line. I if want do this a bit differently</technical_language>

Target:
public void accept(GcsEvent gcsEvent, Context context) { String bucket = gcsEvent.getBucket(); if (bucket == null) { throw new IllegalArgumentException("Missing bucket parameter"); } String filename = gcsEvent.getName(); if (filename == null) { throw new IllegalArgumentException("Missing name parameter"); } detectText(bucket, filename); }
Source:
<code>public void testDisableBeforeDelayedInitialization() throws Exception { provider = createProvider(); Map<String, Object> props = new HashMap<>(); props.put("enabled", "true"); provider.activate(props); verify(linkRegistry, never()).addRegistryChangeListener(same(provider.linkRegistryListener)); verify(itemRegistry, never()).addRegistryHook(same(provider.itemRegistryListener)); props = new HashMap<>(); props.put("enabled", "false"); provider.modified(props); <START> Thread.sleep(2500); <END> verify(linkRegistry, never()).addRegistryChangeListener(same(provider.linkRegistryListener)); verify(itemRegistry, never()).addRegistryHook(same(provider.itemRegistryListener)); }</code><technical_language>Thread.sleep() tests unstable. a waitForAssert statement here</technical_language>

Target:
public void testDisableBeforeDelayedInitialization() throws Exception { provider = createProvider(); reset(linkRegistry); Field field = ChannelItemProvider.class.getDeclaredField("INITIALIZATION_DELAY_NANOS"); field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); field.set(provider, TimeUnit.MILLISECONDS.toNanos(40)); Map<String, Object> props = new HashMap<>(); props.put("enabled", "true"); provider.activate(props); provider.linkRegistryListener.added(new ItemChannelLink(ITEM_NAME, CHANNEL_UID)); verify(listener, never()).added(same(provider), same(ITEM)); verify(linkRegistry, never()).getAll(); props = new HashMap<>(); props.put("enabled", "false"); provider.modified(props); Thread.sleep(100); provider.linkRegistryListener.added(new ItemChannelLink(ITEM_NAME, CHANNEL_UID)); verify(listener, never()).added(same(provider), same(ITEM)); verify(linkRegistry, never()).getAll(); }
Source:
<code>private void unpackPostIntent(@NonNull Intent intent) { PostModel post = mPostStore.getPostByLocalPostId(intent.getIntExtra(KEY_LOCAL_POST_ID, 0)); if (post != null) { boolean shouldTrackAnalytics = intent.getBooleanExtra(KEY_SHOULD_TRACK_ANALYTICS, false); if (shouldTrackAnalytics) { mPostUploadHandler.registerPostForAnalyticsTracking(post); } if (!hasPendingOrInProgressMediaUploadsForPost(post)) { mPostUploadHandler.upload(post); } else { List<MediaModel> pendingMedia = MediaUploadHandler.getPendingOrInProgressMediaUploadsForPost(post); <START> UploadingPost uploadingPost = new UploadingPost(post, pendingMedia); <END> sPostsWithPendingMedia.add(uploadingPost); showNotificationForPostWithPendingMedia(post); } } }</code><technical_language>is a problem this: calculate stuff starting pendingMedia consists of time, if tap post edit it, wait more media items finish upload while in editor, posts list, progress bar time, calculation is proportional _ pending this moment_ opposed _all pending I started uploading in this post_. This this stop/cancel UploadService time try Edit, service is triggered a new Intent. I suggest (if possible) full count of media items a Post calculate progress UploadService receives a new intent, current pending items</technical_language>

Target:
private void unpackPostIntent(@NonNull Intent intent) { PostModel post = mPostStore.getPostByLocalPostId(intent.getIntExtra(KEY_LOCAL_POST_ID, 0)); if (post != null) { boolean shouldTrackAnalytics = intent.getBooleanExtra(KEY_SHOULD_TRACK_ANALYTICS, false); if (shouldTrackAnalytics) { mPostUploadHandler.registerPostForAnalyticsTracking(post); } if (!hasPendingOrInProgressMediaUploadsForPost(post)) { mPostUploadHandler.upload(post); } else { for (UploadingPost uploadingPost : sPostsWithPendingMedia) { if (uploadingPost.postModel.getId() == post.getId()) { uploadingPost.postModel = post; uploadingPost.isCancelled = false; Set<MediaModel> totalPendingMedia = new HashSet<>(); totalPendingMedia.addAll(uploadingPost.pendingMedia); totalPendingMedia.addAll(MediaUploadHandler.getPendingOrInProgressMediaUploadsForPost(post)); uploadingPost.pendingMedia = new ArrayList<>(totalPendingMedia); showNotificationForPostWithPendingMedia(post); return; } } UploadingPost uploadingPost = new UploadingPost(post, MediaUploadHandler.getPendingOrInProgressMediaUploadsForPost(post)); sPostsWithPendingMedia.add(uploadingPost); showNotificationForPostWithPendingMedia(post); } } }
Source:
<code>public static int countOutgoing( NodeCursor nodeCursor, RelationshipGroupCursor group, int type ) { nodeCursor.relationships( group ); int count = 0; while ( group.next() ) { if ( group.type() == type ) { <START> count += group.outgoingCount() + group.loopCount(); <END> } } return count; }</code><technical_language>encounter type in group, return it. below</technical_language>

Target:
public static int countOutgoing( NodeCursor nodeCursor, RelationshipGroupCursor group, int type ) { nodeCursor.relationships( group ); while ( group.next() ) { if ( group.type() == type ) { return group.outgoingCount() + group.loopCount(); } } return 0; }
Source:
<code><START> public String getContext() <END> { return command_.getContext().name(); }</code><technical_language>convinced showing context (Workbench, etc.) is meaningful end-users adds a lot of visual "stuff" in cases train brain ignore? a screen reader context read start of command scroll list, significantly slowing time cognitive load. least, option turn visually audibly? more I realize</technical_language>

Target:
public String getContext() { Context context = command_.getContext(); if (context == Context.Workbench) { return ""; } return context.toString(); }
Source:
<code>private boolean canPromoteFieldInitializer(ClassMemberDeclaration declaration) { if (!NodeUtil.isLiteralValue(declaration.rhs, false)) { return false; } Node fnNode = NodeUtil.getEnclosingFunction(declaration.exprRoot); if (fnNode != null) { <START> String fnName = getFnName(fnNode); <END> if (!"constructor".equals(fnName)) { return false; } } return true; }</code><technical_language>NodeUtil.getName(fnNode) example cl</technical_language>

Target:
private boolean canPromoteFieldInitializer(ClassMemberDeclaration declaration) { if (!NodeUtil.isLiteralValue(declaration.rhs, false)) { return false; } Node fnNode = NodeUtil.getEnclosingFunction(declaration.exprRoot); if (fnNode != null) { String fnName = getEnclosingFunctionName(fnNode); if (!"constructor".equals(fnName)) { return false; } } return true; }
Source:
<code>public void run() { while (this.active.get()) { QueueEntry queueEntry = null; try { queueEntry = this.queue.peek(); if ((queueEntry != null) && (Time.currentTimeMillis() >= queueEntry.endTimeMs)) { this.queue.remove(queueEntry); queueEntry.func.run(); } else if (queueEntry != null) { Time.sleep(Math.min(1000, (queueEntry.endTimeMs - Time.currentTimeMillis()))); } else { Time.sleep(1000); } if(Thread.interrupted()) <START> this.active.set(false); <END> } catch (Throwable e) { if (!(Utils.exceptionCauseIsInstanceOf(InterruptedException.class, e)) && !(Utils.exceptionCauseIsInstanceOf(ClosedByInterruptException.class, e))) { this.onKill.uncaughtException(this, e); this.setActive(false); } } } }</code><technical_language>wrap this in '{' '}' a space if match style guide</technical_language>

Target:
public void run() { while (this.active.get()) { QueueEntry queueEntry = null; try { queueEntry = this.queue.peek(); if ((queueEntry != null) && (Time.currentTimeMillis() >= queueEntry.endTimeMs)) { this.queue.remove(queueEntry); queueEntry.func.run(); } else if (queueEntry != null) { Time.sleep(Math.min(1000, (queueEntry.endTimeMs - Time.currentTimeMillis()))); } else { Time.sleep(1000); } if (Thread.interrupted()) { this.active.set(false); } } catch (Throwable e) { if (!(Utils.exceptionCauseIsInstanceOf(InterruptedException.class, e)) && !(Utils.exceptionCauseIsInstanceOf(ClosedByInterruptException.class, e))) { this.onKill.uncaughtException(this, e); this.setActive(false); } } } }
Source:
<code>private void onBoardSave() { logger.info("Menu: Boards > Save"); List<PanelInfo> panels = getCurrentPanels(); if (openBoardName.equals("")) { onBoardSaveAs(); <START> } <END> if (panels.isEmpty()) { logger.info("Did not save board " + openBoardName); return; } prefs.addBoard(openBoardName, panels); ui.triggerEvent(new BoardSavedEvent()); logger.info("Board " + openBoardName + " saved"); }</code><technical_language>a return here? onBoardSaveAs saved board not, here</technical_language>

Target:
private void onBoardSave() { logger.info("Menu: Boards > Save"); if (!prefs.getLastOpenBoard().isPresent()) { onBoardSaveAs(); return; } List<PanelInfo> panels = getCurrentPanels(); if (panels.isEmpty()) { logger.info("Did not save board " + prefs.getLastOpenBoard().get()); return; } prefs.addBoard(prefs.getLastOpenBoard().get(), panels); ui.triggerEvent(new BoardSavedEvent()); logger.info("Board " + prefs.getLastOpenBoard().get() + " saved"); }
Source:
<code>public void execute() throws MojoExecutionException, MojoFailureException { long start = System.currentTimeMillis(); getLog().debug("Processing sources..."); if (!lightweightPackage) { RepositoryGenerator repositoryGenerator = new RepositoryGenerator(project.getFile(), outputDirectory, new ArtifactInstaller(getLog()), getClassLoaderModelAssembler()); try { ClassLoaderModel classLoaderModel = repositoryGenerator.generate(); getContentGenerator().createApplicationClassLoaderModelJsonFile(classLoaderModel); } catch (Exception e) { getLog().debug(format("There was an exception while creating the repository of [%s]", project.toString()), e); <START> throw new MojoFailureException(e.getMessage(), e); <END> } } getLog().debug(MessageFormat.format("Process sources done ({0}ms)", System.currentTimeMillis() - start)); }</code><technical_language>please change exception String message = format("There exception while creating repository of [%s]", project.toString()); getLog().debug(message, e); throw new MojoFailureException(message, e);</technical_language>

Target:
public void execute() throws MojoExecutionException, MojoFailureException { long start = System.currentTimeMillis(); getLog().debug("Processing sources..."); if (!lightweightPackage) { RepositoryGenerator repositoryGenerator = new RepositoryGenerator(project.getFile(), outputDirectory, new ArtifactInstaller(getLog()), getClassLoaderModelAssembler()); try { ClassLoaderModel classLoaderModel = repositoryGenerator.generate(); getContentGenerator().createApplicationClassLoaderModelJsonFile(classLoaderModel); } catch (Exception e) { String message = format("There was an exception while creating the repository of [%s]", project.toString()); throw new MojoFailureException(message, e); } } getLog().debug(MessageFormat.format("Process sources done ({0}ms)", System.currentTimeMillis() - start)); }
Source:
<code>public void setup() throws Exception { initMocks(this); when(pid.toString()).thenReturn(PID_STRING); when(dip.getDocument()).thenReturn(idb); when(dip.getPid()).thenReturn(pid); when(dip.getContentObject()).thenReturn(contentObj); when(contentObj.getPid()).thenReturn(pid); <START> when(inheritedAclFactory.isMarkedForDeletion(any(PID.class))).thenReturn(true); <END> principalRoles = new HashMap<>(); principalRoles.put(AccessPrincipalConstants.PUBLIC_PRINC, new HashSet<String>()); when(inheritedAclFactory.getPrincipalRoles(any(PID.class))).thenReturn(principalRoles); when(inheritedAclFactory.getPatronAccess(any(PID.class))).thenReturn(PatronAccess.none); when(objAclFactory.getPatronAccess(any(PID.class))).thenReturn(PatronAccess.none); filter = new SetAccessStatusFilter(); filter.setObjectAclFactory(objAclFactory); filter.setInheritedAclFactory(inheritedAclFactory); }</code><technical_language>kind of weird this happen for test. suggest moving testIsMarkedForDeletion. good test negative case ensure marked deleted</technical_language>

Target:
public void setup() throws Exception { initMocks(this); when(pid.toString()).thenReturn(PID_STRING); when(dip.getDocument()).thenReturn(idb); when(dip.getPid()).thenReturn(pid); principalRoles = new HashMap<>(); when(inheritedAclFactory.getPatronAccess(any(PID.class))).thenReturn(PatronAccess.parent); when(objAclFactory.getPatronAccess(any(PID.class))).thenReturn(PatronAccess.parent); filter = new SetAccessStatusFilter(); filter.setObjectAclFactory(objAclFactory); filter.setInheritedAclFactory(inheritedAclFactory); }
Source:
<code>private void deleteGroupFamily( EntityId entityId, FamilyLayout familyLayout, long upToTimestamp) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot delete family group while KijiTableWriter %s is in state %s.", this, state); final String familyName = Preconditions.checkNotNull(familyLayout.getName()); final KijiColumnNameTranslator colNameTranslator = mWriterLayoutCapsule.getColumnNameTranslator(); int i = 0; final int numColumnLayouts = familyLayout.getColumnMap().size(); byte[][] qualifiers = new byte[numColumnLayouts][]; for (ColumnLayout columnLayout : familyLayout.getColumnMap().values()) { final String qualifier = columnLayout.getName(); final KijiColumnName column = new KijiColumnName(familyName, qualifier); <START> final HBaseColumnName hBaseColumnName = <END> colNameTranslator.toHBaseColumnName(column); qualifiers[i] = hBaseColumnName.getQualifier(); i ++; } final HBaseColumnName hbaseColumnName = mWriterLayoutCapsule.getColumnNameTranslator(). toHBaseColumnName(new KijiColumnName(familyName)); final byte[] family = hbaseColumnName.getFamily(); final DeleteRequest delete = new DeleteRequest( Bytes.toBytes(mTable.getName()), entityId.getHBaseRowKey(), family, qualifiers, upToTimestamp); try { mHBClient.delete(delete).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } }</code><technical_language>this fit a single line</technical_language>

Target:
private void deleteGroupFamily( EntityId entityId, FamilyLayout familyLayout, long upToTimestamp) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot delete family group while KijiTableWriter %s is in state %s.", this, state); final String familyName = Preconditions.checkNotNull(familyLayout.getName()); final KijiColumnNameTranslator colNameTranslator = mWriterLayoutCapsule.getColumnNameTranslator(); int i = 0; final int numColumnLayouts = familyLayout.getColumnMap().size(); byte[][] qualifiers = new byte[numColumnLayouts][]; for (ColumnLayout columnLayout : familyLayout.getColumnMap().values()) { final String qualifier = columnLayout.getName(); final KijiColumnName column = new KijiColumnName(familyName, qualifier); final HBaseColumnName hbaseColumnName = colNameTranslator.toHBaseColumnName(column); qualifiers[i] = hbaseColumnName.getQualifier(); i ++; } final byte[] hbaseFamilyName = mWriterLayoutCapsule.getColumnNameTranslator() .toHBaseFamilyName(familyLayout.getLocalityGroup()); final DeleteRequest delete = new DeleteRequest( mTableName, entityId.getHBaseRowKey(), hbaseFamilyName, qualifiers, upToTimestamp); try { mHBClient.delete(delete).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } }