auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void fillDriverSpecificChannelConfiguration(final Tocd mainOcd, final List<Tad> driverSpecificChannelConfiguration) { if (mainOcd == null || driverSpecificChannelConfiguration == null) { return; } final ChannelDescriptor basicChanneldescriptor = new BaseChannelDescriptor(); final Object baseChannelDescriptor = basicChanneldescriptor.getDescriptor(); if (nonNull(baseChannelDescriptor) && baseChannelDescriptor instanceof List<?>) { List<Tad> channelConfiguration = (List<Tad>) baseChannelDescriptor; channelConfiguration.addAll(driverSpecificChannelConfiguration); for (final Tad attribute : channelConfiguration) { for (final String channelName : this.assetConfiguration.getAssetChannels().keySet()) { final Tad newAttribute = cloneAd(attribute, channelName); mainOcd.addAD(newAttribute); } } } }

Target:
private void fillDriverSpecificChannelConfiguration(final Tocd mainOcd, final List<Tad> driverSpecificChannelConfiguration) { if (mainOcd == null || driverSpecificChannelConfiguration == null) { return; } final ChannelDescriptor basicChanneldescriptor = new BaseChannelDescriptor(); final Object baseChannelDescriptor = basicChanneldescriptor.getDescriptor(); if (nonNull(baseChannelDescriptor) && baseChannelDescriptor instanceof List<?>) { List<Tad> channelConfiguration = (List<Tad>) baseChannelDescriptor; channelConfiguration.addAll(driverSpecificChannelConfiguration); for (final Tad attribute : channelConfiguration) { for (final Entry<String, Channel> entry : this.assetConfiguration.getAssetChannels().entrySet()) { final String channelName = entry.getKey(); final Tad newAttribute = cloneAd(attribute, channelName); mainOcd.addAD(newAttribute); } } } }
Source:
private void appendParameters(StringBuilder builder, String... paramPairs) { Arrays.stream(paramPairs).forEach(paramPair -> builder.append(paramPair).append("&")); builder.deleteCharAt(builder.lastIndexOf("&")); }

Target:
private void appendParameters(StringBuilder builder, String... paramPairs) { builder.append(Arrays.stream(paramPairs).collect(Collectors.joining("&"))); }
Source:
private void visitUnaryExpression(UnaryExpressionTree tree) { visitReadVariable(tree.expression()); visitAssignedVariable(tree.expression()); }

Target:
private void visitUnaryExpression(UnaryExpressionTree tree) { tree.expression().accept(this); visitAssignedVariable(tree.expression()); }
Source:
private static FairyModule getFairyModuleForLocale(DataMaster dataMaster, Locale locale, Random random) { LanguageCode code = LanguageCode.valueOf(locale.getLanguage().toUpperCase()); switch (code) { case PL: return new PlFairyModule(dataMaster, random); case EN: return new EnFairyModule(dataMaster, random); case ES: return new EsFairyModule(dataMaster, random); default: return new EnFairyModule(dataMaster, random); } }

Target:
private static FairyModule getFairyModuleForLocale(DataMaster dataMaster, Locale locale, Random random) { LanguageCode code = LanguageCode.valueOf(locale.getLanguage().toUpperCase()); switch (code) { case PL: return new PlFairyModule(dataMaster, random); case EN: return new EnFairyModule(dataMaster, random); case ES: return new EsFairyModule(dataMaster, random); default: LOG.info("No data for your language - using EN"); return new EnFairyModule(dataMaster, random); } }
Source:
private UserModel createUser(RealmModel realm, String username) { return new AbstractUserAdapterFederatedStorage(session, realm, model) { @Override public String doGetUsername() { return username; } @Override public void doSetUsername(String username1) { if (!username1.equals(username)) { throw new RuntimeException("Unsupported to change username"); } } }; }

Target:
private UserModel createUser(RealmModel realm, String username) { return new AbstractUserAdapterFederatedStorage(session, realm, model) { @Override public String getUsername() { return username; } @Override public void setUsername(String username1) { if (!username1.equals(username)) { throw new RuntimeException("Unsupported to change username"); } } }; }
Source:
public void tearDown(ManagementClient managementClient, String containerId) throws Exception { this.module.remove(); }

Target:
public void tearDown(ManagementClient managementClient, String containerId) throws Exception { this.module.remove(); if (writeMinimumPermissions()) { final ModelNode address = new ModelNode(); address.add("subsystem", "security-manager"); address.add("deployment-permissions", "default"); address.protect(); final ModelNode operation = new ModelNode(); operation.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.WRITE_ATTRIBUTE_OPERATION); operation.get(ModelDescriptionConstants.OP_ADDR).set(address); operation.get("name").set("minimum-permissions"); operation.get("value").set(backupList); ManagementOperations.executeOperation(managementClient.getControllerClient(), operation); ServerReload.executeReloadAndWaitForCompletion(managementClient.getControllerClient()); } }
Source:
public void init(){ intervalTree.clear(); intervalTree.put(1, 10, "foo1"); intervalTree.put(2, 9, "foo2"); intervalTree.put(3, 8, "foo3"); intervalTree.put(4, 7, "foo4"); intervalTree.put(5, 6, "foo5"); intervalTree.put(1, 9, "foo6"); }

Target:
public void init(){ intervalTree.clear(); intervalTree.put(1, 10, "foo1:10"); intervalTree.put(2, 9, "foo2:8"); intervalTree.put(3, 8, "foo3:6"); intervalTree.put(4, 7, "foo4:4"); intervalTree.put(5, 6, "foo5:2"); intervalTree.put(1, 9, "foo6:9"); }
Source:
private long findCollisionIndex( long value ) { long low = 0 + 0; long high = numberOfCollisions - 1; while ( low <= high ) { long mid = (low + high) / 2; long midValue = collisionNodeIdCache.get( mid ); switch ( unsignedDifference( midValue, value ) ) { case EQ: return mid; case LT: low = mid + 1; break; default: high = mid - 1; break; } } return ID_NOT_FOUND; }

Target:
private long findCollisionIndex( long value ) { long low = 0; long high = numberOfCollisions - 1; while ( low <= high ) { long mid = (low + high) / 2; long midValue = collisionNodeIdCache.get( mid ); switch ( unsignedDifference( midValue, value ) ) { case EQ: return mid; case LT: low = mid + 1; break; default: high = mid - 1; break; } } return ID_NOT_FOUND; }
Source:
private boolean connectedToNetworkTypeForMarshmallow(int networkType) { Network[] networks = connectivityManager.getAllNetworks(); for (Network network : networks) { NetworkInfo networkInfo = connectivityManager.getNetworkInfo(network); if (networkInfo.getType() == networkType) { return networkInfo.getState() == NetworkInfo.State.CONNECTED; } } return false; }

