auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public RsWithoutHeader(final Response res, final CharSequence name) { super( new RsOf( () -> { final String prefix = String.format( "%s:", new EnglishLowerCase(name.toString()).string() ); return new Filtered<>( header -> { return !new EnglishLowerCase(header).string() .startsWith(prefix); }, res.head() ); }, res::body ) ); }

Target:
public RsWithoutHeader(final Response res, final CharSequence name) { super( new ResponseOf( () -> { final String prefix = String.format( "%s:", new EnglishLowerCase(name.toString()).string() ); return new Filtered<>( header -> { return !new EnglishLowerCase(header).string() .startsWith(prefix); }, res.head() ); }, res::body ) ); }
Source:
public void tags_facet_should_not_find_tags_of_any_other_organization() { OrganizationDto organization1 = dbTester.organizations().insert(); OrganizationDto organization2 = dbTester.organizations().insert(); RuleDefinitionDto rule = insertRuleDefinition(setSystemTags()); dbTester.rules().insertOrUpdateMetadata(rule, organization1, setTags("bla")); RuleQuery query = new RuleQuery() .setOrganizationUuid(organization2.getUuid()); SearchOptions options = new SearchOptions().addFacets(singletonList(FACET_TAGS)); SearchIdResult result = index.search(query, options); assertThat(result.getFacets().get(FACET_TAGS)).contains(); }

Target:
public void tags_facet_should_not_find_tags_of_any_other_organization() { OrganizationDto organization1 = dbTester.organizations().insert(); OrganizationDto organization2 = dbTester.organizations().insert(); RuleDefinitionDto rule = insertRuleDefinition(setSystemTags()); insertRuleMetaData(organization1, rule, setTags("bla1")); insertRuleMetaData(organization2, rule, setTags("bla2")); RuleQuery query = new RuleQuery() .setOrganizationUuid(organization2.getUuid()); SearchOptions options = new SearchOptions().addFacets(singletonList(FACET_TAGS)); SearchIdResult result = index.search(query, options); assertThat(result.getFacets().get(FACET_TAGS).entrySet()).extracting(e -> entry(e.getKey(), e.getValue())).containsExactly( entry("bla2", 1L) ); }
Source:
public MetadataWebServiceDataInfo(MetadataWebService metadataWebService, String xpsrc, String label, String mapping, String field) { this.xpsrc = xpsrc; this.expr = expr; this.label = label; this.mapping = mapping; if (field != null) { String[] parsed = metadataWebService.parseTransform(field); String[] parts = parsed[0].split("\\."); this.schema = parts[0]; this.element = parts[1]; this.qualifier = (parts.length == 3) ? parts[2] : null; this.transform = parsed[1]; } }

Target:
public MetadataWebServiceDataInfo(MetadataWebService metadataWebService, String xpsrc, String label, String mapping, String field) { this.xpsrc = xpsrc; this.label = label; this.mapping = mapping; if (field != null) { String[] parsed = metadataWebService.parseTransform(field); String[] parts = parsed[0].split("\\."); this.schema = parts[0]; this.element = parts[1]; this.qualifier = (parts.length == 3) ? parts[2] : null; this.transform = parsed[1]; } }
Source:
public void write(ReadHeadInfo headInfo, DataOutput out) throws IOException { out.writeByte(headInfo.getActiveFields()); out.writeLong(headInfo.value); if (this.thisReadSequence != null && this.thisReadSequence.getKmerLetterLength() > 0) { headInfo.thisReadSequence.write(out); } if (this.mateReadSequence != null && this.mateReadSequence.getKmerLetterLength() > 0) { headInfo.mateReadSequence.write(out); } }

Target:
public static void write(ReadHeadInfo headInfo, DataOutput out) throws IOException { out.writeByte(headInfo.getActiveFields()); out.writeLong(headInfo.value); headInfo.getThisReadSequence().write(out); if (headInfo.mateReadSequence != null && headInfo.mateReadSequence.getKmerLetterLength() > 0) { headInfo.mateReadSequence.write(out); } }
Source:
public void encode(LuceneDocumentBuilder documentBuilder, String absoluteFieldPath, String value) { if ( value == null && indexNullAsValue != null ) { value = indexNullAsValue; } if ( value == null ) { return; } if ( searchable ) { documentBuilder.addField( new Field( absoluteFieldPath, value, fieldType ) ); } else if ( fieldType.stored() ) { documentBuilder.addField( new StoredField( absoluteFieldPath, normalize( absoluteFieldPath, value ) ) ); } if ( sortable ) { documentBuilder.addField( new SortedDocValuesField( absoluteFieldPath, normalize( absoluteFieldPath, value ) ) ); } if ( !sortable && fieldType.omitNorms() ) { documentBuilder.addFieldName( absoluteFieldPath ); } }

Target:
public void encode(LuceneDocumentBuilder documentBuilder, String absoluteFieldPath, String value) { if ( value == null && indexNullAsValue != null ) { value = indexNullAsValue; } if ( value == null ) { return; } if ( searchable || fieldType.stored() ) { documentBuilder.addField( new Field( absoluteFieldPath, value, fieldType ) ); } if ( sortable ) { documentBuilder.addField( new SortedDocValuesField( absoluteFieldPath, normalize( absoluteFieldPath, value ) ) ); } if ( !sortable && fieldType.omitNorms() ) { documentBuilder.addFieldName( absoluteFieldPath ); } }
Source:
public AnnotationDeclaration asAnnotationDeclaration() { return (AnnotationDeclaration) this; }

Target:
public AnnotationDeclaration asAnnotationDeclaration() { throw new IllegalStateException(f("%s is not an AnnotationDeclaration", this)); }
Source:
void setMetric(Object metric) { this.metric = metric; }

Target:
synchronized void setMetric(Object metric) { this.metric = metric; }
Source:
private void completeAllProcessableWork() { captureOutputsAndReEnqueueInternalResults(); if (task != null) { while (task.hasRecordsQueued() && task.isProcessable(mockWallClockTime.milliseconds())) { task.process(mockWallClockTime.milliseconds()); task.maybePunctuateStreamTime(); task.commit(); captureOutputsAndReEnqueueInternalResults(); } if (task.hasRecordsQueued()) { log.info("Due to the configuration, there are currently some records that can't be processed." + " Advancing wall-clock time or enqueuing records on the empty partitions will allow" + " Streams to process more.", StreamsConfig.MAX_TASK_IDLE_MS_CONFIG); } } }

