auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void initialise() { playerCamera = worldRenderer.getActiveCamera(); sceneOpaqueFbo = displayResolutionDependentFBOs.get(SCENE_OPAQUE); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); addDesiredStateChange(new LookThrough(playerCamera)); <START> addDesiredStateChange(new SetViewportToSizeOf(SCENE_OPAQUE, displayResolutionDependentFBOs)); <END> addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); }</code><technical_language>Please, put sceneOpaqueFbo line this line. add a newline separate material-related lines, below. feels more related line playerCamera</technical_language>

Target:
public void initialise() { wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER, displayResolutionDependentFBOs)); sceneOpaqueFbo = displayResolutionDependentFBOs.get(READONLY_GBUFFER); addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpSession session = ((HttpServletRequest) request).getSession(false); String engineSessionId = (String) request.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); <START> if (session != null && engineSessionId != null) { <END> session.setAttribute( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY, engineSessionId ); } chain.doFilter(request, response); }</code><technical_language>do check if session != null? if engineSessionID create session. request.getSession(true).setAttribute..</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { String engineSessionId = (String) request.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); if (engineSessionId != null) { ((HttpServletRequest) request).getSession(true).setAttribute( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY, engineSessionId ); } chain.doFilter(request, response); }
Source:
<code>private Cube postCubeLoadAttempt(int cubeX, int cubeY, int cubeZ, @Nullable Cube cube, IColumn column, Requirement req) { if (cube == null) { <START> cube = cubeMap.get(cubeX, cubeY, cubeZ); <END> } if (req == Requirement.LOAD) { return cube; } if (req == Requirement.GENERATE && cube != null) { return cube; } if (cube == null) { cube = generateCube(cubeX, cubeY, cubeZ, column); if (req == Requirement.GENERATE) { return cube; } } if (!cube.isFullyPopulated()) { populateCube(cube); if (req == Requirement.POPULATE) { return cube; } } if (!cube.isInitialLightingDone()) { calculateDiffuseSkylight(cube); } return cube; }</code><technical_language>change it</technical_language>

Target:
private Cube postCubeLoadAttempt(int cubeX, int cubeY, int cubeZ, @Nullable Cube cube, IColumn column, Requirement req) { if (cube == null) { cube = getLoadedCube(cubeX, cubeY, cubeZ); } if (req == Requirement.LOAD) { return cube; } if (req == Requirement.GENERATE && cube != null) { return cube; } if (cube == null) { cube = generateCube(cubeX, cubeY, cubeZ, column); if (req == Requirement.GENERATE) { return cube; } } if (!cube.isFullyPopulated()) { populateCube(cube); if (req == Requirement.POPULATE) { return cube; } } if (!cube.isInitialLightingDone()) { calculateDiffuseSkylight(cube); } return cube; }
Source:
<code>public static byte[] fromCanonicalJSON(ImmutableSerializationContext ctx, Reader reader) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); RawProtoStreamWriter writer = RawProtoStreamWriterImpl.newInstance(baos); JsonReader jsonReader = new JsonReader(reader); jsonReader.setLenient(false); try { JsonToken token = jsonReader.peek(); while (jsonReader.hasNext() && !token.equals(END_DOCUMENT)) { token = jsonReader.peek(); switch (token) { case BEGIN_OBJECT: processJsonDocument(ctx, jsonReader, writer); break; case NULL: jsonReader.nextNull(); break; case END_DOCUMENT: break; default: throw new IllegalStateException("Invalid top level object! Found token: " + token); } } writer.flush(); return baos.toByteArray(); } catch (MalformedJsonException e) { <START> throw new IllegalStateException("Invalid Json"); <END> } finally { baos.close(); reader.close(); } }</code><technical_language>propagate here. Also, I JSON is correct term, Json</technical_language>

