auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public PagedList<models.ebean.Expression> createExpressionQuery(final ExpressionQuery query) { ExpressionList<models.ebean.Expression> ebeanExpressionList = Ebean.find(models.ebean.Expression.class).where(); if (query.getCluster().isPresent()) { ebeanExpressionList = ebeanExpressionList.eq("cluster", query.getCluster().get()); } if (query.getService().isPresent()) { ebeanExpressionList = ebeanExpressionList.eq("service", query.getService().get().toString()); } final Query<models.ebean.Expression> ebeanQuery = ebeanExpressionList.query(); int pageOffset = 0; if (query.getOffset().isPresent()) { pageOffset = query.getOffset().get() / query.getLimit(); } <START> return ebeanQuery.findPagedList(pageOffset, query.getLimit()); <END> }</code><technical_language>point contains</technical_language>

Target:
public PagedList<models.ebean.Expression> createExpressionQuery(final ExpressionQuery query) { ExpressionList<models.ebean.Expression> ebeanExpressionList = Ebean.find(models.ebean.Expression.class).where(); if (query.getCluster().isPresent()) { ebeanExpressionList = ebeanExpressionList.eq("cluster", query.getCluster().get()); } if (query.getService().isPresent()) { ebeanExpressionList = ebeanExpressionList.eq("service", query.getService().get()); } if (query.getContains().isPresent()) { final Junction<models.ebean.Expression> junction = ebeanExpressionList.disjunction(); if (!query.getCluster().isPresent()) { ebeanExpressionList = junction.contains("cluster", query.getContains().get()); } if (!query.getService().isPresent()) { ebeanExpressionList = junction.contains("service", query.getContains().get()); } ebeanExpressionList = junction.contains("metric", query.getContains().get()); ebeanExpressionList = junction.contains("script", query.getContains().get()); ebeanExpressionList = ebeanExpressionList.endJunction(); } final Query<models.ebean.Expression> ebeanQuery = ebeanExpressionList.query(); int pageOffset = 0; if (query.getOffset().isPresent()) { pageOffset = query.getOffset().get() / query.getLimit(); } return ebeanQuery.findPagedList(pageOffset, query.getLimit()); }
Source:
<code>public static void closeInputStream(InputStream stream, String tag){ if(stream!=null){ try { stream.close(); } catch (IOException e) { if (Constants.DEBUG_MODE_ENABLED) { <START> Log.e(tag, "Exception occured when closing InputStream."+e); <END> } } } }</code><technical_language>Formatting issues. Please spaces string literals</technical_language>

Target:
public static void closeInputStream(InputStream stream, String tag) { if (stream != null) { try { stream.close(); } catch (IOException e) { Log.e(tag, "Exception occured when closing InputStream." + e); } } }
Source:
<code>public void testUpdateScript () throws Exception { School.SrlBankProblem.Builder bankProblem = School.SrlBankProblem.newBuilder(); bankProblem.setId(FAKE_ID); bankProblem.setScript("Fake Script"); bankProblem.setQuestionText(FAKE_QUESTION_TEXT); Util.SrlPermission.Builder permissionBuilder = Util.SrlPermission.newBuilder(); permissionBuilder.addAdminPermission(ADMIN_USER); permissionBuilder.addUserPermission(USER_USER); bankProblem.setAccessPermission(permissionBuilder); String problemBankId = mongoInsertBankProblem(db, bankProblem.build()); School.SrlBankProblem.Builder updateBankProblem = SrlBankProblem.newBuilder(); updateBankProblem.setId(FAKE_ID); <START> updateBankProblem.setScript("Faker Script"); <END> boolean isUpdated = mongoUpdateBankProblem(fauth, db, problemBankId, ADMIN_USER, updateBankProblem.build()); Assert.assertEquals(true, isUpdated); final SrlBankProblem getProblem = mongoGetBankProblem(fauth, db, problemBankId, ADMIN_USER); String testString = getProblem.getScript().toString(); Assert.assertEquals("Faker Script", testString); }</code><technical_language>this a variable</technical_language>

Target:
public void testUpdateScript () throws Exception { School.SrlBankProblem.Builder bankProblem = School.SrlBankProblem.newBuilder(); bankProblem.setId(FAKE_ID); bankProblem.setScript(FAKE_SCRIPT); bankProblem.setQuestionText(FAKE_QUESTION_TEXT); Util.SrlPermission.Builder permissionBuilder = Util.SrlPermission.newBuilder(); permissionBuilder.addAdminPermission(ADMIN_USER); permissionBuilder.addUserPermission(USER_USER); bankProblem.setAccessPermission(permissionBuilder); String problemBankId = mongoInsertBankProblem(db, bankProblem.build()); String newFakeScript = "Faker Script"; School.SrlBankProblem.Builder updateBankProblem = SrlBankProblem.newBuilder(); updateBankProblem.setId(FAKE_ID); updateBankProblem.setScript(newFakeScript); boolean isUpdated = mongoUpdateBankProblem(fauth, db, problemBankId, ADMIN_USER, updateBankProblem.build()); Assert.assertEquals(true, isUpdated); final SrlBankProblem getProblem = mongoGetBankProblem(fauth, db, problemBankId, ADMIN_USER); String testString = getProblem.getScript().toString(); Assert.assertEquals(newFakeScript, testString); }
Source:
<code>private void showDeleteDialog(final int position) { new MaterialDialog.Builder(context) .title(R.string.confirm_deletion_title) .content(R.string.confirm_deletion_message) .positiveText(android.R.string.yes) .negativeText(android.R.string.cancel) .onPositive(new MaterialDialog.SingleButtonCallback() { @Override public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { dataSource.deleteList(getItem(position)); preferencesManager.removeNameList(getItem(position)); content.remove(position); setNoContent(); notifyItemRemoved(position); <START> notifyItemRangeChanged(position, content.size()); <END> } }) .show(); }</code><technical_language>I need notifyItemRangeChanged. removing 1 item right? updating several</technical_language>