Target:
private void completeAllProcessableWork() { captureOutputsAndReEnqueueInternalResults(); if (task != null) { while (task.hasRecordsQueued() && task.isProcessable(mockWallClockTime.milliseconds())) { task.process(mockWallClockTime.milliseconds()); task.maybePunctuateStreamTime(); task.commit(); captureOutputsAndReEnqueueInternalResults(); } if (task.hasRecordsQueued()) { log.info("Due to the configuration, there are currently some records" + " that cannot be processed. Advancing wall-clock time or" + " enqueuing records on the empty topics will allow" + " Streams to process more.", StreamsConfig.MAX_TASK_IDLE_MS_CONFIG); } } }
Source:
public void listSettingsWithPagination() { final int numberExpected = 50; for (int value = 0; value < numberExpected; value++) { client.setSetting(new ConfigurationSetting().key(keyPrefix + "-" + value).value("myValue").label(labelPrefix)); } SettingSelector filter = new SettingSelector().keys(keyPrefix + "-*").labels(labelPrefix); assertEquals(numberExpected, client.listSettings(filter).streamByPage().count()); }

Target:
public void listSettingsWithPagination() { final int numberExpected = 50; for (int value = 0; value < numberExpected; value++) { client.setSetting(new ConfigurationSetting().key(keyPrefix + "-" + value).value("myValue").label(labelPrefix)); } SettingSelector filter = new SettingSelector().keys(keyPrefix + "-*").labels(labelPrefix); assertEquals(numberExpected, client.listSettings(filter).stream().count()); }
Source:
public String toString() { return com.google.common.base.Objects.toStringHelper(this) .add("id", this.getId()) .add("application", this.getApplicationName()) .add("reductionKeys", this.getReductionKeys()) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("m_manager", m_manager) .add("m_entity", m_entity) .toString(); }
Source:
public Response getGeoAlertsHistoryForGeoClusters(@QueryParam("from") long from, @QueryParam("to") long to) { String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS"; String fromDate = String.valueOf(from); String toDate = String.valueOf(to); String query = ""; if (from != 0 || to != 0) { query = "timeStamp : [" + fromDate + " TO " + toDate + "]"; } try { List<SortByField> sortByFields = new ArrayList<>(); SortByField sortByField = new SortByField("timeStamp", SortType.ASC); sortByFields.add(sortByField); String authorizedUser = MultitenantUtils.getTenantAwareUsername( CarbonContext.getThreadLocalCarbonContext().getUsername()); try { String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); List<SearchResultEntry> searchResults = analyticsDataAPI.search(tenantId, tableName, query, 0, 100, sortByFields); List<Event> events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList<String>(), searchResults); return Response.ok().entity(events).build(); } catch (AnalyticsException | UserStoreException e) { log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); throw DeviceMgtUtil.buildBadRequestException( Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); } } catch (Exception e) { log.error(e.getMessage()); return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build(); } }

Target:
public Response getGeoAlertsHistoryForGeoClusters(@QueryParam("from") long from, @QueryParam("to") long to) { String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS"; String fromDate = String.valueOf(from); String toDate = String.valueOf(to); String query = ""; if (from != 0 || to != 0) { query = "timeStamp : [" + fromDate + " TO " + toDate + "]"; } try { List<SortByField> sortByFields = new ArrayList<>(); SortByField sortByField = new SortByField("timeStamp", SortType.ASC); sortByFields.add(sortByField); String authorizedUser = MultitenantUtils.getTenantAwareUsername( CarbonContext.getThreadLocalCarbonContext().getUsername()); String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); List<SearchResultEntry> searchResults = analyticsDataAPI.search(tenantId, tableName, query, 0, 100, sortByFields); List<Event> events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList<String>(), searchResults); return Response.ok().entity(events).build(); } catch (AnalyticsException | UserStoreException e) { log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); throw DeviceMgtUtil.buildBadRequestException( Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); } }
Source:
public int[] getRequiredTokens() { return new int[] {TokenTypes.ENUM_DEF}; }

Target:
public int[] getRequiredTokens() { return new int[] {TokenTypes.ENUM_CONSTANT_DEF}; }
Source:
public InvocationHandler(Object target, Appendable writer) { this.target = target; this.writer = writer; screenMap.put("\n", "\\\\n"); screenMap.put("\r", "\\\\r"); screenMap.put("\b", "\\\\b"); screenMap.put("\t", "\\\\t"); screenMap.put("\f", "\\\\f"); }

Target:
public InvocationHandler(Object target, Appendable writer) { this.target = target; this.writer = writer; screenMap.put("\n", "\\\\n"); screenMap.put("\r", "\\\\r"); screenMap.put("\b", "\\\\b"); screenMap.put("\t", "\\\\t"); screenMap.put("\f", "\\\\f"); screenMap.put("\"", "\\\""); }
Source:
public static List<String> readLines(final String s) { List<String> l = new ArrayList<String>(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == '\n') { l.add(sb.toString()); sb.setLength(0); continue; } if (c == '\r') { if (i + 1 < s.length()) { c = s.charAt(++i); l.add(sb.toString()); sb.setLength(0); if (c != '\n') { sb.append(c); } continue; } else { l.add(sb.toString()); break; } } sb.append(c); } l.add(sb.toString()); return l; }

Target:
public static List<String> readLines(final String s) { List<String> l = new ArrayList<String>(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == '\n') { l.add(sb.toString()); sb.setLength(0); continue; } if (c == '\r') { if (i + 1 < s.length()) { c = s.charAt(++i); l.add(sb.toString()); sb.setLength(0); if (c != '\n') sb.append(c); continue; } else { l.add(sb.toString()); break; } } sb.append(c); } l.add(sb.toString()); return l; }
Source:
public void testToFailureLoop() { Throwable exception1 = new RuntimeException("fake exception 1"); Throwable exception2 = new RuntimeException("fake exception 2"); exception1.addSuppressed(exception2); exception2.addSuppressed(exception1); toFailure(exception1); toFailures(ImmutableList.of(exception2)); }

