auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean unsubscribe(final Object subscriber) { final AtomicBoolean unsubscribed = new AtomicBoolean(false); final Map<Class<?>, EventSubscriber> subscriberMap = this.eventSubscriberFinder.findSubscribers(subscriber); if (null != subscriberMap && !subscriberMap.isEmpty()) { subscriberMap.forEach((eventType, eventSubscriber) -> unsubscribed.set( unsubscribed.get() | this.unsubscribe(eventType, eventSubscriber.getId()) )); } return unsubscribed.get(); }

Target:
public boolean unsubscribe(final Object subscriber) { final AtomicBoolean unsubscribed = new AtomicBoolean(false); final Map<Class<?>, EventSubscriber> subscriberMap = this.eventSubscriberFinder.findSubscribers(subscriber); if (null != subscriberMap && !subscriberMap.isEmpty()) { subscriberMap.forEach((eventType, eventSubscriber) -> unsubscribed.set( unsubscribed.get() || this.unsubscribe(eventType, eventSubscriber.getId()) )); } return unsubscribed.get(); }
Source:
public ActivityLogEntry(AccountAttributes userAccount, boolean isMasquerade, String logMessage, String requestUrl, StudentAttributes student, UserType userType){ time = System.currentTimeMillis(); servletName = getActionName(requestUrl); action = servletName; toShow = true; message = logMessage; url = requestUrl; if(userAccount != null && userAccount.googleId != null){ if(userType.isInstructor && !userType.isStudent){ role = "Instructor"; } else if (!userType.isInstructor && userType.isStudent){ role = "Student"; } else if (userType.isInstructor && userType.isStudent){ role = servletName.toLowerCase().startsWith("instructor") ? "Instructor" : "Student"; } else { role = "Unkown"; } role = role + (isMasquerade? "(M)" : ""); name = userAccount.name; googleId = userAccount.googleId; email = userAccount.email; } else if(student != null){ role = "Unregistered"; name = student.name; googleId = "Unregistered"; email = student.email; } else { role = "Unknown"; name = "Unknown"; googleId = "Unknown"; email = "Unknown"; } }

Target:
public ActivityLogEntry(AccountAttributes userAccount, boolean isMasquerade, String logMessage, String requestUrl, StudentAttributes student, UserType userType){ time = System.currentTimeMillis(); servletName = getActionName(requestUrl); action = servletName; toShow = true; message = logMessage; url = requestUrl; if(userAccount != null && userAccount.googleId != null){ if(userType.isInstructor && !userType.isStudent){ role = "Instructor"; } else if (!userType.isInstructor && userType.isStudent){ role = "Student"; } else if (userType.isInstructor && userType.isStudent){ role = servletName.toLowerCase().startsWith("instructor") ? "Instructor" : "Student"; } else { role = "Unknown"; } role = role + (isMasquerade? "(M)" : ""); name = userAccount.name; googleId = userAccount.googleId; email = userAccount.email; } else if(student != null){ role = "Unregistered"; name = student.name; googleId = "Unregistered"; email = student.email; } else { role = "Unknown"; name = "Unknown"; googleId = "Unknown"; email = "Unknown"; } }
Source:
private void loadMergeStrategies(IConfigurationElement[] elements) { for (IConfigurationElement element : elements) { try { Object ext = element.createExecutableExtension("class"); if (ext instanceof MergeStrategy) { MergeStrategy strategy = (MergeStrategy) ext; String name = strategy.getName(); if (name == null || name.isEmpty()) { Activator.logWarning(NLS.bind( CoreText.MergeStrategy_InvalidName, strategy.getClass()), null); } else if (strategies.containsKey(name)) { Activator.logWarning(NLS.bind( CoreText.MergeStrategy_DuplicateName, strategy.getName(), strategy.getClass()), null); } else { if (MergeStrategy.get(name) == null) { MergeStrategy.register(name, strategy); } strategies.put(name, new MergeStrategyDescriptor( name, element.getAttribute("label"))); } } } catch (CoreException e) { Activator.logError(CoreText.MergeStrategy_LoadError, e); } } }

Target:
private void loadMergeStrategies(IConfigurationElement[] elements) { for (IConfigurationElement element : elements) { try { Object ext = element.createExecutableExtension("class"); if (ext instanceof MergeStrategy) { MergeStrategy strategy = (MergeStrategy) ext; String name = element.getAttribute("name"); if (name == null || name.isEmpty()) { name = strategy.getName(); } if (canRegister(name, strategy)) { if (MergeStrategy.get(name) == null) { MergeStrategy.register(name, strategy); } strategies .put(name, new MergeStrategyDescriptor( name, element.getAttribute("label"), strategy.getClass())); } } } catch (CoreException e) { Activator.logError(CoreText.MergeStrategy_LoadError, e); } } }
Source:
Item(InitiateResponseMessage msg) { m_initiateMsg = msg; m_fragmentMsg = null; m_txnId = Long.MIN_VALUE; }

Target:
Item(InitiateResponseMessage msg) { m_initiateMsg = msg; m_fragmentMsg = null; m_safeSpHandle = msg.getSpHandle(); }
Source:
private InetSocketAddress startServer() throws TTransportException { InetSocketAddress addr = new InetSocketAddress(config.getOraclePort()); TNonblockingServerSocket socket = new TNonblockingServerSocket(addr); THsHaServer.Args serverArgs = new THsHaServer.Args(socket); TProcessor processor = new OracleService.Processor<OracleService.Iface>(this); serverArgs.processor(processor); serverArgs.maxReadBufferBytes = 2048; serverArgs.inputProtocolFactory(new TCompactProtocol.Factory()); serverArgs.outputProtocolFactory(new TCompactProtocol.Factory()); server = new THsHaServer(serverArgs); Runnable st = new Runnable() { @Override public void run() { server.serve(); } }; serverThread = new Thread(st); serverThread.setDaemon(true); serverThread.start(); return addr; }

