auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static <T extends Model> List<T> processCursor(Class<? extends Model> type, Cursor cursor) { final List<T> entities = new ArrayList<T>(); try { Constructor<?> entityConstructor = type.getConstructor(); if (cursor.moveToFirst()) { do { Model entity = Cache.getEntity(type, cursor.getLong(cursor.getColumnIndex("Id"))); if (entity == null) { entity = (T) entityConstructor.newInstance(); } entity.loadFromCursor(cursor); entities.add((T) entity); } while (cursor.moveToNext()); } } catch (NoSuchMethodException e) { throw new NoDefaultConstructorOnModelException(type.getName()); } catch (Exception e) { Log.e("Failed to process cursor.", e); } return entities; }

Target:
public static <T extends Model> List<T> processCursor(Class<? extends Model> type, Cursor cursor) { final List<T> entities = new ArrayList<T>(); try { Constructor<?> entityConstructor = type.getConstructor(); if (cursor.moveToFirst()) { do { Model entity = Cache.getEntity(type, cursor.getLong(cursor.getColumnIndex("Id"))); if (entity == null) { entity = (T) entityConstructor.newInstance(); } entity.loadFromCursor(cursor); entities.add((T) entity); } while (cursor.moveToNext()); } } catch (NoSuchMethodException e) { throw new RuntimeException( "Your model " + type.getName() + " does not define a default " + "constructor. The default constructor is required for " + "now in ActiveAndroid models, as the process to " + "populate the ORM model is : " + "1. instantiate default model " + "2. populate fields" ); } catch (Exception e) { Log.e("Failed to process cursor.", e); } return entities; }
Source:
public static void main(String[] args) { if (args.length < 1) { System.out.println("Please specify your access key."); return; } final MessageBirdService wsr = new MessageBirdServiceImpl(args[0], "<LINK_0>"); final MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); PurchasedNumbersFilter filter = new PurchasedNumbersFilter(); filter.addFeature(PhoneNumberFeature.SMS); filter.setType(PhoneNumberType.MOBILE); filter.setLimit(25); try { System.out.println(messageBirdClient.listPurchasedNumbers(filter)); return; } catch (UnauthorizedException | NotFoundException | GeneralException exception) { if (exception.getErrors() != null) { System.out.println(exception.getErrors().toString()); } exception.printStackTrace(); } }

Target:
public static void main(String[] args) { if (args.length < 1) { System.out.println("Please specify your access key."); return; } final MessageBirdService wsr = new MessageBirdServiceImpl(args[0]); final MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); PurchasedNumbersFilter filter = new PurchasedNumbersFilter(); filter.setLimit(25); try { System.out.println(messageBirdClient.listPurchasedNumbers(filter)); } catch (UnauthorizedException | NotFoundException | GeneralException exception) { if (exception.getErrors() != null) { System.out.println(exception.getErrors().toString()); } exception.printStackTrace(); } }
Source:
public void traverse(String ... paths) throws IOException { BufferedWriter writer = null; final AtomicInteger count = new AtomicInteger(); boolean threw = true; System.out.println("Starting dump of blob references by traversing"); Stopwatch watch = createStarted(); try { writer = Files.newWriter(references, Charsets.UTF_8); if (paths.length == 0) { traverseChildren(nodeStore.getRoot(), PATH_DELIM, writer, count); } else { for (String path: paths ) { String[] nodeList = path.split(PATH_DELIM); NodeState state = nodeStore.getRoot(); for (String node: nodeList) { if (node.isEmpty()) continue; state = state.getChildNode(node); } traverseChildren(state, path, writer, count); } } writer.flush(); sort(references, idComparator); System.out.println(count.get() + " blob references found"); System.out.println("Finished in " + watch.elapsed(TimeUnit.SECONDS) + " seconds"); threw = false; } finally { Closeables.close(writer, threw); } }

Target:
public void traverse(String ... paths) throws IOException { BufferedWriter writer = null; final AtomicInteger count = new AtomicInteger(); boolean threw = true; System.out.println("Starting dump of blob references by traversing"); Stopwatch watch = createStarted(); try { writer = Files.newWriter(references, Charsets.UTF_8); if (paths.length == 0) { traverseChildren(nodeStore.getRoot(), "/", writer, count); } else { for (String path: paths ) { Iterable<String> nodeList = PathUtils.elements(path); NodeState state = nodeStore.getRoot(); for (String node: nodeList) { state = state.getChildNode(node); } traverseChildren(state, path, writer, count); } } writer.flush(); sort(references, idComparator); System.out.println(count.get() + " blob references found"); System.out.println("Finished in " + watch.elapsed(TimeUnit.SECONDS) + " seconds"); threw = false; } finally { Closeables.close(writer, threw); } }
Source:
private Void deleteOldSegments() { removeTaskFuture(m_pbd.getNonce()); try { while (m_pbd.isCursorOpen(CURSOR_NAME) && m_reader.skipToNextSegmentIfOlder(m_retainMillis)); } catch(IOException e) { m_pbd.getUsageSpecificLog().warn("Unexpected error trying to check for PBD segments to be deleted", e); return null; } if (m_pbd.isCursorOpen(CURSOR_NAME) && !m_reader.isCurrentSegmentActive()) { long recordTime = m_reader.getSegmentLastRecordTimestamp(); if (recordTime == 0) { m_pbd.getUsageSpecificLog().rateLimitedLog(60, Level.WARN, null, "Could not get last record time for segment in PBD %s. This may prevent enforcing time-based retention", m_pbd.getNonce()); return null; } long timerDelay = m_retainMillis - (System.currentTimeMillis() - recordTime); try { if (m_pbd.getUsageSpecificLog().isDebugEnabled()) { m_pbd.getUsageSpecificLog().rateLimitedLog(60, Level.DEBUG, null, "Scheduling time-based retention for %s in %d milliseconds", m_pbd.getNonce(), Math.max(timerDelay, MIN_DELAY)); } scheduleTaskFor(m_pbd.getNonce(), ()->deleteOldSegments(), Math.max(timerDelay, MIN_DELAY)); } catch(RejectedExecutionException e) { } } return null; }

