auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<AuditLogWithHistory> getEmailAuditLogsWithHistoryForId(final UUID accountEmailId, final AuditLevel auditLevel, final InternalTenantContext context) throws AccountApiException { return transactionalSqlDao.execute(true, AccountApiException.class, new EntitySqlDaoTransactionWrapper<List<AuditLogWithHistory>>() { @Override public List<AuditLogWithHistory> inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) { final AccountEmailSqlDao transactional = entitySqlDaoWrapperFactory.become(AccountEmailSqlDao.class); return auditDao.getAuditLogsWithHistoryForId(transactional, TableName.ACCOUNT_EMAIL, accountEmailId, auditLevel, context); } }); }

Target:
public List<AuditLogWithHistory> getEmailAuditLogsWithHistoryForId(final UUID accountEmailId, final AuditLevel auditLevel, final InternalTenantContext context) { return transactionalSqlDao.execute(true, new EntitySqlDaoTransactionWrapper<List<AuditLogWithHistory>>() { @Override public List<AuditLogWithHistory> inTransaction(final EntitySqlDaoWrapperFactory entitySqlDaoWrapperFactory) { final AccountEmailSqlDao transactional = entitySqlDaoWrapperFactory.become(AccountEmailSqlDao.class); return auditDao.getAuditLogsWithHistoryForId(transactional, TableName.ACCOUNT_EMAIL, accountEmailId, auditLevel, context); } }); }
Source:
private void handleResponse(Consumer<RuntimeModel> modelLoaded, Command emptyModel, Optional<RuntimeModel> runtimeModelOp) { if (runtimeModelOp.isPresent()) { RuntimeModel runtimeModel = runtimeModelOp.get(); registerModel(runtimeModel); modelLoaded.accept(runtimeModel); } else { emptyModel.execute(); } }

Target:
private void handleResponse(Consumer<RuntimeModel> modelLoaded, Command emptyModel, Optional<RuntimeModel> runtimeModelOp) { loading.hideBusyIndicator(); if (runtimeModelOp.isPresent()) { RuntimeModel runtimeModel = runtimeModelOp.get(); registerModel(runtimeModel); modelLoaded.accept(runtimeModel); } else { emptyModel.execute(); } }
Source:
public Set<Node> getNodes() { Set<Node> nodes = this.nodes; if(nodes!=null) return nodes; Set<Node> r = new TreeSet<Node>(new NodeSorter()); Jenkins h = Jenkins.getInstance(); if(this.matches(h)) r.add(h); for (Node n : h.getNodes()) { if(this.matches(n)) r.add(n); } return this.nodes = Collections.unmodifiableSet(r); }

Target:
public Set<Node> getNodes() { Set<Node> nodes = this.nodes; if(nodes!=null) return nodes; Set<Node> r = new HashSet<>(); Jenkins h = Jenkins.getInstance(); if(this.matches(h)) r.add(h); for (Node n : h.getNodes()) { if(this.matches(n)) r.add(n); } return this.nodes = Collections.unmodifiableSet(r); }
Source:
public <T> T fromJson(JsonReader reader, Type typeOfT) throws JsonIOException, JsonSyntaxException { boolean isEmpty = true; boolean oldLenient = reader.isLenient(); reader.setLenient(true); try { JsonToken token = reader.peek(); if (token == JsonToken.END_DOCUMENT) { return null; } isEmpty = false; TypeToken<T> typeToken = (TypeToken<T>) TypeToken.get(typeOfT); TypeAdapter<T> typeAdapter = getAdapter(typeToken); T object = typeAdapter.read(reader); return object; } catch (EOFException e) { if (isEmpty) { return null; } throw new JsonSyntaxException(e); } catch (IllegalStateException e) { throw new JsonSyntaxException(e); } catch (IOException e) { throw new JsonSyntaxException(e); } catch (AssertionError e) { AssertionError error = new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage()); error.initCause(e); throw error; } finally { reader.setLenient(oldLenient); } }

Target:
public <T> T fromJson(JsonReader reader, Type typeOfT) throws JsonIOException, JsonSyntaxException { boolean oldLenient = reader.isLenient(); reader.setLenient(true); try { if (reader.peek() == JsonToken.END_DOCUMENT) { return null; } TypeToken<T> typeToken = (TypeToken<T>) TypeToken.get(typeOfT); TypeAdapter<T> typeAdapter = getAdapter(typeToken); T object = typeAdapter.read(reader); return object; } catch (IllegalStateException e) { throw new JsonSyntaxException(e); } catch (IOException e) { throw new JsonSyntaxException(e); } catch (AssertionError e) { AssertionError error = new AssertionError("AssertionError (GSON " + GsonBuildConfig.VERSION + "): " + e.getMessage()); error.initCause(e); throw error; } finally { reader.setLenient(oldLenient); } }
Source:
private String generateTokenValueResponse() { byte[] cookieBytes = getThreadLocalRequest().getSession().getId().getBytes(); return StringUtils.toHexString(Md5Utils.getMd5Digest(cookieBytes)); }

Target:
private String generateTokenValueResponse() { byte[] tokenBytes = getThreadLocalRequest().getSession().getId().getBytes(Charset.forName("UTF-8")); return StringUtils.toHexString(Md5Utils.getMd5Digest(tokenBytes)); }
Source:
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(); } return ebeanQuery.findPagedList(pageOffset, query.getLimit()); }

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:
public static void closeInputStream(InputStream stream, String tag){ if(stream!=null){ try { stream.close(); } catch (IOException e) { if (Constants.DEBUG_MODE_ENABLED) { Log.e(tag, "Exception occured when closing InputStream."+e); } } } }

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:
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); updateBankProblem.setScript("Faker Script"); 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); }

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:
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, content.size()); } }) .show(); }

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:
static String toHexString(byte[] bytes) { try(Formatter formatter = new Formatter()){ for (byte b : bytes) { formatter.format("%02x", b); } return formatter.toString(); } }

Target:
static String toHexString(byte[] bytes) { return Hex.encodeHexString(bytes); }
Source:
public InfinispanRemoteQueryDescriptor parseNativeQuery(String nativeQuery) { throw new UnsupportedOperationException( "Native Query not supported by Infinispan Remote Dialect" ); }

Target:
public InfinispanRemoteQueryDescriptor parseNativeQuery(String nativeQuery) { return new InfinispanRemoteNativeQueryParser( nativeQuery ).parse(); }
Source:
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(new Book(), 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()); }

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:
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), loc(1, 100, 370), 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); }

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:
public void testUriGeneration() { Action action = new TasksInformation.Builder("node_id:task_id").build(); assertEquals("_tasks/node_id:task_id", action.getURI()); }

Target:
public void testUriGeneration() { Action action = new TasksInformation.Builder().build(); assertEquals("_tasks", action.getURI()); }
Source:
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(new Color(0,0,0))); filterColorComboBox.setRenderer(new ColorRenderer()); filterColorComboBox.setSelectedIndex(0); filterColorComboBox.setSize(new Dimension(20, 5)); registerCallbacks(); }

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:
public AllCodeSystemSearchRequestBuilder filterByToolingIds(final Iterable<String> toolingIds) { this.toolingIds = ImmutableSet.copyOf(toolingIds); return this; }

Target:
public AllCodeSystemSearchRequestBuilder filterByToolingIds(final Iterable<String> toolingIds) { this.toolingIds = toolingIds; return this; }
Source:
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)) { if (stateItem instanceof GroupedStateItem) { 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); } } }

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:
public void setUp() throws Exception { createProjectAndGetStartScriptWithImages("BroadcastBrickTest"); baseActivityTestRule.launchActivity(null); onView(withId(R.id.brick_when_condition_edit_text)).perform(click()); 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()); }

Target:
public void setUp() throws Exception { createProjectAndGetStartScriptWithImages("BroadcastBrickTest"); baseActivityTestRule.launchActivity(null); }
Source:
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(); mapboxMap.addOnMapClickListener(new MapboxMap.OnMapClickListener() { @Override public void onMapClick(@NonNull LatLng point) { ValueAnimator markerAnimator = ObjectAnimator.ofObject(marker, "position", new LatLngEvaluator(), marker.getPosition(), point); markerAnimator.setDuration(2000); markerAnimator.start(); } }); } }); }

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:
public void send(byte[] buf) { DatagramPacket packet; packet = new DatagramPacket(buf, buf.length, ina, 15001); try { _socket.send(packet); } catch (IOException e) { e.printStackTrace(); } }

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:
private void askQuestion() { ArrayList<Object> params = new ArrayList<>(); params.add(this); if (StageActivity.messageHandler == null) { return; } Message message = StageActivity.messageHandler.obtainMessage(StageActivity.REGISTER_INTENT, params); message.sendToTarget(); questionAsked = true; }

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:
public void handleRequest(HttpServerExchange exchange) throws Exception { if (mode != null) { exchange.addResponseCommitListener(new ResponseCommitListener() { @Override public void beforeCommit(HttpServerExchange exchange) { if (mode.equalsIgnoreCase(Cookie.SameSiteMode.None.toString())) { 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); }

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:
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); errorMessage = constraintViolations.iterator().next().getMessage(); return false; }

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:
public boolean downgrade() { if (!mRwLock.isWriteLocked()) { return false; } Preconditions.checkState(mRwLock.isWriteLockedByCurrentThread(), "Lock downgrades may only be initiated by the holding thread."); mRwLock.readLock().lock(); mLock.unlock(); mLock = mRwLock.readLock(); return true; }

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:
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 { onSuccess(lastSuccess); } } }); }

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:
protected Collection<String> getTableDefinitions() { 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')))" ); }

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:
public Metadata build() { 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); }

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:
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; final long cacheOffset = cacheSize == 0 ? fileBytes : cacheSize > fileBytes ? 1 : fileBytes / cacheSize; 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++; } }

Target:
public FileWordList(final RandomAccessFile raf, final boolean caseSensitive, final int cachePercent) throws IOException { super(raf, caseSensitive, cachePercent); initialize(cachePercent); }
Source:
public AvailabilitySet apply(final Template input) { checkArgument(input.getOptions() instanceof AzureTemplateOptions, "An AzureTemplateOptions object is required"); AzureTemplateOptions options = input.getOptions().as(AzureTemplateOptions.class); AvailabilitySet as = null; 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; }

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:
public void init(IWorkbench workbench) { final IPreferenceStore store = Activator.getDefault() .getPreferenceStore(); store.addPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty() == PROVIDER) { } } }); setPreferenceStore(store); setDescription(Messages.SnapshotPreferencesPage_0); }

Target:
public void init(IWorkbench workbench) { final IPreferenceStore store = new ScopedPreferenceStore( configScopeInstance, QUALIFIER); setPreferenceStore(store); setDescription(Messages.SnapshotPreferencesPage_0); }
Source:
public boolean accept(CommandEnvelope envelope, StreamObserver<Response> responseObserver) { 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; }

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

Target:
protected String getDurationFieldName() { return "time_spent"; }
Source:
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; while (true) { 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); }

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:
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 null; }

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:
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 null; } catch (IOException | InterruptedException e) { throw Throwables.propagate(e); } }

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:
public RestoreRedundancyRequest( RestoreRedundancyRequest other) { this.setExcludeRegions(other.getExcludeRegions()); this.setIncludeRegions(other.getIncludeRegions()); this.setReassignPrimaries(other.getReassignPrimaries()); this.operator = other.getOperator(); }

Target:
public RestoreRedundancyRequest( RestoreRedundancyRequest other) { setExcludeRegions(other.getExcludeRegions()); setIncludeRegions(other.getIncludeRegions()); setReassignPrimaries(other.getReassignPrimaries()); operator = other.getOperator(); }
Source:
public void test() throws Exception { assertLine("baseclinit", ICounter.FULLY_COVERED); 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); }

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:
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`. " + "Please select a valid one: %s.", maxSizePolicy, MAP_SUPPORTED_ON_HEAP_MAX_SIZE_POLICIES); throw new InvalidConfigurationException(msg); } }

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:
public ServiceName getName() { return ServiceName.JBOSS.append(serviceName, className.replaceAll("\\.", "_")); }

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

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:
protected BuilderInfo findBuilderInfo(TypeElement typeElement) { Name name = typeElement.getQualifiedName(); if ( name.toString().endsWith( ".Item" ) ) { BuilderInfo info = findBuilderInfoForImmutables( typeElement ); if ( info != null ) { return info; } } return super.findBuilderInfo( typeElement ); }

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:
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) .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("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; }

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:
private boolean isSequenceChange(Notification input) { return new NotificationQuery(input).isNotationChange() && isSequenceElement(input.getNotifier()) && needsLayout(input); }

Target:
private boolean isSequenceChange(Notification input) { return new NotificationQuery(input).isNotationChange() && isSequenceElement(input) && needsLayout(input); }
Source:
public void testGetString() { jsonObject.put("foo", "bar"); assertEquals("bar", jsonObject.getString("foo")); jsonObject.put("bar", 123); try { jsonObject.getString("bar"); } catch (ClassCastException e) { fail(); } jsonObject.putNull("foo"); assertNull(jsonObject.getString("foo")); assertNull(jsonObject.getString("absent")); try { jsonObject.getString(null); fail(); } catch (NullPointerException e) { } }

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:
} catch (Throwable t) { platform = null; if (LOG.isDebugEnabled()) 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)."); }

Target:
} catch (Throwable t) { platform = null; LOG.debug("Error loading jnr.ffi.Platform class, this class will not be available.", t); }
Source:
public ImmutableMapValue<BodyPart, Vector3d> partRotation() { return new ImmutableSpongeMapValue<>(Keys.BODY_ROTATIONS, this.rotations); }

Target:
public ImmutableMapValue<BodyPart, Vector3d> partRotation() { return this.rotationsValue; }