Target:
public static byte[] fromCanonicalJSON(ImmutableSerializationContext ctx, Reader reader) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); RawProtoStreamWriter writer = RawProtoStreamWriterImpl.newInstance(baos); JsonReader jsonReader = new JsonReader(reader); jsonReader.setLenient(false); try { JsonToken token = jsonReader.peek(); while (jsonReader.hasNext() && !token.equals(END_DOCUMENT)) { token = jsonReader.peek(); switch (token) { case BEGIN_OBJECT: processJsonDocument(ctx, jsonReader, writer); break; case NULL: jsonReader.nextNull(); break; case END_DOCUMENT: break; default: throw new IllegalStateException("Invalid top level object! Found token: " + token); } } writer.flush(); return baos.toByteArray(); } catch (MalformedJsonException e) { throw new IllegalStateException("Invalid JSON", e); } finally { baos.close(); reader.close(); } }
Source:
<code>public static URL join(URL urlBase, File... elements) { if (urlBase == null) { return null; } final StringBuilder buf = new StringBuilder(urlBase.getPath()); for (final File elt : elements) { <START> if (!elt.isAbsolute() && buf.length() == 0 || buf.charAt(buf.length() - 1) != URL_PATH_SEPARATOR_CHAR) { <END> buf.append(URL_PATH_SEPARATOR_CHAR); } buf.append(getFilePath(elt)); } try { if (isJarURL(urlBase)) { return new URL( urlBase.getProtocol(), urlBase.getHost(), urlBase.getPort(), buf.toString()); } return new URI( urlBase.getProtocol(), urlBase.getUserInfo(), urlBase.getHost(), urlBase.getPort(), decodeHTMLEntities(buf.toString()), decodeHTMLEntities(urlBase.getQuery()), urlBase.getRef()).toURL(); } catch (Throwable exception) { } try { return new URL( urlBase.getProtocol(), urlBase.getHost(), buf.toString()); } catch (Throwable exception) { return null; } }</code><technical_language>This line be: java if (!elt.isAbsolute() && (buf.length() == 0 || buf.charAt(buf.length() - 1) != URL_PATH_SEPARATOR_CHAR)) { behavior of function is change</technical_language>

Target:
public static URL join(URL urlBase, File... elements) { if (urlBase == null) { return null; } final StringBuilder buf = new StringBuilder(urlBase.getPath()); for (final File elt : elements) { if (!elt.isAbsolute() && (buf.length() == 0 || buf.charAt(buf.length() - 1) != URL_PATH_SEPARATOR_CHAR)) { buf.append(URL_PATH_SEPARATOR_CHAR); } buf.append(getFilePath(elt)); } try { if (isJarURL(urlBase)) { return new URL( urlBase.getProtocol(), urlBase.getHost(), urlBase.getPort(), buf.toString()); } return new URI( urlBase.getProtocol(), urlBase.getUserInfo(), urlBase.getHost(), urlBase.getPort(), decodeHTMLEntities(buf.toString()), decodeHTMLEntities(urlBase.getQuery()), urlBase.getRef()).toURL(); } catch (Throwable exception) { } try { return new URL( urlBase.getProtocol(), urlBase.getHost(), buf.toString()); } catch (Throwable exception) { return null; } }
Source:
<code>private Set<AnnotationMirror> getSupportedAnnotationsInElementAnnotation( @Nullable Element element, Class<? extends Annotation> annoClass) { Set<AnnotationMirror> found = AnnotationUtils.createAnnotationSet(); if (element == null) { <START> return found; <END> } AnnotationMirror annotation = getDeclAnnotation(element, annoClass); if (annotation == null) { return found; } List<Name> qualClasses = AnnotationUtils.getElementValueClassNames(annotation, "value", true); for (Name qual : qualClasses) { AnnotationMirror annotationMirror = AnnotationBuilder.fromName(elements, qual); if (isSupportedQualifier(annotationMirror)) { found.add(annotationMirror); } } return found; }</code><technical_language>Return immutable singleton instead of a fresh object for null</technical_language>

Target:
private Set<AnnotationMirror> getSupportedAnnotationsInElementAnnotation( @Nullable Element element, Class<? extends Annotation> annoClass) { if (element == null) { return Collections.emptySet(); } AnnotationMirror annotation = getDeclAnnotation(element, annoClass); if (annotation == null) { return Collections.emptySet(); } Set<AnnotationMirror> found = AnnotationUtils.createAnnotationSet(); List<Name> qualClasses = AnnotationUtils.getElementValueClassNames(annotation, "value", true); for (Name qual : qualClasses) { AnnotationMirror annotationMirror = AnnotationBuilder.fromName(elements, qual); if (isSupportedQualifier(annotationMirror)) { found.add(annotationMirror); } } return found; }
Source:
<code>void bufferCurrentEventAndScheduleIfRequired(RecordsRetrieved recordsRetrieved, RecordFlow triggeringFlow) { final RecordsRetrievedContext recordsRetrievedContext = new RecordsRetrievedContext(Either.left(recordsRetrieved), triggeringFlow, Instant.now()); try { recordsDeliveryQueue.add(recordsRetrievedContext); if (recordsDeliveryQueue.size() == 1) { subscriber.onNext(recordsRetrieved); } } catch (IllegalStateException e) { <START> log.warn("{}: Unable to enqueue the payload due to capacity restrictions in delivery queue with remaining capacity {}. Last successful response: RequestId - {}, Timestamp - {}", <END> shardId, recordsDeliveryQueue.remainingCapacity(), getLastSuccessfulResponseRequestId(), getLastSuccessfulResponseTimestamp()); throw e; } catch (Throwable t) { log.error("{}: Unable to deliver event to the shard consumer.", shardId, t); throw t; } }</code><technical_language>log RequestDetails object toString() method, adding/removing attributes in future require updates log statements</technical_language>

Target:
void bufferCurrentEventAndScheduleIfRequired(RecordsRetrieved recordsRetrieved, RecordFlow triggeringFlow) { final RecordsRetrievedContext recordsRetrievedContext = new RecordsRetrievedContext(Either.left(recordsRetrieved), triggeringFlow, Instant.now()); try { recordsDeliveryQueue.add(recordsRetrievedContext); if (recordsDeliveryQueue.size() == 1) { subscriber.onNext(recordsRetrieved); } } catch (IllegalStateException e) { log.warn("{}: Unable to enqueue the payload due to capacity restrictions in delivery queue with remaining capacity {}. Last successful request details -- {}", shardId, recordsDeliveryQueue.remainingCapacity(), lastSuccessfulRequestDetails); throw e; } catch (Throwable t) { log.error("{}: Unable to deliver event to the shard consumer.", shardId, t); throw t; } }
Source:
<code>private void fireNewSessionEvents() { <START> if (isManagingZkConnection()) { <END> return; } final String sessionId = getHexSessionId(); for (final IZkStateListener stateListener : _stateListener) { _eventThread.send(new ZkEventThread.ZkEvent("New session event sent to " + stateListener, sessionId) { @Override public void run() throws Exception { stateListener.handleNewSession(sessionId); } }); } }</code><technical_language>Reversed way? Managing connection fire handle new session events</technical_language>

Target:
private void fireNewSessionEvents() { if (!isManagingZkConnection()) { return; } final String sessionId = getHexSessionId(); for (final IZkStateListener stateListener : _stateListener) { _eventThread.send(new ZkEventThread.ZkEvent("New session event sent to " + stateListener, sessionId) { @Override public void run() throws Exception { stateListener.handleNewSession(sessionId); } }); } }
Source:
<code>public PagedIterable<TableItem> listTables() { <START> return new PagedIterable<>(client.listTables(new ListTablesOptions())); <END> }</code><technical_language>consider making new ListTablesOptions() a member variable allocate a new object for call</technical_language>

Target:
public PagedIterable<TableItem> listTables() { return new PagedIterable<>(client.listTables()); }
Source:
<code>public HashSet<PersistentID> doBackup() throws IOException { BackupTask task = currentTask.get(); if (task == null) { throw new IOException("No backup currently in progress"); } task.notifyOtherMembersReady(); HashSet<PersistentID> result; try { result = taskFuture.get(); } catch (InterruptedException | ExecutionException e) { <START> if (e instanceof ExecutionException) { <END> logger.warn("Backup failed with exception: ", e); } result = new HashSet<>(); } finally { cleanup(); } return result; }</code><technical_language>I good log exceptions. Please remove this check</technical_language>

Target:
public HashSet<PersistentID> doBackup() throws IOException { BackupTask task = currentTask.get(); if (task == null) { throw new IOException("No backup currently in progress"); } task.notifyOtherMembersReady(); HashSet<PersistentID> result; try { result = taskFuture.get(); } catch (InterruptedException | ExecutionException e) { logger.warn("Backup failed with exception: ", e); result = new HashSet<>(); } finally { cleanup(); } return result; }
Source:
<code>public Attribute createAttribute(HttpRequest request, String name) { <START> Attribute attribute; <END> if (useDisk) { attribute = new DiskAttribute(name, charset); } else if (checkSize) { attribute = new MixedAttribute(name, minSize, charset); } else { attribute = new MemoryAttribute(name); } attribute.setMaxSize(maxSize); List<HttpData> list = getList(request); list.add(attribute); return attribute; }</code><technical_language>nit: this final</technical_language>

Target:
public Attribute createAttribute(HttpRequest request, String name) { final Attribute attribute; if (useDisk) { attribute = new DiskAttribute(name, charset); } else if (checkSize) { attribute = new MixedAttribute(name, minSize, charset); } else { attribute = new MemoryAttribute(name); } attribute.setMaxSize(maxSize); List<HttpData> list = getList(request); list.add(attribute); return attribute; }
Source:
<code><START> protected SortedAssignmentContainer sortByProgress() { <END> List<Assignment> uncompleted = fetchUncompletedAssignments(); Collections.sort(uncompleted); return new SortedAssignmentContainer(uncompleted, assignments.getExpansions()); }</code><technical_language>Do want skip assignments completed? I reckon bottom</technical_language>

Target:
protected SortedAssignmentContainer sortByProgress() { if (groupedMap.size() == 0) { sortByCategory(); } List<Assignment> uncompleted = new ArrayList<Assignment>(); List<Assignment> completed = new ArrayList<Assignment>(); for (String group : ASSIGNMENT_TYPE) { Pair<List<Assignment>, List<Assignment>> pair = fetchPairedAssignmentLists(group); uncompleted.addAll(pair.first); completed.addAll(pair.second); } Collections.sort(uncompleted); uncompleted.addAll(completed); return new SortedAssignmentContainer(uncompleted, assignments.getExpansions()); }
Source:
<code><START> private DeserializationResult readInto(IOReadableWritable target) throws IOException { <END> target.read(this); int remaining = remaining(); if (remaining > 0) { return INTERMEDIATE_RECORD_FROM_BUFFER; } else if (remaining == 0) { return LAST_RECORD_FROM_BUFFER; } else { throw new IOException(BROKEN_SERIALIZATION_ERROR_MESSAGE, new IndexOutOfBoundsException("Remaining = " + remaining)); } }</code><technical_language>move this method getNextRecord class read top bottom</technical_language>

Target:
private NextRecordResponse readInto(IOReadableWritable target) throws IOException { try { target.read(this); } catch (IndexOutOfBoundsException e) { throw new IOException(BROKEN_SERIALIZATION_ERROR_MESSAGE, e); } int remaining = remaining(); if (remaining < 0) { throw new IOException(BROKEN_SERIALIZATION_ERROR_MESSAGE, new IndexOutOfBoundsException("Remaining = " + remaining)); } return reusedNextRecordResponse.updated(remaining == 0 ? LAST_RECORD_FROM_BUFFER : INTERMEDIATE_RECORD_FROM_BUFFER, remaining); }
Source:
<code>public ToggleablePolicy.PolicyMode getPolicyMode() { String configKey = PolicyConfigKey.HEALTH_POLICY_MODE.key(); if (configs.containsKey(configKey) <START> && "deactivated".equals((String) configs.get(PolicyConfigKey.HEALTH_POLICY_MODE.key()))) { <END> return ToggleablePolicy.PolicyMode.deactivated; } return ToggleablePolicy.PolicyMode.activated; }</code><technical_language>create a static string variable for deactivated</technical_language>

Target:
public ToggleablePolicy.PolicyMode getPolicyMode() { String configKey = PolicyConfigKey.HEALTH_POLICY_MODE.key(); if (configs.containsKey(configKey)) { String val = (String) configs.get(PolicyConfigKey.HEALTH_POLICY_MODE.key()); if (CONF_POLICY_MODE_DEACTIVATED.equals(val)) { return ToggleablePolicy.PolicyMode.deactivated; } else if (CONF_POLICY_MODE_ACTIVATED.equals(val)) { return ToggleablePolicy.PolicyMode.activated; } else { LOG.warning("unknown policy mode config " + val); } } return ToggleablePolicy.PolicyMode.activated; }
Source:
<code>public void handleException(Throwable throwable, boolean fromChild) throws Exception { if (fromChild && !failureHandlingConfig.failParentOnSecondaryFailure) { <START> log.debug("Parent task "+this+" swallowing child error: "+throwable); <END> return; } handleException(throwable); }</code><technical_language>this risk log exception debug else? rely task task.get() done a log.warn? Feels report more debug, guessing is happening</technical_language>

Target:
public void handleException(Throwable throwable, boolean fromChild) throws Exception { Exceptions.propagateIfFatal(throwable); if (fromChild && !failureHandlingConfig.failParentOnSecondaryFailure) { log.debug("Parent task "+this+" swallowing child error: "+throwable); return; } handleException(throwable); }
Source:
<code>protected void updateEmptyState() { if (mRecyclerView == null) { return; } boolean empty = false; RecyclerView.Adapter<?> adapter = mRecyclerView.getAdapter(); if (adapter instanceof RootAdapter) { empty = ((RootAdapter) adapter).getCount() == 0; } else if (adapter != null) { empty = adapter.getItemCount() == 0; } mRecyclerView.setVisibility(empty ? View.GONE : View.VISIBLE); <START> mEmptyView.setVisibility(empty ? View.VISIBLE : View.GONE); <END> mEmptyViewContainer.setVisibility(empty ? View.VISIBLE : View.GONE); }</code><technical_language>this view permanently visible now</technical_language>

Target:
protected void updateEmptyState() { if (mRecyclerView == null) { return; } boolean empty = false; RecyclerView.Adapter<?> adapter = mRecyclerView.getAdapter(); if (adapter instanceof RootAdapter) { empty = ((RootAdapter) adapter).getCount() == 0; } else if (adapter != null) { empty = adapter.getItemCount() == 0; } mRecyclerView.setVisibility(empty ? View.GONE : View.VISIBLE); mEmptyViewContainer.setVisibility(empty ? View.VISIBLE : View.GONE); }
Source:
<code>private SortedMap<EntityType, List<Entity>> getEntityList(String extensionName, String jobName, List<FormDataBodyPart> feedForms, List<FormDataBodyPart> processForms, InputStream config) throws FalconException, IOException { List<Entity> processes = getProcesses(processForms); List<Entity> feeds = getFeeds(feedForms); ExtensionType extensionType = getExtensionType(extensionName); List<Entity> entities; TreeMap<EntityType, List<Entity>> entityMap = new TreeMap<>(); if (ExtensionType.TRUSTED.equals(extensionType)) { entities = extension.getEntities(jobName, addJobNameToConf(config, jobName)); List<Entity> trustedFeeds = new ArrayList<>(); List<Entity> trustedProcesses = new ArrayList<>(); for (Entity entity : entities) { if (EntityType.FEED.equals(entity.getEntityType())) { trustedFeeds.add(entity); } else { trustedProcesses.add(entity); } } <START> EntityUtil.applyTags(extensionName, jobName, trustedFeeds); <END> EntityUtil.applyTags(extensionName, jobName, trustedProcesses); entityMap.put(EntityType.PROCESS, trustedProcesses); entityMap.put(EntityType.FEED, trustedFeeds); return entityMap; } else { EntityUtil.applyTags(extensionName, jobName, processes); EntityUtil.applyTags(extensionName, jobName, feeds); entityMap.put(EntityType.PROCESS, processes); entityMap.put(EntityType.FEED, feeds); return entityMap; } }</code><technical_language>Applying Tags returning entityMap moved if-else avoid code repetition. Also, related patch, but, getEntityList method re-organized a avoid code repetition</technical_language>

Target:
private SortedMap<EntityType, List<Entity>> getEntityList(String extensionName, String jobName, List<FormDataBodyPart> feedForms, List<FormDataBodyPart> processForms, InputStream config) throws FalconException, IOException { List<Entity> processes = getProcesses(processForms); List<Entity> feeds = getFeeds(feedForms); ExtensionType extensionType = getExtensionType(extensionName); List<Entity> entities; TreeMap<EntityType, List<Entity>> entityMap = new TreeMap<>(); if (ExtensionType.TRUSTED.equals(extensionType)) { entities = extension.getEntities(jobName, addJobNameToConf(config, jobName)); feeds = new ArrayList<>(); processes = new ArrayList<>(); for (Entity entity : entities) { if (EntityType.FEED.equals(entity.getEntityType())) { feeds.add(entity); } else { processes.add(entity); } } } EntityUtil.applyTags(extensionName, jobName, processes); EntityUtil.applyTags(extensionName, jobName, feeds); entityMap.put(EntityType.PROCESS, processes); entityMap.put(EntityType.FEED, feeds); return entityMap; }
Source:
<code>public Templates list() { Templates templates = new Templates(); if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { List<org.ovirt.engine.core.common.businessentities.VmTemplate> unregisteredTemplates = getBackendCollection(VdcQueryType.GetUnregisteredVmTemplates, new UnregisteredEntitiesQueryParameters(storageDomainId, VmEntityType.TEMPLATE.name())); List<Template> collection = new ArrayList<Template>(); for (org.ovirt.engine.core.common.businessentities.VmTemplate entity : unregisteredTemplates) { Template vmTemplate = map(entity); collection.add(addLinks(populate(vmTemplate, entity))); } <START> templates.getTemplates().addAll(collection); <END> } return templates; }</code><technical_language>This return Templates unregister param is provided, good..</technical_language>

Target:
public Templates list() { Templates templates = new Templates(); if (QueryHelper.hasMatrixParam(getUriInfo(), UNREGISTERED_CONSTRAINT_PARAMETER)) { List<org.ovirt.engine.core.common.businessentities.VmTemplate> unregisteredTemplates = getBackendCollection(VdcQueryType.GetUnregisteredVmTemplates, new UnregisteredEntitiesQueryParameters(storageDomainId, VmEntityType.TEMPLATE.name())); List<Template> collection = new ArrayList<Template>(); for (org.ovirt.engine.core.common.businessentities.VmTemplate entity : unregisteredTemplates) { Template vmTemplate = map(entity); collection.add(addLinks(populate(vmTemplate, entity))); } templates.getTemplates().addAll(collection); } else { templates.getTemplates().addAll(getCollection()); } return templates; }
Source:
<code>public FbStatus(final int code, final Fallback fallback) { this( new Filtered<Integer>( <START> (status) -> { <END> return code == status.intValue(); }, code ), fallback ); }</code><technical_language>@paulodamaso braces return needed</technical_language>

Target:
public FbStatus(final int code, final Fallback fallback) { this( new Filtered<Integer>( (status) -> code == status.intValue(), code ), fallback ); }
Source:
<code>public WorkflowInstanceAction mapRow(ResultSet rs, int rowNum) throws SQLException { int actionId = rs.getInt("id"); Map<String, String> actionState = actionStates.getOrDefault(actionId, emptyMap()); return new WorkflowInstanceAction.Builder() <START> .setId(rs.getInt("id")) END> .setWorkflowInstanceId(rs.getInt("workflow_id")) .setExecutorId(rs.getInt("executor_id")) .setType(WorkflowActionType.valueOf(rs.getString("type"))) .setState(rs.getString("state")) .setStateText(rs.getString("state_text")) .setUpdatedStateVariables(actionState) .setRetryNo(rs.getInt("retry_no")) .setExecutionStart(toDateTime(rs.getTimestamp("execution_start"))) .setExecutionEnd(toDateTime(rs.getTimestamp("execution_end"))).build(); }</code><technical_language>this setId(actionId)</technical_language>

Target:
public WorkflowInstanceAction mapRow(ResultSet rs, int rowNum) throws SQLException { int actionId = rs.getInt("id"); Map<String, String> actionState = actionStates.getOrDefault(actionId, emptyMap()); return new WorkflowInstanceAction.Builder() .setId(actionId) .setWorkflowInstanceId(rs.getInt("workflow_id")) .setExecutorId(rs.getInt("executor_id")) .setType(WorkflowActionType.valueOf(rs.getString("type"))) .setState(rs.getString("state")) .setStateText(rs.getString("state_text")) .setUpdatedStateVariables(actionState) .setRetryNo(rs.getInt("retry_no")) .setExecutionStart(toDateTime(rs.getTimestamp("execution_start"))) .setExecutionEnd(toDateTime(rs.getTimestamp("execution_end"))).build(); }
Source:
<code>private static String removeDeviceFromPathOnWindows(String path) { <START> final String os = System.getProperty("os.name", "Unix"); <END> String fixedPath = path; if (os.startsWith("Windows")) { fixedPath = path.substring(path.indexOf(':') + 1); } return fixedPath; }</code><technical_language>this final put current path assignment else statement. @romani prefer this way</technical_language>

Target:
private static String removeDeviceFromPathOnWindows(String path) { String fixedPath = path; final String os = System.getProperty("os.name", "Unix"); if (os.startsWith("Windows")) { fixedPath = path.substring(path.indexOf(':') + 1); } return fixedPath; }
Source:
<code>public String solveProblemForAll() { try { for (Task s : this.steps) { this.currentStep = s; serviceManager.getWorkflowService().setSolution(getSolution()); try { setCurrentStep(serviceManager.getWorkflowService().solveProblem(this.currentStep, this.solutionTask)); } catch (DataException e) { <START> logger.error("Problem couldn't be solved: " + e); <END> } saveStep(); } this.solution.setMessage(""); this.solutionTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); } catch (AuthenticationException e) { Helper.setFehlerMeldung(e.getMessage()); return ""; } }</code><technical_language>2 things: 1) If a DataException is thrown is a good idea on? 2) this kind of error logging work casting exception object string message</technical_language>