Target:
private void showDeleteDialog(final int position) { new MaterialDialog.Builder(context) .title(R.string.confirm_deletion_title) .content(R.string.confirm_deletion_message) .positiveText(android.R.string.yes) .negativeText(android.R.string.cancel) .onPositive(new MaterialDialog.SingleButtonCallback() { @Override public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { dataSource.deleteList(getItem(position)); preferencesManager.removeNameList(getItem(position)); content.remove(position); setNoContent(); notifyItemRemoved(position); notifyItemRangeChanged(position, 1); } }) .show(); }
Source:
<code><START> static String toHexString(byte[] bytes) { <END> try(Formatter formatter = new Formatter()){ for (byte b : bytes) { formatter.format("%02x", b); } return formatter.toString(); } }</code><technical_language>a commons convert string Hexadecimal? like: org.apache.commons.codec.binary.Hex.encode(byte[])</technical_language>

Target:
static String toHexString(byte[] bytes) { return Hex.encodeHexString(bytes); }
Source:
<code>public InfinispanRemoteQueryDescriptor parseNativeQuery(String nativeQuery) { <START> throw new UnsupportedOperationException( "Native Query not supported by Infinispan Remote Dialect" ); <END> }</code><technical_language>need do now, basiccaly a native query in case of Infinispan is a HQL query, it? hard implement</technical_language>

Target:
public InfinispanRemoteQueryDescriptor parseNativeQuery(String nativeQuery) { return new InfinispanRemoteNativeQueryParser( nativeQuery ).parse(); }
Source:
<code>void testCommandsAreRoutedToCorrectEntity() throws Exception { AggregateModel<Book> bookAggregateModel = AnnotatedAggregateMetaModelFactory.inspectAggregate(Book.class); EventBus mockEventBus = SimpleEventBus.builder().build(); mockEventBus.subscribe(m -> m.forEach(i -> System.out.println(i.getPayloadType().getName()))); <START> AnnotatedAggregate<Book> bookAggregate = AnnotatedAggregate.initialize(new Book(), <END> bookAggregateModel, mockEventBus); bookAggregate.handle(command(new CreateBookCommand("book1"))); bookAggregate.handle(command(new CreatePageCommand("book1"))); bookAggregate.handle(command(new CreateParagraphCommand("book1", 0))); bookAggregate.handle(command(new CreateParagraphCommand("book1", 0))); bookAggregate.handle(command(new UpdateParagraphCommand("book1", 0, 0, "Hello world"))); bookAggregate.handle(command(new UpdateParagraphCommand("book1", 0, 1, "Hello world2"))); assertEquals("Hello world", bookAggregate.getAggregateRoot().getPages().get(0).getParagraphs().get(0).getText()); assertEquals("Hello world2", bookAggregate.getAggregateRoot().getPages().get(0).getParagraphs().get(1).getText()); }</code><technical_language>this is required. test want create a new book instance, means Aggregate (wrapper class) initialized instance first</technical_language>

Target:
void testCommandsAreRoutedToCorrectEntity() throws Exception { AggregateModel<Book> bookAggregateModel = AnnotatedAggregateMetaModelFactory.inspectAggregate(Book.class); EventBus mockEventBus = SimpleEventBus.builder().build(); mockEventBus.subscribe(m -> m.forEach(i -> System.out.println(i.getPayloadType().getName()))); AnnotatedAggregate<Book> bookAggregate = AnnotatedAggregate.initialize((Callable<Book>) () -> new Book(new CreateBookCommand("book1")), bookAggregateModel, mockEventBus); bookAggregate.handle(command(new CreateBookCommand("book1"))); bookAggregate.handle(command(new CreatePageCommand("book1"))); bookAggregate.handle(command(new CreateParagraphCommand("book1", 0))); bookAggregate.handle(command(new CreateParagraphCommand("book1", 0))); bookAggregate.handle(command(new UpdateParagraphCommand("book1", 0, 0, "Hello world"))); bookAggregate.handle(command(new UpdateParagraphCommand("book1", 0, 1, "Hello world2"))); assertEquals("Hello world", bookAggregate.getAggregateRoot().getPages().get(0).getParagraphs().get(0).getText()); assertEquals("Hello world2", bookAggregate.getAggregateRoot().getPages().get(0).getParagraphs().get(1).getText()); }
Source:
<code>public void testKeeperOrderDependence() { final Log log = Log.getInstance(OpticalDuplicateFinderTest.class); final OpticalDuplicateFinder finder = new OpticalDuplicateFinder(OpticalDuplicateFinder.DEFAULT_READ_NAME_REGEX, 100, log); List<PhysicalLocation> locs = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), <START> loc(1, 100, 370), <END> loc(1, 100, 460) ); List<PhysicalLocation> locsReordered = Arrays.asList( loc(1, 100, 190), loc(1, 100, 460), loc(1, 100, 370), loc(1, 100, 280) ); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locs, locs.get(0))),3); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locsReordered, locsReordered.get(0))), 3); }</code><technical_language>odd spacing suggestion loc(1, 100, 370),</technical_language>

Target:
public void testKeeperOrderDependence() { final Log log = Log.getInstance(OpticalDuplicateFinderTest.class); final OpticalDuplicateFinder finder = new OpticalDuplicateFinder(OpticalDuplicateFinder.DEFAULT_READ_NAME_REGEX, 100, log); final List<PhysicalLocation> locs = Arrays.asList( loc(1, 100, 190), loc(1, 100, 280), loc(1, 100, 370), loc(1, 100, 460) ); final List<PhysicalLocation> locsReordered = Arrays.asList( loc(1, 100, 190), loc(1, 100, 460), loc(1, 100, 370), loc(1, 100, 280) ); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locs, locs.get(0))), 3); Assert.assertEquals(countTrue(finder.findOpticalDuplicates(locsReordered, locsReordered.get(0))), 3); }
Source:
<code>public void testUriGeneration() { <START> Action action = new TasksInformation.Builder("node_id:task_id").build(); <END> assertEquals("_tasks/node_id:task_id", action.getURI()); }</code><technical_language>expose internal ES queries lang Java users. I suggest if want allow query NodeID withNodeID builder. In example, test end is Builder(5) for taskId=5</technical_language>

Target:
public void testUriGeneration() { Action action = new TasksInformation.Builder().build(); assertEquals("_tasks", action.getURI()); }
Source:
<code>public FilterView() { setCollapsed(); dateHolderPanel.setLayout(new MigLayout("", "[grow]", "[][]")); dateHolderPanel.add(startDateFilterLabel, "flowx, cell 0 0"); dateHolderPanel.add(endDateFilterLabel, "flowx, cell 0 1"); dateHolderPanel.add(filterEndDatePicker, "cell 0 1"); dateHolderPanel.add(filterStartDatePicker, "cell 0 0"); titleHolderPanel.setLayout(new MigLayout("fill")); titleHolderPanel.setBorder(new <START> LineBorder(new Color(0,0,0))); <END> filterColorComboBox.setRenderer(new ColorRenderer()); filterColorComboBox.setSelectedIndex(0); filterColorComboBox.setSize(new Dimension(20, 5)); registerCallbacks(); }</code><technical_language>Color.black</technical_language>