Target:
private void deleteOldSegments() { try { removeTaskFuture(m_pbd.getNonce()); try { while (m_pbd.isCursorOpen(CURSOR_NAME) && m_reader.skipToNextSegmentIfOlder(m_retainMillis)); } catch(IOException e) { m_pbd.getUsageSpecificLog().warn("Unexpected error trying to check for PBD segments to be deleted", e); return; } if (m_pbd.isCursorOpen(CURSOR_NAME) && !m_reader.isCurrentSegmentActive()) { long recordTime = m_reader.getSegmentLastRecordTimestamp(); if (recordTime == 0) { m_pbd.getUsageSpecificLog().rateLimitedLog(60, Level.WARN, null, "Could not get last record time for segment in PBD %s. This may prevent enforcing time-based retention", m_pbd.getNonce()); return; } long timerDelay = m_retainMillis - (System.currentTimeMillis() - recordTime); try { if (m_pbd.getUsageSpecificLog().isDebugEnabled()) { m_pbd.getUsageSpecificLog().rateLimitedLog(60, Level.DEBUG, null, "Scheduling time-based retention for %s in %d milliseconds", m_pbd.getNonce(), Math.max(timerDelay, MIN_DELAY)); } scheduleTaskFor(m_pbd.getNonce(), this::deleteOldSegments, Math.max(timerDelay, MIN_DELAY)); } catch(RejectedExecutionException e) { } } } catch(Exception e) { m_pbd.getUsageSpecificLog().error("Unexpected error running deleteOldSegements for pbd " + m_pbd.getNonce(), e); } }
Source:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { CompletableFuture<Exception> eFuture = new CompletableFuture<>(); eFuture.thenAccept(e -> showError(user.getBase(), e, commandLabel)); switch (args.length) { case 0: throw new NotEnoughArgumentsException(); case 1: final User player = getPlayer(server, user, args, 0); if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) { throw new Exception(tl("noPerm", "essentials.worlds." + player.getWorld().getName())); } user.getAsyncTeleport().now(player.getBase(), false, TeleportCause.COMMAND, eFuture, new CompletableFuture<>()); break; default: if (!user.isAuthorized("essentials.tp.others")) { throw new Exception(tl("noPerm", "essentials.tp.others")); } final User target = getPlayer(server, user, args, 0); final User toPlayer = getPlayer(server, user, args, 1); if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + toPlayer.getWorld().getName())) { throw new Exception(tl("noPerm", "essentials.worlds." + toPlayer.getWorld().getName())); } CompletableFuture<Boolean> future = new CompletableFuture<>(); future.thenAccept(success -> { if (success) { target.sendMessage(tl("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); } }); target.getAsyncTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND, eFuture, future); break; } }

Target:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { switch (args.length) { case 0: throw new NotEnoughArgumentsException(); case 1: final User player = getPlayer(server, user, args, 0); if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + player.getWorld().getName())) { throw new Exception(tl("noPerm", "essentials.worlds." + player.getWorld().getName())); } user.getAsyncTeleport().now(player.getBase(), false, TeleportCause.COMMAND, getNewExceptionFuture(user.getSource(), commandLabel)); break; default: if (!user.isAuthorized("essentials.tp.others")) { throw new Exception(tl("noPerm", "essentials.tp.others")); } final User target = getPlayer(server, user, args, 0); final User toPlayer = getPlayer(server, user, args, 1); if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.worlds." + toPlayer.getWorld().getName())) { throw new Exception(tl("noPerm", "essentials.worlds." + toPlayer.getWorld().getName())); } CompletableFuture<Boolean> future = getNewExceptionFuture(user.getSource(), commandLabel); target.getAsyncTeleport().now(toPlayer.getBase(), false, TeleportCause.COMMAND, future); future.thenAccept(success -> { if (success) { target.sendMessage(tl("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName())); } }); break; } }
Source:
private void checkFragmentConstraints(ResolverBundle bundle) { ResolverBundle[] fragments = bundle.getFragments(); for (ResolverBundle fragment1 : fragments) { BundleDescription fragment = fragment1.getBundleDescription(); if (bundle.constraintsConflict(fragment, fragment.getImportPackages(), fragment.getRequiredBundles(), fragment.getGenericRequires()) && !developmentMode) { bundle.detachFragment(fragment1, null); } } }