Target:
private boolean connectedToNetworkTypeForMarshmallow(int networkType) { Network[] networks = connectivityManager.getAllNetworks(); for (Network network : networks) { NetworkInfo networkInfo = connectivityManager.getNetworkInfo(network); if (networkInfo.getType() == networkType) { return networkInfo.isConnected(); } } return false; }
Source:
public int read() throws IOException { return 0; }

Target:
public int read() throws IOException { return -1; }
Source:
protected ITranslationUnit getTranslationUnitViaEditorOrWorkspace(IMarker marker) { IResource resource = marker.getResource(); if (resource instanceof IFile) { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); IEditorPart editor = ResourceUtil.findEditor(page, (IFile) resource); if (editor != null) { return (ITranslationUnit) CDTUITools.getEditorInputCElement(editor.getEditorInput()); } } return getTranslationUnitViaWorkspace(marker); }

Target:
protected Optional<ITranslationUnit> getTranslationUnitViaEditorOrWorkspace(IMarker marker) { return Optional.ofNullable(getTranslationUnitViaWorkspace(marker)).map(toWorkingCopy); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (request instanceof HttpServletRequest && !Boolean.parseBoolean((String) request.getAttribute(ATTRIBUTE_ACTION_DISPATCHED))) { String[] xactions = request.getParameterValues("xaction"); HttpServletRequest hrequest = (HttpServletRequest) request; Enumeration<String> parameterNames = hrequest.getParameterNames(); while (parameterNames.hasMoreElements()) { String parameter = parameterNames.nextElement(); if (parameter.startsWith(ACTION_PREFIX) && (xactions == null || Stream.of(xactions) .anyMatch(it -> Objects.equals(parameter, String.format("action_%s", it))))) { String targetURL = getTargetURL(hrequest, parameter); RequestDispatcher dispatcher = hrequest.getRequestDispatcher(targetURL); if (dispatcher != null) { LOGGER.debug("Forwarding request to " + targetURL); request.setAttribute(ATTRIBUTE_ACTION_DISPATCHED, "true"); dispatcher.forward(hrequest, response); request.removeAttribute(ATTRIBUTE_ACTION_DISPATCHED); return; } } } } chain.doFilter(request, response); }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (request instanceof HttpServletRequest && !Boolean.parseBoolean((String) request.getAttribute(ATTRIBUTE_ACTION_DISPATCHED))) { HttpServletRequest hrequest = (HttpServletRequest) request; Enumeration<String> parameterNames = hrequest.getParameterNames(); while (parameterNames.hasMoreElements()) { String parameter = parameterNames.nextElement(); String[] xactions = request.getParameterValues("xaction"); if (parameter.startsWith(ACTION_PREFIX) && (xactions == null || Stream.of(xactions) .anyMatch(it -> Objects.equals(parameter, String.format("action_%s", it))))) { String targetURL = getTargetURL(hrequest, parameter); RequestDispatcher dispatcher = hrequest.getRequestDispatcher(targetURL); if (dispatcher != null) { LOGGER.debug("Forwarding request to " + targetURL); request.setAttribute(ATTRIBUTE_ACTION_DISPATCHED, "true"); dispatcher.forward(hrequest, response); request.removeAttribute(ATTRIBUTE_ACTION_DISPATCHED); return; } } } } chain.doFilter(request, response); }
Source:
public static void waitForStreamedTargetDeallocated(Client client) throws Exception { boolean passed = false; System.out.println("Quiesce client...."); quiesce(client); System.out.println("Quiesce done...."); VoltTable stats = null; long ftime = 0; long st = System.currentTimeMillis(); long end = System.currentTimeMillis() + (10 * 60 * 1000); while (true) { stats = client.callProcedure("@Statistics", "export", 0).getResults()[0]; boolean passedThisTime = true; long ctime = System.currentTimeMillis(); if (ctime > end) { System.out.println("Waited too long..."); System.out.println(stats); break; } if (ctime - st > (3 * 60 * 1000)) { System.out.println(stats); st = System.currentTimeMillis(); } while (stats.advanceRow()) { passedThisTime = false; String target = stats.getString("TARGET"); String ttable = stats.getString("SOURCE"); Long host = stats.getLong("HOST_ID"); Long pid = stats.getLong("PARTITION_ID"); if (target.isEmpty()) { System.out.println("Stream Not Dropped but target is disabled: " + ttable + " host:" + host + " partid:" + pid); } else { System.out.println("Stream Not Dropped: " + ttable + " to " + target + " host:" + host + " partid:" + pid); } } if (passedThisTime) { passed = true; break; } Thread.sleep(5000); } System.out.println("Passed is: " + passed); assertTrue(passed); }

Target:
public static void waitForStreamedTargetDeallocated(Client client) throws Exception { boolean passed = false; System.out.println("Quiesce client...."); quiesce(client); System.out.println("Quiesce done...."); VoltTable stats = null; long st = System.currentTimeMillis(); long end = System.currentTimeMillis() + (10 * 60 * 1000); while (true) { boolean passedThisTime = true; long ctime = System.currentTimeMillis(); if (ctime > end) { System.out.println("Waited too long..."); System.out.println(stats); break; } if (ctime - st > (3 * 60 * 1000)) { System.out.println(stats); st = System.currentTimeMillis(); } stats = client.callProcedure("@Statistics", "export", 0).getResults()[0]; while (stats.advanceRow()) { passedThisTime = false; String target = stats.getString("TARGET"); String ttable = stats.getString("SOURCE"); Long host = stats.getLong("HOST_ID"); Long pid = stats.getLong("PARTITION_ID"); if (target.isEmpty()) { System.out.println("Stream Not Dropped but target is disabled: " + ttable + " host:" + host + " partid:" + pid); } else { System.out.println("Stream Not Dropped: " + ttable + " to " + target + " host:" + host + " partid:" + pid); } } if (passedThisTime) { passed = true; break; } Thread.sleep(5000); } System.out.println("Passed is: " + passed); assertTrue(passed); }
Source:
public void setup() throws Exception { super.setup(); S3AFileSystem fs = getFileSystem(); assertTrue("FS needs to have a metadatastore.", fs.hasMetadataStore()); assertTrue("Metadatastore should persist authoritative bit", metadataStorePersistsAuthoritativeBit(fs.getMetadataStore())); guardedFs = fs; metadataStore = fs.getMetadataStore(); rawFS = createUnguardedFS(); assertFalse("Raw FS still has S3Guard " + rawFS, rawFS.hasMetadataStore()); }