Target:
public FilterView() { setCollapsed(); dateHolderPanel.setLayout(new MigLayout("", "[grow]", "[][]")); dateHolderPanel.add(startDateFilterLabel, "flowx, cell 0 0"); dateHolderPanel.add(endDateFilterLabel, "flowx, cell 0 1"); dateHolderPanel.add(filterEndDatePicker, "cell 0 1"); dateHolderPanel.add(filterStartDatePicker, "cell 0 0"); titleHolderPanel.setLayout(new MigLayout("fill")); titleHolderPanel.setBorder(new LineBorder(Color.BLACK)); filterColorComboBox.setRenderer(new ColorRenderer()); filterColorComboBox.setSelectedIndex(0); filterColorComboBox.setSize(new Dimension(20, 5)); registerCallbacks(); }
Source:
<code>public AllCodeSystemSearchRequestBuilder filterByToolingIds(final Iterable<String> toolingIds) { <START> this.toolingIds = ImmutableSet.copyOf(toolingIds); <END> return this; }</code><technical_language>This fail if toolingIds is null. is necessary wrap argument ImmutableSet here, feel free remove, apply this setFields, filterByIds methods</technical_language>

Target:
public AllCodeSystemSearchRequestBuilder filterByToolingIds(final Iterable<String> toolingIds) { this.toolingIds = toolingIds; return this; }
Source:
<code>protected void createStatesGroup(Composite composite) { String stateTypeName = fProvider.getStateTypeName(); StringBuilder buffer = new StringBuilder(); if (!stateTypeName.isEmpty()) { buffer.append(stateTypeName); buffer.append(" "); } buffer.append(Messages.TmfTimeLegend_StateTypeName); StateItem[] stateTable = fProvider.getStateTable(); List<StateItem> stateItems = stateTable != null ? Arrays.asList(stateTable) : Collections.emptyList(); Multimap<String, StateItem> groupedStateItems = ArrayListMultimap.create(); for (StateItem stateItem : stateItems) { if (!isLinkState(stateItem)) { <START> if (stateItem instanceof GroupedStateItem) { <END> groupedStateItems.put(((GroupedStateItem) stateItem).getGroupLabel(), stateItem); } else { groupedStateItems.put(buffer.toString(), stateItem); } } } for (String groupedStateLabel : groupedStateItems.keySet()) { Group gs = new Group(composite, SWT.NONE); gs.setText(groupedStateLabel); GridLayout layout = new GridLayout(); layout.marginWidth = 20; layout.marginBottom = 10; gs.setLayout(layout); GridData gridData = new GridData(); gridData.verticalAlignment = SWT.TOP; gs.setLayoutData(gridData); for (StateItem stateItem : groupedStateItems.get(groupedStateLabel)) { new LegendEntry(gs, stateItem); } } }</code><technical_language>ITimeEventStyleStrings.group() instead</technical_language>

Target:
protected void createStatesGroup(Composite composite) { String stateTypeName = fProvider.getStateTypeName(); StringBuilder buffer = new StringBuilder(); if (!stateTypeName.isEmpty()) { buffer.append(stateTypeName); buffer.append(" "); } buffer.append(Messages.TmfTimeLegend_StateTypeName); StateItem[] stateTable = fProvider.getStateTable(); List<StateItem> stateItems = stateTable != null ? Arrays.asList(stateTable) : Collections.emptyList(); Multimap<String, StateItem> groupedStateItems = ArrayListMultimap.create(); for (StateItem stateItem : stateItems) { if (!isLinkState(stateItem)) { Object group = stateItem.getStyleMap().get(ITimeEventStyleStrings.group()); if (group instanceof String) { groupedStateItems.put((String) group, stateItem); } else { groupedStateItems.put(buffer.toString(), stateItem); } } } for (String groupedStateLabel : groupedStateItems.keySet()) { Group gs = new Group(composite, SWT.NONE); gs.setText(groupedStateLabel); GridLayout layout = new GridLayout(); layout.marginWidth = 20; layout.marginBottom = 10; gs.setLayout(layout); GridData gridData = new GridData(); gridData.verticalAlignment = SWT.TOP; gs.setLayoutData(gridData); for (StateItem stateItem : groupedStateItems.get(groupedStateLabel)) { new LegendEntry(gs, stateItem); } } }
Source:
<code>public void setUp() throws Exception { createProjectAndGetStartScriptWithImages("BroadcastBrickTest"); baseActivityTestRule.launchActivity(null); <START> onView(withId(R.id.brick_when_condition_edit_text)).perform(click()); <END> onView(withId(R.id.formula_editor_keyboard_sensors)).perform(click()); onView(withText(getResourcesString(R.string.formula_editor_function_touched))).perform(click()); onView(withId(R.id.formula_editor_keyboard_ok)).perform(click()); }</code><technical_language>is this necessary? onTouch? please do espresso onView onData operations in setUp</technical_language>