Target:
public String solveProblemForAll() { try { for (Task s : this.steps) { this.currentStep = s; serviceManager.getWorkflowService().setSolution(getSolution()); try { setCurrentStep(serviceManager.getWorkflowService().solveProblem(this.currentStep, this.solutionTask)); saveStep(); } catch (DataException e) { logger.error("Problem couldn't be solved: " + e); } } this.solution.setMessage(""); this.solutionTask = ""; AktuelleSchritteForm asf = (AktuelleSchritteForm) Helper.getManagedBeanValue("#{AktuelleSchritteForm}"); return asf.filterAll(); } catch (AuthenticationException e) { Helper.setFehlerMeldung(e.getMessage()); return ""; } }
Source:
<code><START> private String getDeviceIpAddressFromSessionProvider(final DlmsDevice dlmsDevice) throws ProtocolAdapterException { <END> final SessionProvider sessionProvider = this.sessionProviderService.getSessionProvider(dlmsDevice .getCommunicationProvider()); String deviceIpAddress = null; try { deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress == null) { this.jasperWirelessSmsClient.sendWakeUpSMS(dlmsDevice.getIccId()); for (int i = 0; i < this.jasperGetSessionRetries; i++) { Thread.sleep(this.jasperGetSessionSleepBetweenRetries); deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress != null) { return deviceIpAddress; } } } } catch (final InterruptedException e) { throw new ProtocolAdapterException( "Interrupted while sleeping before calling the sessionProvider.getIpAddress", e); } catch (SessionProviderUnsupportedException | SessionProviderException e) { throw new ProtocolAdapterException("", e); } if (deviceIpAddress == null || "".equals(deviceIpAddress)) { throw new ProtocolAdapterException("Session provider: " + dlmsDevice.getCommunicationProvider() + " did not return an IP address for device: " + dlmsDevice.getDeviceIdentification() + " and iccId: " + dlmsDevice.getIccId()); } else { return deviceIpAddress; } }</code><technical_language>![MAJOR](<LINK_1> Cyclomatic Complexity of this method "getDeviceIpAddressFromSessionProvider" is 12 is greater 10 authorized. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
private String getDeviceIpAddressFromSessionProvider(final DlmsDevice dlmsDevice) throws ProtocolAdapterException { final SessionProvider sessionProvider = this.sessionProviderService.getSessionProvider(dlmsDevice .getCommunicationProvider()); String deviceIpAddress = null; try { deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress != null) { return deviceIpAddress; } this.jasperWirelessSmsClient.sendWakeUpSMS(dlmsDevice.getIccId()); for (int i = 0; i < this.jasperGetSessionRetries; i++) { Thread.sleep(this.jasperGetSessionSleepBetweenRetries); deviceIpAddress = sessionProvider.getIpAddress(dlmsDevice.getIccId()); if (deviceIpAddress != null) { break; } } } catch (final InterruptedException e) { throw new ProtocolAdapterException( "Interrupted while sleeping before calling the sessionProvider.getIpAddress", e); } catch (SessionProviderUnsupportedException | SessionProviderException e) { throw new ProtocolAdapterException("", e); } if (deviceIpAddress == null || "".equals(deviceIpAddress)) { throw new ProtocolAdapterException("Session provider: " + dlmsDevice.getCommunicationProvider() + " did not return an IP address for device: " + dlmsDevice.getDeviceIdentification() + "and iccId: " + dlmsDevice.getIccId()); } return deviceIpAddress; }
Source:
<code>public void processWatermark(ControlTuple.Watermark watermark) { currentWatermark = watermark.getTimestamp(); long horizon = currentWatermark - allowedLatenessMillis; if (allowedLatenessMillis >= 0) { <START> dataStorage.removeUpTo(horizon); <END> } for (Iterator<Map.Entry<Window, WindowState>> it = windowStateMap.iterator(); it.hasNext(); ) { Map.Entry<Window, WindowState> entry = it.next(); Window window = entry.getKey(); WindowState windowState = entry.getValue(); if (allowedLatenessMillis >= 0 && window.getBeginTimestamp() + window.getDurationMillis() < horizon) { it.remove(); } else if (window.getBeginTimestamp() + window.getDurationMillis() < currentWatermark) { if (windowState.watermarkArrivalTime == -1) { windowState.watermarkArrivalTime = currentDerivedTimestamp; if (triggerAtWatermark) { fireTrigger(window, windowState); } } } } controlOutput.emit(watermark); }</code><technical_language>removing storage, check triggers fired data is send downstream for window is late</technical_language>