Target:
public void setup() throws Exception { super.setup(); S3AFileSystem fs = getFileSystem(); assumeTrue("FS needs to have a metadatastore.", fs.hasMetadataStore()); assumeTrue("Metadatastore should persist authoritative bit", metadataStorePersistsAuthoritativeBit(fs.getMetadataStore())); guardedFs = fs; metadataStore = fs.getMetadataStore(); rawFs = createUnguardedFS(); assertFalse("Raw FS still has S3Guard " + rawFs, rawFs.hasMetadataStore()); }
Source:
public TextsSizeMismatch(WebElementsCollection collection, List<String> actualTexts, List<String> expectedTexts, String explanation, long timeoutMs) { super(collection.driver(), "\nActual: " + actualTexts + ", List size: " + actualTexts.size() + "\nExpected: " + expectedTexts + ", List size: " + expectedTexts.size() + (explanation == null ? "" : "\nBecause: " + explanation) + "\nCollection: " + collection.description()); super.timeoutMs = timeoutMs; }

Target:
public TextsSizeMismatch(WebElementsCollection collection, List<String> actualTexts, List<String> expectedTexts, String explanation, long timeoutMs) { super(collection.driver(), lineSeparator() + "Actual: " + actualTexts + ", List size: " + actualTexts.size() + lineSeparator() + "Expected: " + expectedTexts + ", List size: " + expectedTexts.size() + (explanation == null ? "" : lineSeparator() + "Because: " + explanation) + lineSeparator() + "Collection: " + collection.description()); super.timeoutMs = timeoutMs; }
Source:
public String evaluateNamespaceName(NamespaceResolutionContext resolutionCtx) throws InfrastructureException { String namespace = evalPlaceholders(defaultNamespaceName, resolutionCtx); if (!NamespaceNameValidator.isValid(namespace)) { Optional<KubernetesNamespaceMeta> namespaceMetaOptional; String normalizedNamespace = NamespaceNameValidator.normalize(namespace); if (normalizedNamespace.isEmpty()) { throw new InfrastructureException( format( "Evaluated empty namespace name for workspace %s", resolutionCtx.getWorkspaceId())); } do { normalizedNamespace = normalizedNamespace .substring(0, Math.min(55, normalizedNamespace.length())) .concat(NameGenerator.generate("-", 6)); namespaceMetaOptional = fetchNamespace(normalizedNamespace); } while (namespaceMetaOptional.isPresent()); namespace = normalizedNamespace; } LOG.debug( "Evaluated the namespace for workspace using the namespace default to {}", resolutionCtx.getWorkspaceId(), namespace); return namespace; }

Target:
public String evaluateNamespaceName(NamespaceResolutionContext resolutionCtx) throws InfrastructureException { String namespace; Optional<Pair<String, String>> storedNamespace = getPreferencesNamespaceName(resolutionCtx); if (storedNamespace.isEmpty() || !isStoredTemplateValid(storedNamespace.get().second)) { namespace = evalPlaceholders(defaultNamespaceName, resolutionCtx); } else { namespace = storedNamespace.get().first; } if (!NamespaceNameValidator.isValid(namespace)) { Optional<KubernetesNamespaceMeta> namespaceMetaOptional; String normalizedNamespace = normalizeNamespaceName(namespace); if (normalizedNamespace.isEmpty()) { throw new InfrastructureException( format( "Evaluated empty namespace name for workspace %s", resolutionCtx.getWorkspaceId())); } do { normalizedNamespace = normalizedNamespace .substring(0, Math.min(55, normalizedNamespace.length())) .concat(NameGenerator.generate("-", 6)); namespaceMetaOptional = fetchNamespace(normalizedNamespace); } while (namespaceMetaOptional.isPresent()); namespace = normalizedNamespace; } LOG.debug( "Evaluated the namespace for workspace using the namespace default to {}", resolutionCtx.getWorkspaceId(), namespace); if (resolutionCtx.isPersistAfterCreate() && !defaultNamespaceName.contains(WORKSPACEID_PLACEHOLDER)) { recordEvaluatedNamespaceName(namespace, resolutionCtx); } return namespace; }
Source:
public void invoke(Request request, Response response) throws IOException, ServletException { Tracer tracer = traceService.getTracer(); Optional.ofNullable(request.getHeader(X_CLOUD_TRACE_HEADER)).ifPresent(traceHeader -> { SpanContext spanContext = traceService .getSpanContextFactory() .fromHeader(traceHeader); traceService.getSpanContextHandler().attach(spanContext); log.trace("Tracing request with header: " + request.getHeader(X_CLOUD_TRACE_HEADER)); }); TraceContext context = tracer.startSpan(request.getRequestURI()); getNext().invoke(request, response); tracer.endSpan(context); }

Target:
public void invoke(Request request, Response response) throws IOException, ServletException { Tracer tracer = traceService.getTracer(); String traceHeader = request.getHeader(X_CLOUD_TRACE_HEADER); if (traceHeader != null) { SpanContext spanContext = traceService .getSpanContextFactory() .fromHeader(traceHeader); traceService.getSpanContextHandler().attach(spanContext); log.debug("Tracing request with header: " + request.getHeader(X_CLOUD_TRACE_HEADER)); } TraceContext context = tracer.startSpan(request.getRequestURI()); getNext().invoke(request, response); tracer.endSpan(context); }
Source:
private boolean checkForMenuHintUpdates() { if (menuHint.hasHint()) { try { int propRV = sendSetProperty("MENU_HINT", menuHint.format()); if (propRV != 0) { if (Sage.DBG) System.out.println("MiniClient did not succeed with menu hint change to:" + menuHint.menuName + ", errcode=" + propRV); } menuHint.clear(); } catch (java.io.IOException e) { if (Sage.DBG) System.out.println("Error w/ MiniClient UI:" + e); connectionError(); return false; } } return true; }