Target:
private InetSocketAddress startServer() throws TTransportException { InetSocketAddress addr = new InetSocketAddress(config.getOraclePort()); TNonblockingServerSocket socket = new TNonblockingServerSocket(addr); THsHaServer.Args serverArgs = new THsHaServer.Args(socket); TProcessor processor = new OracleService.Processor<OracleService.Iface>(this); serverArgs.processor(processor); serverArgs.maxReadBufferBytes = Constants.ORACLE_MAX_READ_BUFFER_BYTES; serverArgs.inputProtocolFactory(new TCompactProtocol.Factory()); serverArgs.outputProtocolFactory(new TCompactProtocol.Factory()); server = new THsHaServer(serverArgs); Runnable st = new Runnable() { @Override public void run() { server.serve(); } }; serverThread = new Thread(st); serverThread.setDaemon(true); serverThread.start(); return addr; }
Source:
public Response head() { appMode = getCurrent().get(ApplicationMode.class); API api = null; if(appMode == ApplicationMode.GlusterOnly) { api = getApi(); } else { api = getGlusterApi(); } return getResponseBuilder(api).build(); }

Target:
public Response head() { appMode = getCurrent().get(ApplicationMode.class); API api = null; if(appMode == ApplicationMode.GlusterOnly) { api = getGlusterApi(); } else { api = getApi(); } return getResponseBuilder(api).build(); }
Source:
public <T> Counter createAndRegisterCounter(Class<T> clazz, String metricName, TableReference tableReference) { Counter counter = metricsManager.registerOrGetTaggedCounter( clazz, metricName, getTagsForTableReference(tableReference)); metricsManager.addMetricFilter( clazz, metricName, getTagsForTableReference(tableReference), MetricPublicationFilter.NEVER_PUBLISH); Gauge<Long> gauge = new ZeroBasedDeltaGauge(counter::getCount); Gauge<Long> memoizedGauge = new CachedGauge<Long>(clock, REFRESH_INTERVAL.toNanos(), TimeUnit.NANOSECONDS) { @Override protected Long loadValue() { return gauge.getValue(); } }; MetricPublicationFilter filter = metricNameToPublicationController.computeIfAbsent(metricName, _name -> TopNMetricPublicationController.create(maximumNumberOfTables)) .registerAndCreateFilter(memoizedGauge); metricsManager.addMetricFilter( clazz, metricName, metricsManager.getTableNameTagFor(tableReference), filter); metricsManager.registerOrGet( clazz, metricName, gauge, metricsManager.getTableNameTagFor(tableReference)); return counter; }

Target:
public <T> Counter createAndRegisterCounter(Class<T> clazz, String metricName, TableReference tableReference) { metricsManager.addMetricFilter( clazz, metricName, getTagsForTableReference(tableReference), MetricPublicationFilter.NEVER_PUBLISH); Counter counter = metricsManager.registerOrGetTaggedCounter( clazz, metricName, getTagsForTableReference(tableReference)); Gauge<Long> gauge = new ZeroBasedDeltaGauge(counter::getCount); Gauge<Long> memoizedGauge = new CachedGauge<Long>(clock, REFRESH_INTERVAL.toNanos(), TimeUnit.NANOSECONDS) { @Override protected Long loadValue() { return gauge.getValue(); } }; MetricPublicationFilter filter = metricNameToPublicationController.computeIfAbsent(metricName, _name -> TopNMetricPublicationController.create(maximumNumberOfTables)) .registerAndCreateFilter(memoizedGauge); metricsManager.addMetricFilter( clazz, metricName, metricsManager.getTableNameTagFor(tableReference), filter); metricsManager.registerOrGet( clazz, metricName, gauge, metricsManager.getTableNameTagFor(tableReference)); return counter; }
Source:
public void updated(Dictionary<String, ?> properties) throws ConfigurationException { if (properties == null) { logger.warn("no configuration found"); } else { String usedCalendars = (String) properties.get(PARAM_USED_CALENDARS); if (usedCalendars != null) { for (String cal : usedCalendars.split(",")) { this.calendars.add(cal.trim()); } } String homeIdentifiers = (String) properties.get(PARAM_HOME_IDENTIFIERS); if (homeIdentifiers != null) { for (String homeIdent : homeIdentifiers.split(",")) { this.homeIdentifier.add(homeIdent.trim().toLowerCase()); } } } }

Target:
public void updated(Dictionary<String, ?> properties) throws ConfigurationException { if (properties != null) { logger.debug("loading configuration..."); String usedCalendars = (String) properties .get(PARAM_USED_CALENDARS); if (usedCalendars != null) { for (String cal : usedCalendars.split(",")) { this.calendars.add(cal.trim()); } } String homeIdentifiers = (String) properties .get(PARAM_HOME_IDENTIFIERS); if (homeIdentifiers != null) { for (String homeIdent : homeIdentifiers.split(",")) { this.homeIdentifier.add(homeIdent.trim().toLowerCase()); } } logger.debug("loading configuration done"); this.reloadCurrentLoadedEvents(); } }
Source:
private void configureDestinations(iOSVariant iOSVariant, ApnsServiceBuilder builder) { if (iOSVariant.isProduction()) { builder.withProductionDestination(); } else { builder.withSandboxDestination(); } if(System.getProperty("aerogear.apns.push.host")!= null){ int port = Utilities.SANDBOX_GATEWAY_PORT; if(System.getProperty("aerogear.apns.push.port")!= null) { port = Integer.parseInt(System.getProperty("aerogear.apns.push.port")); } builder.withGatewayDestination(System.getProperty("aerogear.apns.push.host"),port); } if(System.getProperty("aerogear.apns.feedback.host")!= null){ int port = Utilities.SANDBOX_FEEDBACK_PORT; if(System.getProperty("aerogear.apns.feedback.port")!= null) { port = Integer.parseInt(System.getProperty("aerogear.apns.feedback.port")); } builder.withFeedbackDestination(System.getProperty("aerogear.apns.feedback.host"),port); } }

Target:
private void configureDestinations(iOSVariant iOSVariant, ApnsServiceBuilder builder) { if (iOSVariant.isProduction()) { builder.withProductionDestination(); } else { builder.withSandboxDestination(); } if(customAerogearApnsPushHost != null){ int port = Utilities.SANDBOX_GATEWAY_PORT; if(customAerogearApnsPushPort != null) { port = Integer.parseInt(customAerogearApnsPushPort); } builder.withGatewayDestination(customAerogearApnsPushHost,port); } if(customAerogearApnsFeedbackHost != null){ int port = Utilities.SANDBOX_FEEDBACK_PORT; if(customAerogearApnsFeedbackPort!= null) { port = Integer.parseInt(customAerogearApnsFeedbackPort); } builder.withFeedbackDestination(customAerogearApnsFeedbackPort,port); } }
Source:
public void run() { if (this.ex != null) { try { exceptional(this.ex); } catch (RuntimeException ex) { if (ex == this.ex) { debug("Expected exception thrown", ex); } else { ex.printStackTrace(); } } catch (Error err) { if (err == this.ex) { this.debug("Expected exception thrown", err); } else { ex.printStackTrace(); } } catch (Throwable ex) { ex.printStackTrace(); } } }