Target:
private void checkFragmentConstraints(ResolverBundle bundle) { ResolverBundle[] fragments = bundle.getFragments(); for (ResolverBundle resolverFragment : fragments) { BundleDescription fragment = resolverFragment.getBundleDescription(); if (bundle.constraintsConflict(fragment, fragment.getImportPackages(), fragment.getRequiredBundles(), fragment.getGenericRequires()) && !developmentMode) { bundle.detachFragment(resolverFragment, null); } } }
Source:
public BlobHolder convertToMimeType(String destinationMimeType, BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionException { String srcMt = blobHolder.getBlob().getMimeType(); String converterName = translationHelper.getConverterName(srcMt, destinationMimeType); if (converterName == null) { return convertThroughHTML(blobHolder, destinationMimeType); } else { return convert(converterName, blobHolder, parameters); } }

Target:
public BlobHolder convertToMimeType(String destinationMimeType, BlobHolder blobHolder, Map<String, Serializable> parameters) throws ConversionException { String srcMimeType = blobHolder.getBlob().getMimeType(); String converterName = translationHelper.getConverterName(srcMimeType, destinationMimeType); if (converterName == null) { return convertThroughHTML(blobHolder, destinationMimeType); } else { return convert(converterName, blobHolder, parameters); } }
Source:
public boolean updateNoSqlConnection(Connection connection) throws Exception{ if (isNoSQLConnection(connection)) { NoSQLConnection noSqlConn = (NoSQLConnection)connection; String pass = noSqlConn.getAttributes().get(ICassandraAttributies.PASSWORD); if(pass != null) { pass = PasswordMigrationUtil.encryptPasswordIfNeeded(pass); noSqlConn.getAttributes().put(ICassandraAttributies.PASSWORD, noSqlConn.getValue(pass, true)); return true; } } return false; }

Target:
public boolean updateNoSqlConnection(Connection connection) throws Exception{ if (isNoSQLConnection(connection)) { NoSQLConnection noSqlConn = (NoSQLConnection)connection; String pass = noSqlConn.getAttributes().get(IMongoDBAttributes.PASSWORD); if(pass != null) { pass = PasswordMigrationUtil.encryptPasswordIfNeeded(pass); noSqlConn.getAttributes().put(IMongoDBAttributes.PASSWORD, noSqlConn.getValue(pass, true)); return true; } } return false; }
Source:
private static void writeConvertTable(Repository repo, ReftableWriter w, boolean writeLogs) throws IOException { int size = 0; List<Ref> refs = repo.getRefDatabase().getRefs(); if (writeLogs) { for (Ref r : refs) { ReflogReader rlr = repo.getReflogReader(r.getName()); size = Math.max(rlr.getReverseEntries().size(), size); } } w.setMinUpdateIndex(1).setMaxUpdateIndex(size + 1).begin(); try (RevWalk rw = new RevWalk(repo)) { List<Ref> toWrite = new ArrayList<>(refs.size()); for (Ref r : refs) { toWrite.add(refForWrite(rw, r)); } w.sortAndWriteRefs(toWrite); } if (writeLogs) { for (Ref r : refs) { long idx = size; ReflogReader reader = repo.getReflogReader(r.getName()); for (ReflogEntry e : reader.getReverseEntries()) { w.writeLog(r.getName(), idx, e.getWho(), e.getOldId(), e.getNewId(), e.getComment()); idx--; } } } }

Target:
private static void writeConvertTable(Repository repo, ReftableWriter w, boolean writeLogs) throws IOException { int size = 0; List<Ref> refs = repo.getRefDatabase().getRefs(); if (writeLogs) { for (Ref r : refs) { ReflogReader rlr = repo.getReflogReader(r.getName()); size = Math.max( rlr == null ? 0 : rlr.getReverseEntries().size(), size); } } w.setMinUpdateIndex(1).setMaxUpdateIndex(size + 1).begin(); try (RevWalk rw = new RevWalk(repo)) { List<Ref> toWrite = new ArrayList<>(refs.size()); for (Ref r : refs) { toWrite.add(refForWrite(rw, r)); } w.sortAndWriteRefs(toWrite); } if (writeLogs) { for (Ref r : refs) { long idx = size; ReflogReader reader = repo.getReflogReader(r.getName()); if (reader == null) { continue; } for (ReflogEntry e : reader.getReverseEntries()) { w.writeLog(r.getName(), idx, e.getWho(), e.getOldId(), e.getNewId(), e.getComment()); idx--; } } } }
Source:
public void showAsyncDialogFragment(AsyncDialogFragment newFragment) { showAsyncDialogFragment(newFragment, DEFAULT_NOTIFICATION_CHANNEL_ID); }

Target:
public void showAsyncDialogFragment(AsyncDialogFragment newFragment) { showAsyncDialogFragment(newFragment, NotificationChannels.Channel.GENERAL); }
Source:
public Optional<EnumParticleTypes> getVanillaParticleType() { return Optional.of(EnumParticleTypes.valueOf(name)); }

Target:
public Optional<EnumParticleTypes> getVanillaParticleType() { try { return Optional.of(EnumParticleTypes.valueOf(name)); } catch (IllegalArgumentException e) { } return Optional.absent(); }
Source:
public long size() { if (name.startsWith(CLASSPATH_PREFIX)) { try { String fileName = name.substring(CLASSPATH_PREFIX.length()); if (!fileName.startsWith("/")) { fileName = "/" + fileName; } URL resource = this.getClass().getResource(fileName); if (resource != null) { return Files.size(Paths.get(this.getClass().getResource(fileName).toURI())); } else { return 0; } } catch (Exception e) { return 0; } } return new File(name).length(); }

Target:
public long size() { if (name.startsWith(CLASSPATH_PREFIX)) { try { String fileName = name.substring(CLASSPATH_PREFIX.length()); if (!fileName.startsWith("/")) { fileName = "/" + fileName; } URL resource = this.getClass().getResource(fileName); if (resource != null) { return Files.size(Paths.get(resource.toURI())); } else { return 0; } } catch (Exception e) { return 0; } } return new File(name).length(); }
Source:
public void testEndOfFreeBlockIsUsedIfThePreviousBlockIsLargerThanTheNextBlock() throws Exception { long prevChunk = mallocChunks(4); long middleChunk = mallocChunks(4); long nextChunk = mallocChunks(2); free(middleChunk); long smallChunk1 = mallocChunks(1); long smallChunk2 = mallocChunks(1); assertTrue("The small chunks should have been allocated from the end of the free block", smallChunk1 > smallChunk2); assertTrue("The small chunks should have been allocated from space before 'nextChunk'", smallChunk1 < nextChunk); assertTrue("The small chunks should have been allocated from space after 'prevChunk'", smallChunk2 > prevChunk); }

Target:
public void testEndOfFreeBlockIsUsedIfThePreviousBlockIsLargerThanTheNextBlock() throws Exception { long prevChunk = mallocChunks(4); long middleChunk = mallocChunks(4); long nextChunk = mallocChunks(2); free(middleChunk); long smallChunk1 = mallocChunks(1); long smallChunk2 = mallocChunks(1); assertTrue("The small chunks should have been allocated from space after 'prevChunk'", prevChunk < smallChunk2); assertTrue("The small chunks should have been allocated from the end of the free block", smallChunk2 < smallChunk1); assertTrue("The small chunks should have been allocated from space before 'nextChunk'", smallChunk1 < nextChunk); }
Source:
public @Nullable LttngInterruptContext peekContextStack(String hostId, Integer cpu) { Stack<LttngInterruptContext> stack = fIntCtxStacks.get(hostId, cpu); if (stack == null) { return null; } if (stack.empty()) { return null; } return stack.peek(); }

Target:
public LttngInterruptContext peekContextStack(String hostId, Integer cpu) { Stack<LttngInterruptContext> stack = fIntCtxStacks.get(hostId, cpu); if (stack == null) { return LttngInterruptContext.DEFAULT_CONTEXT; } if (stack.empty()) { return LttngInterruptContext.DEFAULT_CONTEXT; } LttngInterruptContext peek = stack.peek(); if (peek == null) { peek = LttngInterruptContext.DEFAULT_CONTEXT; } return peek; }
Source:
public AllNodes getAllNodes() { return new AllNodes( ImmutableSet.of( new InternalNode("spark1", URI.create("<LINK_1>"), NodeVersion.UNKNOWN, false), new InternalNode("spark2", URI.create("<LINK_3>"), NodeVersion.UNKNOWN, false), new InternalNode("spark3", URI.create("<LINK_0>"), NodeVersion.UNKNOWN, false), new InternalNode("spark4", URI.create("<LINK_2>"), NodeVersion.UNKNOWN, false)), ImmutableSet.of(), ImmutableSet.of(), ImmutableSet.of()); }

Target:
public AllNodes getAllNodes() { return ALL_NODES; }
Source:
public void predicate_fromJsonString() { IndexSearchTarget searchTarget = indexManager.createSearchTarget().build(); SearchQuery<DocumentReference> query = searchTarget.query( sessionContext ) .asReferences() .predicate().bool( b -> { b.should().extension().ifSupported( LuceneExtension.get(), c -> c.fromLuceneQuery( new TermQuery( new Term( "string", "text 1" ) ) ) ); b.should().extension( LuceneExtension.get() ) .fromLuceneQuery( IntPoint.newExactQuery( "integer", 2 ) ); b.should().extension() .ifSupported( LuceneExtension.get(), c -> c.fromLuceneQuery( LatLonPoint.newDistanceQuery( "geoPoint", 40, -70, 200_000 ) ) ) .orElseFail(); } ) .build(); assertThat( query ) .hasReferencesHitsAnyOrder( INDEX_NAME, FIRST_ID, SECOND_ID, THIRD_ID ) .hasHitCount( 3 ); }

Target:
public void predicate_fromJsonString() { IndexSearchTarget searchTarget = indexManager.createSearchTarget().build(); SearchQuery<DocumentReference> query = searchTarget.query( sessionContext ) .asReferences() .predicate().bool( b -> { b.should().extension( LuceneExtension.get() ) .fromLuceneQuery( new TermQuery( new Term( "string", "text 1" ) ) ); b.should().extension( LuceneExtension.get() ) .fromLuceneQuery( IntPoint.newExactQuery( "integer", 2 ) ); b.should().extension( LuceneExtension.get() ) .fromLuceneQuery( LatLonPoint.newDistanceQuery( "geoPoint", 40, -70, 200_000 ) ); } ) .build(); assertThat( query ) .hasReferencesHitsAnyOrder( INDEX_NAME, FIRST_ID, SECOND_ID, THIRD_ID ) .hasHitCount( 3 ); }
Source:
private void initRecycler() { links.setLayoutManager(new LinearLayoutManager(getActivity())); links.setNestedScrollingEnabled(false); }

Target:
private void initRecycler() { links.setLayoutManager(new LinearLayoutManager(getContext())); links.setNestedScrollingEnabled(false); }
Source:
public void upgrade(ResourceUpgradeReport upgradeReport, ResourceUpgradeContext<ResourceComponent<?>> inventoriedResource) { ProcessInfo processInfo = inventoriedResource.getNativeProcess(); if (DiscoveryCallbackImpl.isRhqServer(processInfo)) { Configuration pluginConfiguration = upgradeReport.getNewPluginConfiguration(); if (pluginConfiguration == null) { pluginConfiguration = inventoriedResource.getPluginConfiguration(); } pluginConfiguration.setSimpleValue("supportsPatching", "false"); String resourceName = upgradeReport.getNewName(); if (resourceName == null) { resourceName = inventoriedResource.getName(); } if (!resourceName.endsWith(" RHQ Server")) { resourceName += " RHQ Server"; } upgradeReport.setNewName(resourceName); } }

Target:
public void upgrade(ResourceUpgradeReport upgradeReport, ResourceUpgradeContext<ResourceComponent<?>> inventoriedResource) { ProcessInfo processInfo = inventoriedResource.getNativeProcess(); if (DiscoveryCallbackImpl.isRhqServer(processInfo)) { Configuration pluginConfiguration = upgradeReport.getNewPluginConfiguration(); if (pluginConfiguration == null) { pluginConfiguration = inventoriedResource.getPluginConfiguration(); } String currentValue = pluginConfiguration.getSimpleValue("supportsPatching"); if (currentValue == null) { pluginConfiguration.setSimpleValue("supportsPatching", "false"); upgradeReport.setNewPluginConfiguration(pluginConfiguration); } String resourceName = upgradeReport.getNewName(); if (resourceName == null) { resourceName = inventoriedResource.getName(); } if (!resourceName.endsWith(" RHQ Server")) { resourceName += " RHQ Server"; upgradeReport.setNewName(resourceName); } } }
Source:
protected void update(final Map<String, Object> attributes) { final String id = (String) attributes.get(getIdAttribute()); logger.debug("Updating id: with attributes: {}", id, attributes); final Map<String,Object> profile = profiles.get(id); if (profile != null) { profile.putAll(attributes); } else { insert(attributes); } }

Target:
protected void update(final Map<String, Object> attributes) { final String id = (String) attributes.get(getIdAttribute()); logger.debug("Updating id: with attributes: {}", id, attributes); final Map<String,Object> profile = profiles.get(id); if (profile != null) { profile.putAll(attributes); } else { profiles.put(id, attributes); } }
Source:
private static boolean isVariableThatCanEscape(Symbol symb) { List<Usage> usages = symb.usages(); if (usages.size() > 2) { return usages.stream().anyMatch(u -> !u.isBindingUsage() && TreeUtils.firstAncestorOfKind(u.tree(), Tree.Kind.IS) == null); } else { return false; } }

Target:
private static boolean isVariableThatCanEscape(Symbol symb) { List<Usage> usages = symb.usages(); if (usages.size() > 2) { return usages.stream().anyMatch(u -> !u.isBindingUsage() && TreeUtils.firstAncestorOfKind(u.tree(), Tree.Kind.IS) == null); } return false; }
Source:
public static Listener buildListener(ListenerDefinition listenerDef, AsyncDispatcher<TelemetryMessage> dispatcher) throws Exception { final Class<?> clazz = Class.forName(listenerDef.getClassName()); final Constructor<?> ctor = clazz.getConstructor(); final Object listenerInstance = ctor.newInstance(); if (!(listenerInstance instanceof Listener)) { throw new IllegalArgumentException(String.format("%s must implement %s", listenerDef.getClassName(), Listener.class.getCanonicalName())); } final Listener listener = (Listener)listenerInstance; final BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(listener); wrapper.setPropertyValues(listenerDef.getParameterMap()); listener.setName(listenerDef.getName()); listener.setDispatcher(dispatcher); return listener; }

Target:
public static Listener buildListener(ListenerDefinition listenerDef, AsyncDispatcher<TelemetryMessage> dispatcher) throws Exception { final Object listenerInstance; try { final Class<?> clazz = Class.forName(listenerDef.getClassName()); final Constructor<?> ctor = clazz.getConstructor(); listenerInstance = ctor.newInstance(); } catch (Exception e) { throw new RuntimeException(String.format("Failed to instantiate listener with class name '%s'.", listenerDef.getClassName(), e)); } if (!(listenerInstance instanceof Listener)) { throw new IllegalArgumentException(String.format("%s must implement %s", listenerDef.getClassName(), Listener.class.getCanonicalName())); } final Listener listener = (Listener)listenerInstance; final BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(listener); wrapper.setPropertyValues(listenerDef.getParameterMap()); listener.setName(listenerDef.getName()); listener.setDispatcher(dispatcher); return listener; }
Source:
public boolean getChannelStatus(String channelIdentifier) { return false; }

Target:
public ChannelStatus getChannelStatus(String channelIdentifier) { return ChannelStatus.OFFLINE; }
Source:
public boolean apply(Throwable exception) { String message; try { message = "Unexpected exception during request; channel = " + channel; } catch (Exception ignore) { message = "Unexpected exception during request; channel = <unprintable>"; } boolean isIOException = exception instanceof IOException || (exception.getCause() instanceof IOException); if (!alwaysLogAtError && isIOException) { if (ioExceptionsAtDebugLevel.stream().anyMatch(ioExceptionAtDebugLevel -> exception.getMessage().contains(ioExceptionAtDebugLevel))) { logger.trace(message, exception); } else { logger.info(message, exception); } } else { logger.error(message, exception); } return true; }

Target:
public boolean apply(Throwable exception) { String message; try { message = "Unexpected exception during request; channel = " + channel; } catch (Exception ignore) { message = "Unexpected exception during request; channel = <unprintable>"; } boolean isIOException = exception instanceof IOException || (exception.getCause() instanceof IOException); if (!alwaysLogAtError && isIOException) { String errorMessage = exception.getMessage(); boolean logAtTrace = false; for (String ioException : ioExceptionsAtDebugLevel) { if (errorMessage.contains(ioException)) { logAtTrace = true; break; } } if (logAtTrace) { logger.trace(message, exception); } else { logger.info(message, exception); } } else { logger.error(message, exception); } return true; }
Source:
public HttpResponse execute(HttpRequestBase request, IOperationMonitor monitor) throws IOException { prepareRequest(request, monitor); return HttpUtil.execute(getHttpClient(), HttpUtil.createHost(request), context.get(), request, monitor); }

Target:
public HttpResponse execute(HttpRequestBase request, IOperationMonitor monitor) throws IOException { prepareRequest(request, monitor); return HttpUtil.execute(getHttpClient(), HttpUtil.createHost(request), getContext(), request, monitor); }
Source:
public synchronized String format(LogRecord record) { date.setTime(record.getMillis()); args[0] = date; args[1] = "[id=" + record.getThreadID() + "]"; args[2] = record.getLevel().getName(); args[3] = record.getSourceMethodName() != null ? abbreviateClassName( record.getSourceClassName() == null ? record.getLoggerName() : record.getSourceClassName(), 32) + "#" + record.getSourceMethodName() : abbreviateClassName( record.getSourceClassName() == null ? record.getLoggerName() : record.getSourceClassName(), 40); args[4] = formatMessage(record); StringBuffer buf = formatter.format(args, new StringBuffer(), null); if (record.getThrown() != null) { try { StringWriter writer = new StringWriter(); PrintWriter out = new PrintWriter(writer); record.getThrown().printStackTrace(out); out.close(); buf.append(writer.toString()); } catch (Error error) { throw error; } catch (Throwable e) { } } return buf.toString(); }

Target:
public synchronized String format(LogRecord record) { date.setTime(record.getMillis()); args[0] = date; args[1] = "[id=" + record.getThreadID() + "]"; args[2] = record.getLevel().getName(); args[3] = record.getSourceMethodName() != null ? abbreviateClassName( record.getSourceClassName() == null ? record.getLoggerName() : record.getSourceClassName(), 32) + "#" + record.getSourceMethodName() : abbreviateClassName( record.getSourceClassName() == null ? record.getLoggerName() : record.getSourceClassName(), 40); args[4] = formatMessage(record); StringBuffer buf = formatter.format(args, new StringBuffer(), null); if (record.getThrown() != null) { try { StringWriter writer = new StringWriter(); PrintWriter out = new PrintWriter(writer); record.getThrown().printStackTrace(out); out.close(); buf.append(writer.toString()); } catch (Exception e) { } } return buf.toString(); }
Source:
public DBReferenceInfo getDatabaseReferences() { ArrayList<String> dbEntries=new ArrayList<String>(); if (uniprotDoc == null) return null; try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ArrayList<Element> dbreferenceElementList = XMLHelper.selectElements(entryElement, "dbReference"); for (Element element : dbreferenceElementList) { String type = element.getAttribute("type"); String id = element.getAttribute("id"); ArrayList<Element> propertyElementList = XMLHelper.selectElements(element, "property"); for (Element propertyElement : propertyElementList) { String propertyType = propertyElement.getAttribute("type"); String propertyValue = propertyElement.getAttribute("value"); System.out.println("here comes a dbxref, with: type: "+type+", id: "+id+", propertyType: "+propertyType+", propertyValue: "+propertyValue); dbEntries.add(propertyType+":"+propertyValue); } } } catch (XPathExpressionException e) { logger.error("Problems while parsing db references in UniProt XML: {}. No db references will be available.",e.getMessage()); return null; } return new DBReferenceInfo(dbEntries.toArray(new String[dbEntries.size()])); }