Target:
private boolean checkForMenuHintUpdates() { String hintText; synchronized (menuHint) { hintText=menuHint.format(); menuHint.clear(); } if (hintText!=null) { try { int propRV = sendSetProperty("MENU_HINT", hintText); if (propRV != 0) { if (Sage.DBG) System.out.println("MiniClient did not succeed with menu hint change to:" + hintText + ", errcode=" + propRV); } } catch (java.io.IOException e) { if (Sage.DBG) System.out.println("Error w/ MiniClient UI:" + e); connectionError(); return false; } } return true; }
Source:
static void waitForReconnectDelay() { Observer.waitForReconnectDelayHelper(reconnectDelayMs); }

Target:
static void waitForReconnectDelay() { waitForReconnectDelayHelper(reconnectDelayMs); }
Source:
protected void setUp() throws Exception { super.setUp(); enableNormalize(); if (this.collapseModuleExportProperties) { this.setAcceptedLanguage(LanguageMode.ECMASCRIPT_2015); this.setLanguageOut(LanguageMode.ECMASCRIPT5); } }

Target:
protected void setUp() throws Exception { super.setUp(); enableNormalize(); }
Source:
public void onSocialChanged(AccountStore.OnSocialChanged event) { if (event.isError()) { AppLog.e(T.API, "SignupGoogleFragment.onSocialChanged: " + event.error.type + " - " + event.error.message); switch (event.error.type) { case TWO_STEP_ENABLED: AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_2FA_NEEDED); ToastUtils.showToast(getContext(), getString(R.string.signup_user_exists, mGoogleEmail), ToastUtils.Duration.LONG); PushSocialPayload payload = new PushSocialPayload(mIdToken, SERVICE_TYPE_GOOGLE); mDispatcher.dispatch(AccountActionBuilder.newPushSocialLoginAction(payload)); break; case USER_EXISTS: AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_ACCOUNTS_NEED_CONNECTING); ToastUtils.showToast(getContext(), getString(R.string.signup_user_exists, mGoogleEmail), ToastUtils.Duration.LONG); mLoginListener.loginViaSocialAccount(mGoogleEmail, mIdToken, SERVICE_TYPE_GOOGLE, true); mDispatcher.unregister(this); getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit(); break; default: showErrorDialog(getString(R.string.login_error_generic)); break; } } else if (event.requiresTwoStepAuth) { mLoginListener.needs2faSocial(mGoogleEmail, event.userId, event.nonceAuthenticator, event.nonceBackup, event.nonceSms); mDispatcher.unregister(this); getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit(); } }

Target:
public void onSocialChanged(AccountStore.OnSocialChanged event) { if (event.isError()) { AppLog.e(T.API, "SignupGoogleFragment.onSocialChanged: " + event.error.type + " - " + event.error.message); switch (event.error.type) { case TWO_STEP_ENABLED: AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_2FA_NEEDED); mLoginListener.showSignupToLoginMessage(); PushSocialPayload payload = new PushSocialPayload(mIdToken, SERVICE_TYPE_GOOGLE); mDispatcher.dispatch(AccountActionBuilder.newPushSocialLoginAction(payload)); break; case USER_EXISTS: AnalyticsTracker.track(AnalyticsTracker.Stat.SIGNUP_SOCIAL_ACCOUNTS_NEED_CONNECTING); mLoginListener.showSignupToLoginMessage(); mLoginListener.loginViaSocialAccount(mGoogleEmail, mIdToken, SERVICE_TYPE_GOOGLE, true); mDispatcher.unregister(this); getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit(); break; default: showErrorDialog(getString(R.string.login_error_generic)); break; } } else if (event.requiresTwoStepAuth) { mLoginListener.needs2faSocial(mGoogleEmail, event.userId, event.nonceAuthenticator, event.nonceBackup, event.nonceSms); mDispatcher.unregister(this); getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit(); } }
Source:
void onlyTanksCanMoveTwo() { final Route route = new Route(germany, easternEurope, kareliaSsr); final Collection<Unit> units = germanyUnits(Matches.unitIsOfTypes(infantryType, armourType)); assertThat(units, hasSize(5)); final Collection<Unit> justTanks = germanyUnits(Matches.unitIsOfType(armourType)); assertThat(justTanks, hasSize(2)); final var result = filterUnits(route, units); assertThat(result.getErrorMessage(), is(nullValue())); assertThat(result.getWarningMessage(), is("Not all units have enough movement")); assertThat(result.getUnitsWithDependents(), containsInAnyOrder(justTanks.toArray())); }

Target:
void onlyTanksCanMoveTwo() { final Route route = new Route(germany, easternEurope, kareliaSsr); final Collection<Unit> units = germanyUnits(Matches.unitIsOfTypes(infantryType, armourType)); assertThat(units, hasSize(5)); final Collection<Unit> justTanks = germanyUnits(Matches.unitIsOfType(armourType)); assertThat(justTanks, hasSize(2)); final var result = filterUnits(route, units); assertThat(result.getStatus(), is(FilterOperationResult.Status.SOME_UNITS_CAN_MOVE)); assertThat( result.getWarningOrErrorMessage(), isPresentAndIs("Not all units have enough movement")); assertThat(result.getUnitsWithDependents(), containsInAnyOrder(justTanks.toArray())); }
Source:
public void testGetUnknownResolver() { String synapseVariable = "$SYSTEM1:VAR"; try { ResolverFactory.getInstance().getResolver(synapseVariable); } catch (ResolverException e) { assertNotNull(e.getMessage()); } }

Target:
public void testGetUnknownResolver() { String synapseVariable = "$SYSTEM1:VAR"; ResolverFactory.getInstance().getResolver(synapseVariable); }
Source:
public void init() throws IOException { super.init(); SortSpec[] sortSpecs = logicalPlan.getSortSpecs(); indexKeys = new int[sortSpecs.length]; keySchema = PlannerUtil.sortSpecsToSchema(sortSpecs); Column col; for (int i = 0 ; i < sortSpecs.length; i++) { col = sortSpecs[i].getSortKey(); indexKeys[i] = inSchema.getColumnId(col.getQualifiedName()); } TajoConf conf = new TajoConf(); Path indexPath = new Path(conf.getVar(ConfVars.INDEX_DIR), logicalPlan.getIndexName() + "/" + context.getUniqueKeyFromFragments()); BSTIndex bst = new BSTIndex(conf); this.comparator = new TupleComparator(keySchema, sortSpecs); this.indexWriter = bst.getIndexWriter(indexPath, BSTIndex.TWO_LEVEL_INDEX, keySchema, comparator); this.indexWriter.setLoadNum(100); this.indexWriter.open(); }

