auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public PlanNode visitProject(ProjectNode node, RewriteContext<Set<Symbol>> context) { ImmutableSet.Builder<Symbol> expectedInputs = ImmutableSet.builder(); Assignments.Builder builder = Assignments.builder(); for (Map.Entry<Symbol, Expression> entry : node.getAssignments().entrySet()) { Symbol output = entry.getKey(); Expression expression = entry.getValue(); if (context.get().contains(output)) { expectedInputs.addAll(SymbolsExtractor.extractUnique(expression)); builder.put(output, expression); } } PlanNode source = context.rewrite(node.getSource(), expectedInputs.build()); return new ProjectNode(node.getId(), source, builder.build()); }

Target:
public PlanNode visitProject(ProjectNode node, RewriteContext<Set<Symbol>> context) { ImmutableSet.Builder<Symbol> expectedInputs = ImmutableSet.builder(); Assignments.Builder builder = Assignments.builder(); node.getAssignments().forEach((symbol, expression) -> { if (context.get().contains(symbol)) { expectedInputs.addAll(SymbolsExtractor.extractUnique(expression)); builder.put(symbol, expression); } }); PlanNode source = context.rewrite(node.getSource(), expectedInputs.build()); return new ProjectNode(node.getId(), source, builder.build()); }
Source:
public byte[] readRound(long seq) { return executeStatement(String.format("SELECT val FROM paxosLog WHERE seq = %s;", seq)) .map(SqlitePaxosStateLog::getByteArrayUnchecked) .orElse(null); }

Target:
public byte[] readRound(long seq) { return executeStatement(String.format("SELECT val FROM paxosLog WHERE seq = %s", seq)) .map(SqlitePaxosStateLog::getByteArrayUnchecked) .orElse(null); }
Source:
public boolean isToPrivateCloudTabOpened() { return seleniumWebDriverHelper .waitVisibilityAndGetAttribute( By.xpath(To_PRIVATE_CLOUD_BUTTON_XPATH + "/parent::md-tab-item"), "aria-selected") .equals("true"); }

Target:
public boolean isToPrivateCloudTabOpened() { final String privateCloudButtonParentContainer = PRIVATE_CLOUD_BUTTON_XPATH + "/parent::md-tab-item"; return seleniumWebDriverHelper .waitVisibilityAndGetAttribute(By.xpath(privateCloudButtonParentContainer), "aria-selected") .equals("true"); }
Source:
public org.activiti.client.model.ProcessInstance from(ProcessInstance source) { org.activiti.client.model.ProcessInstance processInstance = null; if (source != null) { processInstance = new org.activiti.client.model.ProcessInstance(source.getId(), source.getName(), source.getDescription(), source.getProcessDefinitionId(), source.getStartUserId(), source.getStartTime(), source.getBusinessKey(), calculateStatus(source), source.getStartUserId()); } return processInstance; }

Target:
public org.activiti.client.model.ProcessInstance from(ProcessInstance source) { org.activiti.client.model.ProcessInstance processInstance = null; if (source != null) { processInstance = new org.activiti.client.model.ProcessInstance(source.getId(), source.getName(), source.getDescription(), source.getProcessDefinitionId(), source.getStartUserId(), source.getStartTime(), source.getBusinessKey(), calculateStatus(source)); } return processInstance; }
Source:
private static CloseableHttpClient createInsecureSslHttpClient() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException { final SSLContext sslContext = new SSLContextBuilder() .useProtocol("TLSv1.2") .loadTrustMaterial(null, new TrustStrategy() { @Override public boolean isTrusted(final X509Certificate[] chain, final String authType) throws CertificateException { return true; } }).build(); final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new NoopHostnameVerifier()); final Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.getSocketFactory()) .register("https", sslsf) .build(); final HttpClientConnectionManager connectionManager = createConnectionManager(socketFactoryRegistry); return HttpClients.custom() .setConnectionManager(connectionManager) .setSSLSocketFactory( sslsf).build(); }

Target:
private static CloseableHttpClient createInsecureSslHttpClient() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException { final SSLContext sslContext = new SSLContextBuilder() .useProtocol(INSECURE_SSL_PROTOCOL) .loadTrustMaterial(null, new TrustStrategy() { @Override public boolean isTrusted(final X509Certificate[] chain, final String authType) throws CertificateException { return true; } }).build(); final SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslContext, new NoopHostnameVerifier()); final Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder.<ConnectionSocketFactory>create() .register("http", PlainConnectionSocketFactory.getSocketFactory()) .register("https", sslsf) .build(); final HttpClientConnectionManager connectionManager = createConnectionManager(socketFactoryRegistry); return HttpClients.custom() .setConnectionManager(connectionManager) .setSSLSocketFactory( sslsf).build(); }
Source:
@Test public void parseMessageAndOneOf() throws Exception { String proto = "" + "message SearchRequest {\n" + " required string query = 1;\n" + " oneof page_info {\n" + " int32 page_number = 2;\n" + " int32 result_per_page = 3;\n" + " }\n" + "}"; ProtoFile expected = ProtoFile.builder("search.proto") .addType(MessageElement.builder() .setName("SearchRequest") .addField(FieldElement.builder() .setLabel(REQUIRED) .setType("string") .setName("query") .setTag(1) .build()) .addOneOf(OneOfElement.builder() .setName("page_info") .addField(FieldElement.builder() .setLabel(ONE_OF) .setType("int32") .setName("page_number") .setTag(2) .build()) .addField(FieldElement.builder() .setLabel(ONE_OF) .setType("int32") .setName("result_per_page") .setTag(3) .build()) .build()) .build()) .build(); assertThat(ProtoParser.parse("search.proto", proto)).isEqualTo(expected); }