Target:
public void run() { if (this.ex != null) { try { debug(this.ex); } catch (RuntimeException ex) { if (ex == this.ex) { debug(ex); } } catch (Error err) { if (err != this.ex) { this.debug(err); } } } }
Source:
public RelSet getSet() { return set; }

Target:
RelSet getSet() { return set; }
Source:
protected void validateItemIndex(int itemIndex) { if (getDataSize() == 0) { throw new IndexOutOfBoundsException( String.format("Requested index %d on empty data.", itemIndex)); } if (itemIndex < 0 || itemIndex >= getDataSize()) { throw new IndexOutOfBoundsException(String.format( "Given index %d is outside of the accepted range '0 - %d'", itemIndex, getDataSize() - 1)); } }

Target:
protected void validateItemIndex(int itemIndex) { final int dataSize = getDataSize(); if (dataSize == 0) { throw new IndexOutOfBoundsException( String.format("Requested index %d on empty data.", itemIndex)); } if (itemIndex < 0 || itemIndex >= dataSize) { throw new IndexOutOfBoundsException(String.format( "Given index %d is outside of the accepted range '0 - %d'", itemIndex, dataSize - 1)); } }
Source:
public void chat(final String text, final boolean async) { if (text.startsWith("/")) { server.getLogger().info(getName() + " issued command: " + text); try { PlayerCommandPreprocessEvent event = EventFactory.onPlayerCommand(this, text); if (event.isCancelled()) { return; } getServer().dispatchCommand(event.getPlayer(), event.getMessage().substring(1)); } catch (Exception ex) { sendMessage(ChatColor.RED + "An internal error occured while executing your command."); getServer().getLogger().log(Level.SEVERE, "Exception while executing command: " + text, ex); } } else { Runnable task = new Runnable() { @Override public void run() { final AsyncPlayerChatEvent event = EventFactory.onAsyncPlayerChat(async, GlowPlayer.this, text); if (event.isCancelled()) { return; } if (PlayerChatEvent.getHandlerList().getRegisteredListeners().length > 0) { PlayerChatEvent event1 = EventFactory.callEvent(new PlayerChatEvent(GlowPlayer.this, event.getMessage(), event.getFormat(), event.getRecipients())); if (event1.isCancelled()) { return; } event.setFormat(event1.getFormat()); event.setMessage(event1.getMessage()); event.getRecipients().clear(); event.getRecipients().addAll(event1.getRecipients()); } String message = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage()); getServer().getLogger().info(message); for (Player recipient : event.getRecipients()) { recipient.sendMessage(message); } } }; if (async) server.getScheduler().runTaskImmediateAsynchronously(task); else task.run(); } }

Target:
public void chat(final String text, final boolean async) { if (text.startsWith("/")) { server.getLogger().info(getName() + " issued command: " + text); try { PlayerCommandPreprocessEvent event = EventFactory.onPlayerCommand(this, text); if (event.isCancelled()) { return; } getServer().dispatchCommand(event.getPlayer(), event.getMessage().substring(1)); } catch (Exception ex) { sendMessage(ChatColor.RED + "An internal error occured while executing your command."); getServer().getLogger().log(Level.SEVERE, "Exception while executing command: " + text, ex); } } else { Runnable task = new Runnable() { @Override public void run() { final AsyncPlayerChatEvent event = EventFactory.onAsyncPlayerChat(async, GlowPlayer.this, text); if (event.isCancelled()) { return; } if (PlayerChatEvent.getHandlerList().getRegisteredListeners().length > 0) { PlayerChatEvent event1 = EventFactory.callEvent(new PlayerChatEvent(GlowPlayer.this, event.getMessage(), event.getFormat(), event.getRecipients())); if (event1.isCancelled()) { return; } event.setFormat(event1.getFormat()); event.setMessage(event1.getMessage()); event.getRecipients().clear(); event.getRecipients().addAll(event1.getRecipients()); } String message = String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage()); getServer().getLogger().info(message); for (Player recipient : event.getRecipients()) { recipient.sendMessage(message); } } }; if (async) { server.getScheduler().runTaskImmediateAsynchronously(task); } else { task.run(); } } }
Source:
public void onNext(final FailedEvaluator failedEvaluator) { LOG.log(Level.INFO, "Evaluator {0} has failed!", failedEvaluator.getId()); final InetSocketAddress failedNodeInetSocketAddress = failedEvaluator.getFailedContextList().get(0) .getEvaluatorDescriptor().getNodeDescriptor().getInetSocketAddress(); if (failedEvaluator.getFailedContextList().get(0).getId().startsWith(MIST_MASTER_ID_PREFIX)) { isMasterRunning.set(false); hasMasterFailed.set(true); requestor.submit(EvaluatorRequest.newBuilder() .setNumber(1) .setNumberOfCores(masterCpuCores) .setMemory(masterMemSize) .build()); LOG.log(Level.INFO, "Requested Evaluator."); } else { try { proxyToMaster.notifyFailedTask(failedNodeInetSocketAddress.getHostName()); } catch (final AvroRemoteException e) { LOG.log(Level.SEVERE, "Cannot connect to MistMaster for notifying failure! " + e.toString()); throw new IllegalStateException("Cannot connect to MistMaster while failure recovery"); } } }