Target:
public void processWatermark(ControlTuple.Watermark watermark) { this.watermarkTimestamp = watermark.getTimestamp(); }
Source:
<code>private List<EmailWrapper> generateFeedbackSessionEmailBasesForInstructorReminders( CourseAttributes course, FeedbackSessionAttributes session, List<InstructorAttributes> instructors, String template, String subject) { List<EmailWrapper> emails = new ArrayList<EmailWrapper>(); String coOwnersLine = generateCoOwnersEmailsLine(generateCoOwnersList(course.getId())); for (InstructorAttributes instructor : instructors) { emails.add(generateFeedbackSessionEmailBaseForInstructorReminders(course, session, instructor, <START> template, subject, coOwnersLine)); <END> } return emails; }</code><technical_language>8 space indentation here</technical_language>

Target:
private List<EmailWrapper> generateFeedbackSessionEmailBasesForInstructorReminders( CourseAttributes course, FeedbackSessionAttributes session, List<InstructorAttributes> instructors, String template, String subject) { List<EmailWrapper> emails = new ArrayList<EmailWrapper>(); String coOwnersLine = generateCoOwnersEmailsLine(course.getId()); for (InstructorAttributes instructor : instructors) { emails.add(generateFeedbackSessionEmailBaseForInstructorReminders(course, session, instructor, template, subject, coOwnersLine)); } return emails; }
Source:
<code>private Set<EPackage> collectEPackagesToRegister(final EObject target) { final Set<EPackage.Registry> localEPackageRegistries = Sets.newLinkedHashSet(); final Set<EPackage> knownEPackages = Sets.newLinkedHashSet(); for (EObject targetEObject : Iterables.filter(context.getTargetNotifiers(), EObject.class)) { EPackage ePackage = targetEObject.eClass().getEPackage(); if (ePackage != null && ePackage.getNsURI() != null) { knownEPackages.add(ePackage); } if <START> (target.eResource() <END> != null && target.eResource().getResourceSet() != null) { localEPackageRegistries.add(target.eResource().getResourceSet().getPackageRegistry()); } } Set<String> localyRegisteredNsURIs = Sets.newLinkedHashSet(); for (EPackage.Registry registry : localEPackageRegistries) { localyRegisteredNsURIs.addAll(registry.keySet()); for (String nsURI : registry.keySet()) { Object value = registry.get(nsURI); if (value instanceof EPackage) { knownEPackages.add((EPackage) value); } } } for (String nsURI : EPackage.Registry.INSTANCE.keySet()) { if (localyRegisteredNsURIs.size() == 0 || !localyRegisteredNsURIs.contains(nsURI)) { Object value = EPackage.Registry.INSTANCE.get(nsURI); if (value instanceof EPackage) { knownEPackages.add((EPackage) value); } } } return knownEPackages; }</code><technical_language>targetEObject (the iteration variable) instead of target (the method parameter)</technical_language>