Target:
@Test public void parseMessageAndOneOf() throws Exception { String proto = "" + "message SearchRequest {\n" + " required string query = 1;\n" + " oneof page_info {\n" + " int32 page_number = 2;\n" + " int32 result_per_page = 3;\n" + " }\n" + "}"; ProtoFile expected = ProtoFile.builder("search.proto") .addType(MessageElement.builder() .name("SearchRequest") .addField(FieldElement.builder() .label(REQUIRED) .type("string") .name("query") .tag(1) .build()) .addOneOf(OneOfElement.builder() .name("page_info") .addField(FieldElement.builder() .label(ONE_OF) .type("int32") .name("page_number") .tag(2) .build()) .addField(FieldElement.builder() .label(ONE_OF) .type("int32") .name("result_per_page") .tag(3) .build()) .build()) .build()) .build(); assertThat(ProtoParser.parse("search.proto", proto)).isEqualTo(expected); }
Source:
public void testGetNestedPath() { Class clazzRoot = UMLFactory.eINSTANCE.createClass(); Class clazzType1 = UMLFactory.eINSTANCE.createClass(); Class clazzType2 = UMLFactory.eINSTANCE.createClass(); Class clazzType3 = UMLFactory.eINSTANCE.createClass(); Property p1 = clazzRoot.createOwnedAttribute("P1", clazzType1); Property p2 = clazzType1.createOwnedAttribute("P2", clazzType2); Property p3 = clazzType2.createOwnedAttribute("P3", clazzType3); Property p4 = clazzType3.createOwnedAttribute("P4", clazzType1); Node p4View = NotationFactory.eINSTANCE.createNode(); p4View.setElement(p4); Node p3View = NotationFactory.eINSTANCE.createNode(); p3View.setElement(p3); p3View.insertChild(p4View); Node p2View = NotationFactory.eINSTANCE.createNode(); p2View.setElement(p2); p2View.insertChild(p3View); Node p1View = NotationFactory.eINSTANCE.createNode(); p1View.setElement(p1); p1View.insertChild(p2View); Node clazzRootViewNode = NotationFactory.eINSTANCE.createNode(); clazzRootViewNode.setElement(clazzRoot); clazzRootViewNode.insertChild(p1View); List<Property> nestedPath = ConnectorUtil.getNestedPath(clazzRoot, p4View); assertTrue("Wrong nested path, expexted {P1, P2, P3}", nestedPath.size() == 3 && nestedPath.get(0) == p1 && nestedPath.get(1) == p2 && nestedPath.get(2) == p3); nestedPath = ConnectorUtil.getNestedPath(clazzRoot, p2View); assertTrue("Wrong nested path, expexted {P1}", nestedPath.size() == 1 && nestedPath.get(0) == p1); }

Target:
public void testGetNestedPath() { Class clazzRoot = UMLFactory.eINSTANCE.createClass(); Class clazzType1 = UMLFactory.eINSTANCE.createClass(); Class clazzType2 = UMLFactory.eINSTANCE.createClass(); Class clazzType3 = UMLFactory.eINSTANCE.createClass(); Property p1 = clazzRoot.createOwnedAttribute("P1", clazzType1); Property p2 = clazzType1.createOwnedAttribute("P2", clazzType2); Property p3 = clazzType2.createOwnedAttribute("P3", clazzType3); Property p4 = clazzType3.createOwnedAttribute("P4", clazzType1); Node p4View = NotationFactory.eINSTANCE.createNode(); p4View.setElement(p4); Node p3View = NotationFactory.eINSTANCE.createNode(); p3View.setElement(p3); p3View.insertChild(p4View); Node p2View = NotationFactory.eINSTANCE.createNode(); p2View.setElement(p2); p2View.insertChild(p3View); Node p1View = NotationFactory.eINSTANCE.createNode(); p1View.setElement(p1); p1View.insertChild(p2View); Node clazzRootViewNode = NotationFactory.eINSTANCE.createNode(); clazzRootViewNode.setElement(clazzRoot); clazzRootViewNode.insertChild(p1View); List<Property> nestedPath = ConnectorUtil.getNestedPath(clazzRoot, p4View); assertEquals("Wrong nested path, expected {P1, P2, P3}", Arrays.asList(p1, p2, p3), nestedPath); nestedPath = ConnectorUtil.getNestedPath(clazzRoot, p2View); assertTrue("Wrong nested path, expected {P1}", nestedPath.size() == 1 && nestedPath.get(0) == p1); }
Source:
public NewPartitionReassignment(List<Integer> targetReplicas) { this.targetReplicas = Collections.unmodifiableList(new ArrayList<>(targetReplicas)); }

Target:
private NewPartitionReassignment(List<Integer> targetReplicas) { this.targetReplicas = Collections.unmodifiableList(new ArrayList<>(targetReplicas)); }
Source:
public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { if (needFiltering(name)) { synchronized(this) { Class<?> cl = findLoadedClass(name); if (cl == null && delegatingClassLoader != null) { InputStream inputStream = delegatingClassLoader.getResourceAsStream(name.replace('.','/')+".class"); if (inputStream != null) { ByteArrayOutputStream targetBuffer = new ByteArrayOutputStream(); try { try { byte[] buffer = new byte[1024]; for(int r = inputStream.read(buffer, 0, buffer.length); r > 0; r = inputStream.read(buffer, 0, buffer.length)) { targetBuffer.write(buffer, 0, r); } } finally { inputStream.close(); } } catch (IOException e) { throw new ClassNotFoundException("Cannot load class with name '"+name+"' from delegating classloader", e); } byte[] classBytes = targetBuffer.toByteArray(); cl = defineClass(name, classBytes, 0, classBytes.length); if (resolve) { resolveClass(cl); } } } if (cl != null) { return cl; } else { throw new ClassNotFoundException("Class with name '"+name+"' should not be loaded from parent classloader and is not found in delegating classloader"); } } } else { return super.loadClass(name, resolve); } }