Target:
public void init() throws IOException { super.init(); SortSpec[] sortSpecs = logicalPlan.getSortSpecs(); indexKeys = new int[sortSpecs.length]; keySchema = PlannerUtil.sortSpecsToSchema(sortSpecs); Column col; for (int i = 0 ; i < sortSpecs.length; i++) { col = sortSpecs[i].getSortKey(); indexKeys[i] = inSchema.getColumnId(col.getQualifiedName()); } TajoConf conf = context.getConf(); String[] splits = logicalPlan.getIndexName().split("\\."); Path indexPath = new Path(conf.getVar(ConfVars.WAREHOUSE_DIR), splits[0] + "/" + splits[1] + "/" + context.getUniqueKeyFromFragments()); System.out.println("exec: " + indexPath); BSTIndex bst = new BSTIndex(conf); this.comparator = new TupleComparator(keySchema, sortSpecs); this.indexWriter = bst.getIndexWriter(indexPath, BSTIndex.TWO_LEVEL_INDEX, keySchema, comparator); this.indexWriter.setLoadNum(100); this.indexWriter.open(); }
Source:
private void appendLineText(final SafeHtmlBuilder m, final int lineNumberMinusOne, final PatchLine.Type type, final SafeHtml lineHtml, final boolean trailingEdit, final boolean fullBlock) { m.openTd(); m.setStyleName(Gerrit.RESOURCES.css().lineNumber()); m.openAnchor(); m.append(lineNumberMinusOne + 1); m.closeAnchor(); m.closeTd(); m.openTd(); m.addStyleName(Gerrit.RESOURCES.css().fileLine()); switch (type) { case CONTEXT: m.addStyleName(Gerrit.RESOURCES.css().fileLineCONTEXT()); break; case DELETE: m.addStyleName(Gerrit.RESOURCES.css().fileLineDELETE()); if (trailingEdit || fullBlock) { m.addStyleName("wdd"); } break; case INSERT: m.addStyleName(Gerrit.RESOURCES.css().fileLineINSERT()); if (trailingEdit || fullBlock) { m.addStyleName("wdi"); } break; } m.append(lineHtml); m.closeTd(); }

Target:
private void appendLineText(final SafeHtmlBuilder m, final int lineNumberMinusOne, final PatchLine.Type type, final SafeHtml lineHtml, final boolean trailingEdit, final boolean fullBlock) { m.openTd(); m.setStyleName(Gerrit.RESOURCES.css().lineNumber()); m.append(lineNumberMinusOne + 1); m.closeTd(); m.openTd(); m.addStyleName(Gerrit.RESOURCES.css().fileLine()); switch (type) { case CONTEXT: m.addStyleName(Gerrit.RESOURCES.css().fileLineCONTEXT()); break; case DELETE: m.addStyleName(Gerrit.RESOURCES.css().fileLineDELETE()); if (trailingEdit || fullBlock) { m.addStyleName("wdd"); } break; case INSERT: m.addStyleName(Gerrit.RESOURCES.css().fileLineINSERT()); if (trailingEdit || fullBlock) { m.addStyleName("wdi"); } break; } m.append(lineHtml); m.closeTd(); }
Source:
private static DistributedQueryRunner createQueryRunner() throws Exception { DistributedQueryRunner queryRunner = new DistributedQueryRunner(testSessionBuilder() .setSource(TestSpatialJoins.class.getSimpleName()) .setCatalog("hive") .setSchema("default") .build(), 4); queryRunner.installPlugin(new GeoPlugin()); File baseDir = queryRunner.getCoordinator().getBaseDataDir().resolve("hive_data").toFile(); HiveClientConfig hiveClientConfig = new HiveClientConfig(); HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationUpdater(hiveClientConfig)); HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, hiveClientConfig, new NoHdfsAuthentication()); FileHiveMetastore metastore = new FileHiveMetastore(hdfsEnvironment, baseDir.toURI().toString(), "test"); metastore.createDatabase(Database.builder() .setDatabaseName("default") .setOwnerName("public") .setOwnerType(PrincipalType.ROLE) .build()); queryRunner.installPlugin(new HivePlugin("hive", Optional.of(metastore))); queryRunner.createCatalog("hive", "hive"); return queryRunner; }

Target:
private static DistributedQueryRunner createQueryRunner() throws Exception { Session session = testSessionBuilder() .setSource(TestSpatialJoins.class.getSimpleName()) .setCatalog("hive") .setSchema("default") .build(); DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session) .setNodeCount(4) .build(); queryRunner.installPlugin(new GeoPlugin()); File baseDir = queryRunner.getCoordinator().getBaseDataDir().resolve("hive_data").toFile(); HiveClientConfig hiveClientConfig = new HiveClientConfig(); HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationUpdater(hiveClientConfig)); HdfsEnvironment hdfsEnvironment = new HdfsEnvironment(hdfsConfiguration, hiveClientConfig, new NoHdfsAuthentication()); FileHiveMetastore metastore = new FileHiveMetastore(hdfsEnvironment, baseDir.toURI().toString(), "test"); metastore.createDatabase(Database.builder() .setDatabaseName("default") .setOwnerName("public") .setOwnerType(PrincipalType.ROLE) .build()); queryRunner.installPlugin(new HivePlugin("hive", Optional.of(metastore))); queryRunner.createCatalog("hive", "hive"); return queryRunner; }
Source:
private Date updateAge(String birthdate, String dateformat, String age) throws java.text.ParseException { SimpleDateFormat df = new SimpleDateFormat(); if (!"".equals(dateformat)) { dateformat = dateformat.toLowerCase().replaceAll("m", "M"); } else { dateformat = new String("MM/dd/yyyy"); } df.applyPattern(dateformat); Calendar cal = Calendar.getInstance(); cal.clear(Calendar.HOUR); cal.clear(Calendar.MINUTE); cal.clear(Calendar.SECOND); cal.clear(Calendar.MILLISECOND); if ("".equals(birthdate)) { if ("".equals(age)) { return cal.getTime(); } try { cal.add(Calendar.YEAR, -(Integer.parseInt(age))); } catch (NumberFormatException nfe) { log.debug ("Error during adding date into calendar",nfe); } return cal.getTime(); } else { cal.setTime(df.parse(birthdate)); } return cal.getTime(); }