Target:
private Set<EPackage> collectEPackagesToRegister(final EObject target) { final Set<EPackage.Registry> localEPackageRegistries = Sets.newLinkedHashSet(); final Set<EPackage> knownEPackages = Sets.newLinkedHashSet(); for (EObject targetEObject : Iterables.filter(context.getTargetNotifiers(), EObject.class)) { EPackage ePackage = targetEObject.eClass().getEPackage(); if (ePackage != null && ePackage.getNsURI() != null) { knownEPackages.add(ePackage); } Resource targetEObjectResource = targetEObject.eResource(); if (targetEObjectResource != null && targetEObjectResource.getResourceSet() != null) { localEPackageRegistries.add(targetEObjectResource.getResourceSet().getPackageRegistry()); } } Set<String> localyRegisteredNsURIs = Sets.newLinkedHashSet(); for (EPackage.Registry registry : localEPackageRegistries) { localyRegisteredNsURIs.addAll(registry.keySet()); for (String nsURI : registry.keySet()) { Object value = registry.get(nsURI); if (value instanceof EPackage) { knownEPackages.add((EPackage) value); } } } for (String nsURI : EPackage.Registry.INSTANCE.keySet()) { if (localyRegisteredNsURIs.size() == 0 || !localyRegisteredNsURIs.contains(nsURI)) { Object value = EPackage.Registry.INSTANCE.get(nsURI); if (value instanceof EPackage) { knownEPackages.add((EPackage) value); } } } return knownEPackages; }
Source:
<code><START> private String stripLeadingAndTrailingSlash(String string) { <END> int startIndex = string.startsWith("/") ? 1 : 0; int endIndex = Math.max(string.length() - (string.endsWith("/") ? 1 : 0), startIndex); return string.substring(startIndex, endIndex); }</code><technical_language>Is this string.replaceAll("^/|/$", "");</technical_language>