Target:
public void onNext(final FailedEvaluator failedEvaluator) { LOG.log(Level.INFO, "Evaluator {0} has failed!", failedEvaluator.getId()); final InetSocketAddress failedNodeInetSocketAddress = failedEvaluator.getFailedContextList().get(0) .getEvaluatorDescriptor().getNodeDescriptor().getInetSocketAddress(); if (failedEvaluator.getFailedContextList().get(0).getId().startsWith(MIST_MASTER_ID_PREFIX)) { isMasterRunning.set(false); isMasterFailed.set(true); requestor.submit(EvaluatorRequest.newBuilder() .setNumber(1) .setNumberOfCores(masterCpuCores) .setMemory(masterMemSize) .build()); LOG.log(Level.INFO, "Requested Evaluator."); } else { try { final String failedTaskHostname = failedNodeInetSocketAddress.getHostName(); runningTaskInfo.remove(failedTaskHostname); proxyToMaster.notifyFailedTask(failedTaskHostname); } catch (final AvroRemoteException e) { LOG.log(Level.SEVERE, "Cannot connect to MistMaster for notifying failure! " + e.toString()); throw new IllegalStateException("Cannot connect to MistMaster while failure recovery"); } } }
Source:
public void shouldNotifyEventWhenCreateComment() { DocumentModel comment = captureAndVerifyCommentEventNotification(() -> { Comment createdComment = createCommentAndAddSubscription(commentedDocumentModel, "CommentAdded", "Creation"); return session.getDocument(new IdRef(createdComment.getId())); }, COMMENT_ADDED, DOCUMENT_CREATED); commentedCommentDocumentModel = comment; captureAndVerifyCommentEventNotification(() -> { Comment createdComment = createCommentAndAddSubscription(comment, "CommentAdded", "Creation"); return session.getDocument(new IdRef(createdComment.getId())); }, COMMENT_ADDED, DOCUMENT_CREATED); }

Target:
public void shouldNotifyEventWhenCreateComment() { captureAndVerifyCommentEventNotification(() -> { Comment createdComment = createCommentAndAddSubscription("CommentAdded", "Creation"); return session.getDocument(new IdRef(createdComment.getId())); }, COMMENT_ADDED, DOCUMENT_CREATED); }
Source:
public static Object convertPrimitive(Class<?> type, String value) { if (value == null) { return null; } else if (type == char.class || type == Character.class) { return value.length() > 0 ? value.charAt(0) : '\0'; } else if (type == boolean.class || type == Boolean.class) { return Boolean.valueOf(value); } else if (type == byte.class || type == Byte.class) { return isNumber(value) ? Byte.valueOf(value) : null; } else if (type == short.class || type == Short.class) { return isNumber(value) ? Short.valueOf(value) : null; } else if (type == int.class || type == Integer.class) { return isNumber(value) ? Integer.valueOf(value) : null; } else if (type == long.class || type == Long.class) { return isNumber(value) ? Long.valueOf(value) : null; } else if (type == float.class || type == Float.class) { return isNumber(value) ? Float.valueOf(value) : null; } else if (type == double.class || type == Double.class) { return isNumber(value) ? Double.valueOf(value) : null; } return value; }

Target:
public static Object convertPrimitive(Class<?> type, String value) { if (value == null) { return null; } else if (type == char.class || type == Character.class) { return value.length() > 0 ? value.charAt(0) : '\0'; } else if (type == boolean.class || type == Boolean.class) { return Boolean.valueOf(value); } try { if (type == byte.class || type == Byte.class) { return Byte.valueOf(value); } else if (type == short.class || type == Short.class) { return Short.valueOf(value); } else if (type == int.class || type == Integer.class) { return Integer.valueOf(value); } else if (type == long.class || type == Long.class) { return Long.valueOf(value); } else if (type == float.class || type == Float.class) { return Float.valueOf(value); } else if (type == double.class || type == Double.class) { return Double.valueOf(value); } } catch (NumberFormatException e) { return null; } return value; }
Source:
public MergeSubscriber(Subscriber<? super T> child, boolean delayErrors, int maxConcurrent) { this.child = child; this.delayErrors = delayErrors; this.maxConcurrent = maxConcurrent; this.nl = NotificationLite.instance(); this.innerGuard = new Object(); this.innerSubscribers = EMPTY; this.request(0); }

Target:
public MergeSubscriber(Subscriber<? super T> child, boolean delayErrors, int maxConcurrent) { this.child = child; this.delayErrors = delayErrors; this.maxConcurrent = maxConcurrent; this.nl = NotificationLite.instance(); this.innerGuard = new Object(); this.innerSubscribers = EMPTY; long r = Math.min(maxConcurrent, RxRingBuffer.SIZE); request(r); }
Source:
public IgniteServiceProcessor(GridKernalContext ctx) { super(ctx); ctx.metric().registerList(SVCS_MON_LIST, SVCS_MON_LIST_DESC, ServiceView.class, registeredServices, s -> s, s -> {}); }

Target:
public IgniteServiceProcessor(GridKernalContext ctx) { super(ctx); ctx.systemView().registerView(SVCS_VIEW, SVCS_VIEW_DESC, ServiceView.class, registeredServices.values(), ServiceView::new); }
Source:
private ISPProgram show(IDBDatabaseService database, ISPProgram prog) { AdminModel model = new AdminModel(prog); AdminUI ui = new AdminUI(); AdminEditor editor = new AdminEditor(ui); editor.setModel(model); pane.setMessage(ui); JDialog dialog = pane.createDialog(null, title); dialog.setModal(modal); Resources.setOTFrameIcon(dialog); dialog.setVisible(true); Object sel = pane.getValue(); if (!(sel instanceof Integer) || (JOptionPane.OK_OPTION != (Integer) sel)) { return prog; } model = editor.getModel(); ISPProgram res = prog; try { res = model.apply(database, prog); } catch (DBIDClashException e) { JOptionPane.showMessageDialog(pane, String.format("The program id '%s' is already in use, please choose another.", model.getProgramAttrModel().getProgramId()), "Duplicate Program ID", JOptionPane.ERROR_MESSAGE); } return res; }

Target:
private ISPProgram show(IDBDatabaseService database, ISPProgram prog) { AdminModel model = new AdminModel(prog); AdminUI ui = new AdminUI(); AdminEditor editor = new AdminEditor(ui); editor.setModel(model); pane.setMessage(ui); JDialog dialog = pane.createDialog(title); dialog.setModal(modal); Resources.setOTFrameIcon(dialog); dialog.setVisible(true); Object sel = pane.getValue(); if (!(sel instanceof Integer) || (JOptionPane.OK_OPTION != (Integer) sel)) { return prog; } model = editor.getModel(); ISPProgram res = prog; try { res = model.apply(database, prog); } catch (DBIDClashException e) { JOptionPane.showMessageDialog(pane, String.format("The program id '%s' is already in use, please choose another.", model.getProgramAttrModel().getProgramId()), "Duplicate Program ID", JOptionPane.ERROR_MESSAGE); } return res; }
Source:
private static String raw(final Message msg) throws IOException { try { final Object body = msg.getContent(); if (!(body instanceof Multipart)) { throw new IOException("body is not Multipart"); } final Multipart parts = (Multipart) body; for (int pos = 0; pos < parts.getCount(); pos += 1) { final BodyPart part = parts.getBodyPart(pos); if (part.getContentType().startsWith("text/plain")) { return part.getContent().toString(); } } } catch (final MessagingException ex) { throw new IOException(ex); } throw new IOException("no plain/text part found"); }