Target:
private Date updateAge(String birthdate, String dateformat, String age) throws java.text.ParseException { SimpleDateFormat df = new SimpleDateFormat(); if (!"".equals(dateformat)) { dateformat = dateformat.toLowerCase().replaceAll("m", "M"); } else { dateformat = new String("MM/dd/yyyy"); } df.applyPattern(dateformat); Calendar cal = Calendar.getInstance(); cal.clear(Calendar.HOUR); cal.clear(Calendar.MINUTE); cal.clear(Calendar.SECOND); cal.clear(Calendar.MILLISECOND); if ("".equals(birthdate)) { if ("".equals(age)) { return cal.getTime(); } try { cal.add(Calendar.YEAR, -(Integer.parseInt(age))); } catch (NumberFormatException nfe) { log.error ("Error during adding date into calendar", nfe); } return cal.getTime(); } else { cal.setTime(df.parse(birthdate)); } return cal.getTime(); }
Source:
private void expandIfNecessary(long dataLength) throws IOException { long elementLength = Element.HEADER_LENGTH + dataLength; long remainingBytes = remainingBytes(); if (remainingBytes >= elementLength) return; long previousLength = fileLength; long newLength; do { remainingBytes += previousLength; newLength = previousLength << 1; previousLength = newLength; } while (remainingBytes < elementLength); setLength(newLength); long endOfLastElement = wrapPosition(last.position + Element.HEADER_LENGTH + last.length); long count = 0; if (endOfLastElement <= first.position) { FileChannel channel = raf.getChannel(); channel.position(fileLength); count = endOfLastElement - headerLength; if (channel.transferTo(headerLength, count, channel) != count) { throw new AssertionError("Copied insufficient number of bytes!"); } } if (last.position < first.position) { long newLastPosition = fileLength + last.position - headerLength; writeHeader(newLength, elementCount, first.position, newLastPosition); last = new Element(newLastPosition, last.length); } else { writeHeader(newLength, elementCount, first.position, last.position); } fileLength = newLength; if (zero && count != 0) { ringErase(headerLength, count); } }

Target:
private void expandIfNecessary(long dataLength) throws IOException { long elementLength = Element.HEADER_LENGTH + dataLength; long remainingBytes = remainingBytes(); if (remainingBytes >= elementLength) return; long previousLength = fileLength; long newLength; do { remainingBytes += previousLength; newLength = previousLength << 1; previousLength = newLength; } while (remainingBytes < elementLength); setLength(newLength); long endOfLastElement = wrapPosition(last.position + Element.HEADER_LENGTH + last.length); long count = 0; if (endOfLastElement <= first.position) { FileChannel channel = raf.getChannel(); channel.position(fileLength); count = endOfLastElement - headerLength; if (channel.transferTo(headerLength, count, channel) != count) { throw new AssertionError("Copied insufficient number of bytes!"); } } if (last.position < first.position) { long newLastPosition = fileLength + last.position - headerLength; writeHeader(newLength, elementCount, first.position, newLastPosition); last = new Element(newLastPosition, last.length); } else { writeHeader(newLength, elementCount, first.position, last.position); } fileLength = newLength; if (zero) { ringErase(headerLength, count); } }
Source:
private static boolean isFuncInFuncSignature(@Nullable GoType type) { if (type == null) return false; PsiElement parentFunc = type; if (type.getParent() instanceof GoParameterDeclaration && type.getParent().getParent() instanceof GoParameters) { parentFunc = type.getParent().getParent().getParent(); } else if (type.getParent() instanceof GoResult) { parentFunc = type.getParent(); } if (parentFunc.getParent() instanceof GoResult) { parentFunc = type.getParent(); } else if (!(parentFunc instanceof GoResult)) { return false; } return parentFunc.getParent() instanceof GoSignature && (type instanceof GoFunctionType || parentFunc.getParent().getParent().getParent().getParent() instanceof GoSignature); }

Target:
private static boolean isFuncInFuncSignature(@Nullable GoType type) { if (type == null || !(type.getParent() instanceof GoResult)) return false; PsiElement parentFunc = type.getParent(); GoParameterDeclaration paramDecl = PsiTreeUtil.getParentOfType(parentFunc, GoParameterDeclaration.class); return parentFunc.getParent() instanceof GoSignature && (type instanceof GoFunctionType || (paramDecl != null && paramDecl.getParent() instanceof GoSignature)); }
Source:
public Parser getParser() { return inputStream -> { String response = new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining(OS.NEWLINE)); System.out.println(response); List<BibEntry> entries = new ArrayList<>(); CoinsParser parser = new CoinsParser(); Pattern pattern = Pattern.compile("<span class=\"Z3988\" title=\"(.*)\"></span>"); Matcher matcher = pattern.matcher(response); while (matcher.find()) { String encodedDataString = matcher.group(1); entries.addAll(parser.parseEntries(encodedDataString)); } return entries; }; }

Target:
public Parser getParser() { return inputStream -> { String response = new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining(OS.NEWLINE)); List<BibEntry> entries = new ArrayList<>(); CoinsParser parser = new CoinsParser(); Pattern pattern = Pattern.compile("<span class=\"Z3988\" title=\"(.*)\"></span>"); Matcher matcher = pattern.matcher(response); while (matcher.find()) { String encodedDataString = matcher.group(1); entries.addAll(parser.parseEntries(encodedDataString)); } return entries; }; }
Source:
public IsoValidStatus isIsoFileValid(StringBuilder isoFile, List<OVirtNodeInfo> Info, RpmVersion ovirtHostOsVersion) { IsoValidStatus result = IsoValidStatus.NOTCOMPATIBLE; String iso = isoFile.toString(); if (StringUtils.isNotBlank(iso)) { for (OVirtNodeInfo infoData: Info) { if (infoData.path != null) { File path = new File(infoData.path, iso); log.infoFormat("Validating ISOs path: {0}", path); if (path.exists()) { log.infoFormat("ISO found: {0}", path); Matcher matcher = infoData.pattern.matcher(iso); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.infoFormat("ISO version [{0}] for RpmVersion", rpmLike); RpmVersion isoVersion = new RpmVersion(iso, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { isoFile.setLength(0); isoFile.append(path.getAbsolutePath()); result = IsoValidStatus.VALID; break; } else { result = IsoValidStatus.NOTCOMPATIBLE; } } else { result = IsoValidStatus.MISSINGFILE; } break; } } } } log.infoFormat("isIsoFileValid result [{0}]", result); return result; }