Target:
public DBReferenceInfo getDatabaseReferences() { DBReferenceInfo dbRefI=null; if (uniprotDoc == null) return null; try { Element uniprotElement = uniprotDoc.getDocumentElement(); Element entryElement = XMLHelper.selectSingleElement(uniprotElement, "entry"); ArrayList<Element> dbreferenceElementList = XMLHelper.selectElements(entryElement, "dbReference"); for (Element element : dbreferenceElementList) { String type = element.getAttribute("type"); String id = element.getAttribute("id"); if(dbRefI==null) dbRefI = new DBReferenceInfo(type, id); else dbRefI.addDBReferenceInfo(type, id); } } catch (XPathExpressionException e) { logger.error("Problems while parsing db references in UniProt XML: {}. No db references will be available.",e.getMessage()); return null; } return dbRefI; }
Source:
private static void booted(final boolean result) { sBooted = true; sBootResult = result; sBooting = false; if (result) { Utils.d("BOOTED ++++++++++++"); } else { Utils.d("BOOT FAILED } Utils.runOnMain(new Runnable() { @Override public void run() { for (IOnResult<Boolean> callback : mBootCallbacks) { if (callback != null) { callback.onResult(result); } } mBootCallbacks.clear(); } }); }

Target:
private static void booted(final boolean result) { sBooted = true; sBootResult = result; sBooting = false; if (result) { Utils.d("Booted!"); } else { Utils.d("Boot failed..."); } Utils.runOnMain(new Runnable() { @Override public void run() { for (IOnResult<Boolean> callback : mBootCallbacks) { if (callback != null) { callback.onResult(result); } } mBootCallbacks.clear(); } }); }
Source:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain filterChain) throws IOException, ServletException { final HttpServletResponse httpResponse = (HttpServletResponse) response; try { filterChain.doFilter(request, response); } catch (final Throwable e) { final Throwable t = extractErrorToCompare(e); ErrorHolder currentMatch = null; for (final ErrorHolder errorHolder : this.errors) { if (errorHolder.exactMatch(t)) { currentMatch = errorHolder; break; } else if (errorHolder.inheritanceMatch(t)) { currentMatch = errorHolder; } } if (currentMatch != null) { httpResponse.sendRedirect(currentMatch.getUrl()); } else { httpResponse.sendRedirect(defaultErrorRedirectPage); } } }

Target:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain filterChain) throws IOException, ServletException { final HttpServletResponse httpResponse = (HttpServletResponse) response; try { filterChain.doFilter(request, response); } catch (final Exception e) { final Throwable t = extractErrorToCompare(e); ErrorHolder currentMatch = null; for (final ErrorHolder errorHolder : this.errors) { if (errorHolder.exactMatch(t)) { currentMatch = errorHolder; break; } else if (errorHolder.inheritanceMatch(t)) { currentMatch = errorHolder; } } if (currentMatch != null) { httpResponse.sendRedirect(currentMatch.getUrl()); } else { httpResponse.sendRedirect(defaultErrorRedirectPage); } } }
Source:
public void getImageBytes(ByteBuffer byteBuffer) { DataBuffer dataBuffer = image.getRaster().getDataBuffer(); byte[] pixelData = ((DataBufferByte) dataBuffer).getData(); byteBuffer.wrap(pixelData); }

Target:
public void getImageBytes(ByteBuffer byteBuffer) { try { byteBuffer.put(readNextFrame()); } catch (IOException e) { e.printStackTrace(); } }
Source:
public void testCheckLengthVersion_2() throws Exception { System.setProperty("VERSION","1.0.0-1.0.0"); assertThatExceptionOfType(Exception.class).isThrownBy(() -> runontag.checkParams(runontag.getParams("@runOnEnv(VERSION>1.0.0-1.0)"))) .withMessage("Error while parsing params. The versions must have the same numbers of elements"); }

Target:
public void testCheckLengthVersion_2() throws Exception { System.setProperty("VERSION","1.0.0-1.0.0"); assertThatExceptionOfType(Exception.class).isThrownBy(() -> runontag.checkParams(runontag.getParams("@runOnEnv(VERSION>1.0.0-1.0)"))) .withMessage("Error while parsing params. The versions must have the same number of elements"); }
Source:
public void testJobCanceledEventOnBoundaryEvent() throws Exception { Clock testClock = new DefaultClockImpl(); assertNotNull(testClock); processEngineConfiguration.setClock(testClock); testClock.setCurrentTime(new Date()); runtimeService.startProcessInstanceByKey("testTimerCancelledEvent"); listener.clearEventsReceived(); Task task = taskService.createTaskQuery().singleResult(); taskService.complete(task.getId()); checkEventCount(1, ActivitiEventType.JOB_CANCELED); }

Target:
public void testJobCanceledEventOnBoundaryEvent() throws Exception { Clock testClock = new DefaultClockImpl(); processEngineConfiguration.setClock(testClock); testClock.setCurrentTime(new Date()); runtimeService.startProcessInstanceByKey("testTimerCancelledEvent"); listener.clearEventsReceived(); Task task = taskService.createTaskQuery().singleResult(); assertNotNull(task); taskService.complete(task.getId()); checkEventCount(1, ActivitiEventType.JOB_CANCELED); }
Source:
protected void doStop() { if (this.hazelcastInstance.getLifecycleService().isRunning()) { if (this.monitorTypes.contains(ClusterMonitorType.MEMBERSHIP.name())) { this.hazelcastInstance.getCluster().removeMembershipListener( this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.MEMBERSHIP)); this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.MEMBERSHIP); } if (this.monitorTypes.contains(ClusterMonitorType.DISTRIBUTED_OBJECT.name())) { this.hazelcastInstance .removeDistributedObjectListener(this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.DISTRIBUTED_OBJECT)); this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.DISTRIBUTED_OBJECT); } if (this.monitorTypes.contains(ClusterMonitorType.MIGRATION.name())) { this.hazelcastInstance.getPartitionService().removeMigrationListener( this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.MIGRATION)); this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.MIGRATION); } if (this.monitorTypes.contains(ClusterMonitorType.LIFECYCLE.name())) { this.hazelcastInstance.getLifecycleService().removeLifecycleListener( this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.LIFECYCLE)); this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.LIFECYCLE); } if (this.monitorTypes.contains(ClusterMonitorType.CLIENT.name())) { this.hazelcastInstance.getClientService().removeClientListener( this.hazelcastRegisteredListenerIdMap .get(ClusterMonitorType.CLIENT)); this.hazelcastRegisteredListenerIdMap.remove(ClusterMonitorType.CLIENT); } } }