Target:
private String stripLeadingAndTrailingSlash(String string) { return string.replaceAll("^/|/$", ""); }
Source:
<code>private void validate() { if (!containsMacro("delimiter") && !delimMap.containsKey(delimiter)) { <START> throw new IllegalArgumentException("Unknown delimiter '" + delimiter + "' specified. "); <END> } if (!containsMacro("format") && (format == null || format.isEmpty())) { throw new IllegalArgumentException("Format is not specified. Allowed values are DELIMITED, EXCEL, MYSQL," + " RFC4180 & TDF"); } if (!containsMacro("format") && !format.equalsIgnoreCase("DELIMITED") && !format.equalsIgnoreCase("EXCEL") && !format.equalsIgnoreCase("MYSQL") && !format.equalsIgnoreCase("RFC4180") && !format.equalsIgnoreCase("TDF")) { throw new IllegalArgumentException("Format specified is not one of the allowed values. Allowed values are " + "DELIMITED, EXCEL, MYSQL, RFC4180 & TDF"); } }</code><technical_language>.. specified. Allowed values " + Joiner.on(", ").join(delimMap.keySet())</technical_language>

Target:
private void validate() { if (!containsMacro("delimiter") && !delimMap.containsKey(delimiter)) { throw new IllegalArgumentException("Unknown delimiter '" + delimiter + "' specified. Allowed values are " + Joiner.on(", ").join(delimMap.keySet())); } if (!containsMacro("format") && (format == null || format.isEmpty())) { throw new IllegalArgumentException("Format is not specified. Allowed values are DELIMITED, EXCEL, MYSQL," + " RFC4180 & TDF"); } if (!containsMacro("format") && !format.equalsIgnoreCase("DELIMITED") && !format.equalsIgnoreCase("EXCEL") && !format.equalsIgnoreCase("MYSQL") && !format.equalsIgnoreCase("RFC4180") && !format.equalsIgnoreCase("TDF")) { throw new IllegalArgumentException("Format specified is not one of the allowed values. Allowed values are " + "DELIMITED, EXCEL, MYSQL, RFC4180 & TDF"); } }
Source:
<code>public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getActivity().getActionBar() != null) { getActivity().getActionBar().setTitle(R.string.title_check_email); } if (!(getActivity() instanceof CheckEmailListener)) { throw new IllegalStateException("Activity must implement CheckEmailListener"); } this.mListener = (CheckEmailListener) getActivity(); String email = getArguments().getString(ExtraConstants.EXTRA_EMAIL); if (!TextUtils.isEmpty(email)) { mEmailEditText.setText(email); validateAndProceed(); <START> } if (mHelper.getFlowParams().smartLockEnabled) { <END> showEmailAutoCompleteHint(); } }</code><technical_language>This a new line</technical_language>