Target:
public IsoValidStatus isIsoFileValid(StringBuilder isoFile, List<OVirtNodeInfo> Info, RpmVersion ovirtHostOsVersion) { IsoValidStatus result = IsoValidStatus.NOTCOMPATIBLE; String iso = isoFile.toString(); if (StringUtils.isNotBlank(iso)) { for (OVirtNodeInfo infoData: Info) { if (infoData.path != null) { File path = new File(infoData.path, iso); log.infoFormat("Validating ISOs path: {0}", path); if (path.exists()) { log.infoFormat("ISO found: {0}", path); Matcher matcher = infoData.pattern.matcher(iso); if (matcher.find()) { String rpmLike = matcher.group(1).replaceAll("-", "."); log.infoFormat("ISO version [{0}] for RpmVersion", rpmLike); RpmVersion isoVersion = new RpmVersion(iso, "", true); if (VdsHandler.isIsoVersionCompatibleForUpgrade(ovirtHostOsVersion, isoVersion)) { isoFile.setLength(0); isoFile.append(path.getAbsolutePath()); result = IsoValidStatus.VALID; break; } else { result = IsoValidStatus.NOTCOMPATIBLE; } } else { result = IsoValidStatus.MISSINGFILE; } } } } } log.infoFormat("isIsoFileValid result [{0}]", result); return result; }
Source:
public JAXRSContract() { super.registerClassAnnotation(Path.class, (path, data) -> { if (path.value().isEmpty()) { return; } String pathValue = path.value(); if (!pathValue.startsWith("/")) { pathValue = "/" + pathValue; } if (pathValue.endsWith("/")) { pathValue = pathValue.substring(0, pathValue.length() - 1); } pathValue = pathValue.replaceAll("\\{\\s*(.+?)\\s*(:.+?)?\\}", "\\{$1\\}"); data.template().uri(pathValue); }); super.registerClassAnnotation(Consumes.class, this::handleConsumesAnnotation); super.registerClassAnnotation(Produces.class, this::handleProducesAnnotation); registerMethodsAnnotations(); registerParamAnnotations(); }

Target:
public JAXRSContract() { super.registerClassAnnotation(Path.class, (path, data) -> { if (path != null && !path.value().isEmpty()) { String pathValue = path.value(); if (!pathValue.startsWith("/")) { pathValue = "/" + pathValue; } if (pathValue.endsWith("/")) { pathValue = pathValue.substring(0, pathValue.length() - 1); } pathValue = pathValue.replaceAll("\\{\\s*(.+?)\\s*(:.+?)?\\}", "\\{$1\\}"); data.template().uri(pathValue); } }); super.registerClassAnnotation(Consumes.class, this::handleConsumesAnnotation); super.registerClassAnnotation(Produces.class, this::handleProducesAnnotation); registerMethodAnnotation(methodAnnotation -> { Class<? extends Annotation> annotationType = methodAnnotation.annotationType(); HttpMethod http = annotationType.getAnnotation(HttpMethod.class); return http != null; }, (methodAnnotation, data) -> { Class<? extends Annotation> annotationType = methodAnnotation.annotationType(); HttpMethod http = annotationType.getAnnotation(HttpMethod.class); checkState(data.template().method() == null, "Method %s contains multiple HTTP methods. Found: %s and %s", data.configKey(), data.template().method(), http.value()); data.template().method(Request.HttpMethod.valueOf(http.value())); }); super.registerMethodAnnotation(Path.class, (path, data) -> { final String pathValue = emptyToNull(path.value()); if (pathValue == null) { return; } String methodAnnotationValue = path.value(); if (!methodAnnotationValue.startsWith("/") && !data.template().url().endsWith("/")) { methodAnnotationValue = "/" + methodAnnotationValue; } methodAnnotationValue = methodAnnotationValue.replaceAll("\\{\\s*(.+?)\\s*(:.+?)?\\}", "\\{$1\\}"); data.template().uri(methodAnnotationValue, true); }); super.registerMethodAnnotation(Consumes.class, this::handleConsumesAnnotation); super.registerMethodAnnotation(Produces.class, this::handleProducesAnnotation); registerParamAnnotations(); }
Source:
protected long getJWTTokenExpiration(final String token) { if (!isValidIdentifier(token)) { throw new IllegalArgumentException("Token data cannot be null."); } JWT jwt; try { jwt = new JWTToken(token); } catch (final ParseException e) { log.errorParsingToken(e.toString()); throw new IllegalArgumentException(e); } final Date expires = jwt.getExpiresDate(); if (expires == null) { log.jwtTokenExpiry(TokenUtils.getTokenDisplayText(token), "-1"); return -1L; } log.jwtTokenExpiry(TokenUtils.getTokenDisplayText(token), expires.toString()); return expires.getTime(); }

Target:
protected OptionalLong getJWTTokenExpiration(final String token) { JWT jwt; try { jwt = new JWTToken(token); } catch (final ParseException e) { log.errorParsingToken(e.toString()); return OptionalLong.empty(); } final Date expires = jwt.getExpiresDate(); if (expires == null) { log.jwtTokenExpiry(TokenUtils.getTokenDisplayText(token), "-1"); return OptionalLong.of(-1); } log.jwtTokenExpiry(TokenUtils.getTokenDisplayText(token), expires.toString()); return OptionalLong.of(expires.getTime()); }
Source:
public void shouldCreateProcessFromAppstorePackageRegistryMiss() throws Exception { onRequest() .havingMethodEqualTo("POST") .havingPathEqualTo(PROCESSES_PATH) .respond() .withBody(readFromResource("/dataload/processes/asyncTask.json")) .withStatus(202); onRequest() .havingMethodEqualTo("GET") .havingPathEqualTo(PROCESS_DEPLOYMENT_POLLING_URI) .respond() .withStatus(200) .withBody(readFromResource("/dataload/processes/appstoreProcess.json")); DataloadProcess newProcess = new DataloadProcess("appstoreProcess", ProcessType.RUBY.toString(), "${PUBLIC_APPSTORE}:tag/prodigy-testing:/test/rubyHello"); DataloadProcess process = retry(() -> gd.getProcessService().createProcessFromAppstore(project, newProcess).get()); assertThat(process, notNullValue()); }