Target:
public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { if (!needFiltering(name)) { return super.loadClass(name, resolve); } synchronized(this) { Class<?> cl = findLoadedClass(name); if (cl == null && delegatingClassLoader != null) { InputStream inputStream = delegatingClassLoader.getResourceAsStream(name.replace('.','/')+".class"); if (inputStream != null) { ByteArrayOutputStream targetBuffer = new ByteArrayOutputStream(); try { try { byte[] buffer = new byte[1024]; for(int r = inputStream.read(buffer, 0, buffer.length); r > 0; r = inputStream.read(buffer, 0, buffer.length)) { targetBuffer.write(buffer, 0, r); } } finally { inputStream.close(); } } catch (IOException e) { throw new ClassNotFoundException("Cannot load class with name '"+name+"' from delegating classloader", e); } byte[] classBytes = targetBuffer.toByteArray(); cl = defineClass(name, classBytes, 0, classBytes.length); if (resolve) { resolveClass(cl); } } } if (cl != null) { return cl; } else { throw new ClassNotFoundException("Class with name '"+name+"' should not be loaded from parent classloader and is not found in delegating classloader"); } } }
Source:
private void handleSubquery(FilterContext filter, List<IndexSegment> indexSegments, TimerContext timerContext, ExecutorService executorService, long endTimeMs) throws Exception { Predicate predicate = filter.getPredicate(); if (predicate != null) { handleSubquery(predicate.getLhs(), indexSegments, timerContext, executorService, endTimeMs); } else { for (FilterContext child : filter.getChildren()) { handleSubquery(child, indexSegments, timerContext, executorService, endTimeMs); } } }

Target:
private void handleSubquery(FilterContext filter, List<IndexSegment> indexSegments, TimerContext timerContext, ExecutorService executorService, long endTimeMs) throws Exception { List<FilterContext> children = filter.getChildren(); if (children != null) { for (FilterContext child : children) { handleSubquery(child, indexSegments, timerContext, executorService, endTimeMs); } } else { handleSubquery(filter.getPredicate().getLhs(), indexSegments, timerContext, executorService, endTimeMs); } }
Source:
Map<String, Long> getExternalResourcesUnSafe(Object resource) { if (!isYarnResourceTypesAvailable) { return Collections.emptyMap(); } final Map<String, Long> externalResources = new HashMap<>(); final Object[] externalResourcesInfo; try { externalResourcesInfo = (Object[]) resourceGetResourcesMethod.invoke(resource); for (int i = 2; i < externalResourcesInfo.length; i++) { final String name = (String) resourceInformationGetNameMethod.invoke(externalResourcesInfo[i]); final long value = (long) resourceInformationGetValueMethod.invoke(externalResourcesInfo[i]); if (value > 0) { externalResources.put(name, value); } } } catch (Exception e) { LOG.warn("Could not obtain the external resources supported by the given Resource.", e); return Collections.emptyMap(); } return externalResources; }

Target:
Map<String, Long> getExternalResourcesUnSafe(Object resource) { if (!isYarnResourceTypesAvailable) { return Collections.emptyMap(); } final Map<String, Long> externalResources = new HashMap<>(); final Object[] externalResourcesInfo; try { externalResourcesInfo = (Object[]) resourceGetResourcesMethod.invoke(resource); for (int i = 2; i < externalResourcesInfo.length; i++) { final String name = (String) resourceInformationGetNameMethod.invoke(externalResourcesInfo[i]); final long value = (long) resourceInformationGetValueMethod.invoke(externalResourcesInfo[i]); externalResources.put(name, value); } } catch (Exception e) { LOG.warn("Could not obtain the external resources supported by the given Resource.", e); return Collections.emptyMap(); } return externalResources; }
Source:
private static JsonElement createErrorJson(String message, Response.Status status, Object entity, Exception ex) { JsonObject ret = new JsonObject(); JsonObject err = new JsonObject(); ret.add(JSON_KEY_ERROR, err); err.addProperty(JSON_KEY_ERROR_MESSAGE, message); if (null != status) { err.addProperty(JSON_KEY_HTTPCODE, status.getStatusCode()); } if (null != entity) { ret.add("entity", GSON.toJsonTree(entity)); } if (null != ex) { JsonObject exc = new JsonObject(); err.add("exception", exc); { exc.addProperty("class", ex.getClass().getName()); exc.addProperty("message", ex.getMessage()); exc.addProperty("localized-message", ex.getLocalizedMessage()); exc.addProperty("cause", null != ex.getCause() ? ex.getCause().getClass().getName() : null); if (WITH_STACKTRACE) exc.add("stacktrace", GSON.toJsonTree(ex.getStackTrace())); } } return ret; }

Target:
private static JsonElement createErrorJson(String message, Response.Status status, Object entity, Exception ex) { JsonObject ret = new JsonObject(); JsonObject err = new JsonObject(); ret.add(JSON_KEY_ERROR, err); err.addProperty(JSON_KEY_ERROR_MESSAGE, message); if (null != status) { err.addProperty(JSON_KEY_HTTPCODE, status.getStatusCode()); } if (null != entity) { ret.add("entity", GSON.toJsonTree(entity)); } if (null != ex) { JsonObject exc = new JsonObject(); err.add("exception", exc); { exc.addProperty("class", ex.getClass().getName()); exc.addProperty("message", ex.getMessage()); exc.addProperty("localized-message", ex.getLocalizedMessage()); exc.addProperty("cause", null != ex.getCause() ? ex.getCause().getClass().getName() : null); if (WITH_STACKTRACE) { exc.add("stacktrace", GSON.toJsonTree(ex.getStackTrace())); } } } return ret; }
Source:
public int getMax() { return getSeaPickle().getMinimumPickles(); }

Target:
public int getMax() { return getSeaPickle().getMaximumPickles(); }
Source:
public void focusLost() { assertFalse(new BooleanTextBox(true).isValidValue("-", true)); assertTrue(new BooleanTextBox(false).isValidValue("-", false)); }

Target:
public void focusLost() { assertFalse(new BooleanTextBox(true).isValidValue("-", true)); assertFalse(new BooleanTextBox(false).isValidValue("-", true)); assertTrue(new BooleanTextBox(false).isValidValue("-", false)); assertTrue(new BooleanTextBox(true).isValidValue("-", false)); }
Source:
public void testOverSizedBitImageExplicitStorageArray() { final int numLongs = ( int ) Math.ceil( 1000 * 1000 / 64 ); final ArrayImg< BitType, LongArray > img = ArrayImgs.bits( new LongArray( new long[ numLongs ] ), 1000, 1000 ); final Random r = new Random( 42l ); img.forEach( p -> { p.set( r.nextBoolean() ); } ); final long[] storage = ( long[] ) ( ( ArrayDataAccess< ? > ) img.update( null ) ).getCurrentStorageArray(); final long[] sizes = new long[ img.numDimensions() ]; img.dimensions( sizes ); assertEquals( storage.length, numLongs ); }