Target:
protected void doStop() { if (this.hazelcastInstance.getLifecycleService().isRunning()) { String id = this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.MEMBERSHIP); if (id != null) { this.hazelcastInstance.getCluster().removeMembershipListener(id); } id = this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.DISTRIBUTED_OBJECT); if (id != null) { this.hazelcastInstance.removeDistributedObjectListener(id); } id = this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.MIGRATION); if (id != null) { this.hazelcastInstance.getPartitionService().removeMigrationListener(id); } id = this.hazelcastRegisteredListenerIdMap .remove(ClusterMonitorType.LIFECYCLE); if (id != null) { this.hazelcastInstance.getLifecycleService().removeLifecycleListener(id); } id = this.hazelcastRegisteredListenerIdMap.remove(ClusterMonitorType.CLIENT); if (id != null) { this.hazelcastInstance.getClientService().removeClientListener(id); } } }
Source:
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if(localName.equalsIgnoreCase("geokret")) { trackable = new Trackable(); trackables.add(trackable); try { final String kretyId = attributes.getValue("id"); if (StringUtils.isNumeric(kretyId)) { trackable.setGeocode(GeokretyConnector.geocode(Integer.parseInt(kretyId))); } final String distance = attributes.getValue("dist"); if (StringUtils.isNotBlank(distance)) { trackable.setDistance(Float.parseFloat(distance)); } final String kretyType = attributes.getValue("type"); if (StringUtils.isNotBlank(kretyType)) { trackable.setType(getType(Integer.parseInt(kretyType))); } final String waypointCode = attributes.getValue("waypoint"); if (StringUtils.isNotBlank(waypointCode)) { trackable.setSpottedName(waypointCode); trackable.setSpottedType(Trackable.SPOTTED_CACHE); } final String imageName = attributes.getValue("image"); if (StringUtils.isNotBlank(imageName)) { trackable.setImage("<LINK_0>" + imageName); } } catch (final NumberFormatException e) { Log.e("Parsing geokret", e); } } }