Target:
private static String raw(final Message msg) throws IOException { try { final Object body = msg.getContent(); if (!(body instanceof Multipart)) { throw new IOException("body is not Multipart"); } final Multipart parts = (Multipart) body; for (int pos = 0; pos < parts.getCount(); ++pos) { final BodyPart part = parts.getBodyPart(pos); if (part.getContentType().startsWith("text/plain")) { return part.getContent().toString(); } } } catch (final MessagingException ex) { throw new IOException(ex); } throw new IOException("no plain/text part found"); }
Source:
private TypeMirror getTypeMirror(Class<?> clazz) { return elements.getTypeElement(clazz.getCanonicalName()).asType(); }

Target:
private TypeMirror getTypeMirror(Class<?> clazz) { return TypesUtils.typeFromClass(clazz, types, elements); }
Source:
public void theSetConfigurationObjectRequestIsReceived(final Map<String, String> requestData) throws Throwable { final Map<String, String> settings = new HashMap<>(); settings.put(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION, requestData.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION)); settings.put(PlatformSmartmeteringKeys.CONFIGURATION_FLAG_TYPE, requestData.get(PlatformSmartmeteringKeys.CONFIGURATION_FLAG_TYPE)); settings.put(PlatformSmartmeteringKeys.CONFIGURATION_FLAG_ENABLED, requestData.get(PlatformSmartmeteringKeys.CONFIGURATION_FLAG_ENABLED)); settings.put(PlatformSmartmeteringKeys.GPRS_OPERATION_MODE_TYPE, requestData.get(PlatformSmartmeteringKeys.GPRS_OPERATION_MODE_TYPE)); final SetConfigurationObjectRequest setConfigurationObjectRequest = SetConfigurationObjectRequestFactory .fromParameterMap(settings); final SetConfigurationObjectAsyncResponse setConfigurationObjectAsyncResponse = this.smartMeteringConfigurationClient .setConfigurationObject(setConfigurationObjectRequest); LOGGER.info("Set configuration object response is received {}", setConfigurationObjectAsyncResponse); assertNotNull("Set configuration object response should not be null", setConfigurationObjectAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setConfigurationObjectAsyncResponse.getCorrelationUid()); }

Target:
public void theSetConfigurationObjectRequestIsReceived(final Map<String, String> requestData) throws Throwable { final SetConfigurationObjectRequest setConfigurationObjectRequest = SetConfigurationObjectRequestFactory .fromParameterMap(requestData); final SetConfigurationObjectAsyncResponse setConfigurationObjectAsyncResponse = this.smartMeteringConfigurationClient .setConfigurationObject(setConfigurationObjectRequest); LOGGER.info("Set configuration object response is received {}", setConfigurationObjectAsyncResponse); assertNotNull("Set configuration object response should not be null", setConfigurationObjectAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setConfigurationObjectAsyncResponse.getCorrelationUid()); }
Source:
private static GerritConfigX gerritConfigFromString(String token) { try { JSonSupport support = new JSonSupport(); return support.parseResponse(token, GerritConfigX.class); } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, GerritCorePlugin.PLUGIN_ID, NLS.bind( Messages.GerritHtmlProcessor_Failed_to_deserialize_Gerrit_configuration, token), e)); return null; } }

Target:
private static GerritConfigX gerritConfigFromString(String token) { try { JSonSupport support = new JSonSupport(); return support.parseResponse(token, GerritConfigX.class); } catch (Exception e) { StatusHandler.log(new Status(IStatus.ERROR, GerritCorePlugin.PLUGIN_ID, NLS.bind( "Failed to deserialize Gerrit configuration: ''{0}''", token), e)); return null; } }
Source:
public static Date parse(String dateStr, Calendar now) throws ParseException { dateStr = dateStr.trim(); Date ret; StringBuilder allFormats = null; ret = parse_relative(dateStr, now); if (ret != null) return ret; for (ParseableSimpleDateFormat f : ParseableSimpleDateFormat.values()) { try { ret = parse_simple(dateStr, f); if (ret != null) return ret; } catch (ParseException e) { if (allFormats == null) allFormats = new StringBuilder(f.formatStr); else { allFormats.append(", "); allFormats.append(f.formatStr); } } } throw new ParseException( MessageFormat.format(JGitText.get().cannotParseDate, dateStr, allFormats.toString()), 0); }

Target:
public static Date parse(String dateStr, Calendar now) throws ParseException { dateStr = dateStr.trim(); Date ret; ret = parse_relative(dateStr, now); if (ret != null) return ret; for (ParseableSimpleDateFormat f : ParseableSimpleDateFormat.values()) { try { return parse_simple(dateStr, f); } catch (ParseException e) { } } ParseableSimpleDateFormat[] values = ParseableSimpleDateFormat.values(); StringBuilder allFormats = new StringBuilder("\"") .append(values[0].formatStr); for (int i = 1; i < values.length; i++) allFormats.append("\", \"").append(values[i].formatStr); allFormats.append("\""); throw new ParseException(MessageFormat.format( JGitText.get().cannotParseDate, dateStr, allFormats.toString()), 0); }
Source:
public DbTaskRunner(R66Session session, DbRule rule, long id, String requester, String requested) throws WaarpDatabaseException { super(); TransferDAO transferAccess = null; try { transferAccess = DAOFactory.getInstance().getTransferDAO(); transfer = transferAccess.select(id, requester, requested, Configuration.configuration.getHOST_ID()); } catch (DAOException e) { throw new WaarpDatabaseException(e); } finally { if (transferAccess != null) { transferAccess.close(); } } if (transfer == null) { throw new WaarpDatabaseNoDataException("Transfer not found"); } this.rule = new DbRule(getRuleId()); if (rule != null) { if (!transfer.getRule().equals(rule.getIdRule())) { throw new WaarpDatabaseNoDataException( "Rule does not correspond"); } } }