Target:
public void testOverSizedBitImageExplicitStorageArray() { final int numLongs = ( int ) Math.ceil( 100 * 100 / 64d ); final ArrayImg< BitType, LongArray > img = ArrayImgs.bits( new LongArray( new long[ numLongs ] ), 100, 100 ); final Random r = new Random( 42l ); img.forEach( p -> { p.set( r.nextBoolean() ); } ); final long[] storage = ( long[] ) ( ( ArrayDataAccess< ? > ) img.update( null ) ).getCurrentStorageArray(); final long[] sizes = new long[ img.numDimensions() ]; img.dimensions( sizes ); assertEquals( storage.length, numLongs ); }
Source:
public void getBrand(final String brand, final int page, final OnBrandCallback onBrandCallback) { String fields = "brands,product_name_fr,product_name,image_small_url,image_front_thumb_url,quantity,nutrition_grades_tags"; apiService.getProductByBrands(brand, page, fields).enqueue(new Callback<Search>() { @Override public void onResponse(Call<Search> call, Response<Search> response) { onBrandCallback.onBrandResponse(true, response.body()); } @Override public void onFailure(Call<Search> call, Throwable t) { onBrandCallback.onBrandResponse(false, null); } }); }

Target:
public void getBrand(final String brand, final int page, final OnBrandCallback onBrandCallback) { apiService.getProductByBrands(brand, page, FIELDS_TO_FETCH_FACETS).enqueue(new Callback<Search>() { @Override public void onResponse(@NonNull Call<Search> call, @NonNull Response<Search> response) { onBrandCallback.onBrandResponse(true, response.body()); } @Override public void onFailure(@NonNull Call<Search> call, @NonNull Throwable t) { onBrandCallback.onBrandResponse(false, null); } }); }
Source:
private boolean isLogNumFieldValid() { String count = logFileCount.getText(); logNumAlert.setText(""); if (count.length() == 0) { logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_noValueEntered_text()); return false; } if (count.replaceAll("[^\\d]", "").length() != count.length() || count.replaceFirst("^0+", "").length() == 0) { logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text()); return false; } return true; }

Target:
private boolean isLogNumFieldValid() { String count = logFileCount.getText(); logNumAlert.setText(""); try { int count_num = Integer.parseInt(count); if (count_num < 1) { logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text()); return false; } } catch (NumberFormatException e) { logNumAlert.setText(Bundle.AutopsyOptionsPanel_logNumAlert_invalidInput_text()); return false; } return true; }
Source:
private void updateView(BoxIteratorCollaborations boxIteratorCollaborations) { mCollaborations = boxIteratorCollaborations; if (mCollaborations != null) { if (mCollaborations.size() == 0) { this.setVisibility(GONE); } else { this.setVisibility(View.VISIBLE); mInitialsListHeader.setVisibility(View.VISIBLE); final int totalCollaborators = mCollaborations.fullSize().intValue(); final int remainingWidth = mInitialsListView.getWidth(); final ArrayList<BoxCollaboration> collaborations = mCollaborations.getEntries(); clearInitialsView(); mInitialsListView.post(new Runnable() { @Override public void run() { final View initialsView = addInitialsToList(collaborations.get(0).getAccessibleBy()); initialsView.post(new Runnable() { @Override public void run() { int viewWidth = initialsView.getWidth(); int viewsCount = remainingWidth/viewWidth; for (int i = 1; i < viewsCount && i < collaborations.size(); i++) { View viewAdded = addInitialsToList(collaborations.get(i).getAccessibleBy()); if (i == viewsCount - 1) { int remaining = totalCollaborators - viewsCount; if (remaining > 0) { BoxAvatarView initials = (BoxAvatarView) viewAdded.findViewById(R.id.collaborator_initials); JsonObject jsonObject = new JsonObject(); jsonObject.set(BoxCollaborator.FIELD_NAME, Integer.toString(remaining + 1)); BoxUser numberUser = new BoxUser(jsonObject); initials.loadUser(numberUser, mController.getAvatarController()); } } } } }); } }); } } }

Target:
private void updateView(BoxIteratorCollaborations boxIteratorCollaborations) { mCollaborations = boxIteratorCollaborations; if (mCollaborations == null) { this.setVisibility(GONE); return; } if (mCollaborations.size() == 0) { this.setVisibility(GONE); } else { this.setVisibility(View.VISIBLE); mInitialsListHeader.setVisibility(View.VISIBLE); final int totalCollaborators = mCollaborations.fullSize().intValue(); final int remainingWidth = mInitialsListView.getWidth(); final ArrayList<BoxCollaboration> collaborations = mCollaborations.getEntries(); clearInitialsView(); mInitialsListView.post(new Runnable() { @Override public void run() { final View initialsView = addInitialsToList(collaborations.get(0).getAccessibleBy()); initialsView.post(new Runnable() { @Override public void run() { int viewWidth = initialsView.getWidth(); int viewsCount = remainingWidth/viewWidth; for (int i = 1; i < viewsCount && i < collaborations.size(); i++) { View viewAdded = addInitialsToList(collaborations.get(i).getAccessibleBy()); if (i == viewsCount - 1) { int remaining = totalCollaborators - viewsCount; if (remaining > 0) { BoxAvatarView initials = (BoxAvatarView) viewAdded.findViewById(R.id.collaborator_initials); JsonObject jsonObject = new JsonObject(); jsonObject.set(BoxCollaborator.FIELD_NAME, Integer.toString(remaining + 1)); BoxUser numberUser = new BoxUser(jsonObject); initials.loadUser(numberUser, mController.getAvatarController()); } } } } }); } }); } }
Source:
public void bootstrapOnHost(Stack stack) throws CloudbreakException { Set<Node> nodes = collectNodesForBootstrap(stack); try { List<GatewayConfig> allGatewayConfig = collectAndCheckGateways(stack); saveSaltComponent(stack); BootstrapParams params = createBootstrapParams(stack); hostOrchestrator.bootstrap(allGatewayConfig, nodes, params, clusterDeletionBasedModel(stack.getId(), null)); InstanceMetaData primaryGateway = stack.getPrimaryGatewayInstance(); saveOrchestrator(stack, primaryGateway); checkIfAllNodesAvailable(stack, nodes, primaryGateway); } catch (Exception e) { throw new CloudbreakException(e); } }