Target:
public final void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (localName.equalsIgnoreCase("geokret")) { trackable = new Trackable(); trackables.add(trackable); try { final String kretyId = attributes.getValue("id"); if (StringUtils.isNumeric(kretyId)) { trackable.setGeocode(GeokretyConnector.geocode(Integer.parseInt(kretyId))); } final String distance = attributes.getValue("dist"); if (StringUtils.isNotBlank(distance)) { trackable.setDistance(Float.parseFloat(distance)); } final String kretyType = attributes.getValue("type"); if (StringUtils.isNotBlank(kretyType)) { trackable.setType(getType(Integer.parseInt(kretyType))); } final String waypointCode = attributes.getValue("waypoint"); if (StringUtils.isNotBlank(waypointCode)) { trackable.setSpottedName(waypointCode); trackable.setSpottedType(Trackable.SPOTTED_CACHE); } final String imageName = attributes.getValue("image"); if (StringUtils.isNotBlank(imageName)) { trackable.setImage("<LINK_0>" + imageName); } } catch (final NumberFormatException e) { Log.e("Parsing geokret", e); } } }
Source:
public static void refreshBackground() { EclipseUIUtil.displayAsyncExec(new Runnable() { @Override public void run() { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage != null) { IEditorPart activeEditor = activePage.getActiveEditor(); if (activeEditor instanceof DDiagramEditorImpl) { ((DDiagramEditorImpl) activeEditor).getDiagramEditPart().refresh(); } } } } }); }