Target:
public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (getActivity().getActionBar() != null) { getActivity().getActionBar().setTitle(R.string.title_check_email); } if (!(getActivity() instanceof CheckEmailListener)) { throw new IllegalStateException("Activity must implement CheckEmailListener"); } mListener = (CheckEmailListener) getActivity(); if (savedInstanceState != null) { return; } String email = getArguments().getString(ExtraConstants.EXTRA_EMAIL); if (!TextUtils.isEmpty(email)) { mEmailEditText.setText(email); validateAndProceed(); } else if (mHelper.getFlowParams().smartLockEnabled) { showEmailAutoCompleteHint(); } }
Source:
<code>public static void pickle(final AndroidFxAccount account, final String filename) { final ExtendedJSONObject o = new ExtendedJSONObject(); o.put(KEY_PICKLE_VERSION, new Long(PICKLE_VERSION)); o.put(KEY_PICKLE_TIMESTAMP, new Long(System.currentTimeMillis())); <START> o.put(KEY_ACCOUNT_VERSION, AndroidFxAccount.CURRENT_PREFS_VERSION); <END> o.put(KEY_ACCOUNT_TYPE, FxAccountConstants.ACCOUNT_TYPE); o.put(KEY_EMAIL, account.getEmail()); o.put(KEY_PROFILE, account.getProfile()); o.put(KEY_IDP_SERVER_URI, account.getAccountServerURI()); o.put(KEY_TOKEN_SERVER_URI, account.getTokenServerURI()); o.put(KEY_IS_SYNCING_ENABLED, account.isSyncingEnabled()); final ExtendedJSONObject bundle = account.unbundle(); if (bundle == null) { Logger.warn(LOG_TAG, "Unable to obtain account bundle; aborting."); return; } o.put(KEY_BUNDLE, bundle); writeToDisk(account.context, filename, o); }</code><technical_language>I CURRENT_ACCOUNT_VERSION. CURRENT_PREFS_VERSION irrelevant pickling code - need read prefs</technical_language>

Target:
public static void pickle(final AndroidFxAccount account, final String filename) { final ExtendedJSONObject o = new ExtendedJSONObject(); o.put(KEY_PICKLE_VERSION, Long.valueOf(PICKLE_VERSION)); o.put(KEY_PICKLE_TIMESTAMP, Long.valueOf(System.currentTimeMillis())); o.put(KEY_ACCOUNT_VERSION, AndroidFxAccount.CURRENT_ACCOUNT_VERSION); o.put(KEY_ACCOUNT_TYPE, FxAccountConstants.ACCOUNT_TYPE); o.put(KEY_EMAIL, account.getEmail()); o.put(KEY_PROFILE, account.getProfile()); o.put(KEY_IDP_SERVER_URI, account.getAccountServerURI()); o.put(KEY_TOKEN_SERVER_URI, account.getTokenServerURI()); o.put(KEY_IS_SYNCING_ENABLED, account.isSyncingEnabled()); final ExtendedJSONObject bundle = account.unbundle(); if (bundle == null) { Logger.warn(LOG_TAG, "Unable to obtain account bundle; aborting."); return; } o.put(KEY_BUNDLE, bundle); writeToDisk(account.context, filename, o); }
Source:
<code>public void setup(Context.OperatorContext context) { <START> blocksDir = context.getValue(DAGContext.APPLICATION_PATH) + Path.SEPARATOR + BlockWriter.SUBDIR_BLOCKS; <END> try { outputFS = getOutputFSInstance(); outputFS.setWriteChecksum(writeChecksum); } catch (IOException ex) { throw new RuntimeException("Exception in getting output file system.", ex); } try { appFS = getAppFSInstance(); } catch (IOException ex) { try { outputFS.close(); } catch (IOException e) { throw new RuntimeException("Exception in closing output file system.", e); } throw new RuntimeException("Exception in getting application file system.", ex); } super.setup(context); }</code><technical_language>above, this blocksDir parameter configurable</technical_language>

Target:
public void setup(Context.OperatorContext context) { blocksDirectoryPath = context.getValue(DAGContext.APPLICATION_PATH) + Path.SEPARATOR + blocksDirectory; try { outputFS = getOutputFSInstance(); outputFS.setWriteChecksum(writeChecksum); } catch (IOException ex) { throw new RuntimeException("Exception in getting output file system.", ex); } try { appFS = getAppFSInstance(); } catch (IOException ex) { try { outputFS.close(); } catch (IOException e) { throw new RuntimeException("Exception in closing output file system.", e); } throw new RuntimeException("Exception in getting application file system.", ex); } super.setup(context); }
Source:
<code>private void checkDataSizeLimit(String path, byte[] data) { if (data == null) { return; } int sizeLimit = ZNRecordUtil.getSerializerWriteSizeLimit(); if (data.length > sizeLimit) { <START> throw new ZkMarshallingError( <END> "Path: " + path + " data size is larger than " + sizeLimit + " bytes"); } }</code><technical_language>I agree this is right do. Thanks for catching this fixing this. concern I is change of exception type. I if changing ZkMarshallingError is right do 1. ZkMarshallingError is thrown in reserved for in ZkSerializer implementations. 2. Changing Exception types backward-compatibility issues. do think</technical_language>