Target:
public void bootstrapOnHost(Stack stack) throws CloudbreakException { bootstrapOnHostInternal(stack, this::saveSaltComponent); }
Source:
NameMatcher(String pattern, Character pathSeparator, boolean dirOnly){ super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); beginning = pattern.length() == 0 ? false : pattern.charAt(0) == slash; if(!beginning) { this.subPattern = pattern; } else { this.subPattern = pattern.substring(1, pattern.length()); } }

Target:
NameMatcher(String pattern, Character pathSeparator, boolean dirOnly) { super(pattern, dirOnly); slash = getPathSeparator(pathSeparator); beginning = pattern.length() == 0 ? false : pattern.charAt(0) == slash; if (!beginning) this.subPattern = pattern; else this.subPattern = pattern.substring(1); }
Source:
public Iterable<EdgeInfo> getEdgeInfos(Direction direction, final String[] labels, Authorizations authorizations) { if (!getFetchHints().isIncludeEdgeRefs()) { throw new VertexiumException("getEdgeInfos called without including any edge infos"); } Iterable<EdgeInfo> results = internalGetEdgeInfo(direction, authorizations); results = new FilterIterable<EdgeInfo>(results) { @Override protected boolean isIncluded(EdgeInfo o) { if (!getFetchHints().isIncludeEdgeRefLabel(o.getLabel())) { return false; } if (labels == null) { return true; } else { for (String label : labels) { if (o.getLabel().equals(label)) { return true; } } return false; } } }; return results; }

Target:
public Iterable<EdgeInfo> getEdgeInfos(Direction direction, final String[] labels, Authorizations authorizations) { getFetchHints().validateHasEdgeFetchHints(direction, labels); Iterable<EdgeInfo> results = internalGetEdgeInfo(direction, authorizations); results = new FilterIterable<EdgeInfo>(results) { @Override protected boolean isIncluded(EdgeInfo o) { if (!getFetchHints().isIncludeEdgeRefLabel(o.getLabel())) { return false; } if (labels == null) { return true; } else { for (String label : labels) { if (o.getLabel().equals(label)) { return true; } } return false; } } }; return results; }
Source:
public String[] updateTranslationNames(String[] translationNames) { List<String> transList = new ArrayList<>(); for (String translation : translationNames) { transList.add(translation); } transList.add(getContext().getString(R.string.more_translations)); translationNames = transList.toArray(new String[transList.size()]); return translationNames; }

Target:
private String[] updateTranslationNames(String[] translationNames) { List<String> translationsList = new ArrayList<>(); for (String translation : translationNames) { translationsList.add(translation); } translationsList.add(getContext().getString(R.string.more_translations)); translationNames = translationsList.toArray(new String[translationsList.size()]); return translationNames; }
Source:
Observer<List<Location>> getLocationList() { return new Observer<List<Location>>() { @Override public void onCompleted() { new AlertDialog.Builder(ACBaseActivity.this) .setSingleChoiceItems( new ArrayAdapter<>(ACBaseActivity.this, android.R.layout.simple_list_item_single_choice, locationList), locationList.indexOf(mOpenMRS.getLocation()), (dialog, which) -> { mOpenMRS.setLocation(locationList.get(which)); dialog.dismiss(); }) .show(); } @Override public void onError(Throwable e) { e.printStackTrace(); } @Override public void onNext(List<Location> locations) { locationList = new ArrayList<>(); for (Location locationItem : locations) { locationList.add(locationItem.getName()); } } }; }

Target:
private Observer<List<Location>> getLocationList() { return new Observer<List<Location>>() { @Override public void onCompleted() { showLocationDialog(locationList); } @Override public void onError(Throwable e) { e.printStackTrace(); } @Override public void onNext(List<Location> locations) { for (Location locationItem : locations) { locationList.add(locationItem.getName()); } } }; }
Source:
void testCloserClosingState() throws InterruptedException { Injector i = createInjector(); final Closer closer = i.getInstance(Closer.class); assert closer.getState() == Closer.State.OPEN; final AtomicBoolean flag = new AtomicBoolean(true); closer.addToClose(new Closeable() { @Override public void close() throws IOException { while (flag.get()) { } assert closer.getState() == Closer.State.CLOSING; } }); Thread thread = new Thread(new Runnable() { @Override public void run() { try { closer.close(); } catch (IOException e) { assert false; } } }); thread.start(); while (closer.getState() == Closer.State.OPEN) { } assert closer.getState() == Closer.State.CLOSING; flag.set(false); thread.join(); assert closer.getState() == Closer.State.CLOSED; }

Target:
void testCloserClosingState() throws InterruptedException { Injector i = createInjector(); final Closer closer = i.getInstance(Closer.class); final CountDownLatch closeDone = new CountDownLatch(1); final CountDownLatch closeStart = new CountDownLatch(1); closer.addToClose(new Closeable() { @Override public void close() throws IOException { try { closeStart.countDown(); assert closer.getState() == Closer.State.PROCESSING; closeDone.await(); } catch (InterruptedException e) { assert false : e.getMessage(); } } }); Thread thread = new Thread(new Runnable() { @Override public void run() { try { closer.close(); } catch (IOException e) { assert false : e.getMessage(); } } }); thread.start(); closeStart.await(); assert closer.getState() == Closer.State.PROCESSING; closeDone.countDown(); thread.join(); assert closer.getState() == Closer.State.DONE; }
Source:
protected static Object getTraceTypeElement(IResource resource, String element) { try { if (resource != null) { String traceType = resource.getPersistentProperty(TmfCommonConstants.TRACETYPE); for (IConfigurationElement ce : TmfTraceType.getTypeElements()) { if (ce.getAttribute(TmfTraceType.ID_ATTR).equals(traceType)) { IConfigurationElement[] viewerCE = ce.getChildren(element); if (viewerCE.length != 1) { break; } return viewerCE[0].createExecutableExtension(TmfTraceType.CLASS_ATTR); } } } } catch (CoreException e) { Activator.getDefault().logError("Error creating statistics viewer", e); } return null; }