Target:
public void testToFailureLoop() { Throwable exception1 = new PrestoException(TOO_MANY_REQUESTS_FAILED, "fake exception 1"); Throwable exception2 = new RuntimeException("fake exception 2", exception1); exception1.addSuppressed(exception2); ExecutionFailureInfo failure = toFailure(exception1); assertEquals(failure.getMessage(), "fake exception 1"); assertNull(failure.getCause()); assertEquals(failure.getSuppressed().size(), 1); assertEquals(failure.getSuppressed().get(0).getMessage(), "fake exception 2"); assertEquals(failure.getErrorCode(), TOO_MANY_REQUESTS_FAILED.toErrorCode()); failure = toFailure(exception2); assertEquals(failure.getMessage(), "fake exception 2"); assertNotNull(failure.getCause()); assertEquals(failure.getCause().getMessage(), "fake exception 1"); assertEquals(failure.getSuppressed().size(), 0); assertEquals(failure.getErrorCode(), TOO_MANY_REQUESTS_FAILED.toErrorCode()); exception1 = new PrestoException(TOO_MANY_REQUESTS_FAILED, "fake exception 1"); exception2 = new RuntimeException("fake exception 2"); exception1.addSuppressed(exception2); exception2.addSuppressed(exception1); failure = toFailure(exception1); assertEquals(failure.getMessage(), "fake exception 1"); assertNull(failure.getCause()); assertEquals(failure.getSuppressed().size(), 1); assertEquals(failure.getSuppressed().get(0).getMessage(), "fake exception 2"); assertEquals(failure.getErrorCode(), TOO_MANY_REQUESTS_FAILED.toErrorCode()); exception1 = new RuntimeException("fake exception 1"); exception2 = new RuntimeException("fake exception 2", exception1); exception1.initCause(exception2); failure = toFailure(exception2); assertEquals(failure.getMessage(), "fake exception 2"); assertNotNull(failure.getCause()); assertEquals(failure.getCause().getMessage(), "fake exception 1"); assertEquals(failure.getSuppressed().size(), 0); assertEquals(failure.getErrorCode(), GENERIC_INTERNAL_ERROR.toErrorCode()); }
Source:
public void impactScore(RuleContext kcontext) { throw new UnsupportedOperationException("In the rule (" + kcontext.getRule().getName() + "), the scoreHolder class (" + getClass() + ") does not support an no weightMultiplier."); }

Target:
public void impactScore(RuleContext kcontext) { throw new UnsupportedOperationException("In the rule (" + kcontext.getRule().getName() + "), the scoreHolder class (" + getClass() + ") requires a weightMultiplier."); }
Source:
public crafttweaker.api.block.IBlockState withProperty(String name, String value) { IProperty property = blockState.getBlock().getBlockState().getProperty(name); Optional<? extends Comparable> propValue = property.parseValue(value); if (propValue.isPresent()) { return new MCBlockState(blockState.withProperty(property, propValue.get())); } return null; }

Target:
public crafttweaker.api.block.IBlockState withProperty(String name, String value) { IProperty property = blockState.getBlock().getBlockState().getProperty(name); if (property == null) { CraftTweakerAPI.logWarning("Invalid property name"); } else { Optional<? extends Comparable> propValue = property.parseValue(value); if (propValue.isPresent()) { return new MCBlockState(blockState.withProperty(property, propValue.get())); } CraftTweakerAPI.logWarning("Invalid property value"); } return this; }
Source:
public void initialise(FBOConfig inputFboConfig, BaseFBOsManager inputFboManager, FBOConfig outputFboConfig, BaseFBOsManager outputFboManager, String aLabel) { this.outputFboManager = outputFboManager; this.outputFboUrn = outputFboConfig.getName(); requiresFBO(inputFboConfig, inputFboManager); outputFbo = requiresFBO(outputFboConfig, outputFboManager); addDesiredStateChange(new BindFBO(outputFboConfig.getName(), outputFboManager)); addDesiredStateChange(new SetViewportToSizeOf(outputFboConfig.getName(), outputFboManager)); addDesiredStateChange(new SetInputTextureFromFBO(SLOT_0, inputFboConfig.getName(), ColorTexture, inputFboManager, DOWN_SAMPLER_MATERIAL, TEXTURE_NAME)); setupConditions(); addDesiredStateChange(new EnableMaterial(DOWN_SAMPLER_MATERIAL.toString())); downSampler = getMaterial(DOWN_SAMPLER_MATERIAL); this.performanceMonitorLabel = aLabel; outputFboManager.subscribe(this); }

Target:
public void initialise(FBOConfig inputFboConfig, BaseFBOsManager inputFboManager, FBOConfig outputFboConfig, BaseFBOsManager outputFboManager, String aLabel) { this.outputFboManager = outputFboManager; this.outputFboUrn = outputFboConfig.getName(); requiresFBO(inputFboConfig, inputFboManager); requiresFBO(outputFboConfig, outputFboManager); addDesiredStateChange(new BindFBO(outputFboUrn, outputFboManager)); addDesiredStateChange(new SetViewportToSizeOf(outputFboUrn, outputFboManager)); addDesiredStateChange(new SetInputTextureFromFBO(SLOT_0, inputFboConfig.getName(), ColorTexture, inputFboManager, DOWN_SAMPLER_MATERIAL, TEXTURE_NAME)); update(); outputFboManager.subscribe(this); setupConditions(); addDesiredStateChange(new EnableMaterial(DOWN_SAMPLER_MATERIAL.toString())); downSampler = getMaterial(DOWN_SAMPLER_MATERIAL); this.performanceMonitorLabel = aLabel; }
Source:
public void setWifiApEnabled(WifiConfiguration wifiConfig, boolean enabled) { enforceChangePermission(); mLog.trace("setWifiApEnabled uid=%").c(Binder.getCallingUid()).flush(); ConnectivityManager.enforceTetherChangePermission(mContext); if (mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING)) { throw new SecurityException("DISALLOW_CONFIG_TETHERING is enabled for this user."); } if (wifiConfig == null || isValid(wifiConfig)) { mWifiController.obtainMessage(CMD_SET_AP, enabled ? 1 : 0, 0, wifiConfig).sendToTarget(); } else { Slog.e(TAG, "Invalid WifiConfiguration"); } }