Target:
public static void refreshBackground() { EclipseUIUtil.displayAsyncExec(new Runnable() { @Override public void run() { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage(); if (activePage != null) { IEditorPart activeEditor = activePage.getActiveEditor(); if (activeEditor instanceof DDiagramEditorImpl) { DiagramEditPart diagramEditPart = ((DDiagramEditorImpl) activeEditor).getDiagramEditPart(); ((DDiagramEditPart) diagramEditPart).configureBackground(diagramEditPart.getFigure()); } } } } }); }
Source:
public DB2YearWeekFunction() { super("CONCAT(YEAR(DATE_TRUNC('week', ?1)), '-', WEEK_ISO(?1))"); }

Target:
public DB2YearWeekFunction() { super("VARCHAR_FORMAT(?1, 'IYYY-IW')"); }
Source:
public ObjectBinding<String> getFieldBinding(Field field) { if (field == InternalField.TYPE_HEADER || field == InternalField.OBSOLETE_TYPE_HEADER) { return Bindings.createObjectBinding(() -> { return type.getValue().getDisplayName(); }, type); } return Bindings.valueAt(fields, field); }

Target:
public ObjectBinding<String> getFieldBinding(Field field) { if ((field == InternalField.TYPE_HEADER) || (field == InternalField.OBSOLETE_TYPE_HEADER)) { return (ObjectBinding<String>) EasyBind.map(type, EntryType::getDisplayName); } return Bindings.valueAt(fields, field); }
Source:
private Long appendWithOffset(long offset, boolean isControlRecord, long timestamp, ByteBuffer key, ByteBuffer value, Header[] headers) { try { if (isControlRecord != isControlBatch) throw new IllegalArgumentException("Control records can only be appended to control batches"); if (lastOffset != null && offset <= lastOffset) throw new IllegalArgumentException(String.format("Illegal offset %s following previous offset %s " + "(Offsets must increase monotonically).", offset, lastOffset)); if (timestamp < 0 && timestamp != RecordBatch.NO_TIMESTAMP) throw new IllegalArgumentException("Invalid negative timestamp " + timestamp); if (magic < RecordBatch.MAGIC_VALUE_V2 && headers != null && headers.length > 0) throw new IllegalArgumentException("Magic v" + magic + " does not support record headers"); if (firstTimestamp == null) { if (isDeleteHorizonSet()) { firstTimestamp = deleteHorizonMs; } else { firstTimestamp = timestamp; } } if (magic > RecordBatch.MAGIC_VALUE_V1) { appendDefaultRecord(offset, timestamp, key, value, headers); return null; } else { return appendLegacyRecord(offset, timestamp, key, value, magic); } } catch (IOException e) { throw new KafkaException("I/O exception when writing to the append stream, closing", e); } }