Target:
public static Object getTraceTypeElement(IResource resource, String element) { try { if (resource != null) { String traceType = resource.getPersistentProperty(TmfCommonConstants.TRACETYPE); for (IConfigurationElement ce : TmfTraceType.getTypeElements()) { if (ce.getAttribute(TmfTraceType.ID_ATTR).equals(traceType)) { IConfigurationElement[] viewerCE = ce.getChildren(element); if (viewerCE.length != 1) { break; } return viewerCE[0].createExecutableExtension(TmfTraceType.CLASS_ATTR); } } } } catch (CoreException e) { Activator.getDefault().logError("Error creating statistics viewer", e); } return null; }
Source:
public void close() { final List<Throwable> suppressed = new ArrayList<>(); if (closed) { return; } boolean wasInTransaction = forceEndTransactions && config.get().get(Handles.class).isForceEndTransactions(); if (wasInTransaction) { try { wasInTransaction &= isInTransaction(); } catch (Exception e) { suppressed.add(e); } } extensionMethod.remove(); config.remove(); if (wasInTransaction) { try { rollback(); } catch (Exception e) { suppressed.add(e); } } try { statementBuilder.close(getConnection()); } catch (Exception e) { suppressed.add(e); } try { closer.close(connection); if (!suppressed.isEmpty()) { final Throwable original = suppressed.remove(0); suppressed.forEach(original::addSuppressed); throw new CloseException("Failed to clear transaction status on close", original); } if (wasInTransaction) { TransactionException txe = new TransactionException("Improper transaction handling detected: A Handle with an open " + "transaction was closed. Transactions must be explicitly committed or rolled back " + "before closing the Handle. " + "Jdbi has rolled back this transaction automatically. " + "This check may be disabled by calling getConfig(Handles.class).setForceEndTransactions(false)."); suppressed.forEach(txe::addSuppressed); throw txe; } } catch (SQLException e) { CloseException ce = new CloseException("Unable to close Connection", e); suppressed.forEach(ce::addSuppressed); throw ce; } finally { LOG.trace("Handle released", this); closed = true; } }

Target:
public void close() { final List<Throwable> suppressed = new ArrayList<>(); if (closed) { return; } boolean wasInTransaction = false; if (forceEndTransactions && config.get().get(Handles.class).isForceEndTransactions()) { try { wasInTransaction = isInTransaction(); } catch (Exception e) { suppressed.add(e); } } extensionMethod.remove(); config.remove(); if (wasInTransaction) { try { rollback(); } catch (Exception e) { suppressed.add(e); } } try { statementBuilder.close(getConnection()); } catch (Exception e) { suppressed.add(e); } try { closer.close(connection); if (!suppressed.isEmpty()) { final Throwable original = suppressed.remove(0); suppressed.forEach(original::addSuppressed); throw new CloseException("Failed to clear transaction status on close", original); } if (wasInTransaction) { throw new TransactionException("Improper transaction handling detected: A Handle with an open " + "transaction was closed. Transactions must be explicitly committed or rolled back " + "before closing the Handle. " + "Jdbi has rolled back this transaction automatically. " + "This check may be disabled by calling getConfig(Handles.class).setForceEndTransactions(false)."); } } catch (SQLException e) { CloseException ce = new CloseException("Unable to close Connection", e); suppressed.forEach(ce::addSuppressed); throw ce; } finally { LOG.trace("Handle released", this); closed = true; } }
Source:
private boolean proceedCommandExecutionFailed() { if (getParameters().getCommandStep() == RemoveSnapshotSingleDiskLiveStep.MERGE) { log.warn("Merge failed, retrying to recover from MERGE_STATUS step"); getParameters().setCommandStep(RemoveSnapshotSingleDiskLiveStep.MERGE_STATUS); return true; } if (getParameters().getCommandStep() == RemoveSnapshotSingleDiskLiveStep.DESTROY_IMAGE) { log.warn("Child command '{}' failed, proceeding to verify", getParameters().getCommandStep()); getParameters().setCommandStep(getParameters().getNextCommandStep()); return true; } log.error("Failed child command status for step '{}'", getParameters().getCommandStep()); setCommandStatus(CommandStatus.FAILED); return false; }

Target:
private boolean proceedCommandExecutionFailed() { if (getParameters().getCommandStep() == RemoveSnapshotSingleDiskLiveStep.MERGE) { log.warn("Merge failed, attempting to recover from MERGE_STATUS step"); getParameters().setCommandStep(RemoveSnapshotSingleDiskLiveStep.MERGE_STATUS); return true; } if (getParameters().getCommandStep() == RemoveSnapshotSingleDiskLiveStep.DESTROY_IMAGE) { log.warn("Child command '{}' failed, proceeding to verify", getParameters().getCommandStep()); getParameters().setCommandStep(getParameters().getNextCommandStep()); return true; } log.error("Failed child command status for step '{}'", getParameters().getCommandStep()); setCommandStatus(CommandStatus.FAILED); return false; }
Source:
private List<TermResource> executeSearch(QueryBuilder qb, int limit, Boolean thinFilter) { List<TermResource> termList = new ArrayList<>(); SearchHits hits = client.prepareSearch(index).setQuery(qb).setSize(limit).execute().actionGet().getHits(); ObjectMapper mapper = new ObjectMapper(); if (thinFilter) { SimpleModule module = new SimpleModule(); module.addDeserializer(TermResource.class, new TermResourceMinimalDeserializer()); mapper.registerModule(module); } for (SearchHit hit : hits.getHits()) { String jsonString = hit.getSourceAsString(); try { TermResource resource = mapper.readValue(jsonString, TermResource.class); termList.add(resource); } catch (IOException e) { logger.error("Exception mapping value: '" + jsonString + "' to TermResource: " + e.getMessage()); } } return termList; }