Target:
public void setWifiApEnabled(WifiConfiguration wifiConfig, boolean enabled) { enforceChangePermission(); ConnectivityManager.enforceTetherChangePermission(mContext); mLog.trace("setWifiApEnabled uid=% enable=%") .c(Binder.getCallingUid()) .c(enabled ? "true" : "false").flush(); if (mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING)) { throw new SecurityException("DISALLOW_CONFIG_TETHERING is enabled for this user."); } if (wifiConfig == null || isValid(wifiConfig)) { mWifiController.obtainMessage(CMD_SET_AP, enabled ? 1 : 0, 0, wifiConfig).sendToTarget(); } else { Slog.e(TAG, "Invalid WifiConfiguration"); } }
Source:
private static void setAlertnessOptions(JSONObject fcmJson, NotificationCompat.Builder notifBuilder) { int payloadPriority = fcmJson.optInt("pri", 6); int androidPriority = convertOSToAndroidPriority(payloadPriority); notifBuilder.setPriority(androidPriority); boolean lowDisplayPriority = androidPriority < NotificationCompat.PRIORITY_DEFAULT; if (lowDisplayPriority) return; int notificationDefaults = 0; if (fcmJson.has("ledc") && fcmJson.optInt("led", 1) == 1) { try { BigInteger ledColor = new BigInteger(fcmJson.optString("ledc"), 16); notifBuilder.setLights(ledColor.intValue(), 2000, 5000); } catch (Throwable t) { notificationDefaults |= Notification.DEFAULT_LIGHTS; } } else { notificationDefaults |= Notification.DEFAULT_LIGHTS; } notifBuilder.setDefaults(notificationDefaults); }

Target:
private static void setAlertnessOptions(JSONObject fcmJson, NotificationCompat.Builder notifBuilder) { int payloadPriority = fcmJson.optInt("pri", 6); int androidPriority = convertOSToAndroidPriority(payloadPriority); notifBuilder.setPriority(androidPriority); boolean lowDisplayPriority = androidPriority < NotificationCompat.PRIORITY_DEFAULT; if (lowDisplayPriority) return; int notificationDefaults = 0; if (fcmJson.has("ledc") && fcmJson.optInt("led", 1) == 1) { try { BigInteger ledColor = new BigInteger(fcmJson.optString("ledc"), 16); notifBuilder.setLights(ledColor.intValue(), 2000, 5000); } catch (Throwable t) { notificationDefaults |= Notification.DEFAULT_LIGHTS; } } else { notificationDefaults |= Notification.DEFAULT_LIGHTS; } if (fcmJson.optInt("vib", 1) == 1) { if (fcmJson.has("vib_pt")) { long[] vibrationPattern = OSUtils.parseVibrationPattern(fcmJson); if (vibrationPattern != null) notifBuilder.setVibrate(vibrationPattern); } else notificationDefaults |= Notification.DEFAULT_VIBRATE; } if (isSoundEnabled(fcmJson)) { Uri soundUri = OSUtils.getSoundUri(currentContext, fcmJson.optString("sound", null)); if (soundUri != null) notifBuilder.setSound(soundUri); else notificationDefaults |= Notification.DEFAULT_SOUND; } notifBuilder.setDefaults(notificationDefaults); }
Source:
public void process(JSONRequestContext jsonRequestContext) { StudentGroupContactLogEntryDAO logEntryDAO = DAOFactory.getInstance().getStudentGroupContactLogEntryDAO(); try { Long entryId = jsonRequestContext.getLong("entryId"); StudentGroupContactLogEntry entry = logEntryDAO.findById(entryId); String entryText = jsonRequestContext.getRequest().getParameter("entryText"); String entryCreator = jsonRequestContext.getRequest().getParameter("entryCreatorName"); Date entryDate = new Date(NumberUtils.createLong(jsonRequestContext.getRequest().getParameter("entryDate"))); StudentContactLogEntryType entryType = StudentContactLogEntryType.valueOf(jsonRequestContext.getString("entryType")); logEntryDAO.update(entry, entryType, entryText, entryDate, entryCreator); Map<String, Object> info = new HashMap<String, Object>(); info.put("id", entry.getId()); info.put("creatorName", entry.getCreatorName()); info.put("timestamp", entry.getEntryDate().getTime()); info.put("text", entry.getText()); info.put("type", entry.getType()); info.put("studentGroupId", entry.getStudentGroup().getId()); jsonRequestContext.addResponseParameter("results", info); } catch (Exception e) { throw new SmvcRuntimeException(e); } }

Target:
public void process(JSONRequestContext jsonRequestContext) { StudentGroupContactLogEntryDAO logEntryDAO = DAOFactory.getInstance().getStudentGroupContactLogEntryDAO(); Long entryId = jsonRequestContext.getLong("entryId"); if (entryId == null) throw new SmvcRuntimeException(StatusCode.UNDEFINED, "EntryId was not defined."); try { StudentGroupContactLogEntry entry = logEntryDAO.findById(entryId); String entryText = jsonRequestContext.getString("entryText"); String entryCreator = jsonRequestContext.getString("entryCreatorName"); Date entryDate = jsonRequestContext.getDate("entryDate"); StudentContactLogEntryType entryType = StudentContactLogEntryType.valueOf(jsonRequestContext.getString("entryType")); logEntryDAO.update(entry, entryType, entryText, entryDate, entryCreator); Map<String, Object> info = new HashMap<String, Object>(); info.put("id", entry.getId()); info.put("creatorName", entry.getCreatorName()); info.put("timestamp", entry.getEntryDate() != null ? entry.getEntryDate().getTime() : ""); info.put("text", entry.getText()); info.put("type", entry.getType()); info.put("studentGroupId", entry.getStudentGroup().getId()); jsonRequestContext.addResponseParameter("results", info); } catch (Exception e) { throw new SmvcRuntimeException(e); } }
Source:
public List<AbstractPlan> buildPlans(final AbstractDefinitions defs, final String csarName) { final List<AbstractPlan> plans = new ArrayList<>(); AbstractSimplePlanBuilder buildPlanBuilder = new BPELBuildProcessBuilder(); if (!new BPELSituationAwareBuildProcessBuilder().buildPlans(csarName, defs).isEmpty()) { buildPlanBuilder = new BPELSituationAwareBuildProcessBuilder(); } final AbstractSimplePlanBuilder terminationPlanBuilder = new BPELTerminationProcessBuilder(); final AbstractSimplePlanBuilder scalingPlanBuilder = new BPELScaleOutProcessBuilder(); final AbstractSimplePlanBuilder freezePlanBuilder = new BPELFreezeProcessBuilder(); final AbstractSimplePlanBuilder defreezePlanBuilder = new BPELDefrostProcessBuilder(); plans.addAll(scalingPlanBuilder.buildPlans(csarName, defs)); plans.addAll(buildPlanBuilder.buildPlans(csarName, defs)); plans.addAll(terminationPlanBuilder.buildPlans(csarName, defs)); plans.addAll(freezePlanBuilder.buildPlans(csarName, defs)); plans.addAll(defreezePlanBuilder.buildPlans(csarName, defs)); return plans; }