Target:
private void checkDataSizeLimit(String path, byte[] data) { if (data == null) { return; } if (data.length > WRITE_SIZE_LIMIT) { throw new ZkClientException("Data size of path " + path + " is greater than write size limit " + WRITE_SIZE_LIMIT + " bytes"); } }
Source:
<code>public AuthenticationException(ADALError code, String details, Throwable throwable) { super(details, throwable); mCode = code; if (null == throwable) { return; } if (throwable instanceof AuthenticationException) { mServiceStatusCode = ((AuthenticationException) throwable).getServiceStatusCode(); mResponseBody = ((AuthenticationException) throwable).getResponseBody(); <START> mHttpResponseHeaders = ((AuthenticationException) throwable).getHttpResponseHeaders(); <END> } }</code><technical_language>nit: if more once, create a variable casts AuthenticationException</technical_language>

Target:
public AuthenticationException(ADALError code, String details, Throwable throwable) { super(details, throwable); mCode = code; if (null == throwable) { return; } if (throwable instanceof AuthenticationException) { mServiceStatusCode = ((AuthenticationException) throwable).getServiceStatusCode(); if (null != ((AuthenticationException) throwable).getHttpResponseBody()) { mHttpResponseBody = new HashMap<>(((AuthenticationException) throwable).getHttpResponseBody()); } if (null != ((AuthenticationException) throwable).getHttpResponseHeaders()) { mHttpResponseHeaders = new HashMap<>(((AuthenticationException) throwable).getHttpResponseHeaders()); } } }
Source:
<code>public void initAfterFirstDbConnection() { logger.debug("JDBC::initAfterFirstDbConnection: Initializing step, after db is connected."); dbMeta = new DbMetaData(); <START> if (dbMeta.isDbVersionGreater(5, 1)) { <END> sqlTypes.put("DATETIMEITEM", "TIMESTAMP(3)"); sqlTypes.put("TABLEPRIMARYKEY", "TIMESTAMP(3)"); sqlTypes.put("TABLEPRIMARYVALUE", "NOW(3)"); } }</code><technical_language>check for >= 5.6.4 if [this](<LINK_0> is correct</technical_language>

Target:
public void initAfterFirstDbConnection() { logger.debug("JDBC::initAfterFirstDbConnection: Initializing step, after db is connected."); dbMeta = new DbMetaData(); if (dbMeta.isDbVersionGreater(5, 1)) { sqlTypes.put("DATETIMEITEM", "TIMESTAMP(3)"); sqlTypes.put("tablePrimaryKey", "TIMESTAMP(3)"); sqlTypes.put("tablePrimaryValue", "NOW(3)"); } }
Source:
<code>public void init() { Date date = new Date(); <START> long initialTime = date.getTime(); <END> while (jmxConnectionTimeout.getValue() > (date.getTime() - initialTime)) { try { connections = AgentUtils.getMBeanConnections( AgentUtils.getJMXConnectors(AgentUtils.splitServices(jmxServices), name + " collect from jmx port ", urlFormat)); break; } catch (IOException e) { log.error("Error during JMX initializing", e); TimeUtils.sleepMillis(3000); } } if (connections.size() == 0) { throw new RuntimeException("Error during JMX initialization. ZERO connections created for url " + jmxServices + "."); } }</code><technical_language>System.currentTimeMillis()</technical_language>

Target:
public void init() { long initialTime = System.currentTimeMillis(); while (jmxConnectionTimeout.getValue() > (System.currentTimeMillis() - initialTime)) { try { connections = AgentUtils.getMBeanConnections( AgentUtils.getJMXConnectors(AgentUtils.splitServices(jmxServices), name + " collect from jmx port ", urlFormat)); break; } catch (IOException e) { log.error("Error during JMX initializing", e); TimeUtils.sleepMillis(jmxConnectionRetryDelay.getValue()); } } if (connections.size() == 0) { throw new RuntimeException("Error during JMX initialization. ZERO connections created for url " + jmxServices + "."); } }
Source:
<code><START> public Builder measurementMappings(Map<String, String> measurementMappings) { <END> this.measurementMappings = measurementMappings; return this; }</code><technical_language>easy use, construct Map<String, Pattern> throw a runtime if a pattern compile</technical_language>

Target:
public Builder measurementMappings(Map<String, String> measurementMappings) { Map<String, Pattern> mappingsByPattern = new HashMap<String, Pattern>(); for(Map.Entry<String, String> entry: measurementMappings.entrySet()) { try { final Pattern pattern = Pattern.compile(entry.getValue()); mappingsByPattern.put(entry.getKey(), pattern); } catch (PatternSyntaxException e) { throw new RuntimeException("Could not compile regex: " + entry.getValue(), e); } } this.measurementMappings = mappingsByPattern; return this; }
Source:
<code>DefaultEndpoint(final URI uri, final InetAddress ip) { this.uri = checkNotNull(uri); this.ip = checkNotNull(ip); final String scheme = this.uri.getScheme(); final String host = this.uri.getHost(); final int port = this.uri.getPort(); if (!VALID_PROTOCOLS.contains(scheme) || host == null || port == -1) { throw new IllegalArgumentException(String.format( <START> "Master endpoints must be of the form \"%s://heliosmaster.domain.net:<port>\"", <END> VALID_PROTOCOLS_STR)); } }</code><technical_language>if care format hostname (which this error message kind of suggests do), this message Endpoints of form %s://<host>:<port></technical_language>

Target:
DefaultEndpoint(final URI uri, final InetAddress ip) { this.uri = checkNotNull(uri); this.ip = checkNotNull(ip); final String scheme = this.uri.getScheme(); final String host = this.uri.getHost(); final int port = this.uri.getPort(); if (!VALID_PROTOCOLS.contains(scheme) || host == null || port == -1) { throw new IllegalArgumentException(String.format( "Master endpoints must be of the form \"%s://<hostname>:<port>\"", VALID_PROTOCOLS_STR)); } }