Target:
public DbTaskRunner(R66Session session, DbRule rule, long id, String requester, String requested) throws WaarpDatabaseException { super(); this.session = session; TransferDAO transferAccess = null; try { transferAccess = DAOFactory.getInstance().getTransferDAO(); transfer = transferAccess.select(id, requester, requested, Configuration.configuration.getHOST_ID()); } catch (DAOException e) { throw new WaarpDatabaseException(e); } finally { if (transferAccess != null) { transferAccess.close(); } } if (transfer == null) { throw new WaarpDatabaseNoDataException("Transfer not found"); } this.rule = new DbRule(getRuleId()); if (rule != null) { if (!transfer.getRule().equals(rule.getIdRule())) { throw new WaarpDatabaseNoDataException( "Rule does not correspond"); } } }
Source:
private Group renderWall() { Group result = new Group(); for (int h = 0; h < 2; h++) { for (int i = 0; i < 100; i++) { for (int j = 0; j < 3; j++) { double random = Math.random(); final Box wallPiece = new Box(0, 1, 1); wallPiece.setTranslateY(j - 3); wallPiece.setTranslateZ(i); wallPiece.setTranslateX(h * 3 - 1.5); if (random < 0.5) { wallPiece.setMaterial(Style.BRICK); } else if (random > 0.5 && random < 0.75) { wallPiece.setMaterial(Style.CRACK); } else { wallPiece.setMaterial(Style.MOSS); } wallPiece.setCache(true); wallPiece.setCacheHint(CacheHint.SPEED); result.getChildren().add(wallPiece); } } } return result; }

Target:
private Group renderWall() { Group result = new Group(); final int offset = 3; final double correction = 1.5; for (int h = 0; h < 2; h++) { for (int i = 0; i < (int) Track.LENGTH; i++) { for (int j = 0; j < Track.WIDTH; j++) { final Box wallPiece = new Box(0, 1, 1); wallPiece.setTranslateY(j - offset); wallPiece.setTranslateZ(i); wallPiece.setTranslateX(h * offset - correction); wallPiece.setMaterial(chooseMaterial()); wallPiece.setCache(true); wallPiece.setCacheHint(CacheHint.SPEED); result.getChildren().add(wallPiece); } } } return result; }
Source:
public void onAttach(@NotNull Context context) { super.onAttach(context); if (context instanceof RankingListener) { listener = (RankingListener) context; } viewModel = ViewModelProviders.of(this, new RankingViewModel.Factory(items, formIndex)).get(RankingViewModel.class); if (viewModel.getItems() == null) { dismiss(); } }

Target:
public void onAttach(@NotNull Context context) { super.onAttach(context); if (context instanceof RankingListener) { listener = (RankingListener) context; } viewModel = new ViewModelProvider(this, new RankingViewModel.Factory(items, formIndex)).get(RankingViewModel.class); if (viewModel.getItems() == null) { dismiss(); } }
Source:
default <K, V> Map<K, V> toMap( Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valueMapper, BiFunction<? super V, ? super V, ? extends V> merge) { Objects.requireNonNull(keyMapper, "keyMapper is null"); Objects.requireNonNull(valueMapper, "valueMapper is null"); Objects.requireNonNull(merge, "merge is null"); return toMap(t -> Tuple.of(keyMapper.apply(t), valueMapper.apply(t)), merge); }

Target:
default <K, V> Map<K, V> toMap( Function<? super T, ? extends K> keyMapper, Function<? super T, ? extends V> valueMapper, BiFunction<? super V, ? super V, ? extends V> merge) { Objects.requireNonNull(keyMapper, "keyMapper is null"); Objects.requireNonNull(valueMapper, "valueMapper is null"); Objects.requireNonNull(merge, "merge is null"); return this.<K>groupBy(keyMapper) .mapValues(s -> s.<V>map(valueMapper).reduce(merge)); }
Source:
public Object addNodeEntity(Object entity, Long id) { if (nodeEntityRegister.add(id, entity)) { entity = nodeEntityRegister.get(id); addType(entity.getClass(), entity, id); } remember(entity, false); return entity; }

Target:
public Object addNodeEntity(Object entity, Long id) { if (nodeEntityRegister.add(id, entity)) { entity = nodeEntityRegister.get(id); addType(entity.getClass(), entity, id); remember(entity); collectLabelHistory(entity); } return entity; }
Source:
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (element != null && element.isValid() && element instanceof GoUnaryExpr) { GoUnaryExpr unaryExpr = (GoUnaryExpr)element; if (unaryExpr.getBitAnd() != null && unaryExpr.getExpression() != null && unaryExpr.getExpression() instanceof GoCompositeLit) { GoCompositeLit compositeLit = (GoCompositeLit)unaryExpr.getExpression(); if (compositeLit.getLiteralValue() != null) { unaryExpr.replace(compositeLit.getLiteralValue()); } } } }

Target:
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiElement element = descriptor.getPsiElement(); if (element != null && element.isValid() && element instanceof GoUnaryExpr) { GoUnaryExpr unaryExpr = (GoUnaryExpr)element; GoExpression expr = unaryExpr.getExpression(); if (unaryExpr.getBitAnd() != null && expr instanceof GoCompositeLit) { GoCompositeLit compositeLit = (GoCompositeLit)expr; if (compositeLit.getLiteralValue() != null) { unaryExpr.replace(compositeLit.getLiteralValue()); } } } }
Source:
public static Optional<File> saveTable(JFrame frame, String dialogTitle, FileType format, Campaign campaign) { String fileName = String.format( campaign.getName() + campaign.getShortDateAsString() + "." + format.getRecommendedExtension() ); return GUI.fileDialogSave( frame, dialogTitle, new File(".", fileName), format ); }

Target:
public static Optional<File> saveTable(JFrame frame, String dialogTitle, FileType format, Campaign campaign) { String fileName = campaign.getName() + campaign.getShortDateAsString() + "." + format.getRecommendedExtension(); return GUI.fileDialogSave( frame, dialogTitle, new File(".", fileName), format ); }
Source:
public void getCauseOfDeathGlobalID() { patientRepository.getCauseOfDeathGlobalID(new VisitsResponseCallback() { @Override public void onSuccess(@Nullable String response) { if (response.length() == 36) { getConceptCauseOfDeath(response); } else { mPatientInfoView.cannotMarkDeceased(R.string.mark_patient_deceased_invalid_uuid); } } @Override public void onFailure(@Nullable String errorMessage) { mPatientInfoView.cannotMarkDeceased(errorMessage); } }); }