Target:
public List<AbstractPlan> buildPlans(final AbstractDefinitions defs, final String csarName) { final List<AbstractPlan> plans = new ArrayList<>(); AbstractSimplePlanBuilder buildPlanBuilder = new BPELBuildProcessBuilder(); BPELSituationAwareBuildProcessBuilder sitAwareBuilder = new BPELSituationAwareBuildProcessBuilder(); if (!sitAwareBuilder.buildPlans(csarName, defs).isEmpty()) { buildPlanBuilder = sitAwareBuilder; } final AbstractSimplePlanBuilder terminationPlanBuilder = new BPELTerminationProcessBuilder(); final AbstractSimplePlanBuilder scalingPlanBuilder = new BPELScaleOutProcessBuilder(); final AbstractSimplePlanBuilder freezePlanBuilder = new BPELFreezeProcessBuilder(); final AbstractSimplePlanBuilder defreezePlanBuilder = new BPELDefrostProcessBuilder(); plans.addAll(scalingPlanBuilder.buildPlans(csarName, defs)); plans.addAll(buildPlanBuilder.buildPlans(csarName, defs)); plans.addAll(terminationPlanBuilder.buildPlans(csarName, defs)); plans.addAll(freezePlanBuilder.buildPlans(csarName, defs)); plans.addAll(defreezePlanBuilder.buildPlans(csarName, defs)); return plans; }
Source:
public static String calculateContentPreview(String text) { if (text == null) { return null; } if (text.length() > 8192) { text = text.substring(0, 8192); } text = text.replaceAll("(?m)^----.*?$", ""); text = text.replaceAll("(?m)^[#>].*$", ""); text = text.replaceAll("(?m)^On .*wrote.?$", ""); text = text.replaceAll("(?m)^.*\\w+:$", ""); text = text.replaceAll("\\s*([-=_]{30,}+)\\s*", " "); text = text.replaceAll("https?://\\S+", "..."); text = text.replaceAll("(\\r|\\n)+", " "); text = text.replaceAll("\\s+", " "); text = text.trim(); return (text.length() <= 512) ? text : text.substring(0, 512); }

Target:
public static String calculateContentPreview(String text) { if (text == null) { return null; } if (text.length() > 8192) { text = text.substring(0, 8192); } text = text.replaceAll("(?ms)^-- [\\r\\n]+.*", ""); text = text.replaceAll("(?m)^----.*?$", ""); text = text.replaceAll("(?m)^[#>].*$", ""); text = text.replaceAll("(?m)^On .*wrote.?$", ""); text = text.replaceAll("(?m)^.*\\w+:$", ""); text = text.replaceAll("\\s*([-=_]{30,}+)\\s*", " "); text = text.replaceAll("https?://\\S+", "..."); text = text.replaceAll("(\\r|\\n)+", " "); text = text.replaceAll("\\s+", " "); text = text.trim(); return (text.length() <= 512) ? text : text.substring(0, 512); }
Source:
public void checkProjectWithoutGitFolder() { projectExplorer.openContextMenuByPathSelectedItem(PROJECT_WITHOUT_GIT_FOLDER); projectExplorer.waitItemOnContexMenuIsNotVisible( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.OPEN_ON_GITHUB); projectExplorer.clickOnItemInContextMenu( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.COPY); }

Target:
public void checkProjectWithoutGitFolder() { projectExplorer.openContextMenuByPathSelectedItem(PROJECT_WITHOUT_GIT_FOLDER); projectExplorer.waitContexMenuItemIsNotVisible( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.OPEN_ON_GITHUB); projectExplorer.clickOnItemInContextMenu( TestProjectExplorerContextMenuConstants.ContextMenuFirstLevelItems.COPY); }
Source:
public void testDoNotUpdateDeviceWhenReadOnlyIsNotChanged() { final UpdateVmDiskParameters parameters = createParameters(); parameters.getDiskInfo().setReadOnly(false); when(diskDao.get(diskImageGuid)).thenReturn(createDiskImage()); VmDevice device = createVmDevice(diskImageGuid, vmId); assertEquals(device.getIsReadOnly(), parameters.getDiskInfo().getReadOnly()); initializeCommand(parameters); command.executeVmCommand(); assertFalse(command.updateReadOnlyRequested()); verify(command, atLeast(1)).updateReadOnlyRequested(); verify(vmDeviceDAO, never()).update(any(VmDevice.class)); }

Target:
public void testDoNotUpdateDeviceWhenReadOnlyIsNotChanged() { final UpdateVmDiskParameters parameters = createParameters(); parameters.getDiskInfo().setReadOnly(false); when(diskDao.get(diskImageGuid)).thenReturn(createDiskImage()); initializeCommand(parameters); command.executeVmCommand(); verify(command, atLeast(1)).updateReadOnlyRequested(); assertFalse(command.updateReadOnlyRequested()); verify(vmDeviceDAO, never()).update(any(VmDevice.class)); }
Source:
private UserIdent(UUID identUuid, String identUsername, EntityPlayerMP identPlayer) { if (identUsername != null && identUsername.isEmpty()) identUsername = null; player = identPlayer == null ? null : new WeakReference<EntityPlayer>(identPlayer); if (identPlayer != null) { uuid = identPlayer.getPersistentID(); username = identPlayer.getCommandSenderName(); byUuid.put(uuid, this); byUsername.put(username.toLowerCase(), this); } else { uuid = identUuid; username = identUsername; if (uuid != null) byUuid.put(this.uuid, this); if (identUsername != null && identUsername.charAt(0) != '@') byUsername.put(identUsername.toLowerCase(), this); if (uuid == null && username != null) uuid = resolveMissingUUID(username); else if (uuid != null && username == null) username = resolveMissingUsername(uuid); } }

Target:
private UserIdent(UUID identUuid, String identUsername, EntityPlayerMP identPlayer) { if (identUsername != null && identUsername.isEmpty()) identUsername = null; player = identPlayer == null ? null : new WeakReference<EntityPlayer>(identPlayer); if (identPlayer != null) { uuid = identPlayer.getPersistentID(); username = identPlayer.getCommandSenderName(); byUuid.put(uuid, this); byUsername.put(username.toLowerCase(), this); } else { uuid = identUuid; username = identUsername; if (uuid != null) byUuid.put(this.uuid, this); if (identUsername != null && identUsername.charAt(0) != '@') byUsername.put(identUsername.toLowerCase(), this); if (uuid == null && username != null) uuid = UserIdentUtils.resolveMissingUUID(username); else if (uuid != null && username == null) username = UserIdentUtils.resolveMissingUsername(uuid); } }
Source:
PersistEvent get(int idx) { Preconditions.checkState(numEvents > 0 && 0 <= idx && idx < numEvents); return events[idx]; }