Target:
private Long appendWithOffset(long offset, boolean isControlRecord, long timestamp, ByteBuffer key, ByteBuffer value, Header[] headers) { try { if (isControlRecord != isControlBatch) throw new IllegalArgumentException("Control records can only be appended to control batches"); if (lastOffset != null && offset <= lastOffset) throw new IllegalArgumentException(String.format("Illegal offset %s following previous offset %s " + "(Offsets must increase monotonically).", offset, lastOffset)); if (timestamp < 0 && timestamp != RecordBatch.NO_TIMESTAMP) throw new IllegalArgumentException("Invalid negative timestamp " + timestamp); if (magic < RecordBatch.MAGIC_VALUE_V2 && headers != null && headers.length > 0) throw new IllegalArgumentException("Magic v" + magic + " does not support record headers"); if (firstTimestamp == null) { if (deleteHorizonSet()) firstTimestamp = deleteHorizonMs; else firstTimestamp = timestamp; } if (magic > RecordBatch.MAGIC_VALUE_V1) { appendDefaultRecord(offset, timestamp, key, value, headers); return null; } else { return appendLegacyRecord(offset, timestamp, key, value, magic); } } catch (IOException e) { throw new KafkaException("I/O exception when writing to the append stream, closing", e); } }
Source:
public wyvern.target.corewyvernIL.decl.Declaration generateDecl(GenContext ctx, GenContext thisContext) { String targetName = ((Variable)target).getName(); wyvern.target.corewyvernIL.decl.DelegateDeclaration ILDelegateDecl = new wyvern.target.corewyvernIL.decl.DelegateDeclaration(type.getILType(ctx), targetName); return ILDelegateDecl; }

Target:
public wyvern.target.corewyvernIL.decl.Declaration generateDecl(GenContext ctx, GenContext thisContext) { String targetName = ((Variable)target).getName(); wyvern.target.corewyvernIL.decl.DelegateDeclaration iLDelegateDecl = new wyvern.target.corewyvernIL.decl.DelegateDeclaration(type.getILType(ctx), targetName); return iLDelegateDecl; }
Source:
private void stopJobs() { ThingUID thingUID = getThing().getUID(); int jobsRemoved = 0; logger.debug("Stopping Scheduled Jobs for thing {}", thingUID); monitor.lock(); try { if (scheduledExecutor != null) { BlockingQueue<Runnable> queue = scheduledExecutor.getQueue(); int sizeBefore = queue.size(); queue.removeIf(this::isJobAssociatedWithThing); int sizeAfter = queue.size(); jobsRemoved = sizeBefore - sizeAfter; } logger.debug("Stopped Scheduled Jobs for thing {}", jobsRemoved, thingUID); } catch (final Exception ex) { logger.error("{}", ex.getMessage(), ex); } finally { monitor.unlock(); } }

Target:
private void stopJobs() { ThingUID thingUID = getThing().getUID(); logger.debug("Stopping Scheduled Jobs for thing {}", thingUID); monitor.lock(); try { if (scheduledExecutor != null) { List<Job> jobsToRemove = scheduledJobs.stream().filter(this::isJobAssociatedWithThing) .collect(toList()); Consumer<Job> removalFromExecutor = scheduledExecutor::remove; Consumer<Job> removalFromQueue = scheduledJobs::remove; jobsToRemove.forEach(removalFromExecutor.andThen(removalFromQueue)); logger.debug("Stopped Scheduled Jobs for thing {}", jobsToRemove.size(), thingUID); } } catch (final Exception ex) { logger.error("{}", ex.getMessage(), ex); } finally { monitor.unlock(); } }
Source:
public void destroyAll() throws CachePersistenceException { if (!inMaintenance) { throw new IllegalStateException("Maintenance mode required"); } LOGGER.info("destroyAll called for cluster tiers on {}", this.clusterUri); try { entityFactory.destroy(entityIdentifier); } catch (ClusterTierManagerNotFoundException e) { throw new CachePersistenceException("cluster tiers on " + this.clusterUri + " not found", e); } catch (EntityBusyException e) { throw new CachePersistenceException("Can not delete cluster tiers on " + this.clusterUri, e); } }

Target:
public void destroyAll() throws CachePersistenceException { if (!inMaintenance) { throw new IllegalStateException("Maintenance mode required"); } LOGGER.info("destroyAll called for cluster tiers on {}", this.clusterUri); try { entityFactory.destroy(entityIdentifier); } catch (ClusterTierManagerNotFoundException e) { throw new CachePersistenceException("Cluster tiers on " + this.clusterUri + " not found", e); } catch (EntityBusyException e) { throw new CachePersistenceException("Can not delete cluster tiers on " + this.clusterUri, e); } }
Source:
public String getSemanticObjectLabel(Object object) { final OpaqueElementBodyChange bodyChange = (OpaqueElementBodyChange)object; final EObject discriminant = bodyChange.getDiscriminant(); final ComposedStyledString text = new ComposedStyledString(); text.append(bodyChange.getLanguage()); text.append(" body of "); text.append(itemDelegator.getText(discriminant)); text.append(" "); text.append(getChangeKindLabel(bodyChange)); return text.getString(); }

Target:
public String getSemanticObjectLabel(Object object) { final OpaqueElementBodyChange bodyChange = (OpaqueElementBodyChange)object; final EObject discriminant = bodyChange.getDiscriminant(); return doGetSemanticObjectLabel(bodyChange, discriminant).getString(); }