Target:
private List<TermResource> executeSearch(QueryBuilder qb, int limit, Boolean thinFilter) { List<TermResource> termList = new ArrayList<>(); SearchHits hits = client.prepareSearch(index).setQuery(qb).setSize(limit).execute().actionGet().getHits(); ObjectMapper mapper = new ObjectMapper(); for (SearchHit hit : hits.getHits()) { String jsonString = hit.getSourceAsString(); try { TermResource resource = mapper.readValue(jsonString, TermResource.class); if (thinFilter) { resource.setOntology(null); resource.setUsable(null); resource.setParents(null); } termList.add(resource); } catch (IOException e) { logger.error("Exception mapping value: '" + jsonString + "' to TermResource: " + e.getMessage()); } } return termList; }
Source:
protected final void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { drawForegroundLayer(); GlStateManager.translate(-guiLeft, -guiTop, 0); mouse.setMousePosition(mouseX, mouseY); for (IGuiElement element : guiElements) { element.drawForeground(); } tooltips.drawForeground(); GlStateManager.translate(guiLeft, guiTop, 0); }

Target:
protected final void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { GlStateManager.translate(-guiLeft, -guiTop, 0); mouse.setMousePosition(mouseX, mouseY); drawForegroundLayer(); for (IGuiElement element : guiElements) { element.drawForeground(); } tooltips.drawForeground(); GlStateManager.translate(guiLeft, guiTop, 0); }
Source:
public void setLocked(boolean locked) { isLocked = locked; }

Target:
public void setLocked(boolean locked) { this.isLocked = locked; }
Source:
public List<Map<String, String>> replace(String input) { List<Map<String, String>> parsed = Lists.newArrayList(); Matcher m = pattern.matcher(input); int last = 0; while (m.find()) { addText(parsed, input.substring(last, m.start())); if (link != null) { String builder = new String(link); for (int i = 0; i < m.groupCount(); i++) { builder = builder.replaceAll("\\$" + Integer.toString(i), m.group(i + 1)); } addLink(parsed, m.group(0), builder); } last = m.end(); } addText(parsed, input.substring(last)); return parsed; }