Target:
PersistEvent get(int idx) { Preconditions.checkState(numEvents > 0 && 0 <= idx && idx < numEvents, "Accessing Events array (Size = %s) with wrong index [%s]", numEvents, idx); return events[idx]; }
Source:
public GatewaySession(SipGateway gateway) { this.sipGateway = gateway; this.sipProvider = gateway.getSipProvider(); this.jitsiMeetTools = sipProvider.getOperationSet( OperationSetJitsiMeetTools.class); JITSI_MEET_ROOM_PASS_HEADER = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_ROOM_PASS_HEADER_PROPERTY, JITSI_MEET_ROOM_PASS_HEADER); JITSI_MEET_DOMAIN_BASE_HEADER = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_DOMAIN_BASE_HEADER_PROPERTY, JITSI_MEET_DOMAIN_BASE_HEADER); }

Target:
public GatewaySession(SipGateway gateway) { this.sipGateway = gateway; this.sipProvider = gateway.getSipProvider(); this.jitsiMeetTools = sipProvider.getOperationSet( OperationSetJitsiMeetTools.class); roomPassHeaderName = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_ROOM_PASS_HEADER_PROPERTY, JITSI_MEET_ROOM_PASS_HEADER_DEFAULT); domainBaseHeaderName = sipProvider.getAccountID() .getAccountPropertyString( JITSI_MEET_DOMAIN_BASE_HEADER_PROPERTY, JITSI_MEET_DOMAIN_BASE_HEADER_DEFAULT); }
Source:
private void initCellularData() { CellularData data = new CellularData(); data.ratType = DataStallEventProto.RADIO_TECHNOLOGY_UNKNOWN; data.networkMccmnc = ""; data.simMccmnc = ""; data.signalStrength = UNKNOWN_SIGNAL_STRENGTH; cellularInfo = MessageNano.toByteArray(data); }

Target:
private byte[] initCellularData() { CellularData data = new CellularData(); data.ratType = DataStallEventProto.RADIO_TECHNOLOGY_UNKNOWN; data.networkMccmnc = ""; data.simMccmnc = ""; data.signalStrength = UNKNOWN_SIGNAL_STRENGTH; return MessageNano.toByteArray(data); }
Source:
public void testConvertBedToTargetFile() { final String[] arguments = { "-" + ConvertBedToTargetFile.BED_INPUT_SHORT_NAME, TEST_BED_INPUT.getAbsolutePath(), "-" + ConvertBedToTargetFile.TARGET_OUTPUT_SHORT_NAME, TEST_TARGET_OUTPUT.getAbsolutePath(), }; runCommandLine(arguments); Assert.assertTrue(TEST_TARGET_OUTPUT.exists()); List<Target> outputTestTargets = TargetTableReader.readTargetFile(TEST_TARGET_OUTPUT); Assert.assertNotNull(outputTestTargets); List<Target> gtTargets = TargetTableReader.readTargetFile(TARGET_FILE_GT); Assert.assertEquals(outputTestTargets.size(), gtTargets.size()); for(int i=0; i<gtTargets.size(); i++){ Assert.assertEquals(outputTestTargets.get(i), gtTargets.get(i)); } }

Target:
public void testConvertBedToTargetFile() { final String[] arguments = { "-" + ConvertBedToTargetFile.BED_INPUT_SHORT_NAME, TEST_BED_INPUT.getAbsolutePath(), "-" + ConvertBedToTargetFile.TARGET_OUTPUT_SHORT_NAME, TEST_TARGET_OUTPUT.getAbsolutePath(), }; runCommandLine(arguments); Assert.assertTrue(TEST_TARGET_OUTPUT.exists()); final List<Target> outputTestTargets = TargetTableReader.readTargetFile(TEST_TARGET_OUTPUT); Assert.assertNotNull(outputTestTargets); final List<Target> gtTargets = TargetTableReader.readTargetFile(TARGET_FILE_GT); Assert.assertEquals(outputTestTargets.size(), gtTargets.size()); for(int i=0; i<gtTargets.size(); i++){ Assert.assertEquals(outputTestTargets.get(i), gtTargets.get(i)); } }
Source:
private String uploadPartCopy( String bucketName, String objectName, String uploadId, int partNumber, Multimap<String, String> headerMap) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException { Multimap<String, String> queryParamMap = HashMultimap.create(); queryParamMap.put("partNumber", Integer.toString(partNumber)); queryParamMap.put("uploadId", uploadId); Response response = execute( Method.PUT, bucketName, objectName, getRegion(bucketName), headerMap, queryParamMap, "", 0); try (ResponseBody body = response.body()) { CopyPartResult result = Xml.unmarshal(CopyPartResult.class, body.charStream()); return result.etag(); } }

Target:
protected String uploadPartCopy( String bucketName, String objectName, String uploadId, int partNumber, Multimap<String, String> headerMap) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException { Multimap<String, String> queryParamMap = HashMultimap.create(); queryParamMap.put("partNumber", Integer.toString(partNumber)); queryParamMap.put("uploadId", uploadId); Response response = execute( Method.PUT, bucketName, objectName, getRegion(bucketName), headerMap, queryParamMap, "", 0); try (ResponseBody body = response.body()) { CopyPartResult result = Xml.unmarshal(CopyPartResult.class, body.charStream()); return result.etag(); } }
Source:
public String getGuiID() { return archetype.getProperty(GuiIDProperty.class, GuiIDProperty.class.getSimpleName().toLowerCase()).map(p -> p.getValue()).orElse("minecraft:chest"); }

Target:
public String getGuiID() { String key = AbstractInventoryProperty.getDefaultKey(GuiIdProperty.class).toString(); InventoryProperty<?, ?> property = this.properties.get(key); if (property instanceof GuiIdProperty) { if (property.getValue() instanceof SpongeGuiId) { return ((SpongeGuiId) property.getValue()).getInternalId(); } return ((GuiIdProperty) property).getValue().getId(); } GuiId guiId = this.archetype.getProperty(GuiIdProperty.class, key).map(GuiIdProperty::getValue).orElse(GuiIds.CHEST); if (guiId instanceof SpongeGuiId) { return ((SpongeGuiId) guiId).getInternalId(); } return guiId.getId(); }
Source:
protected abstract int peekData(DatagramPacket pack) throws IOException; protected void initBound(InetAddress localAddress, int localPort) { this.localPort = localPort; }