Target:
public void getCauseOfDeathGlobalID() { patientRepository.getCauseOfDeathGlobalID(new VisitsResponseCallback() { @Override public void onSuccess(@Nullable String response) { if (response.length() == ApplicationConstants.UUID_LENGTH) { getConceptCauseOfDeath(response); } else { mPatientInfoView.cannotMarkDeceased(R.string.mark_patient_deceased_invalid_uuid); } } @Override public void onFailure(@Nullable String errorMessage) { mPatientInfoView.cannotMarkDeceased(errorMessage); } }); }
Source:
protected void createNameControl(Composite parent, FormToolkit toolkit) { createLabel(parent, toolkit, Messages.NamedElementEditorPage_NameLabel); nameText = createWrappedText(parent, toolkit, element.getName(), 2); nameText.setBackground(null); if (model instanceof IContext) { nameText.setEnabled(!((IContext)model).isDefault()); } nameDecoration = new ControlDecoration(nameText, SWT.TOP | SWT.LEFT); FieldDecoration errorFieldIndicator = FieldDecorationRegistry .getDefault().getFieldDecoration( FieldDecorationRegistry.DEC_ERROR); nameDecoration.setImage(errorFieldIndicator.getImage()); nameDecoration.setMarginWidth(2); nameDecoration.setShowHover(true); nameDecoration.hide(); }

Target:
protected void createNameControl(Composite parent, FormToolkit toolkit) { createLabel(parent, toolkit, Messages.NamedElementEditorPage_NameLabel); nameText = createWrappedText(parent, toolkit, element.getName(), 2); nameText.setBackground(null); nameDecoration = new ControlDecoration(nameText, SWT.TOP | SWT.LEFT); FieldDecoration errorFieldIndicator = FieldDecorationRegistry .getDefault().getFieldDecoration( FieldDecorationRegistry.DEC_ERROR); nameDecoration.setImage(errorFieldIndicator.getImage()); nameDecoration.setMarginWidth(2); nameDecoration.setShowHover(true); nameDecoration.hide(); }
Source:
public static Supplier<Delay> constant(int delay, TimeUnit timeUnit) { LettuceAssert.isTrue(delay >= 0, "Delay must be greater or equal to 0"); final Delay statelessDelay = new ConstantDelay(delay, timeUnit); return () -> statelessDelay; }

Target:
public static Delay constant(int delay, TimeUnit timeUnit) { LettuceAssert.isTrue(delay >= 0, "Delay must be greater or equal to 0"); return new ConstantDelay(delay, timeUnit); }
Source:
public static IConsole[] findConsole(IRemoteConnection connection) { return new TerminalConsoleFactory().findConsole(connection); }

Target:
public static List<IConsole> findConsole(IRemoteConnection connection) { return new TerminalConsoleFactory().findConsole(connection); }
Source:
public void removeAllAttributes(PerunSession sess, Member member, Group group) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException { List<Attribute> attributes = getAttributes(sess, member, group); getAttributesManagerImpl().removeAllAttributes(sess, member, group); getPerunBl().getAuditer().log(sess, "All attributes removed for and {}", member, group); for(Attribute attribute : attributes) attribute.setValue(null); try { checkAttributesValue(sess, member, group, attributes); checkAttributesValue(sess, member, group, attributes); } catch(WrongAttributeAssignmentException ex) { throw new ConsistencyErrorException(ex); } for(Attribute attribute: attributes) { try { getAttributesManagerImpl().changedAttributeHook(sess, member, group, new Attribute(attribute)); } catch (WrongAttributeValueException ex) { throw new InternalErrorException(ex); } catch (WrongReferenceAttributeValueException ex) { throw new InternalErrorException(ex); } } }

Target:
public void removeAllAttributes(PerunSession sess, Member member, Group group) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException { List<Attribute> attributes = getAttributes(sess, member, group); getAttributesManagerImpl().removeAllAttributes(sess, member, group); getPerunBl().getAuditer().log(sess, "All attributes removed for and {}", member, group); for(Attribute attribute : attributes) attribute.setValue(null); try { checkAttributesValue(sess, member, group, attributes); } catch(WrongAttributeAssignmentException ex) { throw new ConsistencyErrorException(ex); } for(Attribute attribute: attributes) { try { getAttributesManagerImpl().changedAttributeHook(sess, member, group, new Attribute(attribute)); } catch (WrongAttributeValueException ex) { throw new InternalErrorException(ex); } catch (WrongReferenceAttributeValueException ex) { throw new InternalErrorException(ex); } } }
Source:
public static String stringWithoutTrailingZero(String value) { if (value.contains(".") && value.matches("[0-9.-]+")) { String[] splitter = value.split("\\."); String splitter1 = splitter[1]; for (int i = 0; i < splitter1.length(); i++) { if (splitter1.endsWith("0")) { splitter1 = splitter1.replaceFirst("0*$", ""); } else { break; } } if (splitter1.isEmpty()) { value = splitter[0]; } else { value = splitter[0].concat(".").concat(splitter1); } } return value; }

Target:
public static String stringWithoutTrailingZero(String value) { if (value.contains(".") && value.matches("[0-9.-]+")) { value = !value.contains(".") ? value : value.replaceAll("0*$", "").replaceAll("\\.$", ""); } return value; }
Source:
public String getMessage() { return ("done".equalsIgnoreCase(_message.toLowerCase())) ? "" : _message; }

Target:
public String getMessage() { return ("done".equalsIgnoreCase(_message)) ? "" : _message; }
Source:
public boolean addSyncUrl() { SyncUrl syncUrl = new SyncUrl(); syncUrl.setKeywords(keywords.getText().toString()); syncUrl.setSecret(Util.removeWhitespaces(this.secret.getText().toString())); syncUrl.setTitle(title.getText().toString()); syncUrl.setUrl(url.getText().toString()); syncUrl.setStatus(0); syncUrl.setSyncScheme(new SyncScheme()); return syncUrl.save(); }

Target:
public boolean addSyncUrl() { SyncUrl syncUrl = new SyncUrl(); syncUrl.setKeywords(keywords.getText().toString()); syncUrl.setSecret(secret.getText().toString()); syncUrl.setTitle(title.getText().toString()); syncUrl.setUrl(url.getText().toString()); syncUrl.setStatus(0); syncUrl.setSyncScheme(new SyncScheme()); return syncUrl.save(); }
Source:
protected void manageCollectionProperty(ScenarioSimulationContext context, ScenarioGridColumn selectedColumn, String className, int columnIndex, List<String> fullPropertyPathElements) { final SortedMap<String, FactModelTree> dataObjectFieldsMap = context.getDataObjectFieldsMap(); if (className.contains(".")) { className = className.substring(className.lastIndexOf('.') + 1); } final FactModelTree factModelTree = dataObjectFieldsMap.get(className); final Optional<AbstractScesimModel> selectedScenarioGridModel = context.getSelectedScenarioGridModel().getAbstractScesimModel(); if (!selectedScenarioGridModel.isPresent()) { throw new IllegalArgumentException(); } final FactMapping factMapping = selectedScenarioGridModel.get().getSimulationDescriptor().getFactMappingByIndex(columnIndex); selectedColumn.setFactory(context.getCollectionEditorSingletonDOMElementFactory()); if (factModelTree.isSimple()) { factMapping.setGenericTypes(factModelTree.getGenericTypeInfo(ConstantHolder.VALUE)); } else { final FactModelTree nestedFactModelTree = navigateComplexObject(factModelTree, fullPropertyPathElements, dataObjectFieldsMap); factMapping.setGenericTypes(nestedFactModelTree.getGenericTypeInfo(fullPropertyPathElements.get(fullPropertyPathElements.size() - 1))); } }

Target:
protected void manageCollectionProperty(ScenarioSimulationContext context, ScenarioGridColumn selectedColumn, String className, int columnIndex, List<String> fullPropertyPathElements) { final SortedMap<String, FactModelTree> dataObjectFieldsMap = context.getDataObjectFieldsMap(); if (className.contains(".")) { className = className.substring(className.lastIndexOf('.') + 1); } final FactModelTree factModelTree = dataObjectFieldsMap.get(className); final Optional<AbstractScesimModel> selectedScenarioGridModel = context.getSelectedScenarioGridModel().getAbstractScesimModel(); if (!selectedScenarioGridModel.isPresent()) { throw new IllegalArgumentException("SelectedGrid not found"); } final FactMapping factMapping = selectedScenarioGridModel.get().getScesimModelDescriptor().getFactMappingByIndex(columnIndex); selectedColumn.setFactory(context.getCollectionEditorSingletonDOMElementFactory()); if (factModelTree.isSimple()) { factMapping.setGenericTypes(factModelTree.getGenericTypeInfo(ConstantHolder.VALUE)); } else { final FactModelTree nestedFactModelTree = navigateComplexObject(factModelTree, fullPropertyPathElements, dataObjectFieldsMap); factMapping.setGenericTypes(nestedFactModelTree.getGenericTypeInfo(fullPropertyPathElements.get(fullPropertyPathElements.size() - 1))); } }
Source:
public boolean matches(RelOptRuleCall call) { FlinkLogicalOverAggregate logicWindow = call.rel(0); List<AggregateCall> aggCalls = logicWindow.groups.get(0).getAggregateCalls(logicWindow); boolean existGeneralPythonFunction = aggCalls.stream().anyMatch(x -> PythonUtil.isPythonAggregate(x, PythonFunctionKind.GENERAL)); boolean existPandasFunction = aggCalls.stream().anyMatch(x -> PythonUtil.isPythonAggregate(x, PythonFunctionKind.PANDAS)); boolean existJavaFunction = aggCalls.stream().anyMatch(x -> !PythonUtil.isPythonAggregate(x, null)); if (existPandasFunction || existGeneralPythonFunction) { if (existGeneralPythonFunction) { throw new TableException("non-Pandas UDAFs are not supported in stream mode currently."); } if (existJavaFunction) { throw new TableException("Python UDAF and Java/Scala UDAF cannot be used together."); } return true; } else { return false; } }

Target:
public boolean matches(RelOptRuleCall call) { FlinkLogicalOverAggregate logicWindow = call.rel(0); List<AggregateCall> aggCalls = logicWindow.groups.get(0).getAggregateCalls(logicWindow); boolean existGeneralPythonFunction = aggCalls.stream().anyMatch(x -> PythonUtil.isPythonAggregate(x, PythonFunctionKind.GENERAL)); boolean existPandasFunction = aggCalls.stream().anyMatch(x -> PythonUtil.isPythonAggregate(x, PythonFunctionKind.PANDAS)); boolean existJavaFunction = aggCalls.stream().anyMatch(x -> !PythonUtil.isPythonAggregate(x, null)); if (existPandasFunction || existGeneralPythonFunction) { if (existGeneralPythonFunction) { throw new TableException("Non-Pandas Python UDAFs are not supported in stream mode currently."); } if (existJavaFunction) { throw new TableException("Python UDAF and Java/Scala UDAF cannot be used together."); } return true; } else { return false; } }
Source:
private boolean isBindingChange(FieldDefinition oldField, FieldDefinition fieldCopy) { if (oldField.getBinding() == null) { return fieldCopy.getBinding() != null && !fieldCopy.getBinding().equals(""); } return !oldField.getBinding().equals(fieldCopy.getBinding()) || !oldField.getId().equals(fieldCopy.getId()) || (oldField.getBinding().equals(fieldCopy.getBinding()) && oldField.getId().equals(fieldCopy.getId())); }

Target:
protected boolean isBindingChange(FieldDefinition oldField, FieldDefinition fieldCopy) { if (oldField.getBinding() == null || oldField.getBinding().equals("")) { return fieldCopy.getBinding() != null && !fieldCopy.getBinding().equals(""); } return true; }
Source:
public Map<Errors, Integer> errorCounts() { Map<Errors, Integer> counts = new HashMap<>(); Errors topLevelErr = Errors.forCode(data.errorCode()); updateErrorCounts(counts, topLevelErr); data.responses().forEach(topicResponse -> topicResponse.partitions().forEach(partitionResponse -> updateErrorCounts(counts, Errors.forCode(partitionResponse.errorCode())) )); return counts; }

Target:
public Map<Errors, Integer> errorCounts() { Map<Errors, Integer> counts = new HashMap<>(); updateErrorCounts(counts, Errors.forCode(data.errorCode())); data.responses().forEach(topicResponse -> topicResponse.partitions().forEach(partitionResponse -> updateErrorCounts(counts, Errors.forCode(partitionResponse.errorCode())) )); return counts; }