Target:
public void shouldCreateProcessFromAppstorePackageRegistryMiss() throws Exception { onRequest() .havingMethodEqualTo("POST") .havingPathEqualTo(PROCESSES_PATH) .respond() .withBody(readFromResource("/dataload/processes/asyncTask.json")) .withStatus(202); onRequest() .havingMethodEqualTo("GET") .havingPathEqualTo(PROCESS_DEPLOYMENT_POLLING_URI) .respond() .withStatus(200) .withBody(readFromResource("/dataload/processes/appstoreProcess.json")); DataloadProcess process = gd.getProcessService().createProcessFromAppstore(project, new DataloadProcess("appstoreProcess", ProcessType.RUBY.toString(), "${PUBLIC_APPSTORE}:tag/prodigy-testing:/test/rubyHello")).get(); assertThat(process, notNullValue()); }
Source:
public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal docMetadata) { List<ReferenceMetadata> citationReferencesMetadata = Lists.newArrayList(); if (docMetadata.getReferences() != null) { for (eu.dnetlib.iis.metadataextraction.schemas.ReferenceMetadata docReferenceMetadata : docMetadata.getReferences()) { ReferenceMetadata citationReferenceMetadata = convertReference(docReferenceMetadata); if (citationReferenceMetadata != null) { citationReferencesMetadata.add(citationReferenceMetadata); } } } return new DocumentMetadata(docMetadata.getId(), docMetadata.getExternalIdentifiers(), docMetadata.getPublicationTypeName(), citationReferencesMetadata); }

Target:
public DocumentMetadata convert(ExtractedDocumentMetadataMergedWithOriginal docMetadata) { Preconditions.checkNotNull(docMetadata); List<ReferenceMetadata> citationReferencesMetadata = convertReferences(docMetadata.getReferences()); return new DocumentMetadata(docMetadata.getId(), docMetadata.getExternalIdentifiers(), docMetadata.getPublicationTypeName(), citationReferencesMetadata); }
Source:
public Matrix randn(final int length) { return randn(length); }

Target:
public Matrix randn(final int length) { return randn(length, 1); }
Source:
private void handleDatastreamAddOrDelete() { boolean shouldRetry = false; List<Datastream> allStreams = _datastreamCache.getAllDatastreams(true); if (allStreams.isEmpty()) { _log.warn("Received a new datastream event, but there were no datastreams"); return; } boolean needInvalidate = false; for (Datastream ds : allStreams) { if (ds.getStatus() == DatastreamStatus.INITIALIZING) { try { createTopic(ds); ds.setStatus(DatastreamStatus.READY); if (!_adapter.updateDatastream(ds)) { _log.warn(String.format("Failed to update datastream: %s after initializing, " + "This datastream will not be scheduled for producing events ", ds.getName())); shouldRetry = true; } } catch (Exception e) { _log.warn("Failed to update the destination of new datastream {}", ds, e); shouldRetry = true; } } else if (isDeletingOrExpired(ds)) { _log.info("Trying to hard delete datastream (reason={})", ds, ds.getStatus() == DatastreamStatus.DELETING ? "deleting" : "expired"); hardDeleteDatastream(ds, allStreams); needInvalidate = true; } } if (!shouldRetry && needInvalidate) { _datastreamCache.invalidateAllCache(); } if (shouldRetry) { _dynamicMetricsManager.createOrUpdateMeter(MODULE, "handleDatastreamAddOrDelete", NUM_RETRIES, 1); if (leaderDatastreamAddOrDeleteEventScheduled.compareAndSet(false, true)) { _log.warn("Schedule retry for handling new datastream"); _executor.schedule(() -> { _eventQueue.put(CoordinatorEvent.createHandleDatastreamAddOrDeleteEvent()); leaderDatastreamAddOrDeleteEventScheduled.set(false); }, _config.getRetryIntervalMs(), TimeUnit.MILLISECONDS); } } _eventQueue.put(CoordinatorEvent.createLeaderDoAssignmentEvent()); }

Target:
private void handleDatastreamAddOrDelete() { boolean shouldRetry = false; List<Datastream> allStreams = _datastreamCache.getAllDatastreams(true); if (allStreams.isEmpty()) { _log.warn("Received a new datastream event, but there were no datastreams"); return; } for (Datastream ds : allStreams) { if (ds.getStatus() == DatastreamStatus.INITIALIZING) { try { createTopic(ds); ds.setStatus(DatastreamStatus.READY); if (!_adapter.updateDatastream(ds)) { _log.warn(String.format("Failed to update datastream: %s after initializing, " + "This datastream will not be scheduled for producing events ", ds.getName())); shouldRetry = true; } } catch (Exception e) { _log.warn("Failed to update the destination of new datastream {}", ds, e); shouldRetry = true; } } else if (isDeletingOrExpired(ds)) { _log.info("Trying to hard delete datastream (reason={})", ds, ds.getStatus() == DatastreamStatus.DELETING ? "deleting" : "expired"); hardDeleteDatastream(ds, allStreams); } } if (shouldRetry) { _dynamicMetricsManager.createOrUpdateMeter(MODULE, "handleDatastreamAddOrDelete", NUM_RETRIES, 1); if (leaderDatastreamAddOrDeleteEventScheduled.compareAndSet(false, true)) { _log.warn("Schedule retry for handling new datastream"); _executor.schedule(() -> { _eventQueue.put(CoordinatorEvent.createHandleDatastreamAddOrDeleteEvent()); leaderDatastreamAddOrDeleteEventScheduled.set(false); }, _config.getRetryIntervalMs(), TimeUnit.MILLISECONDS); } } _eventQueue.put(CoordinatorEvent.createLeaderDoAssignmentEvent()); }
Source:
private void handleEvent(JsonArray array) { if (array.size() > 0) { Event event = new JSONEventImpl(array); for (EventItem item : event.getEventItems()) { logger.info("{}", item.getProperties().toString()); this.sceneManager.handleEvent(item); } } }

Target:
private void handleEvent(JsonArray array) { if (array.size() > 0) { Event event = new JSONEventImpl(array); for (EventItem item : event.getEventItems()) { logger.info("{}", item.getProperties()); this.sceneManager.handleEvent(item); } } }
Source:
static boolean needsQuotedPrintableWithinPhrase(final int cp) { switch (cp) { case '!': case '*': case '+': case '-': case '/': case '=': case '_': return false; default: if ((cp >= 'a' && cp <= 'z') || (cp >= 'A' && cp <= 'Z') || (cp >= '0' && cp <= '9')) { return false; } else { return true; } } }

Target:
static boolean needsQuotedPrintableWithinPhrase(final int cp) { switch (cp) { case '!': case '*': case '+': case '-': case '/': case '=': case '_': return false; default: if (('a' <= cp && cp <= 'z') || ('A' <= cp && cp <= 'Z') || ('0' <= cp && cp <= '9')) { return false; } else { return true; } } }