Target:
protected abstract int peekData(DatagramPacket pack) throws IOException; protected void onBind(InetAddress localAddress, int localPort) { this.localPort = localPort; }
Source:
static public void generateError(final PerunError error, String header, String text) { String reportLabel = WidgetTranslation.INSTANCE.jsonClientReportErrorButton(); String okLabel = ButtonTranslation.INSTANCE.cancelButton(); final ClickHandler okClickHandler = new ClickHandler() { public void onClick(ClickEvent arg0) { if (error != null && "0".equals(error.getErrorId())) { Window.Location.reload(); } } }; final ClickHandler reportClickHandler = new ClickHandler() { public void onClick(ClickEvent arg0) { JsonErrorHandler.reportBox(error); } }; FlexTable layout = new FlexTable(); layout.setWidget(0, 0, new HTML("<p>" + new Image(LargeIcons.INSTANCE.errorIcon()))); layout.setHTML(0, 1, "<p>" + text); layout.getFlexCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP); layout.getFlexCellFormatter().setAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP); layout.getFlexCellFormatter().setStyleName(0, 0, "alert-box-image"); Confirm conf; if (error != null && "0".equals(error.getErrorId())) { conf = new Confirm(header + ((!error.getErrorId().equals("")) ? " (" + error.getErrorId() + ")" : ""), layout, okClickHandler, true); } else { conf = new Confirm(header + ((!error.getErrorId().equals("")) ? " (" + error.getErrorId() + ")" : ""), layout, okClickHandler, reportClickHandler, okLabel, reportLabel, true); conf.setCancelIcon(SmallIcons.INSTANCE.emailIcon()); conf.setOkIcon(SmallIcons.INSTANCE.cancelIcon()); } conf.setNonScrollable(true); conf.setAutoHide(false); conf.show(); }

Target:
static public void generateError(final PerunError error, String header, String text) { String reportLabel = WidgetTranslation.INSTANCE.jsonClientReportErrorButton(); String okLabel = ButtonTranslation.INSTANCE.cancelButton(); final ClickHandler okClickHandler = new ClickHandler() { public void onClick(ClickEvent arg0) { if (error != null && "0".equals(error.getErrorId())) { Window.Location.reload(); } } }; final ClickHandler reportClickHandler = new ClickHandler() { public void onClick(ClickEvent arg0) { JsonErrorHandler.reportBox(error); } }; FlexTable layout = new FlexTable(); layout.setWidget(0, 0, new HTML("<p>" + new Image(LargeIcons.INSTANCE.errorIcon()))); layout.setHTML(0, 1, "<p>" + text); layout.getFlexCellFormatter().setAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP); layout.getFlexCellFormatter().setAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_TOP); layout.getFlexCellFormatter().setStyleName(0, 0, "alert-box-image"); Confirm conf; if (error != null && "0".equals(error.getErrorId())) { conf = new Confirm(header + ((!error.getErrorId().equals("")) ? " (" + error.getErrorId() + ")" : ""), layout, okClickHandler, true); } else { conf = new Confirm(header + ((!error.getErrorId().equals("")) ? " (" + error.getErrorId() + ")" : ""), layout, okClickHandler, reportClickHandler, okLabel, reportLabel, true); conf.setCancelIcon(SmallIcons.INSTANCE.emailIcon()); conf.setOkIcon(SmallIcons.INSTANCE.stopIcon()); } conf.setNonScrollable(true); conf.setAutoHide(false); conf.show(); }
Source:
public void handleDatastream(List<DatastreamGroup> datastreamGroups) { List<String> dgNames = datastreamGroups.stream().map(DatastreamGroup::getTaskPrefix).collect(Collectors.toList()); List<String> obsoleteDgs = new ArrayList<>(_partitionDiscoveryThreadMap.keySet()); obsoleteDgs.removeAll(dgNames); obsoleteDgs.stream().forEach(name -> { LOG.info("remove datastream group {}", name); Optional.ofNullable(_partitionDiscoveryThreadMap.remove(name)).ifPresent(Thread::interrupt); }); datastreamGroups.stream().forEach(datastreamGroup -> { String datastreamGroupName = datastreamGroup.getTaskPrefix(); PartitionDiscoveryThread partitionDiscoveryThread; if (_partitionDiscoveryThreadMap.containsKey(datastreamGroupName)) { partitionDiscoveryThread = _partitionDiscoveryThreadMap.get(datastreamGroupName); partitionDiscoveryThread.setDatastreamGroup(datastreamGroup); } else { if (_partitionChangeCallback != null) { partitionDiscoveryThread = new PartitionDiscoveryThread(datastreamGroup); partitionDiscoveryThread.start(); _partitionDiscoveryThreadMap.put(datastreamGroupName, partitionDiscoveryThread); LOG.info("DatastreamChangeListener for registered", datastreamGroupName); } } }); }

Target:
public void handleDatastream(List<DatastreamGroup> datastreamGroups) { if (!_enablePartitionAssignment) { return; } if (_partitionChangeCallback == null) { throw new DatastreamRuntimeException("Partition change callback is not defined"); } LOG.info("handleDatastream: original datastream groups: {}, received datastream group {}", _partitionDiscoveryThreadMap.keySet(), datastreamGroups); List<String> dgNames = datastreamGroups.stream().map(DatastreamGroup::getName).collect(Collectors.toList()); List<String> obsoleteDgs = new ArrayList<>(_partitionDiscoveryThreadMap.keySet()); obsoleteDgs.removeAll(dgNames); obsoleteDgs.forEach(name -> Optional.ofNullable(_partitionDiscoveryThreadMap.remove(name)).ifPresent(PartitionDiscoveryThread::shutdown)); datastreamGroups.forEach(datastreamGroup -> { String datastreamGroupName = datastreamGroup.getName(); PartitionDiscoveryThread partitionDiscoveryThread; if (!_partitionDiscoveryThreadMap.containsKey(datastreamGroupName)) { partitionDiscoveryThread = new PartitionDiscoveryThread(datastreamGroup); partitionDiscoveryThread.start(); _partitionDiscoveryThreadMap.put(datastreamGroupName, partitionDiscoveryThread); LOG.info("DatastreamChangeListener for registered", datastreamGroupName); } }); LOG.info("handleDatastream: new datastream groups: {}", _partitionDiscoveryThreadMap.keySet()); }
Source:
public void verifyDescriptionFieldIsDisplayed() { waitForElementByElement(descriptionField); PageObjectLogging.log("verifyPinCategorySelector", "Pin category selector is visible", true, driver); }