Target:
public void setUp() throws Exception { createProjectAndGetStartScriptWithImages("BroadcastBrickTest"); baseActivityTestRule.launchActivity(null); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_annotation_animated_marker); mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { final Marker marker = mapboxMap.addMarker(new MarkerOptions() .position(new LatLng(64.900932, -18.167040))); Toast.makeText( AnimatedMarkerActivity.this, getString(R.string.tap_on_map_instruction), Toast.LENGTH_LONG ).show(); <START> mapboxMap.addOnMapClickListener(new MapboxMap.OnMapClickListener() { <END> @Override public void onMapClick(@NonNull LatLng point) { ValueAnimator markerAnimator = ObjectAnimator.ofObject(marker, "position", new LatLngEvaluator(), marker.getPosition(), point); markerAnimator.setDuration(2000); markerAnimator.start(); } }); } }); }</code><technical_language>if add a listener cleaner remove part of tearing map object MapboxMap#removeOnMapClickListener avoid leaking objects</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_annotation_animated_marker); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); mapView.getMapAsync(this); }
Source:
<code>public void send(byte[] buf) { DatagramPacket packet; <START> packet = new DatagramPacket(buf, buf.length, ina, 15001); END> try { _socket.send(packet); } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>pls this line</technical_language>

Target:
public void send(byte[] buf) { DatagramPacket packet = new DatagramPacket(buf, buf.length, ina, 15001); try { _socket.send(packet); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>private void askQuestion() { ArrayList<Object> params = new ArrayList<>(); params.add(this); <START> if (StageActivity.messageHandler == null) { <END> return; } Message message = StageActivity.messageHandler.obtainMessage(StageActivity.REGISTER_INTENT, params); message.sendToTarget(); questionAsked = true; }</code><technical_language>This done creating ArrayList (also in AskAction)</technical_language>

Target:
private void askQuestion() { if (StageActivity.messageHandler == null) { return; } ArrayList<Object> params = new ArrayList<>(); params.add(this); Message message = StageActivity.messageHandler.obtainMessage(StageActivity.REGISTER_INTENT, params); message.sendToTarget(); questionAsked = true; }
Source:
<code>public void handleRequest(HttpServerExchange exchange) throws Exception { if (mode != null) { exchange.addResponseCommitListener(new ResponseCommitListener() { @Override public void beforeCommit(HttpServerExchange exchange) { <START> if (mode.equalsIgnoreCase(Cookie.SameSiteMode.None.toString())) { <END> String ua = exchange.getRequestHeaders().getFirst(Headers.USER_AGENT); if (!disableClientChecker && !SameSiteNoneIncompatibleClientChecker.shouldSendSameSiteNone(ua)) { return; } } for (Map.Entry<String, Cookie> cookie : exchange.getResponseCookies().entrySet()) { if (cookiePattern == null || cookiePattern.matcher(cookie.getValue().getName()).matches()) { cookie.getValue().setSameSiteMode(mode); } } } }); } next.handleRequest(exchange); }</code><technical_language>For performance reasons, need change mode enum, verify if disableClientChecker is true, right here, short-circuiting check for mode if needed</technical_language>

Target:
public void handleRequest(HttpServerExchange exchange) throws Exception { if (mode != null) { exchange.addResponseCommitListener(new ResponseCommitListener() { @Override public void beforeCommit(HttpServerExchange exchange) { if (enableClientChecker && !SameSiteNoneIncompatibleClientChecker.shouldSendSameSiteNone(exchange.getRequestHeaders().getFirst(Headers.USER_AGENT))) { return; } for (Map.Entry<String, Cookie> cookie : exchange.getResponseCookies().entrySet()) { if (cookiePattern == null || cookiePattern.matcher(cookie.getValue().getName()).matches()) { cookie.getValue().setSameSiteMode(mode); if (addSecureForNone) { cookie.getValue().setSecure(true); } } } } }); } next.handleRequest(exchange); }
Source:
<code>public boolean validate() { log.debug("Validating {}", request); Set<ConstraintViolation<TaskInsertRequest>> constraintViolations = validator.validate(request); if (constraintViolations.isEmpty()) { log.debug("Request is valid", request); return true; } log.debug("Request is invalid, violation(s) found: {}", constraintViolations.size(), constraintViolations); <START> errorMessage = constraintViolations.iterator().next().getMessage(); <END> return false; }</code><technical_language>this considering violation error message</technical_language>

Target:
public boolean validate() { log.debug("Validating {}", request); Set<ConstraintViolation<TaskInsertRequest>> constraintViolations = validator.validate(request); if (constraintViolations.isEmpty()) { log.debug("Request is valid", request); return true; } log.debug("Request is invalid, violation(s) found: {}", constraintViolations.size(), constraintViolations); StringBuilder b = new StringBuilder(); Iterator<ConstraintViolation<TaskInsertRequest>> itr = constraintViolations.iterator(); while (itr.hasNext()) { ConstraintViolation<TaskInsertRequest> constraint = itr.next(); b.append(constraint.getMessage()); if (itr.hasNext()) { b.append(", "); } } errorMessage = b.toString(); return false; }
Source:
<code>public boolean downgrade() { if (!mRwLock.isWriteLocked()) { return false; } <START> Preconditions.checkState(mRwLock.isWriteLockedByCurrentThread(), <END> "Lock downgrades may only be initiated by the holding thread."); mRwLock.readLock().lock(); mLock.unlock(); mLock = mRwLock.readLock(); return true; }</code><technical_language>a precondition mLock is writeLock() of mRwLock? But, basically, invariant for RWLockResource is mLock == mRwLock.readLock() mLock == mRwLock.writeLock() times</technical_language>

Target:
public boolean downgrade() { if (!mRwLock.isWriteLocked()) { return false; } Preconditions.checkState(mRwLock.isWriteLockedByCurrentThread(), "Lock downgrades may only be initiated by the holding thread."); Preconditions.checkState(mLock == mRwLock.writeLock(), "mLock must be the same as mRwLock"); mRwLock.readLock().lock(); mLock.unlock(); mLock = mRwLock.readLock(); return true; }
Source:
<code>public void updateBeaconLayout(SortedMap<String, String> attributes) { getApiService() .updateBeaconLayout(attributes) .enqueue(new Callback<ResolveResponse>() { @Override public void onResponse(Call<ResolveResponse> call, Response<ResolveResponse> response) { if (response.isSuccessful() && response.body() != null) { save(response.body()); onSuccess(response.body()); } else { onFail(); } } @Override public void onFailure(Call<ResolveResponse> call, Throwable t) { onFail(); } void onSuccess(ResolveResponse resolveResponse) { mProximityUUIDUpdateHandler.proximityUUIDListUpdated(resolveResponse.getAccountProximityUUIDs()); } void onFail() { if (lastSuccess == null) { mProximityUUIDUpdateHandler.proximityUUIDListUpdated(Collections.EMPTY_LIST); } else { <START> onSuccess(lastSuccess); <END> } } }); }</code><technical_language>Applies I guess. not, based decision</technical_language>

Target:
public void updateBeaconLayout(SortedMap<String, String> attributes) { getApiService() .updateBeaconLayout(attributes) .enqueue(new Callback<ResolveResponse>() { @Override public void onResponse(Call<ResolveResponse> call, Response<ResolveResponse> response) { if (response.isSuccessful() && response.body() != null) { save(response.body()); onSuccess(response.body()); } else { onFail(new Exception("Failed to updateBeaconLayout. Response body is empty")); } } @Override public void onFailure(Call<ResolveResponse> call, Throwable t) { onFail(t); } void onSuccess(ResolveResponse resolveResponse) { mProximityUUIDUpdateHandler.proximityUUIDListUpdated(resolveResponse.getAccountProximityUUIDs()); } void onFail(Throwable t) { if (lastSuccess == null) { Logger.log.logError("UpdateBeaconLayout failed", t); mProximityUUIDUpdateHandler.proximityUUIDListUpdated(Collections.EMPTY_LIST); } else { Logger.log.logError("UpdateBeaconLayout failed, but we have a backup", t); onSuccess(lastSuccess); } } }); }
Source:
<code><START> protected Collection<String> getTableDefinitions() { <END> return Lists.newArrayList( "CREATE TYPE IF NOT EXISTS \"udt2\" (f2 text)", "CREATE TYPE IF NOT EXISTS \"udt1\" (f1 frozen<udt2>)", "CREATE TABLE IF NOT EXISTS \"t1\" (pk int PRIMARY KEY, c1 frozen<udt1>, c2 frozen<tuple<tuple<text>>>)", "INSERT INTO t1 (pk, c1) VALUES (1, {f1:{f2:'foo'}})", "INSERT INTO t1 (pk, c2) VALUES (2, (('foo')))" ); }</code><technical_language>good a test for a tuple a UDT a UDT a tuple, 3 layers deep of something</technical_language>

Target:
protected Collection<String> getTableDefinitions() { return Lists.newArrayList( "CREATE TYPE IF NOT EXISTS \"udt3\" (f3 text)", "CREATE TYPE IF NOT EXISTS \"udt2\" (f2 frozen<udt3>)", "CREATE TYPE IF NOT EXISTS \"udt1\" (f1 frozen<udt2>)", "CREATE TABLE IF NOT EXISTS \"t1\" (pk int PRIMARY KEY, " + "c1 frozen<udt1>, " + "c2 frozen<tuple<tuple<tuple<text>>>>, " + "c3 frozen<tuple<tuple<tuple<udt1>>>>" + ")", "INSERT INTO t1 (pk, c1) VALUES (1, {f1:{f2:{f3:'foo'}}})", "INSERT INTO t1 (pk, c2) VALUES (2, ((('foo'))))", "INSERT INTO t1 (pk, c3) VALUES (3, ((({f1:{f2:{f3:'foo'}}}))))" ); }
Source:
<code>public Metadata build() { <START> if (hasLifespan() && hasMaxIdle()) <END> return new EmbeddedExpirableMetadata( lifespan, lifespanUnit, maxIdle, maxIdleUnit, version); else if (hasLifespan()) return new EmbeddedLifespanExpirableMetadata(lifespan, lifespanUnit, version); else if (hasMaxIdle()) return new EmbeddedMaxIdleExpirableMetadata(maxIdle, maxIdleUnit, version); else return new EmbeddedMetadata(version); }</code><technical_language>if want call hasLifespan hasMaxIdle store in local variables evaluated 2x if is lifespan idle? This is pretty minor lack of complexity for methods</technical_language>

Target:
public Metadata build() { boolean hasLifespan = hasLifespan(); boolean hasMaxIdle = hasMaxIdle(); if (hasLifespan && hasMaxIdle) return new EmbeddedExpirableMetadata( lifespan, lifespanUnit, maxIdle, maxIdleUnit, version); else if (hasLifespan) return new EmbeddedLifespanExpirableMetadata(lifespan, lifespanUnit, version); else if (hasMaxIdle) return new EmbeddedMaxIdleExpirableMetadata(maxIdle, maxIdleUnit, version); else return new EmbeddedMetadata(version); }
Source:
<code>public FileWordList(final RandomAccessFile raf, final boolean caseSensitive, final int cachePercent) throws IOException { super(raf, caseSensitive, cachePercent); long pos = 0; file.seek(pos); final long fileBytes = file.length(); final long cacheSize = (fileBytes / HUNDRED_PERCENT) * cachePercent; <START> final long cacheOffset = cacheSize == 0 ? fileBytes : cacheSize > fileBytes ? 1 : fileBytes / cacheSize; <END> String a; String b = null; while ((a = file.readLine()) != null) { if (b != null && comparator.compare(a, b) < 0) { throw new IllegalArgumentException("File is not sorted correctly for this comparator"); } b = a; if (cacheSize > 0 && size % cacheOffset == 0) { cache.put(size, pos); } pos = file.getFilePointer(); size++; } }</code><technical_language>a fair bit of study understand purpose of this variable, I name added difficulty. Consider renaming cacheModulus cacheFrequency</technical_language>

Target:
public FileWordList(final RandomAccessFile raf, final boolean caseSensitive, final int cachePercent) throws IOException { super(raf, caseSensitive, cachePercent); initialize(cachePercent); }
Source:
<code>public AvailabilitySet apply(final Template input) { checkArgument(input.getOptions() instanceof AzureTemplateOptions, "An AzureTemplateOptions object is required"); AzureTemplateOptions options = input.getOptions().as(AzureTemplateOptions.class); <START> AvailabilitySet as = null; <END> String location = input.getLocation().getId(); String resourceGroup = resourceGroupMap.getUnchecked(location).name(); if (options.getAvailabilitySetName() != null) { as = api.getAvailabilitySetApi(resourceGroup).get(options.getAvailabilitySetName()); checkArgument(as != null, "No availability set with name '%s' was found", options.getAvailabilitySetName()); checkArgument(location.equals(as.location()), "The availability set %s does not belong to location %s", options.getAvailabilitySetName(), location); } else if (options.getAvailabilitySet() != null) { as = api.getAvailabilitySetApi(resourceGroup).get(options.getAvailabilitySet().name()); if (as != null) { checkArgument(location.equals(as.location()), "The availability set %s does not belong to location %s", options.getAvailabilitySetName(), location); } else { as = api.getAvailabilitySetApi(resourceGroup).createOrUpdate(options.getAvailabilitySet().name(), location, options.getAvailabilitySet().tags(), options.getAvailabilitySet().properties()); logger.debug(">> creating availability set [%s]", as.name()); } } return as; }</code><technical_language>[minor] yo rename availabilitySet</technical_language>

Target:
public AvailabilitySet apply(final Template input) { checkArgument(input.getOptions() instanceof AzureTemplateOptions, "An AzureTemplateOptions object is required"); AzureTemplateOptions options = input.getOptions().as(AzureTemplateOptions.class); AvailabilitySet availabilitySet = null; String location = input.getLocation().getId(); String resourceGroup = resourceGroupMap.getUnchecked(location).name(); if (options.getAvailabilitySetName() != null) { availabilitySet = api.getAvailabilitySetApi(resourceGroup).get(options.getAvailabilitySetName()); checkArgument(availabilitySet != null, "No availability set with name '%s' was found", options.getAvailabilitySetName()); checkArgument(location.equals(availabilitySet.location()), "The availability set %s does not belong to location %s", options.getAvailabilitySetName(), location); } else if (options.getAvailabilitySet() != null) { availabilitySet = api.getAvailabilitySetApi(resourceGroup).get(options.getAvailabilitySet().name()); if (availabilitySet != null) { checkArgument(location.equals(availabilitySet.location()), "The availability set %s does not belong to location %s", options.getAvailabilitySetName(), location); } else { availabilitySet = api.getAvailabilitySetApi(resourceGroup).createOrUpdate(options.getAvailabilitySet().name(), location, options.getAvailabilitySet().tags(), options.getAvailabilitySet().properties()); logger.debug(">> creating availability set [%s]", availabilitySet.name()); } } return availabilitySet; }
Source:
<code>public void init(IWorkbench workbench) { final IPreferenceStore store = Activator.getDefault() .getPreferenceStore(); store.addPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { <START> if (event.getProperty() == PROVIDER) { <END> } } }); setPreferenceStore(store); setDescription(Messages.SnapshotPreferencesPage_0); }</code><technical_language>point in this property change listener do anything</technical_language>

Target:
public void init(IWorkbench workbench) { final IPreferenceStore store = new ScopedPreferenceStore( configScopeInstance, QUALIFIER); setPreferenceStore(store); setDescription(Messages.SnapshotPreferencesPage_0); }
Source:
<code><START> public boolean accept(CommandEnvelope envelope, StreamObserver<Response> responseObserver) { <END> final TenantId tenantId = envelope.getCommandContext() .getTenantId(); final boolean tenantSpecified = !isDefault(tenantId); final Command command = envelope.getCommand(); if (commandBus.isMultitenant()) { if (!tenantSpecified) { reportMissingTenantId(command, responseObserver); return false; } } else { if (tenantSpecified) { reportTenantIdInapplicable(command, responseObserver); return false; } } final List<ConstraintViolation> violations = CommandValidator.getInstance() .validate(command); if (!violations.isEmpty()) { final CommandException invalidCommand = InvalidCommandException.onConstraintViolations(command, violations); commandBus.commandStore() .storeWithError(command, invalidCommand); responseObserver.onError(Statuses.invalidArgumentWithCause(invalidCommand)); return false; } return true; }</code><technical_language>try simplify this method extracting some bits methods. moment return conditions a lot of if statements</technical_language>

Target:
public boolean accept(CommandEnvelope envelope, StreamObserver<Response> responseObserver) { if (!isTenantIdValid(envelope, responseObserver)) { return false; } final boolean commandValid = isCommandValid(envelope, responseObserver); return commandValid; }
Source:
<code>protected String getDurationFieldName() { return <START> "duration"; <END> }</code><technical_language>time_spent</technical_language>

Target:
protected String getDurationFieldName() { return "time_spent"; }
Source:
<code>private void verifyLoadedSinksForConfig( final String expectationString, final String configName, final List<List<String>> expectedSinks ) { final InputStream configStream = stream(configName).get(); final FastForwardAgent agent = FastForwardAgent.setup(Optional.empty(), Optional.of(configStream)); final Injector primaryInjector = agent.getCore().getPrimaryInjector(); final CoreOutputManager outputManager = (CoreOutputManager) primaryInjector.getInstance(OutputManager.class); final List<PluginSink> sinks = outputManager.getSinks(); final List<List<String>> sinkChains = new ArrayList<>(); for (final PluginSink sink : sinks) { final List<String> sinkChain = new ArrayList<>(); sinkChains.add(sinkChain); PluginSink sinkToInspect = sink; <START> while (true) { <END> sinkChain.add(sinkToInspect.getClass().getCanonicalName()); if (sinkToInspect instanceof BatchingPluginSink) { final BatchingPluginSink batching = (BatchingPluginSink) sinkToInspect; sinkToInspect = batching.getSink(); continue; } if (sinkToInspect instanceof FilteringPluginSink) { final FilteringPluginSink filtering = (FilteringPluginSink) sinkToInspect; sinkToInspect = filtering.getSink(); continue; } break; } } assertEquals(expectationString, expectedSinks, sinkChains); }</code><technical_language>Move a helper function</technical_language>

Target:
private void verifyLoadedSinksForConfig( final String expectationString, final String configName, final List<List<String>> expectedSinks ) { final InputStream configStream = stream(configName).get(); final FastForwardAgent agent = FastForwardAgent.setup(Optional.empty(), Optional.of(configStream)); final Injector primaryInjector = agent.getCore().getPrimaryInjector(); final CoreOutputManager outputManager = (CoreOutputManager) primaryInjector.getInstance(OutputManager.class); final List<PluginSink> sinks = outputManager.getSinks(); final List<List<String>> sinkChains = new ArrayList<>(); for (final PluginSink sink : sinks) { sinkChains.add(extractSinkChain(sink)); } assertEquals(expectationString, expectedSinks, sinkChains); }
Source:
<code>public FormValidation doCheckTagsDir(StaplerRequest req, @AncestorInPath Item context, @QueryParameter String value) { Jenkins instance = Jenkins.getInstance(); if (instance != null) { SubversionSCM.ModuleLocation.DescriptorImpl desc = instance.getDescriptorByType(SubversionSCM.ModuleLocation.DescriptorImpl.class); if (desc != null) { return desc.doCheckRemote(req, context, value); } } <START> return null; <END> }</code><technical_language>return a warning IMO</technical_language>

Target:
public FormValidation doCheckTagsDir(StaplerRequest req, @AncestorInPath Item context, @QueryParameter String value) { Jenkins instance = Jenkins.getInstance(); if (instance != null) { SubversionSCM.ModuleLocation.DescriptorImpl desc = instance.getDescriptorByType(SubversionSCM.ModuleLocation.DescriptorImpl.class); if (desc != null) { return desc.doCheckRemote(req, context, value); } } return FormValidation.warning("Unable to check tags directory."); }
Source:
<code>public Map<Integer, Long> pause(final String id, final long timeout) { log.debug("Pause task[%s] timeout[%d]", id, timeout); try { final FullResponseHolder response = submitRequest( id, HttpMethod.POST, "pause", timeout > 0 ? String.format("timeout=%d", timeout) : null, true ); if (response.getStatus().equals(HttpResponseStatus.OK)) { return jsonMapper.readValue(response.getContent(), new TypeReference<Map<Integer, Long>>() {}); } final RetryPolicy retryPolicy = retryPolicyFactory.makeRetryPolicy(); while (true) { if (getStatus(id) == KafkaIndexTask.Status.PAUSED) { return getCurrentOffsets(id, true); } final Duration delay = retryPolicy.getAndIncrementRetryDelay(); if (delay == null) { throw new ISE("Task [%s] failed to pause, aborting", id); } else { final long sleepTime = delay.getMillis(); log.info( "Still waiting for task [%s] to pause; will try again in [%s]", id, new Duration(sleepTime).toString() ); Thread.sleep(sleepTime); } } } catch (NoTaskLocationException e) { <START> return null; <END> } catch (IOException | InterruptedException e) { throw Throwables.propagate(e); } }</code><technical_language>minor nit: getCurrentOffsets return empty map task location is unknown instead of null, nice a consistent behavior in case same</technical_language>

Target:
public Map<Integer, Long> pause(final String id, final long timeout) { log.debug("Pause task[%s] timeout[%d]", id, timeout); try { final FullResponseHolder response = submitRequest( id, HttpMethod.POST, "pause", timeout > 0 ? String.format("timeout=%d", timeout) : null, true ); if (response.getStatus().equals(HttpResponseStatus.OK)) { return jsonMapper.readValue(response.getContent(), new TypeReference<Map<Integer, Long>>() {}); } final RetryPolicy retryPolicy = retryPolicyFactory.makeRetryPolicy(); while (true) { if (getStatus(id) == KafkaIndexTask.Status.PAUSED) { return getCurrentOffsets(id, true); } final Duration delay = retryPolicy.getAndIncrementRetryDelay(); if (delay == null) { throw new ISE("Task [%s] failed to pause, aborting", id); } else { final long sleepTime = delay.getMillis(); log.info( "Still waiting for task [%s] to pause; will try again in [%s]", id, new Duration(sleepTime).toString() ); Thread.sleep(sleepTime); } } } catch (NoTaskLocationException e) { return ImmutableMap.of(); } catch (IOException | InterruptedException e) { throw Throwables.propagate(e); } }
Source:
<code>public RestoreRedundancyRequest( RestoreRedundancyRequest other) { <START> this.setExcludeRegions(other.getExcludeRegions()); <END> this.setIncludeRegions(other.getIncludeRegions()); this.setReassignPrimaries(other.getReassignPrimaries()); this.operator = other.getOperator(); }</code><technical_language>Lots of unnecessary this. qualifiers</technical_language>

Target:
public RestoreRedundancyRequest( RestoreRedundancyRequest other) { setExcludeRegions(other.getExcludeRegions()); setIncludeRegions(other.getIncludeRegions()); setReassignPrimaries(other.getReassignPrimaries()); operator = other.getOperator(); }
Source:
<code>public void test() throws Exception { <START> assertLine("baseclinit", ICounter.FULLY_COVERED); <END> if (System.getProperty("java.version").startsWith("9-ea")) { assertLine("childclinit", ICounter.NOT_COVERED); } else { assertLine("childclinit", ICounter.FULLY_COVERED); } assertLine("childdefault", ICounter.FULLY_COVERED); assertLine("childstatic", ICounter.FULLY_COVERED); }</code><technical_language>@marchof more specifically - this assertion conditional</technical_language>

Target:
public void test() throws Exception { if (System.getProperty("java.version").startsWith("9-ea")) { assertLine("baseclinit", ICounter.EMPTY); assertLine("childdefault", ICounter.NOT_COVERED); } else { assertLine("baseclinit", ICounter.FULLY_COVERED); assertLine("childdefault", ICounter.FULLY_COVERED); } assertLine("childclinit", ICounter.FULLY_COVERED); assertLine("childstatic", ICounter.FULLY_COVERED); }
Source:
<code>private static void checkMapMaxSizePolicyConfig(MaxSizePolicy maxSizePolicy) { if (!MAP_SUPPORTED_ON_HEAP_MAX_SIZE_POLICIES.contains(maxSizePolicy) && !MAP_SUPPORTED_NATIVE_MAX_SIZE_POLICIES.contains(maxSizePolicy)) { String msg = format("IMap eviction config doesn't support max size policy `%s`. " <START> + "Please select a valid one: %s.", maxSizePolicy, MAP_SUPPORTED_ON_HEAP_MAX_SIZE_POLICIES); <END> throw new InvalidConfigurationException(msg); } }</code><technical_language>print out of policies here, check allows for MAP_SUPPORTED_NATIVE_MAX_SIZE_POLICIES too</technical_language>

Target:
static void checkMapMaxSizePolicyConfig(MaxSizePolicy maxSizePolicy) { if (!MAP_SUPPORTED_ON_HEAP_MAX_SIZE_POLICIES.contains(maxSizePolicy) && !MAP_SUPPORTED_NATIVE_MAX_SIZE_POLICIES.contains(maxSizePolicy)) { EnumSet<MaxSizePolicy> allMaxSizePolicies = EnumSet.copyOf(MAP_SUPPORTED_ON_HEAP_MAX_SIZE_POLICIES); allMaxSizePolicies.addAll(MAP_SUPPORTED_NATIVE_MAX_SIZE_POLICIES); String msg = format("IMap eviction config doesn't support max size policy `%s`. " + "Please select a valid one: %s.", maxSizePolicy, allMaxSizePolicies); throw new InvalidConfigurationException(msg); } }
Source:
<code>public ServiceName getName() { <START> return ServiceName.JBOSS.append(serviceName, className.replaceAll("\\.", "_")); <END> }</code><technical_language>replacing a single char is public String replace(char oldChar, char newChar)</technical_language>

Target:
public ServiceName getName() { return ServiceName.JBOSS.append(serviceName, className.replace(".", "_")); }
Source:
<code>private void addDomainColumns(List<ColumnMeta<T>> columnMetaList, Set<String> columns) { columns.stream().filter(newColumn -> newColumnIsNotInDataStoreNames(newColumn, columnMetaList)) .forEach(column -> { <START> newColumnMeta(column, <END> false); columnMetaList.add(newColumnMeta(column, false)); }); }</code><technical_language>newColumnMeta called in here</technical_language>

Target:
private void addDomainColumns(List<ColumnMeta<T>> columnMetaList, Set<String> columns) { columns.stream().filter(newColumn -> newColumnIsNotInDataStoreNames(newColumn, columnMetaList)) .forEach(column -> { ColumnMeta<T> columnMeta = newColumnMeta(column, false, false); columnMetaList.add(columnMeta); }); }
Source:
<code>protected BuilderInfo findBuilderInfo(TypeElement typeElement) { Name name = typeElement.getQualifiedName(); if ( name.toString().endsWith( ".Item" ) ) { <START> BuilderInfo info = findBuilderInfoForImmutables( typeElement ); <END> if ( info != null ) { return info; } } return super.findBuilderInfo( typeElement ); }</code><technical_language>do ? : Name name = typeElement.getQualifiedName(); BuilderInfo info; if ( name.toString().endsWith( ".Item" ) ) { info = findBuilderInfoForImmutables( typeElement ); } return info == null ? super.findBuilderInfo(typeElement) : info;</technical_language>

Target:
protected BuilderInfo findBuilderInfo(TypeElement typeElement) { Name name = typeElement.getQualifiedName(); if ( name.toString().endsWith( ".Item" ) ) { BuilderInfo info = findBuilderInfoFromInnerBuilderClass( typeElement ); if ( info != null ) { return info; } } return super.findBuilderInfo( typeElement ); }
Source:
<code>public Class<? extends Driver> validateJDBCPluginPipeline(PipelineConfigurer pipelineConfigurer, String jdbcPluginId, FailureCollector collector) { if (config.user == null && config.password != null) { collector.addFailure("User is null. Please provide both user name and password if database requires " + "authentication. If not, please remove password and retry.", null) <START> .withConfigProperty(ConnectionConfig.USER).withConfigProperty(ConnectionConfig.PASSWORD); <END> } Class<? extends Driver> jdbcDriverClass = pipelineConfigurer.usePluginClass(config.jdbcPluginType, config.jdbcPluginName, jdbcPluginId, PluginProperties.builder().build()); if (jdbcDriverClass == null) { collector.addFailure(String.format("Unable to load JDBC Driver class for plugin name '%s'.", config.jdbcPluginName), String.format("Please make sure that the plugin '%s' of type '%s' containing " + "the driver has been installed correctly.", config.jdbcPluginName, config.jdbcPluginType)) .withConfigProperty(ConnectionConfig.JDBC_PLUGIN_NAME); } return jdbcDriverClass; }</code><technical_language>this perform checks for macros in username password</technical_language>

Target:
public Class<? extends Driver> validateJDBCPluginPipeline(PipelineConfigurer pipelineConfigurer, String jdbcPluginId, FailureCollector collector) { if (!config.containsMacro(config.user) && !config.containsMacro(config.password) && config.user == null && config.password != null) { collector.addFailure("Username and password should be provided together.", "Please provide both " + "user name and password, if database supports it or remove password.") .withConfigProperty(ConnectionConfig.USER).withConfigProperty(ConnectionConfig.PASSWORD); } Class<? extends Driver> jdbcDriverClass = pipelineConfigurer.usePluginClass(config.jdbcPluginType, config.jdbcPluginName, jdbcPluginId, PluginProperties.builder().build()); if (jdbcDriverClass == null) { collector.addFailure( String.format("Unable to load JDBC Driver class for plugin name '%s'.", config.jdbcPluginName), String.format("Ensure that plugin '%s' of type '%s' containing the driver has been " + "deployed.", config.jdbcPluginName, config.jdbcPluginType)) .withConfigProperty(ConnectionConfig.JDBC_PLUGIN_NAME) .withPluginNotFound(jdbcPluginId, config.jdbcPluginName, config.jdbcPluginType); } return jdbcDriverClass; }
Source:
<code>private boolean <START> isSequenceChange(Notification <END> input) { return new NotificationQuery(input).isNotationChange() && isSequenceElement(input.getNotifier()) && needsLayout(input); }</code><technical_language>isSequenceNotationChange a name</technical_language>

Target:
private boolean isSequenceChange(Notification input) { return new NotificationQuery(input).isNotationChange() && isSequenceElement(input) && needsLayout(input); }
Source:
<code>public void testGetString() { jsonObject.put("foo", "bar"); assertEquals("bar", jsonObject.getString("foo")); jsonObject.put("bar", 123); try { jsonObject.getString("bar"); <START> } catch (ClassCastException e) { <END> fail(); } jsonObject.putNull("foo"); assertNull(jsonObject.getString("foo")); assertNull(jsonObject.getString("absent")); try { jsonObject.getString(null); fail(); } catch (NullPointerException e) { } }</code><technical_language>simply remove catch block instead</technical_language>

Target:
public void testGetString() { jsonObject.put("foo", "bar"); assertEquals("bar", jsonObject.getString("foo")); jsonObject.put("bar", 123); assertEquals("123", jsonObject.getString("bar")); jsonObject.putNull("foo"); assertNull(jsonObject.getString("foo")); assertNull(jsonObject.getString("absent")); try { jsonObject.getString(null); fail(); } catch (NullPointerException e) { } }
Source:
<code>} catch (Throwable t) { platform = null; <START> if (LOG.isDebugEnabled()) <END> LOG.debug("Could not load jnr.ffi.Platform class, this class will not be available.", t); else LOG.info( "Could not load jnr.ffi.Platform class, this class will not be available " + "(set this logger level to DEBUG to see the full stack trace)."); }</code><technical_language>I contrary 3.x, in 4.x log DEBUG level, I harmonize code</technical_language>

Target:
} catch (Throwable t) { platform = null; LOG.debug("Error loading jnr.ffi.Platform class, this class will not be available.", t); }