Target:
public List<Map<String, String>> replace(String input) { List<Map<String, String>> parsed = Lists.newArrayList(); Matcher m = pattern.matcher(input); int last = 0; while (m.find()) { addText(parsed, input.substring(last, m.start())); if (link != null) { String s = pattern.matcher(m.group(0)).replaceAll(link); addLink(parsed, m.group(0), s); } last = m.end(); } addText(parsed, input.substring(last)); return parsed; }
Source:
public JPanel getReopenPanel(){ if(reopenPanel == null){ reopenPanel = new JPanel(); reopenPanel.setLayout(new GridBagLayout()); reopenPanel.setPreferredSize(new Dimension(100, 160)); int y = 0; reopenPanel.add(wsUiHelper.getRedirectionCheckBox(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.getTrackingSessionCheckBox(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.createVerticalSeparator(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.getWebSocketKeyLabel(),wsUiHelper.getLabelConstraints(0,y++)); reopenPanel.add(wsUiHelper.getSecWebsocketKeyField(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.getAlwaysGenerateCheckBox(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.getGenerateWebSocketKeyButton(),wsUiHelper.getFieldConstraints(0,y++)); } return reopenPanel; }

Target:
private JPanel getReopenPanel(){ if(reopenPanel == null){ reopenPanel = new JPanel(); reopenPanel.setLayout(new GridBagLayout()); int y = 0; reopenPanel.add(wsUiHelper.getRedirectionCheckBox(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.getTrackingSessionCheckBox(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.createVerticalSeparator(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.getWebSocketKeyLabel(),wsUiHelper.getLabelConstraints(0,y++)); reopenPanel.add(wsUiHelper.getWebSocketKeyField(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.getAlwaysGenerateCheckBox(),wsUiHelper.getFieldConstraints(0,y++)); reopenPanel.add(wsUiHelper.getGenerateWebSocketKeyButton(),wsUiHelper.getFieldConstraints(0,y++)); } return reopenPanel; }
Source:
public Void setTier(AccessTier tier) { return setTierWithResponse(tier, null, null, Context.NONE).value(); }

Target:
public void setTier(AccessTier tier) { setTierWithResponse(tier, null, null, Context.NONE); }
Source:
protected Collection<DependencySeed> publishContent(PublisherServiceFactory publisherServiceFactory) throws MojoExecutionException, MojoFailureException { PublisherService publisherService = publisherServiceFactory.createPublisher(getReactorProject(), getEnvironments()); try { List<DependencySeed> categoryIUs = new ArrayList<>(); List<RepositoryReference> categoryRepoRefs = new ArrayList<>(); for (Category category : getCategories()) { final File buildCategoryFile = prepareBuildCategory(category, getBuildDirectory()); Collection<DependencySeed> ius = publisherService.publishCategories(buildCategoryFile); categoryIUs.addAll(ius); for (RepositoryRef repositoryRef : category.getRepositories()) { categoryRepoRefs.add(new RepositoryReference(repositoryRef.getName(), repositoryRef.getLocation(), repositoryRef.isEnabled())); } TychoProjectUtils.getRepositoryLocations(getProject()).addAll(categoryRepoRefs); } return categoryIUs; } catch (FacadeException e) { throw new MojoExecutionException("Exception while publishing categories: " + e.getMessage(), e); } }

Target:
protected Collection<DependencySeed> publishContent(PublisherServiceFactory publisherServiceFactory) throws MojoExecutionException, MojoFailureException { PublisherService publisherService = publisherServiceFactory.createPublisher(getReactorProject(), getEnvironments()); try { List<DependencySeed> categoryIUs = new ArrayList<>(); for (Category category : getCategories()) { final File buildCategoryFile = prepareBuildCategory(category, getBuildDirectory()); Collection<DependencySeed> ius = publisherService.publishCategories(buildCategoryFile); categoryIUs.addAll(ius); } return categoryIUs; } catch (FacadeException e) { throw new MojoExecutionException("Exception while publishing categories: " + e.getMessage(), e); } }
Source:
private void initHeaders(final MultivaluedMap<String, String> mHeaders) { this.headers = new HashMap<>(); mHeaders.keySet().forEach(key -> { this.headers.put(key, mHeaders.get(key)); }); }

Target:
private void initHeaders(final MultivaluedMap<String, String> mHeaders) { this.headers = new HashMap<String, List<String>>(); headers.putAll(mHeaders); }
Source:
private String getDefaultUsername() { int indexOfUserParameter = ArrayUtils.indexOf(commandLine.getArgs(), "--user"); if (indexOfUserParameter >= 0 && indexOfUserParameter < commandLine.getArgs().length - 1) { return commandLine.getArgs()[indexOfUserParameter + 1]; } else { return Target.DEFAULT_USERNAME; } }

Target:
private String getDefaultUsername() { int indexOfUserParameter = ArrayUtils.indexOf(commandLine.getArgs(), "--username"); if (indexOfUserParameter >= 0 && indexOfUserParameter < commandLine.getArgs().length - 1) { return commandLine.getArgs()[indexOfUserParameter + 1]; } else { return Target.DEFAULT_USERNAME; } }
Source:
private void receivedClientCertificate(final CertificateMessage message) throws HandshakeException { if (clientCertificate != null && (clientCertificate.getMessageSeq() == message.getMessageSeq())) { return; } clientCertificate = message; verifyCertificate(clientCertificate); clientPublicKey = clientCertificate.getPublicKey(); peerCertPath = clientCertificate.getCertificateChain(); if (clientAuthenticationRequired && clientPublicKey == null) { LOGGER.debug("Certificate validation failed: x509 could not be trusted!"); AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.HANDSHAKE_FAILURE, session.getPeer()); throw new HandshakeException("Client Certificate required!", alert); } handshakeMessages = ByteArrayUtils.concatenate(handshakeMessages, clientCertificate.getRawMessage()); }

Target:
private void receivedClientCertificate(final CertificateMessage message) throws HandshakeException { if (clientCertificate != null && (clientCertificate.getMessageSeq() == message.getMessageSeq())) { return; } clientCertificate = message; if (clientAuthenticationRequired && clientCertificate.getCertificateChain() != null && clientCertificate.getPublicKey() == null) { LOGGER.debug("Client authentication failed: missing certificate!"); AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.HANDSHAKE_FAILURE, session.getPeer()); throw new HandshakeException("Client Certificate required!", alert); } verifyCertificate(clientCertificate); clientPublicKey = clientCertificate.getPublicKey(); handshakeMessages = ByteArrayUtils.concatenate(handshakeMessages, clientCertificate.getRawMessage()); }
Source:
public void testDateTimeBug3() { final RDFDatatype XSDdateTime = TypeMapper.getInstance().getSafeTypeByName(XSD.dateTime.getURI()); final String testLex = "-0001-02-03T04:05:06"; Node n = createLiteral(testLex, XSDdateTime); assertEquals("Got wrong XSDDateTime representation!", testLex, n.getLiteralValue().toString()); }

Target:
public void testDateTimeBug3() { final String testLex = "-0001-02-03T04:05:06"; Node n = createLiteral(testLex, XSDDatatype.XSDdateTime); assertEquals("Got wrong XSDDateTime representation!", testLex, n.getLiteralValue().toString()); }
Source:
public void processElement(ProcessContext context) throws Exception { KV<String, Iterable<Mutation>> element = context.element(); try (Table t = conn.getTable(TableName.valueOf(element.getKey()))) { List<Mutation> mutations = Lists.newArrayList(element.getValue()); LOG.trace("Persisting elements to table {}", mutations.size(), element.getKey()); Object results[] = new Object[mutations.size()]; t.batch(mutations, results); LOG.trace("Finished persisting elements to table {}", mutations.size(), element.getKey()); } catch (RetriesExhaustedWithDetailsException exception) { logExceptions(context, exception); retrowException(exception); } }

Target:
public void processElement(ProcessContext context) throws Exception { KV<String, Iterable<Mutation>> element = context.element(); String tableName = element.getKey(); try (Table t = conn.getTable(TableName.valueOf(tableName))) { List<Mutation> mutations = Lists.newArrayList(element.getValue()); int mutationCount = mutations.size(); LOG.trace("Persisting elements to table {}.", mutationCount, tableName); t.batch(mutations, new Object[mutationCount]); LOG.trace("Finished persisting elements to table {}.", mutationCount, tableName); } catch (RetriesExhaustedWithDetailsException exception) { logExceptions(context, exception); retrowException(exception); } }
Source:
public Class getColumnClass(int column) { if (column >= StringResourceTableUtil.ConstantColumn.values().length) { return StringResourceTableUtil.ConstantColumn.DEFAULT_VALUE.sampleData.getClass(); } else { return StringResourceTableUtil.ConstantColumn.values()[column].sampleData.getClass(); } }

Target:
public Class getColumnClass(int column) { if (column >= StringResourceTableUtil.ConstantColumn.COUNT) { return StringResourceTableUtil.ConstantColumn.DEFAULT_VALUE.sampleData.getClass(); } else { return StringResourceTableUtil.ConstantColumn.values()[column].sampleData.getClass(); } }
Source:
public <T> void put(EntityId entityId, String family, String qualifier, long timestamp, T value) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot put cell to KijiTableWriter instance %s in state %s.", this, state); final KijiColumnName columnName = new KijiColumnName(family, qualifier); final WriterLayoutCapsule capsule = mWriterLayoutCapsule; final HBaseColumnName hbaseColumnName = capsule.getColumnNameTranslator().toHBaseColumnName(columnName); final KijiCellEncoder cellEncoder = capsule.getCellEncoderProvider().getEncoder(family, qualifier); final byte[] encoded = cellEncoder.encode(value); final PutRequest put = new PutRequest( Bytes.toBytes(mTable.getName()), entityId.getHBaseRowKey(), hbaseColumnName.getFamily(), hbaseColumnName.getQualifier(), encoded, timestamp); try { mHBClient.put(put).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } }

Target:
public <T> void put(EntityId entityId, String family, String qualifier, long timestamp, T value) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot put cell to KijiTableWriter instance %s in state %s.", this, state); final KijiColumnName columnName = new KijiColumnName(family, qualifier); final WriterLayoutCapsule capsule = mWriterLayoutCapsule; final HBaseColumnName hbaseColumnName = capsule.getColumnNameTranslator().toHBaseColumnName(columnName); final KijiCellEncoder cellEncoder = capsule.getCellEncoderProvider().getEncoder(family, qualifier); final byte[] encoded = cellEncoder.encode(value); final PutRequest put = new PutRequest( mTableName, entityId.getHBaseRowKey(), hbaseColumnName.getFamily(), hbaseColumnName.getQualifier(), encoded, timestamp); try { mHBClient.put(put).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } }