auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ElementTag createCancelAddInstructorButton() { String buttonContent = "<span class=\"glyphicon glyphicon-remove\"></span> Cancel"; String buttonId = "newInstrCancelLink"; return createBasicButton(buttonContent, buttonId, "javascript:;", Const.Tooltips.COURSE_INSTRUCTOR_CANCEL_ADD, false); }

Target:
private ElementTag createCancelAddInstructorButton() { String buttonContent = "<span class=\"glyphicon glyphicon-remove\"></span> Cancel"; String buttonId = "cancelAddInstructorLink"; return createBasicButton(buttonContent, buttonId, "javascript:;", Const.Tooltips.COURSE_INSTRUCTOR_CANCEL_ADD, false); }
Source:
private void fetchUsersList(String dotComBlogId, final int localTableBlogId, final int offset) { if (mPeopleEndOfListReached) { return; } FragmentManager fragmentManager = getFragmentManager(); final PeopleListFragment peopleListFragment = (PeopleListFragment) fragmentManager .findFragmentByTag(KEY_PEOPLE_LIST_FRAGMENT); if (peopleListFragment != null && offset > 0) { peopleListFragment.showLoadingProgress(true); } PeopleUtils.fetchUsers(dotComBlogId, localTableBlogId, offset, new PeopleUtils.FetchUsersCallback() { @Override public void onSuccess(List<Person> peopleList, boolean isEndOfList) { boolean isFreshList = (offset == 0); mPeopleEndOfListReached = isEndOfList; PeopleTable.savePeople(peopleList, localTableBlogId, isFreshList); refreshOnScreenFragmentDetails(); if (peopleListFragment != null) { peopleListFragment.showLoadingProgress(false); } } @Override public void onError() { if (peopleListFragment != null) { peopleListFragment.showLoadingProgress(false); } ToastUtils.showToast(PeopleManagementActivity.this, R.string.error_fetch_people_list, ToastUtils.Duration.LONG); } }); }

Target:
private void fetchUsersList(String dotComBlogId, final int localTableBlogId, final int offset) { if (mPeopleEndOfListReached || mFetchRequestInProgress || !NetworkUtils.checkConnection(this)) { return; } FragmentManager fragmentManager = getFragmentManager(); final PeopleListFragment peopleListFragment = (PeopleListFragment) fragmentManager .findFragmentByTag(KEY_PEOPLE_LIST_FRAGMENT); if (peopleListFragment != null) { peopleListFragment.showLoadingProgress(true); } mFetchRequestInProgress = true; PeopleUtils.fetchUsers(dotComBlogId, localTableBlogId, offset, new PeopleUtils.FetchUsersCallback() { @Override public void onSuccess(List<Person> peopleList, boolean isEndOfList) { boolean isFreshList = (offset == 0); mPeopleEndOfListReached = isEndOfList; PeopleTable.savePeople(peopleList, localTableBlogId, isFreshList); refreshOnScreenFragmentDetails(); mFetchRequestInProgress = false; if (peopleListFragment != null) { peopleListFragment.showLoadingProgress(false); } } @Override public void onError() { mFetchRequestInProgress = false; if (peopleListFragment != null) { peopleListFragment.showLoadingProgress(false); } ToastUtils.showToast(PeopleManagementActivity.this, R.string.error_fetch_people_list, ToastUtils.Duration.LONG); } }); }
Source:
public void sawClient(Client client, @Nullable Principal principal) { Instant now = Instant.now(); Instant lastSeen = Optional.ofNullable(client.getLastSeen()) .map(ls -> Instant.ofEpochSecond(ls.toEpochSecond())) .orElse(EPOCH); final Instant expiration; if (principal instanceof CertificatePrincipal) { expiration = Optional.ofNullable((CertificatePrincipal) principal) .map(p -> p.getCertificateExpiration()) .orElse(EPOCH); } else { expiration = EPOCH; } if (now.isAfter(lastSeen.plus(LAST_SEEN_THRESHOLD))) { dslContext.transaction(configuration -> { Param<Long> lastSeenValue = DSL.val(now.getEpochSecond(), CLIENTS.LASTSEEN); Param<Long> expirationValue = DSL.val(expiration.getEpochSecond(), CLIENTS.EXPIRATION); DSL.using(configuration) .update(CLIENTS) .set(CLIENTS.LASTSEEN, when(CLIENTS.LASTSEEN.isNull(), lastSeenValue) .otherwise(greatest(CLIENTS.LASTSEEN, lastSeenValue))) .set(CLIENTS.EXPIRATION, when(CLIENTS.EXPIRATION.isNull(), expirationValue) .otherwise(greatest(CLIENTS.EXPIRATION, expirationValue))) .where(CLIENTS.ID.eq(client.getId())) .execute(); }); } }

Target:
public void sawClient(Client client, @Nullable Principal principal) { Instant now = Instant.now(); Instant lastSeen = Optional.ofNullable(client.getLastSeen()) .map(ls -> Instant.ofEpochSecond(ls.toEpochSecond())) .orElse(EPOCH); final Instant expiration; if (principal instanceof CertificatePrincipal) { expiration = Optional.ofNullable((CertificatePrincipal) principal) .map(p -> p.getCertificateExpiration()) .orElse(EPOCH); } else { expiration = EPOCH; } if (now.isAfter(lastSeen.plus(LAST_SEEN_THRESHOLD))) { dslContext.transaction(configuration -> { Param<Long> lastSeenValue = DSL.val(now.getEpochSecond(), CLIENTS.LASTSEEN); Param<Long> expirationValue = DSL.val(expiration.getEpochSecond(), CLIENTS.EXPIRATION); DSL.using(configuration) .update(CLIENTS) .set(CLIENTS.LASTSEEN, when(CLIENTS.LASTSEEN.isNull(), lastSeenValue) .otherwise(greatest(CLIENTS.LASTSEEN, lastSeenValue))) .set(CLIENTS.EXPIRATION, expirationValue) .where(CLIENTS.ID.eq(client.getId())) .execute(); }); } }
Source:
public boolean acquire(K key, final Runnable cacheHit) { try (Scope ss = tracer.spanBuilder("DistributedRateLimitedCache").startScopedSpan()) { Span span = tracer.getCurrentSpan(); if (cache.get(key) != null) { span.addAnnotation("Found key in cache"); cacheHit.run(); return false; } final String cacheKey = buildKey(key); try { if (memcachedClient.get( cacheKey).toCompletableFuture().get(100, TimeUnit.MILLISECONDS) != null) { span.addAnnotation("Found key in memcached"); cache.putIfAbsent(key, true); cacheHit.run(); return false; } } catch (TimeoutException | InterruptedException | ExecutionException e) { span.addAnnotation("Failed to get key from memcached"); log.error("Failed to get key from memecached", e); } span.addAnnotation("Acquiring rate limiter"); rateLimiter.acquire(); span.addAnnotation("Acquired rate limiter"); if (cache.putIfAbsent(key, true) != null) { cacheHit.run(); return false; } else { span.addAnnotation("Add key in memcached " + cacheKey); memcachedClient.set(cacheKey, "true", memcachedTtlSeconds); } return true; } }

Target:
public boolean acquire(K key, final Runnable cacheHit) { try (Scope ss = tracer.spanBuilder("DistributedRateLimitedCache").startScopedSpan()) { Span span = tracer.getCurrentSpan(); if (cache.get(key) != null) { span.addAnnotation("Found key in cache"); cacheHit.run(); return false; } final String cacheKey = buildKey(key); try { if (memcachedClient.get( cacheKey).toCompletableFuture().get(100, TimeUnit.MILLISECONDS) != null) { span.addAnnotation("Found key in memcached"); cache.putIfAbsent(key, true); cacheHit.run(); return false; } } catch (TimeoutException | InterruptedException | ExecutionException e) { span.setStatus(Status.INTERNAL.withDescription(e.getMessage())); log.error("Failed to get key from memecached", e); } span.addAnnotation("Acquiring rate limiter"); rateLimiter.acquire(); span.addAnnotation("Acquired rate limiter"); if (cache.putIfAbsent(key, true) != null) { cacheHit.run(); return false; } else { span.addAnnotation("Add key in memcached " + cacheKey); memcachedClient.set(cacheKey, "true", memcachedTtlSeconds); } return true; } }
Source:
public void onInit( String clientName, Map<String,Object> credentials ) throws IOException { packer.packStructHeader( 1, INIT.signature() ); packer.pack( clientName ); packer.pack( ValueUtils.asMapValue( credentials ) ); onMessageComplete.onMessageComplete(); }

Target:
public void onInit( String clientName, Map<String,Object> credentials ) throws IOException { packer.packStructHeader( 2, INIT.signature() ); packer.pack( clientName ); packer.pack( ValueUtils.asMapValue( credentials ) ); onMessageComplete.onMessageComplete(); }
Source:
private void activateViewpoints(List<?> selection) { List<RepresentationItemImpl> representationItemList = getRepresentationItems(selection); Set<Viewpoint> viewpointsToActivate = new HashSet<>(); for (RepresentationItemImpl representationItemImpl : representationItemList) { Object parent = representationItemImpl.getParent(); if (parent instanceof RepresentationDescriptionItemImpl) { RepresentationDescriptionItemImpl representationDescriptionItem = (RepresentationDescriptionItemImpl) parent; boolean activateViewpoint = !ViewpointHelper.isViewpointEnabledInSession(session, representationDescriptionItem.getViewpoint()); if (activateViewpoint) { viewpointsToActivate.add(representationDescriptionItem.getViewpoint()); } } } if (!viewpointsToActivate.isEmpty()) { ViewpointHelper.handleViewpointActivation(session, viewpointsToActivate, true, false); } }

Target:
private void activateViewpoints(List<?> selection) { List<RepresentationItemImpl> representationItemList = getRepresentationItems(selection); Set<Viewpoint> viewpointsToActivate = new HashSet<>(); for (RepresentationItemImpl representationItemImpl : representationItemList) { Viewpoint parentViewpoint = ViewpointHelper.getViewpointInVSM(session, new RepresentationDescriptionQuery(representationItemImpl.getDRepresentationDescriptor().getDescription()).getParentViewpoint()); if (parentViewpoint != null) { boolean activateViewpoint = !ViewpointHelper.isViewpointEnabledInSession(session, parentViewpoint); if (activateViewpoint) { viewpointsToActivate.add(parentViewpoint); } } } if (!viewpointsToActivate.isEmpty()) { ViewpointHelper.handleViewpointActivation(session, viewpointsToActivate, true, false); } }
Source:
public void testNoDataNodesOnFlush() throws Exception { boolean failed = false; cnt = 0; noNodesFilter = true; try { Ignite ignite = startGrid(1); IgniteFuture fut = null; try (IgniteDataStreamer<Integer, String> streamer = ignite.dataStreamer(DEFAULT_CACHE_NAME)) { fut = streamer.addData(1, "1"); streamer.flush(); } catch (CacheException ignored) { try { fut.get(); fail("DataStreamer ignores failed streaming."); } catch (CacheServerNotFoundException ignored2) { } failed = true; } } finally { noNodesFilter = false; assertTrue(failed); } }

Target:
public void testNoDataNodesOnFlush() throws Exception { boolean failed = false; cnt = 0; noNodesFilter = true; try { Ignite ignite = startGrid(1); IgniteFuture fut = null; try (IgniteDataStreamer<Integer, String> streamer = ignite.dataStreamer(DEFAULT_CACHE_NAME)) { streamer.perThreadBufferSize(1); fut = streamer.addData(1, "1"); streamer.flush(); } catch (IllegalStateException ignored) { try { fut.get(); fail("DataStreamer ignores failed streaming."); } catch (CacheServerNotFoundException ignored2) { } failed = true; } } finally { noNodesFilter = false; assertTrue(failed); } }
Source:
public void testProjectLockableAccount() { AccountVO accountVO = new AccountVO(); accountVO.setId(7L); accountVO.setDomainId(1L); accountVO.setType(Account.ACCOUNT_TYPE_PROJECT); assertFalse(quotaManager.isLockable(accountVO)); }

Target:
public void testProjectLockableAccount() { accountVO.setType(Account.ACCOUNT_TYPE_PROJECT); assertFalse(quotaManager.isLockable(accountVO)); }
Source:
public void useDefaultKeyPair() throws KeyStoreException { String alias = Config.<String>GetValue(ConfigValues.CertAlias); String p12 = Config.<String>GetValue(ConfigValues.keystoreUrl); String password = Config.<String>GetValue(ConfigValues.keystorePass); KeyStore.PrivateKeyEntry entry; InputStream in = null; try { in = new FileInputStream(p12); KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(in, password.toCharArray()); entry = (KeyStore.PrivateKeyEntry)ks.getEntry( alias, new KeyStore.PasswordProtection( password.toCharArray() ) ); } catch (Exception e) { throw new KeyStoreException( String.format( "Failed to get certificate entry from key store: %1$s/%2$s", p12, alias ), e ); } finally { if (in != null) { try { in.close(); } catch(IOException e) { log.error("Cannot close key store", e); } } } if (entry == null) { throw new KeyStoreException( String.format( "Bad key store: %1$s/%2$s", p12, alias ) ); } setKeyPair( new KeyPair( entry.getCertificate().getPublicKey(), entry.getPrivateKey() ) ); }

Target:
public void useDefaultKeyPair() throws KeyStoreException { String alias = Config.<String>GetValue(ConfigValues.CertAlias); String p12 = Config.<String>GetValue(ConfigValues.keystoreUrl); char password[] = Config.<String>GetValue(ConfigValues.keystorePass).toCharArray(); KeyStore.PrivateKeyEntry entry; InputStream in = null; try { in = new FileInputStream(p12); KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(in, password); entry = (KeyStore.PrivateKeyEntry)ks.getEntry( alias, new KeyStore.PasswordProtection(password) ); } catch (Exception e) { throw new KeyStoreException( String.format( "Failed to get certificate entry from key store: %1$s/%2$s", p12, alias ), e ); } finally { Arrays.fill(password, '*'); if (in != null) { try { in.close(); } catch(IOException e) { log.error("Cannot close key store", e); } } } if (entry == null) { throw new KeyStoreException( String.format( "Bad key store: %1$s/%2$s", p12, alias ) ); } setKeyPair( new KeyPair( entry.getCertificate().getPublicKey(), entry.getPrivateKey() ) ); }
Source:
private Map.Entry<String, Object> jsonEntryToMetacardEntry(Map.Entry<String, Object> entry) { try { return transformations .stream() .filter(transformation -> entry.getKey().equals(transformation.getJsonKey())) .findAny() .flatMap( transformation -> { if (transformation.getExpectedJsonType().isInstance(entry.getValue())) { final String newKey = transformation.getMetacardKey(); final Object newValue = transformation.jsonValueToMetacardValue( this, transformation.getExpectedJsonType().cast(entry.getValue())); return Optional.of( (Map.Entry<String, Object>) new AbstractMap.SimpleEntry<>(newKey, newValue)); } else { LOGGER.warn( "A workspace transformation expected a value of type for key \"{}\", but instead found a value of type {}!", transformation.getExpectedJsonType().getName(), entry.getKey(), entry.getValue().getClass().getName()); return Optional.empty(); } }) .orElse(entry); } catch (Throwable exception) { return null; } }

Target:
private Optional<Map.Entry<String, Object>> jsonEntryToMetacardEntry( Map.Entry<String, Object> entry) { return transformations .stream() .filter(transformation -> entry.getKey().equals(transformation.getJsonKey())) .findAny() .map(transformation -> jsonEntryToMetacardEntry(entry, transformation)) .orElse(Optional.of(entry)); }
Source:
public long size() throws MessagingException { Connection conn = null; PreparedStatement count = null; ResultSet resultSet = null; try { conn = datasource.getConnection(); count = conn.prepareStatement(sqlQueries.getSqlString("countMessagesSQL", true)); resultSet = count.executeQuery(); return resultSet.next() ? resultSet.getLong(1) : 0; } catch (Exception e) { throw new MessagingException("Exception while removing mail: " + e.getMessage(), e); } finally { theJDBCUtil.closeJDBCResultSet(resultSet); theJDBCUtil.closeJDBCStatement(count); theJDBCUtil.closeJDBCConnection(conn); } }

Target:
public long size() throws MessagingException { try (Connection conn = datasource.getConnection(); PreparedStatement count = conn.prepareStatement(sqlQueries.getSqlString("countMessagesSQL", true)); ResultSet resultSet = count.executeQuery()) { return resultSet.next() ? resultSet.getLong(1) : 0; } catch (Exception e) { throw new MessagingException("Exception while fetching size: " + e.getMessage(), e); } }
Source:
protected void setCategory(TextView textView, Trip data) { textView.setText("Receipts: " + data.getSize()); }

Target:
protected void setCategory(TextView textView, Trip data) { textView.setText(getContext().getString(R.string.number_of_receipts, data.getSize())); }
Source:
public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory) { final BaseObjectColumnValueSelector selector = metricFactory.makeColumnValueSelector(getName()); return new StringLastBufferAggregator(null, null, maxStringBytes) { @Override public void aggregate(ByteBuffer buf, int position) { SerializablePairLongString pair = (SerializablePairLongString) selector.getObject(); if (pair != null && pair.rhs != null) { ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); long lastTime = mutationBuffer.getLong(position); if (pair.lhs >= lastTime) { mutationBuffer.putLong(position, pair.lhs); byte[] valueBytes = StringUtils.toUtf8(pair.rhs); mutationBuffer.putInt(position + Long.BYTES, valueBytes.length); mutationBuffer.position(position + Long.BYTES + Integer.BYTES); mutationBuffer.put(valueBytes); } } } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }

Target:
public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory) { final BaseObjectColumnValueSelector selector = metricFactory.makeColumnValueSelector(getName()); return new StringLastBufferAggregator(null, null, maxStringBytes) { @Override public void aggregate(ByteBuffer buf, int position) { SerializablePairLongString pair = (SerializablePairLongString) selector.getObject(); if (pair != null && pair.lhs != null) { ByteBuffer mutationBuffer = buf.duplicate(); mutationBuffer.position(position); long lastTime = mutationBuffer.getLong(position); if (pair.lhs >= lastTime) { mutationBuffer.putLong(position, pair.lhs); if (pair.rhs != null) { byte[] valueBytes = StringUtils.toUtf8(pair.rhs); mutationBuffer.putInt(position + Long.BYTES, valueBytes.length); mutationBuffer.position(position + Long.BYTES + Integer.BYTES); mutationBuffer.put(valueBytes); } else { mutationBuffer.putInt(position + Long.BYTES, 0); } } } } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("selector", selector); } }; }
Source:
public Dialog onCreateDialog(final int id) { Dialog dialog = null; if (id == REALLY_REMOVE_DIALOG) { dialog = new AlertDialog.Builder(getActivity()) .setTitle(R.string.really_remove_account_title) .setMessage(R.string.really_remove_account_message) .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(R.string.remove_account_label, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { AccountManager.get(AccountSyncSettings.this.getActivity()) .removeAccount(mAccount, new AccountManagerCallback<Boolean>() { public void run(AccountManagerFuture<Boolean> future) { if (!AccountSyncSettings.this.isResumed()) { return; } boolean failed = true; try { if (future.getResult() == true) { failed = false; } } catch (OperationCanceledException e) { } catch (IOException e) { } catch (AuthenticatorException e) { } if (failed && !getActivity().isFinishing()) { showDialog(FAILED_REMOVAL_DIALOG); } else { finish(); } } }, null); } }) .create(); } else if (id == FAILED_REMOVAL_DIALOG) { dialog = new AlertDialog.Builder(getActivity()) .setTitle(R.string.really_remove_account_title) .setPositiveButton(android.R.string.ok, null) .setMessage(R.string.remove_account_failed) .create(); } else if (id == CANT_DO_ONETIME_SYNC_DIALOG) { dialog = new AlertDialog.Builder(getActivity()) .setTitle(R.string.cant_sync_dialog_title) .setMessage(R.string.cant_sync_dialog_message) .setPositiveButton(android.R.string.ok, null) .create(); } return dialog; }

Target:
public Dialog onCreateDialog(final int id) { Dialog dialog = null; if (id == REALLY_REMOVE_DIALOG) { dialog = new AlertDialog.Builder(getActivity()) .setTitle(R.string.really_remove_account_title) .setMessage(R.string.really_remove_account_message) .setNegativeButton(android.R.string.cancel, null) .setPositiveButton(R.string.remove_account_label, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { AccountManager.get(AccountSyncSettings.this.getActivity()) .removeAccount(mAccount, new AccountManagerCallback<Boolean>() { public void run(AccountManagerFuture<Boolean> future) { if (!AccountSyncSettings.this.isResumed()) { return; } boolean failed = true; try { if (future.getResult() == true) { failed = false; } } catch (OperationCanceledException e) { } catch (IOException e) { } catch (AuthenticatorException e) { } if (failed && getActivity() != null && !getActivity().isFinishing()) { showDialog(FAILED_REMOVAL_DIALOG); } else { finish(); } } }, null); } }) .create(); } else if (id == FAILED_REMOVAL_DIALOG) { dialog = new AlertDialog.Builder(getActivity()) .setTitle(R.string.really_remove_account_title) .setPositiveButton(android.R.string.ok, null) .setMessage(R.string.remove_account_failed) .create(); } else if (id == CANT_DO_ONETIME_SYNC_DIALOG) { dialog = new AlertDialog.Builder(getActivity()) .setTitle(R.string.cant_sync_dialog_title) .setMessage(R.string.cant_sync_dialog_message) .setPositiveButton(android.R.string.ok, null) .create(); } return dialog; }
Source:
public void execute(MethodTree methodTree) { ExplodedGraphWalker walker = egwFactory.createWalker(behaviorCache, semanticModel); try { Symbol.MethodSymbol methodSymbol = methodTree.symbol(); if (methodCanNotBeOverriden(methodSymbol)) { MethodBehavior methodBehavior = behaviorCache.methodBehaviorForSymbol(methodSymbol); if (!methodBehavior.isVisited()) { methodBehavior = walker.visitMethod(methodTree, methodBehavior); methodBehavior.completed(); } } else { walker.visitMethod(methodTree); } } catch (ExplodedGraphWalker.MaximumStepsReachedException | ExplodedGraphWalker.ExplodedGraphTooBigException | RelationalSymbolicValue.TransitiveRelationExceededException exception) { LOG.debug("Could not complete symbolic execution: ", exception); if (walker.methodBehavior != null) { walker.methodBehavior.visited(); } } }

Target:
public void execute(MethodTree methodTree) { ExplodedGraphWalker walker = egwFactory.createWalker(behaviorCache, (SemanticModel) context.getSemanticModel()); try { Symbol.MethodSymbol methodSymbol = methodTree.symbol(); if (methodCanNotBeOverriden(methodSymbol)) { MethodBehavior methodBehavior = behaviorCache.methodBehaviorForSymbol(methodSymbol); if (!methodBehavior.isVisited()) { methodBehavior = walker.visitMethod(methodTree, methodBehavior); methodBehavior.completed(); } } else { walker.visitMethod(methodTree); } } catch (ExplodedGraphWalker.MaximumStepsReachedException | ExplodedGraphWalker.ExplodedGraphTooBigException | RelationalSymbolicValue.TransitiveRelationExceededException exception) { LOG.debug("Could not complete symbolic execution: ", exception); if (walker.methodBehavior != null) { walker.methodBehavior.visited(); } } }
Source:
public static PageResponse create(int size, int totalElements, int totalPages, int number) { return new AutoValue_PageResponse(size, totalElements, totalPages, number); }

Target:
public static PageResponse create(int size, int totalElements, int totalPages, int number) { Preconditions.checkState(size >= 0, "Negative number of results on the page"); Preconditions.checkState(totalElements >= 0, "Negative number of results in the system"); Preconditions.checkState(totalPages >= 0, "Negative nubmer of pages"); Preconditions.checkState(number >= 0, "Negative number of items"); return new AutoValue_PageResponse(size, totalElements, totalPages, number); }
Source:
public String generateHash() { final Hasher hasher = HASH_FUNCTION.newHasher(); if (key != null) { hasher.putString(key, Charsets.UTF_8); } for (final Map.Entry<String, String> kv : tags.entrySet()) { final String k = kv.getKey(); final String v = kv.getValue(); if (k != null) { hasher.putString(k, Charsets.UTF_8); } if (v != null) { hasher.putString(v, Charsets.UTF_8); } } return hasher.hash().toString(); }

Target:
public String generateHash() { final Hasher hasher = HASH_FUNCTION.newHasher(); if (key != null) { hasher.putString(key, Charsets.UTF_8); } TreeMap<String, String> sortedTags = new TreeMap<>(tags); for (final Map.Entry<String, String> kv : sortedTags.entrySet()) { final String k = kv.getKey(); final String v = kv.getValue(); if (k != null) { hasher.putString(k, Charsets.UTF_8); } if (v != null) { hasher.putString(v, Charsets.UTF_8); } } return hasher.hash().toString(); }
Source:
private int readHighTagNumber() throws BerDataValueFormatException { int b; int result = 0; do { if (!mBuf.hasRemaining()) { throw new BerDataValueFormatException("Truncated tag number"); } b = mBuf.get(); result <<= 7; result += b & 0x7f; if (result < 0) { throw new BerDataValueFormatException("Tag number too large"); } } while ((b & 0x80) != 0); return result; }

Target:
private int readHighTagNumber() throws BerDataValueFormatException { int b; int result = 0; do { if (!mBuf.hasRemaining()) { throw new BerDataValueFormatException("Truncated tag number"); } b = mBuf.get(); if (result > Integer.MAX_VALUE >>> 7) { throw new BerDataValueFormatException("Tag number too large"); } result <<= 7; result |= b & 0x7f; } while ((b & 0x80) != 0); return result; }
Source:
protected void initialize() { super.initialize(); useStagingView.setPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (FieldEditor.VALUE.equals(event.getProperty())) { autoStage.setEnabled( ((Boolean) event.getNewValue()).booleanValue(), getFieldEditorParent()); } } }); }

Target:
protected void initialize() { super.initialize(); useStagingView.setPropertyChangeListener(new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { if (FieldEditor.VALUE.equals(event.getProperty())) { autoStage.setEnabled( ((Boolean) event.getNewValue()).booleanValue(), generalGroup); } } }); }
Source:
private boolean shouldDump(Path previousDumpPath) throws IOException { if (previousDumpPath == null) { return true; } else { FileSystem fs = previousDumpPath.getFileSystem(conf); if (fs.exists(previousDumpPath)) { FileStatus[] latestUpdateStatuses = fs.listStatus(previousDumpPath); for (FileStatus status : latestUpdateStatuses) { if (status.getPath().getName().equalsIgnoreCase(ReplUtils.LOAD_ACKNOWLEDGEMENT)) { return true; } } } } return false; }

Target:
private boolean shouldDump(Path previousDumpPath) throws IOException { if (previousDumpPath == null) { return true; } else { FileSystem fs = previousDumpPath.getFileSystem(conf); return fs.exists(new Path(previousDumpPath, ReplUtils.LOAD_ACKNOWLEDGEMENT)); } }
Source:
public void traverseImpl(Collection<? extends T> roots, TraverserVisitor<? super T> visitor) { assertNotNull(roots); assertNotNull(visitor); DefaultTraverserContext<T> rootContext = newRootContext(rootVars); ForkJoinPool.commonPool().invoke(new CountedCompleter<Void>() { @Override public void compute() { setPendingCount(roots.size()); for (T root : roots) { DefaultTraverserContext context = newContext(root, rootContext, null); EnterAction enterAction = new EnterAction(this, context, visitor); enterAction.fork(); } tryComplete(); } }); }

Target:
public void traverseImpl(Collection<? extends T> roots, TraverserVisitor<? super T> visitor) { assertNotNull(roots); assertNotNull(visitor); DefaultTraverserContext<T> rootContext = newRootContext(rootVars); forkJoinPool.invoke(new CountedCompleter<Void>() { @Override public void compute() { setPendingCount(roots.size()); for (T root : roots) { DefaultTraverserContext context = newContext(root, rootContext, null); EnterAction enterAction = new EnterAction(this, context, visitor); enterAction.fork(); } tryComplete(); } }); }
Source:
public String processElement(ParserContext context, Element element) { String message = $(element).text(); if (StringUtils.isBlank(message)) { throw new WindupException("Error, 'tag' element must not be blank"); } return message; }

Target:
public String processElement(ParserContext context, Element element) { String content = element.getTextContent(); if (StringUtils.isBlank(content)) { throw new WindupException("Error, 'tag' element must not be blank"); } return content; }
Source:
public void run() { final Thread workerThread = Thread.currentThread(); final String oldName = workerThread.getName(); try { workerThread.setName("IOHub#" + _id + ": Worker[channel:" + key.channel() + "] / " + oldName); listener.ready((ops & SelectionKey.OP_ACCEPT) == SelectionKey.OP_ACCEPT, (ops & SelectionKey.OP_CONNECT) == SelectionKey.OP_CONNECT, (ops & SelectionKey.OP_READ) == SelectionKey.OP_READ, (ops & SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE); } catch (Throwable e) { if (LOGGER.isLoggable(Level.SEVERE)) { LogRecord record = new LogRecord(Level.SEVERE, "[{0}] Listener {1} propagated an uncaught {2}"); record.setThrown(e); record.setParameters(new Object[]{workerThread.getName(), listener, e.getClass().getSimpleName()}); LOGGER.log(record); } } finally { workerThread.setName(oldName); } }

Target:
public void run() { final Thread workerThread = Thread.currentThread(); final String oldName = workerThread.getName(); try { workerThread.setName("IOHub#" + _id + ": Worker[channel:" + key.channel() + "] / " + oldName); listener.ready((ops & SelectionKey.OP_ACCEPT) == SelectionKey.OP_ACCEPT, (ops & SelectionKey.OP_CONNECT) == SelectionKey.OP_CONNECT, (ops & SelectionKey.OP_READ) == SelectionKey.OP_READ, (ops & SelectionKey.OP_WRITE) == SelectionKey.OP_WRITE); } catch (Throwable e) { if (LOGGER.isLoggable(Level.SEVERE)) { LogRecord record = new LogRecord(Level.SEVERE, "[{0}] Listener {1} propagated an uncaught {2}"); record.setThrown(e); record.setParameters(new Object[]{workerThread.getName(), listener, e.getClass().getSimpleName()}); LOGGER.log(record); } if (e instanceof Error) { throw (Error)e; } } finally { workerThread.setName(oldName); } }
Source:
private boolean isQuotableParam(String name){ boolean isQuotableParameter = false; SipContext context = SipApplicationSessionCreationThreadLocal.lookupContext(); if (context != null){ Object object = context.getServletContext().getAttribute("org.restcomm.servlets.sip.QUOTABLE_PARAMETER"); if (object != null){ String quotableParameters = object.toString(); if (!quotableParameters.isEmpty()){ String[] parameters = quotableParameters.split(","); for (int i = 0; i < parameters.length; i++){ if (parameters[i].trim().equalsIgnoreCase(name)){ isQuotableParameter = true; break; } } } } } return isQuotableParameter; }

Target:
private boolean isQuotableParam(String name){ boolean isQuotableParameter = false; SipContext context = SipApplicationSessionCreationThreadLocal.lookupContext(); if (context != null){ List<String> params = (List<String>)context.getServletContext().getAttribute("org.restcomm.servlets.sip.QUOTABLE_PARAMETER"); for (String param : params){ if (param.equalsIgnoreCase(name)){ isQuotableParameter = true; break; } } } return isQuotableParameter; }
Source:
protected void onDestroy() { super.onDestroy(); Toaster.iToast(this, "Destroying MusicLibrary Service"); Intent intent = new Intent(this, MusicLibraryService.class); stopService(intent); }

Target:
protected void onDestroy() { super.onDestroy(); Intent intent = new Intent(this, MusicLibraryService.class); stopService(intent); }
Source:
public MongoDbMetadataStore(MongoTemplate template, String collectionName) { this.template = template; this.collectionName = (StringUtils.hasText(collectionName)) ? collectionName : DEFAULT_COLLECTION_NAME; }

Target:
public MongoDbMetadataStore(MongoTemplate template, String collectionName) { Assert.notNull(template, "'template' must not be null."); Assert.hasText(collectionName, "'collectionName' must not be empty."); this.template = template; this.collectionName = collectionName; operations = template.scriptOps(); operations.register(new NamedMongoScript(PUT_IF_ABSENT, buildQuery())); }
Source:
public void testConstraintOnPrivateGetterReturnsConstraintViolation() { Validator validator = getValidator(); LocalDate[][] testData = { { LocalDate.MAX, LocalDate.MIN }, { LocalDate.now( ZoneId.systemDefault() ), null }, { null, null } }; for ( LocalDate[] dates : testData ) { Set<ConstraintViolation<Project>> constraintViolations = validator.validate( new Project( dates[0], dates[1] ) ); assertNumberOfViolations( constraintViolations, 1 ); assertCorrectConstraintTypes( constraintViolations, AssertTrue.class ); assertCorrectPropertyPaths( constraintViolations, "startBeforeEnd" ); } }

Target:
public void testConstraintOnPrivateGetterReturnsConstraintViolation() { Validator validator = getValidator(); LocalDate[][] testData = { { LocalDate.MAX, LocalDate.MIN }, { LocalDate.now(), null }, { null, null } }; for ( LocalDate[] dates : testData ) { Set<ConstraintViolation<Project>> constraintViolations = validator.validate( new Project( dates[0], dates[1] ) ); assertNumberOfViolations( constraintViolations, 1 ); assertCorrectConstraintTypes( constraintViolations, AssertTrue.class ); assertCorrectPropertyPaths( constraintViolations, "startBeforeEnd" ); } }
Source:
private void updateState() { Optional<EclipseProjectBinding> projectBinding = getProjectConfig().getProjectBinding(); if (projectBinding.isPresent()) { boundDetails .setText("Bound to the project '" + projectBinding.get().projectKey() + "' on server '" + serverName(projectBinding.get().connectionId()) + "'"); bindLink.setText("<a>Update project binding</a>"); } else { bindLink.setText("<a>Bind this Eclipse project to a SonarQube project</a>"); boundDetails.setText(""); } if (projectBinding.isPresent() && !SonarLintCorePlugin.getServersManager().forProject(getProject()).isPresent()) { addServerLink.setText("<a>Connect to SonarQube server '" + projectBinding.get().connectionId() + "'</a>"); addServerLink.setVisible(true); } else { addServerLink.setVisible(false); } container.layout(true, true); }

Target:
private void updateState() { Optional<EclipseProjectBinding> projectBinding = getProjectConfig().getProjectBinding(); if (projectBinding.isPresent()) { boundDetails .setText("Bound to the project '" + projectBinding.get().projectKey() + "' on connection '" + serverName(projectBinding.get().connectionId()) + "'"); bindLink.setText("<a>Update project binding</a>"); } else { bindLink.setText("<a>Bind this Eclipse project to SonarQube/SonarCloud...</a>"); boundDetails.setText(""); } if (projectBinding.isPresent() && !SonarLintCorePlugin.getServersManager().resolveBinding(getProject()).isPresent()) { addServerLink.setText("<a>Re-create SonarQube/SonarCloud connection '" + projectBinding.get().connectionId() + "'</a>"); addServerLink.setVisible(true); } else { addServerLink.setVisible(false); } container.layout(true, true); }
Source:
PageFileFooterReader( FSDataInputStream inputStream, long fileSize) throws IOException { requireNonNull(inputStream, "inputStream is null"); if (fileSize >= SIZE_OF_LONG) { inputStream.readFully(fileSize - SIZE_OF_LONG, readBuffer.array()); long footerStart = readBuffer.order(LITTLE_ENDIAN).getLong(0); long footerSize = fileSize - footerStart; stripeOffsets = new long[toIntExact(footerSize / SIZE_OF_LONG)]; for (int i = 0; i < stripeOffsets.length; i++) { inputStream.readFully(footerStart + SIZE_OF_LONG * i, readBuffer.array()); stripeOffsets[i] = readBuffer.order(LITTLE_ENDIAN).getLong(0); } } }

Target:
public PageFileFooterReader( FSDataInputStream inputStream, long fileSize) throws IOException { checkArgument(fileSize >= FOOTER_LENGTH_IN_BYTES, "Malformed PageFile format, footer length is missing."); requireNonNull(inputStream, "inputStream is null"); ImmutableList.Builder<Long> stripeOffsetsBuilder = ImmutableList.builder(); byte[] buffer = new byte[toIntExact(min(fileSize, ESTIMATED_FOOTER_SIZE))]; inputStream.readFully(fileSize - buffer.length, buffer); int footerSize = Slices.wrappedBuffer(buffer, buffer.length - FOOTER_LENGTH_IN_BYTES, FOOTER_LENGTH_IN_BYTES).getInt(0); footerOffset = fileSize - footerSize; if (footerOffset < 0) { throw new IOException("Malformed PageFile format, incorrect footer length."); } else if (footerOffset > 0) { if (footerSize > buffer.length) { buffer = new byte[footerSize]; inputStream.readFully(footerOffset, buffer); } SliceInput sliceInput = Slices.wrappedBuffer(buffer, buffer.length - footerSize, footerSize - FOOTER_LENGTH_IN_BYTES).getInput(); while (sliceInput.isReadable()) { stripeOffsetsBuilder.add(sliceInput.readLong()); } } else { } stripeOffsets = stripeOffsetsBuilder.build(); }
Source:
protected void checkGetPreconditions(TableReference tableRef) { markTableAsInvolvedInThisTransaction(tableRef); if (transactionReadTimeoutMillis != null && System.currentTimeMillis() - timeCreated > transactionReadTimeoutMillis) { throw new TransactionFailedRetriableException("Transaction timed out."); } Preconditions.checkArgument(allowHiddenTableAccess || !AtlasDbConstants.hiddenTables.contains(tableRef)); ensureUncommitted(); }

Target:
protected void checkGetPreconditions(TableReference tableRef) { markTableAsInvolvedInThisTransaction(tableRef); if (transactionReadTimeoutMillis != null && System.currentTimeMillis() - timeCreated > transactionReadTimeoutMillis) { throw new TransactionFailedRetriableException("Transaction timed out."); } Preconditions.checkArgument(allowHiddenTableAccess || !AtlasDbConstants.hiddenTables.contains(tableRef)); if (!(state.get() == State.UNCOMMITTED || state.get() == State.COMMITTING)) { throw new CommittedTransactionException(); } }
Source:
public static Boolean isNonEmpty(byte bytes) { Boolean cond = bytes != null && bytes.length > 0; assertTrue("bytes are non empty", cond); return cond; }

Target:
public static Boolean isNonEmpty(byte[] bytes) { Boolean cond = !NumberUtils.isEmpty(bytes); assertTrue("bytes are non empty", cond); return cond; }
Source:
public void shouldHtmlEncodeXmlDirectives() { String html = "<html><head></head><body><table>" + "<tr><td>&lt;!==&gt;&lt;!==&gt;Hmailserver service shutdown:</td><td>&lt;!==&gt;&lt;!==&gt;Ok</td></tr>" + "</table></body></html>"; assertEquals("<html><head></head><body><table><tbody>" + "<tr><td>&lt;!==&gt;&lt;!==&gt;Hmailserver service shutdown:</td><td>&lt;!==&gt;&lt;!==&gt;Ok</td></tr>" + "</tbody></table></body></html>", htmlSanitizer.sanitize(html)); }

Target:
public void shouldHtmlEncodeXmlDirectives() { String html = "<html><head></head><body><table>" + "<tr><td><!==><!==>Hmailserver service shutdown:</td><td><!==><!==>Ok</td></tr>" + "</table></body></html>"; String result = htmlSanitizer.sanitize(html); assertEquals("<html><head></head><body><table><tbody>" + "<tr><td>&lt;!==&gt;&lt;!==&gt;Hmailserver service shutdown:</td><td>&lt;!==&gt;&lt;!==&gt;Ok</td></tr>" + "</tbody></table></body></html>", result); }
Source:
public String getBasePositionName() { final Asterism a = _targetEnv.getAsterism(); if (a instanceof GhostAsterism) { if (a instanceof GhostAsterism.DualTarget || ((GhostAsterism)a).base().isDefined()) { return SPCoordinates.Name(); } } return _targetEnv.getPrimaryTargetFromAsterism().getName(); }

Target:
public String getBasePositionName() { return _targetEnv.getSlewPositionObjectFromAsterism().getName(); }
Source:
public ErrorMessage convert(DBObject source) { Map<String, Object> headers = MongoDbMessageStore.this.converter.normalizeHeaders((Map<String, Object>) source.get("headers")); Object payload = this.deserializingConverter.convert((byte[]) source.get("payload")); ErrorMessage message = new ErrorMessage((Throwable) payload, headers); Map<String, Object> innerMap = (Map<String, Object>) new DirectFieldAccessor(message.getHeaders()).getPropertyValue("headers"); innerMap.put(MessageHeaders.ID, headers.get(MessageHeaders.ID)); innerMap.put(MessageHeaders.TIMESTAMP, headers.get(MessageHeaders.TIMESTAMP)); return message; }

Target:
public ErrorMessage convert(DBObject source) { @SuppressWarnings("unchecked") Map<String, Object> headers = MongoDbMessageStore.this.converter.normalizeHeaders((Map<String, Object>) source.get("headers")); Object payload = this.deserializingConverter.convert((byte[]) source.get("payload")); ErrorMessage message = new ErrorMessage((Throwable) payload, headers); enhanceHeaders(message.getHeaders(), headers); return message; }
Source:
private void createSortable(AnnotationNode annotation, ClassNode classNode) { List<String> includes = getMemberStringList(annotation, "includes"); List<String> excludes = getMemberStringList(annotation, "excludes"); boolean reversed = getMemberBoolValue(annotation, "reversed"); if (!checkIncludeExcludeUndefinedAware(annotation, excludes, includes, MY_TYPE_NAME)) return; if (!checkPropertyList(classNode, includes, "includes", annotation, MY_TYPE_NAME, false)) return; if (!checkPropertyList(classNode, excludes, "excludes", annotation, MY_TYPE_NAME, false)) return; if (classNode.isInterface()) { addError(MY_TYPE_NAME + " cannot be applied to interface " + classNode.getName(), annotation); } List<PropertyNode> properties = findProperties(annotation, classNode, includes, excludes); implementComparable(classNode); classNode.addMethod(new MethodNode( "compareTo", ACC_PUBLIC, ClassHelper.int_TYPE, params(param(newClass(classNode), OTHER)), ClassNode.EMPTY_ARRAY, createCompareToMethodBody(properties, reversed) )); for (PropertyNode property : properties) { createComparatorFor(classNode, property, reversed); } new VariableScopeVisitor(sourceUnit, true).visitClass(classNode); }

Target:
private void createSortable(AnnotationNode annotation, ClassNode classNode) { List<String> includes = getMemberStringList(annotation, "includes"); List<String> excludes = getMemberStringList(annotation, "excludes"); boolean reversed = memberHasValue(annotation, "reversed", true); if (!checkIncludeExcludeUndefinedAware(annotation, excludes, includes, MY_TYPE_NAME)) return; if (!checkPropertyList(classNode, includes, "includes", annotation, MY_TYPE_NAME, false)) return; if (!checkPropertyList(classNode, excludes, "excludes", annotation, MY_TYPE_NAME, false)) return; if (classNode.isInterface()) { addError(MY_TYPE_NAME + " cannot be applied to interface " + classNode.getName(), annotation); } List<PropertyNode> properties = findProperties(annotation, classNode, includes, excludes); implementComparable(classNode); classNode.addMethod(new MethodNode( "compareTo", ACC_PUBLIC, ClassHelper.int_TYPE, params(param(newClass(classNode), OTHER)), ClassNode.EMPTY_ARRAY, createCompareToMethodBody(properties, reversed) )); for (PropertyNode property : properties) { createComparatorFor(classNode, property, reversed); } new VariableScopeVisitor(sourceUnit, true).visitClass(classNode); }
Source:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (!((item instanceof SwitchItem) || (item instanceof ContactItem))) { logger.error("Item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "' while only 'Switch' or 'Contact' types are allowed"); throw new BindingConfigParseException("Item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "' while only 'Switch' or 'Contact' types are allowed"); } }

Target:
public void validateItemType(Item item, String bindingConfig) throws BindingConfigParseException { if (!((item instanceof SwitchItem) || (item instanceof ContactItem))) { String message = "Item '" + item.getName() + "' is of type '" + item.getClass().getSimpleName() + "' "; message = message + "while only 'Switch' or 'Contact' types are allowed"; logger.error("{}", message); throw new BindingConfigParseException(message); } }
Source:
private void newImport(List fileHierarchy, String value, Int2 valuePos, int num) throws TemplateSyntaxException { boolean isMetamodelImport = parseMetamodelImport(value, valuePos, num); if (scriptContext == null || scriptContext.getMaxLevel() == -1 || fileHierarchy.size() < scriptContext.getMaxLevel()) { if (!isMetamodelImport) { if (file != null) { boolean service = false; boolean specificExists = false; try { addImportForJavaService(file, value); service = true; } catch (final JavaServiceNotFoundException e) { } if (!service) { final String[] specificExtensions = getSpecificImportExtensions(); for (String specificExtension : specificExtensions) { final File specificFile = resolveScriptFile(file, value, specificExtension); if (specificFile != null && specificFile.exists()) { IScript genSpecific = this; do { if (genSpecific.getFile() != null && genSpecific.getFile().equals(specificFile)) { throw new TemplateSyntaxException(AcceleoGenMessages.getString("TemplateSyntaxError.RecursiveImport"), this, valuePos); } genSpecific = genSpecific.getSpecific(); } while (genSpecific != null); try { if (!tryOptimizedImport(fileHierarchy, specificFile)) { final SpecificScript newImport = createSpecificImport(specificFile); newImport.setInitProfiling(initProfiling); newImport.reset(new ArrayList(fileHierarchy)); newImport.setSpecific(this); addImport(newImport); } } catch (final TemplateSyntaxExceptions e) { String message = AcceleoGenMessages.getString("SpecificScript.ErroneousTemplate"); if (e.getProblems().size() == 1) { message += " : " + ((TemplateSyntaxException) e.getProblems().get(0)).getMessage(); } throw new TemplateSyntaxException(message, this, valuePos); } specificExists = true; } } } if (!service && !specificExists) { throw new TemplateSyntaxException(AcceleoGenMessages.getString("TemplateSyntaxError.UnresolvedImport", new Object[] { value, }), this, valuePos); } } } } }

Target:
protected void newImport(List fileHierarchy, String value, Int2 valuePos, int num) throws TemplateSyntaxException { boolean isMetamodelImport = parseMetamodelImport(value, valuePos, num); if (scriptContext == null || scriptContext.getMaxLevel() == -1 || fileHierarchy.size() < scriptContext.getMaxLevel()) { if (!isMetamodelImport) { if (file != null) { boolean service = false; boolean specificExists = false; if (useSpecificImportsFirst()) { specificExists = newImportFromSpecificImports(fileHierarchy, value, valuePos, num); service = newImportFromJavaServices(value); } else { service = newImportFromJavaServices(value); if (!service) { specificExists = newImportFromSpecificImports(fileHierarchy, value, valuePos, num); } } if (!service && !specificExists) { throw new TemplateSyntaxException(AcceleoGenMessages.getString("TemplateSyntaxError.UnresolvedImport", new Object[] { value, }), this, valuePos); } } } } }
Source:
public static IndexedTypesSet fromClasses(Class<?>... classes) { if ( classes == null || classes.length == 0 ) { return empty(); } else if ( classes.length == 1 ) { return fromClass( classes[0] ); } else { HashSet<IndexedTypeIdentifier> set = new HashSet<>(); for ( Class<?> c : classes ) { set.add( new PojoIndexedTypeIdentifier( c ) ); } return new HashSetIndexedTypesSet( set ); } }

Target:
public static IndexedTypeSet fromClasses(Class<?>... classes) { if ( classes == null || classes.length == 0 ) { return empty(); } else if ( classes.length == 1 ) { return fromClass( classes[0] ); } else { return Arrays.stream( classes ).map( PojoIndexedTypeIdentifier::new ).collect( streamCollector() ); } }
Source:
protected void checkPathLegal(Path targetPath) { if (!context.entityClass.getSimpleName().equals(targetPath.getSegment().getElementType().getSimpleName())) { throw new IllegalArgumentException("Current position in the inventory traversal expects entities of type " + context.entityClass.getSimpleName() + " which is incompatible with the provided path: " + targetPath); } }

Target:
protected void checkPathLegal(Path targetPath) { if (!Entity.segmentTypeFromType(context.entityClass).equals(targetPath.getSegment().getElementType())) { throw new IllegalArgumentException("Current position in the inventory traversal expects entities of type " + context.entityClass.getSimpleName() + " which is incompatible with the provided path: " + targetPath); } }
Source:
public Concrete.Expression visitApplyHole(Concrete.ApplyHoleExpression expr, Void params) { myErrorReporter.report(new GeneralError(GeneralError.Level.ERROR, "`__` not allowed here")); return super.visitApplyHole(expr, params); }

Target:
public Concrete.Expression visitApplyHole(Concrete.ApplyHoleExpression expr, Void params) { return expr; }
Source:
public RESTHttpServerController(OMElement element) { super(element); packageName = SynapseTestUtils.getParameter(element, SampleConfigConstants.TAG_BE_SERVER_CONF_REST_PACKAGE_NAME, null); port = Integer.parseInt(SynapseTestUtils.getParameter(element, SampleConfigConstants.TAG_BE_SERVER_CONF_REST_HTTP_PORT, "9000")); ResourceConfig rc = new ResourceConfig().packages(packageName); try { webServer = GrizzlyHttpServerFactory.createHttpServer(getBaseURI(port), rc, false); } catch (Exception e) { log.error(e); } }

Target:
public RESTHttpServerController(OMElement element) { super(element); packageName = SynapseTestUtils.getParameter(element, SampleConfigConstants.TAG_BE_SERVER_CONF_REST_PACKAGE_NAME, null); port = Integer.parseInt(SynapseTestUtils.getParameter(element, SampleConfigConstants.TAG_BE_SERVER_CONF_REST_HTTP_PORT, DEFAULT_PORT)); ResourceConfig rc = new ResourceConfig().packages(packageName); try { webServer = GrizzlyHttpServerFactory.createHttpServer(getBaseURI(port), rc, false); } catch (Exception e) { log.error(e); } }