Target:
public void verifyDescriptionFieldIsDisplayed() { waitForElementByElement(descriptionField); PageObjectLogging.log("verifyDescriptionFieldIsDisplayed", "Description field is visible", true, driver); }
Source:
public void setup() { nakadiSettings = new NakadiSettings( MAX_TOPIC_PARTITION_COUNT, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICA_FACTOR, DEFAULT_TOPIC_RETENTION, DEFAULT_TOPIC_ROTATION, DEFAULT_COMMIT_TIMEOUT, NAKADI_POLL_TIMEOUT, NAKADI_SEND_TIMEOUT, TIMELINE_WAIT_TIMEOUT, NAKADI_EVENT_MAX_BYTES, 0); kafkaSettings = new KafkaSettings(KAFKA_REQUEST_TIMEOUT, KAFKA_BATCH_SIZE, KAFKA_LINGER_MS, KAFKA_ENABLE_AUTO_COMMIT); zookeeperSettings = new ZookeeperSettings(ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT); kafkaHelper = new KafkaTestHelper(KAFKA_URL); kafkaTopicRepository = createKafkaTopicRepository(); }

Target:
public void setup() { nakadiSettings = new NakadiSettings( MAX_TOPIC_PARTITION_COUNT, DEFAULT_PARTITION_COUNT, DEFAULT_REPLICA_FACTOR, DEFAULT_TOPIC_RETENTION, DEFAULT_TOPIC_ROTATION, DEFAULT_COMMIT_TIMEOUT, NAKADI_POLL_TIMEOUT, NAKADI_SEND_TIMEOUT, TIMELINE_WAIT_TIMEOUT, NAKADI_EVENT_MAX_BYTES, NAKADI_SUBSCRIPTION_MAX_PARTITIONS); kafkaSettings = new KafkaSettings(KAFKA_REQUEST_TIMEOUT, KAFKA_BATCH_SIZE, KAFKA_LINGER_MS, KAFKA_ENABLE_AUTO_COMMIT); zookeeperSettings = new ZookeeperSettings(ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT); kafkaHelper = new KafkaTestHelper(KAFKA_URL); kafkaTopicRepository = createKafkaTopicRepository(); }
Source:
public InfoboxBuilderPage changeHeaderCollapsibilityState(int index) { JavascriptExecutor js = (JavascriptExecutor) driver; headers.get(index).click(); wait.forElementClickable(sidebarCheckbox); sidebarCheckbox.click(); String script = "return window.getComputedStyle(document" + ".querySelector('.pi-header'),':after').content"; String chevronContent = js.executeScript(script).toString(); if (sidebarCheckbox.isSelected()) { Assertion.assertFalse(chevronContent.isEmpty()); } else { Assertion.assertTrue(chevronContent.isEmpty()); } return this; }

Target:
public InfoboxBuilderPage changeHeaderCollapsibilityState(int index) { headers.get(index).click(); wait.forElementClickable(sidebarCheckbox); sidebarCheckbox.click(); String script = "return window.getComputedStyle(document" + ".querySelector('.pi-header'),':after').content"; String chevronContent = driver.executeScript(script).toString(); if (sidebarCheckbox.isSelected()) { Assertion.assertFalse(chevronContent.isEmpty()); } else { Assertion.assertTrue(chevronContent.isEmpty()); } return this; }
Source:
public String getServiceUrl() { String context = getContext(); if ("HIVE".equals(getServiceName())) { return String.format(Locale.ROOT, "jdbc:hive2://%s:%d/;?hive.server2.transport.mode=http;hive.server2.thrift.http.path=/%s/%s%s", request.getServerName(), request.getServerPort(), gatewayPath, topologyName, context); } else { if (context.indexOf("{{BACKEND_HOST}}") > -1) { context = context.replaceAll("\\{\\{BACKEND_HOST\\}\\}", getBackendServiceUrl()); } return String.format(Locale.ROOT, "%s://%s:%s/%s/%s%s", request.getScheme(), request.getServerName(), request.getServerPort(), gatewayPath, topologyName, context); } }

Target:
public String getServiceUrl() { String context = getContext(); if ("HIVE".equals(getServiceName())) { return String.format(Locale.ROOT, "jdbc:hive2://%s:%d/;?hive.server2.transport.mode=http;hive.server2.thrift.http.path=/%s/%s%s", request.getServerName(), request.getServerPort(), gatewayPath, topologyName, context); } else { if (context.indexOf("{{BACKEND_HOST}}") > -1) { context = context.replace("{{BACKEND_HOST}}", getBackendServiceUrl()); } return String.format(Locale.ROOT, "%s://%s:%s/%s/%s%s", request.getScheme(), request.getServerName(), request.getServerPort(), gatewayPath, topologyName, context); } }
Source:
public void multiIndex_incompatibleAnalyzer_overrideAnalyzer() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.match().onField( absoluteFieldPath ).matching( "fox" ) .analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE_LOWERCASE.name ) ) .toQuery(); assertThat( query ).assertThat( query ).hasDocRefHitsAnyOrder( b -> { b.doc( INDEX_NAME, DOCUMENT_1 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }

Target:
public void multiIndex_incompatibleAnalyzer_overrideAnalyzer() { StubMappingSearchScope scope = indexManager.createSearchScope( incompatibleAnalyzerIndexManager ); String absoluteFieldPath = indexMapping.analyzedStringField.relativeFieldName; IndexSearchQuery<DocumentReference> query = scope.query().asReference() .predicate( f -> f.match().onField( absoluteFieldPath ).matching( "fox" ) .analyzer( OverrideAnalysisDefinitions.ANALYZER_WHITESPACE_LOWERCASE.name ) ) .toQuery(); assertThat( query ).hasDocRefHitsAnyOrder( b -> { b.doc( INDEX_NAME, DOCUMENT_1 ); b.doc( INCOMPATIBLE_ANALYZER_INDEX_NAME, INCOMPATIBLE_ANALYZER_INDEX_DOCUMENT_1 ); } ); }