auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public void testWithTrace() throws TmfAnalysisException, TmfTraceException, IOException { <END> String tracePath; tracePath = FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).getPath(); assertNotNull(tracePath); TmfTrace testTrace = new LttngKernelTrace(); SystemCallLatencyAnalysis module = new SystemCallLatencyAnalysis(); IAnalysisModule kernelModule = new KernelAnalysisModule(); final IAnalysisModuleSource source = new IAnalysisModuleSource() { @Override public @NonNull Iterable<IAnalysisModuleHelper> getAnalysisModules() { return Arrays.asList(new AnalysisModuleHelper(kernelModule), new AnalysisModuleHelper(module)); } }; TmfAnalysisManager.registerModuleSource(source); testTrace.initTrace(null, tracePath, CtfTmfEvent.class); kernelModule.setTrace(testTrace); module.setTrace(testTrace); try { testTrace.traceOpened(new TmfTraceOpenedSignal(this, testTrace, null)); } catch (NullPointerException e) { } kernelModule.schedule(); kernelModule.waitForCompletion(); module.schedule(); module.waitForCompletion(); final @Nullable ISegmentStore<@NonNull ISegment> segmentStore = module.getResults(); assertNotNull(segmentStore); assertEquals(1801, segmentStore.size()); UIThreadRunnable.syncExec(new VoidResult() { @Override public void run() { fTable.traceOpened(new TmfTraceOpenedSignal(this, testTrace, null)); } }); assertNotNull(fTable); SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable()); assertEquals("24100", tableBot.cell(0, 2)); tableBot.header("Duration").click(); assertEquals("1000", tableBot.cell(0, 2)); tableBot.header("Duration").click(); assertEquals("5904091700", tableBot.cell(0, 2)); UIThreadRunnable.asyncExec(new VoidResult() { @Override public void run() { fTable.traceClosed(new TmfTraceClosedSignal(this, testTrace)); } }); }</code><technical_language>I this more for UI testing. Open trace, open view, table is filled correctly</technical_language>

Target:
public void testWithTrace() throws IOException { String tracePath; tracePath = FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).getPath(); SWTWorkbenchBot bot = new SWTWorkbenchBot(); SWTBotView view = bot.viewById(VIEW_ID); view.close(); bot.waitUntil(ConditionHelpers.ViewIsClosed(view)); SWTBotUtils.createProject(PROJECT_NAME); SWTBotUtils.openTrace(PROJECT_NAME, tracePath, TRACE_TYPE); SWTBotUtils.waitForJobs(); createTable(); SWTBotUtils.waitForJobs(); SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable()); assertEquals("24100", tableBot.cell(0, 2)); tableBot.header("Duration").click(); assertEquals("1000", tableBot.cell(0, 2)); tableBot.header("Duration").click(); assertEquals("5904091700", tableBot.cell(0, 2)); bot.closeAllEditors(); }
Source:
<code><START> protected synchronized void shutdownProducer() { <END> Producer<K, V> producer = _kafkaProducer; _kafkaProducer = null; if (producer != null) { producer.close(TIME_OUT, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); } }</code><technical_language>This package private (no modifier) instead. applies generateSendFailure()</technical_language>

Target:
synchronized void shutdownProducer() { Producer<K, V> producer = _kafkaProducer; _kafkaProducer = null; if (producer != null) { producer.close(TIME_OUT, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); } }
Source:
<code>private Cost checkElement(IType type, IValue initialValue, Cost worstCost) throws DOMException { IType nestedType = SemanticUtil.getNestedType(type, SemanticUtil.TDEF); if (fIndex >= fInitializers.length) return checkInitializationFromDefaultMemberInitializer(nestedType, initialValue, worstCost); worstCost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.IDENTITY); if (initFromStringLiteral(nestedType, fInitializers[fIndex])) { Cost cost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.CONVERSION); fIndex++; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else if (fInitializers[fIndex].isInitializerList() || !isAggregate(nestedType)) { ICPPEvaluation initializer = fInitializers[fIndex]; fIndex++; Cost cost = Conversions.checkImplicitConversionSequence(nestedType, initializer.getType(), initializer.getValueCategory(), UDCMode.ALLOWED, Context.ORDINARY); if (!cost.converts()) { return cost; } <START> if (!(initializer.isConstantExpression()) && cost.isNarrowingConversion()) { <END> return Cost.NO_CONVERSION; } if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else { Cost cost = checkInitializationOfElements(nestedType, worstCost); if (!cost.converts()) return cost; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } return worstCost; }</code><technical_language>cost.isNarrowingConversion() logic handle constexpr case. great length do accurate check, checking if _value_ of constant expression is small enough fit target type narrowing (which is standard checked). accuracy of this check depends CPPBasicTypes for constant expressions tracking of expression represent. missing some cases for tracking this. In this testcase, I tracked EvalUnaryTypeID.getType(), returns CPPVisitor.get_SIZE_T(). return a clone of type instead, call CPPBasicType.setAssociatedNumericalValue(getValue())</technical_language>

Target:
private Cost checkElement(IType type, IValue initialValue, Cost worstCost) throws DOMException { IType nestedType = SemanticUtil.getNestedType(type, SemanticUtil.TDEF); if (fIndex >= fInitializers.length) return checkInitializationFromDefaultMemberInitializer(nestedType, initialValue, worstCost); worstCost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.IDENTITY); if (fInitializers[fIndex].isInitializerList() || !isAggregate(nestedType)) { ICPPEvaluation initializer = fInitializers[fIndex]; fIndex++; Cost cost = Conversions.checkImplicitConversionSequence(nestedType, initializer.getType(), initializer.getValueCategory(), UDCMode.ALLOWED, Context.ORDINARY); if (!cost.converts()) { return cost; } if (!(initializer instanceof EvalInitList) && cost.isNarrowingConversion()) { return Cost.NO_CONVERSION; } if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else { Cost cost = checkInitializationOfElements(nestedType, worstCost); if (!cost.converts()) return cost; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } return worstCost; }
Source:
<code>public boolean hasPostConstructMethods() { <START> return hasPostConstructCallback(); <END> }</code><technical_language>I comprehend this approach - class is for interceptors, I get much. want/need post contruct callbacks there. I get, is invoke them? Putting System.out in postConstruct trigger it. is IMO intended</technical_language>

Target:
public boolean hasPostConstructMethods() { return true; }
Source:
<code>public static void computeLegalDestinations() { Team team = sGame.getTeams()[sGame.getTurnKeeper().getCurrentTeamIndex()]; <START> mData = new ComputedPieceData(sGame.getTurnKeeper().getCurrentTeamIndex()); <END> for (Piece piece : team.getPieces()) { int boardIndex = team.getRules() == null ? piece.getCoordinates().boardIndex : team.getRules().getDestinationBoardIndex(piece.getCoordinates().boardIndex); mData.computeLegalDestinations(piece, boardIndex); } }</code><technical_language>I need save of ComputedPieceData instances, need able data for Team. Well, get saving data for whoever's turn is, easier save all</technical_language>

Target:
public static void computeLegalDestinations() { Team[] teams = sGame.getTeams(); for (int teamIndex = 0; teamIndex < teams.length; teamIndex++) { mDataMap.put(teamIndex, new ComputedPieceData(teamIndex)); for (Piece piece : teams[teamIndex].getPieces()) { int boardIndex = teams[teamIndex].getRules() == null ? piece.getCoordinates().boardIndex : teams[teamIndex].getRules().getDestinationBoardIndex( piece.getCoordinates().boardIndex); mDataMap.get(teamIndex).computeLegalDestinations(piece, boardIndex); } } }
Source:
<code>public ResponseEntity handleException(Locale locale, Exception ex) { LOGGER.error("Error while saving position changes", ex); <START> HttpHeaders headers = new HttpHeaders(); <END> headers.setContentType(TEXT_PLAIN_UTF8); return new ResponseEntity<>(messageSource.getMessage(TECHNICAL_ERROR_MESSAGE_KEY, null, locale), headers, HttpStatus.BAD_REQUEST); }</code><technical_language>This section reused/extracted well, work for Spring MVC error handling task</technical_language>

Target:
public ResponseEntity handleException(Locale locale, Exception ex) { LOGGER.error("Error while saving position changes", ex); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaTypes.TEXT_PLAIN_UTF8); return new ResponseEntity<>(messageSource.getMessage(TECHNICAL_ERROR_MESSAGE_KEY, null, locale), headers, HttpStatus.BAD_REQUEST); }
Source:
<code>public void onError(YouTubePlayer.ErrorReason errorReason) { if (previousYouTubePlayer != null){ previousYouTubePlayer.release(); } youTubePlayer.release(); <START> initializeYoutubePlayer(); <END> }</code><technical_language>initializeYoutubePlayer method call OnError a loop if device is unable initialized youtube player time. show error message user 2-3 times of retry</technical_language>

Target:
public void onError(YouTubePlayer.ErrorReason errorReason) { if (attempts <= 3) { releaseYoutubePlayer(); initializeYoutubePlayer(); attempts++; } else { Toast.makeText(getActivity(), errorReason.toString(), Toast.LENGTH_LONG).show(); } }
Source:
<code>public void searchesMessages() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:99"; final User user = base.user(new URN(urn)); user.aliases().add("test-user"); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("test1"); bout.messages().post("test2"); bout.messages().post("fest"); bout.friends().invite(alias.name()); MatcherAssert.assertThat( XhtmlMatchers.xhtml( new RsPrint( new FkBout(".*", new TkIndex(base)).route( new RqWithAuth( urn, new RqFake( "GET", String.format( "/b/%d/search?q=test", bout.number() ) ) ) ).get() ).printBody() ), XhtmlMatchers.hasXPaths( <START> "/page/bout[number=1]", <END> "/page/bout[title='untitled']", "/page/bout[unread=0]", "/page/bout/friends/friend[alias='test-user']", "/page/bout/friends/friend/links/link[@rel='photo']", "/page/bout/friends/friend/links/link[@rel='kick']", "/page/bout/messages/message[text='test2']", "/page/bout/messages/message[text='test1']" ) ); }</code><technical_language>@erimerturk do need place non-message paths here? 2 expected results (if matcher accepts it, of course)</technical_language>

Target:
public void searchesMessages() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:99"; final User user = base.user(new URN(urn)); user.aliases().add("test-search-user"); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("test1"); bout.messages().post("test2"); bout.messages().post("fest"); bout.friends().invite(alias.name()); MatcherAssert.assertThat( XhtmlMatchers.xhtml( new RsPrint( new FkBout(TkIndexTest.REGEX, new TkIndex(base)).route( new RqWithAuth( urn, new RqFake( RqMethod.GET, String.format( "/b/%d/search?q=test", bout.number() ) ) ) ).get() ).printBody() ), XhtmlMatchers.hasXPaths( "/page/bout/friends/friend[alias='test-search-user']", "/page/bout/messages/message[text='test2']", "/page/bout/messages/message[text='test1']" ) ); }
Source:
<code>private void read(CorfuPayloadMsg<ReadRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { long address = msg.getPayload().getAddress(); boolean cacheable = msg.getPayload().isCacheable(); log.trace("read: {}, cacheable: {}", msg.getPayload().getAddress(), cacheable); ReadResponse rr = new ReadResponse(); try { <START> ILogData e = cacheable ? dataCache.get(address) : handleRetrieval(address); <END> if (e == null) { rr.put(address, LogData.getEmpty(address)); } else { rr.put(address, (LogData) e); } r.sendResponse(ctx, msg, CorfuMsgType.READ_RESPONSE.payloadMsg(rr)); } catch (DataCorruptionException e) { r.sendResponse(ctx, msg, CorfuMsgType.ERROR_DATA_CORRUPTION.msg()); } }</code><technical_language>Suppose read is in cache, this result in a slowdown handleRetrieval fileChannel right? Instead instead of handleRetrieval, do if dataCache.getIfPresent() returns null</technical_language>

Target:
public void read(CorfuPayloadMsg<ReadRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { long address = msg.getPayload().getAddress(); boolean cacheable = msg.getPayload().isCacheReadResult(); log.trace("read: {}, cacheable: {}", msg.getPayload().getAddress(), cacheable); ReadResponse rr = new ReadResponse(); try { ILogData logData = dataCache.get(address, cacheable); if (logData == null) { rr.put(address, LogData.getEmpty(address)); } else { rr.put(address, (LogData) logData); } r.sendResponse(ctx, msg, CorfuMsgType.READ_RESPONSE.payloadMsg(rr)); } catch (DataCorruptionException e) { r.sendResponse(ctx, msg, CorfuMsgType.ERROR_DATA_CORRUPTION.msg()); } }
Source:
<code><START> public void delete(Long poolOrderId) throws IOException { <END> PoolOrder poolOrder = poolOrderDao.getPoolOrder(poolOrderId); if (poolOrder != null) poolOrderDao.deletePoolOrder(poolOrder); }</code><technical_language>Missing authorization check</technical_language>

Target:
public void delete(Long poolOrderId) throws IOException { PoolOrder poolOrder = poolOrderDao.getPoolOrder(poolOrderId); Pool<?> pool = requestManager.getPoolById(poolOrder.getPoolId()); authorizationManager.throwIfNotWritable(pool); if (poolOrder != null) poolOrderDao.deletePoolOrder(poolOrder); }
Source:
<code>protected Object doExecute() throws Exception { printInitCommand("clear resources"); try { getResourceManager().destroyAllResources(); } catch (Exception e) { <START> printError("Error celaring resources"); <END> printError(e); } printEndCommand(); return null; }</code><technical_language>I guess "clearing"</technical_language>

Target:
protected Object doExecute() throws Exception { printInitCommand("clear resources"); try { getResourceManager().destroyAllResources(); } catch (Exception e) { printError("Error clearing resources"); printError(e); } printEndCommand(); return null; }
Source:
<code>private Set<List<JavaFileScannerContext.Location>> flowFromYields(ExplodedGraph.Edge edge) { Set<MethodYield> methodYields = edge.yields(); if (methodYields.isEmpty()) { return ImmutableSet.of(ImmutableList.of()); } <START> Preconditions.checkState(isMethodInvocationNode(edge.parent), "Yield present on edge where parent is not MIT"); <END> List<Integer> argumentIndices = correspondingArgumentIndices(symbolicValues, edge.parent); SymbolicValue returnSV = edge.child.programState.peekValue(); if (symbolicValues.contains(returnSV)) { argumentIndices.add(-1); } return methodYields.stream() .map(y -> y.flow(argumentIndices, domains)) .flatMap(Set::stream) .collect(Collectors.toSet()); }</code><technical_language>I this is place want check this I risk address this invariant</technical_language>

Target:
private Set<List<JavaFileScannerContext.Location>> flowFromYields(ExplodedGraph.Edge edge) { Set<MethodYield> methodYields = edge.yields(); if (methodYields.isEmpty()) { return ImmutableSet.of(ImmutableList.of()); } List<Integer> argumentIndices = correspondingArgumentIndices(symbolicValues, edge.parent); SymbolicValue returnSV = edge.child.programState.peekValue(); if (symbolicValues.contains(returnSV)) { argumentIndices.add(-1); } return methodYields.stream() .map(y -> y.flow(argumentIndices, domains)) .flatMap(Set::stream) .collect(Collectors.toSet()); }
Source:
<code>ServiceAccountCredentials( String clientId, String clientEmail, PrivateKey privateKey, String privateKeyId, Collection<String> scopes, HttpTransportFactory transportFactory, URI tokenServerUri, String serviceAccountUser, String projectId, String quotaProjectId, int lifetime) { this.clientId = clientId; this.clientEmail = Preconditions.checkNotNull(clientEmail); this.privateKey = Preconditions.checkNotNull(privateKey); this.privateKeyId = privateKeyId; this.scopes = (scopes == null) ? ImmutableSet.<String>of() : ImmutableSet.copyOf(scopes); this.transportFactory = firstNonNull( transportFactory, getFromServiceLoader(HttpTransportFactory.class, OAuth2Utils.HTTP_TRANSPORT_FACTORY)); this.transportFactoryClassName = this.transportFactory.getClass().getName(); this.tokenServerUri = (tokenServerUri == null) ? OAuth2Utils.TOKEN_SERVER_URI : tokenServerUri; this.serviceAccountUser = serviceAccountUser; this.projectId = projectId; this.quotaProjectId = quotaProjectId; if (lifetime > TWELVE_HOURS_IN_SECONDS) { throw new IllegalStateException(LIFETIME_EXCEEDED_ERROR); } <START> this.lifetime = lifetime == 0 ? DEFAULT_LIFETIME_IN_SECONDS : lifetime; <END> }</code><technical_language>builder setting default already, do want this check for 0</technical_language>

Target:
ServiceAccountCredentials( String clientId, String clientEmail, PrivateKey privateKey, String privateKeyId, Collection<String> scopes, HttpTransportFactory transportFactory, URI tokenServerUri, String serviceAccountUser, String projectId, String quotaProjectId, int lifetime) { this.clientId = clientId; this.clientEmail = Preconditions.checkNotNull(clientEmail); this.privateKey = Preconditions.checkNotNull(privateKey); this.privateKeyId = privateKeyId; this.scopes = (scopes == null) ? ImmutableSet.<String>of() : ImmutableSet.copyOf(scopes); this.transportFactory = firstNonNull( transportFactory, getFromServiceLoader(HttpTransportFactory.class, OAuth2Utils.HTTP_TRANSPORT_FACTORY)); this.transportFactoryClassName = this.transportFactory.getClass().getName(); this.tokenServerUri = (tokenServerUri == null) ? OAuth2Utils.TOKEN_SERVER_URI : tokenServerUri; this.serviceAccountUser = serviceAccountUser; this.projectId = projectId; this.quotaProjectId = quotaProjectId; if (lifetime > TWELVE_HOURS_IN_SECONDS) { throw new IllegalStateException("lifetime must be less than or equal to 43200"); } this.lifetime = lifetime; }
Source:
<code>private ValidationResult validateMountOptions() { String mountOptions = getConnection().getMountOptions(); if (StringUtils.isBlank(mountOptions)) { return ValidationResult.VALID; } List<String> disallowedOptions = getConnection().getstorage_type() == StorageType.POSIXFS ? POSIX_MANAGED_OPTIONS : NFS_MANAGED_OPTIONS; Map<String, String> optionsMap = XmlRpcStringUtils.string2Map(mountOptions); Set<String> optionsKeys = new HashSet<>(); for (String optionName : optionsMap.keySet()) { optionsKeys.add(optionName.toLowerCase()); <START> } <END> optionsKeys.retainAll(disallowedOptions); if (!optionsKeys.isEmpty()) { addCanDoActionMessageVariable("invalidOptions", StringUtils.join(optionsKeys, ", ")); return new ValidationResult(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY); } return ValidationResult.VALID; }</code><technical_language>Consider a TreeSet String.CASE_INSENSITIVE_ORDER comparator - save this block of code</technical_language>

Target:
private ValidationResult validateMountOptions() { String mountOptions = getConnection().getMountOptions(); if (StringUtils.isBlank(mountOptions)) { return ValidationResult.VALID; } List<String> disallowedOptions = getConnection().getstorage_type() == StorageType.POSIXFS ? POSIX_MANAGED_OPTIONS : NFS_MANAGED_OPTIONS; Map<String, String> optionsMap = XmlRpcStringUtils.string2Map(mountOptions); Set<String> optionsKeys = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); optionsKeys.addAll(optionsMap.keySet()); optionsKeys.retainAll(disallowedOptions); if (!optionsKeys.isEmpty()) { addCanDoActionMessageVariable("invalidOptions", StringUtils.join(optionsKeys, ", ")); return new ValidationResult(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY); } return ValidationResult.VALID; }
Source:
<code>public void init() { setLabel("Decorator Configuration"); setPackage(decoratorPackage); setDescription( <START> "Configuration entity to configurate which dynamic decorators should be applied to an entity types."); <END> addAttribute(ID, ROLE_ID).setAuto(true).setVisible(false).setLabel("Identifier"); addAttribute(ENTITY_TYPE_ID).setNillable(false).setUnique(true).setLabel("Entity Type Identifier"); addAttribute(DYNAMIC_DECORATORS).setNillable(true) .setDataType(AttributeType.MREF) .setRefEntity(dynamicDecoratorMetadata) .setLabel("Decorators"); }</code><technical_language>types --> type</technical_language>

Target:
public void init() { setLabel("Decorator Configuration"); setPackage(decoratorPackage); setDescription( "Configuration entity to configure which dynamic decorators should be applied to an entity type."); addAttribute(ID, ROLE_ID).setAuto(true).setVisible(false).setLabel("Identifier"); addAttribute(ENTITY_TYPE_ID).setNillable(false).setUnique(true).setLabel("Entity Type Identifier"); addAttribute(DYNAMIC_DECORATORS).setNillable(true) .setDataType(AttributeType.MREF) .setRefEntity(dynamicDecoratorMetadata) .setLabel("Decorators"); }
Source:
<code>public Decision decideOnTest(WorkloadTaskData workloadTaskData) { <START> if (Double.compare(workloadTaskData.getSuccessRate().doubleValue(), successRateThreshold) <= 0) { <END> return Decision.OK; } return Decision.FATAL; }</code><technical_language>in this case situation workloadTaskData.getSuccessRate().doubleValue() is successRateThreshold , desideOnTest method return Desision.OK. i guess sign of conditional close ">="</technical_language>

Target:
public Decision decideOnTest(WorkloadTaskData workloadTaskData) { if (MathUtils.compareTo(workloadTaskData.getSuccessRate().doubleValue(), successRateThreshold, epsilon) >= 0) { return Decision.OK; } return Decision.FATAL; }
Source:
<code>private void receiveTokenFromKeycloak(final String content) throws IOException { LOG.debug("receiving new token from keycloak server"); final byte[] rawContent = content.getBytes(PlatformConstants.CHARSET); final URL url = new URL(authEndpoint + "/auth/realms/" + realmName + "/protocol/openid-connect/token"); final HttpURLConnection connection = new DefaultHttpURLConnectionFactory().create(url); connection.setRequestMethod(RequestMethod.POST.getRawName()); connection.setRequestProperty("charset", "UTF-8"); connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); connection.setRequestProperty("Content-Length", rawContent.length + ""); connection.setDoOutput(true); connection.setDoInput(true); final OutputStream w = connection.getOutputStream(); w.write(rawContent); w.close(); <START> final int responseCode = connection.getResponseCode(); <END> final InputStream is = connection.getInputStream(); final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int read = is.read(); while (read != -1) { byteArrayOutputStream.write(read); read = is.read(); } final byte[] rawInput = byteArrayOutputStream.toByteArray(); final String input = new String(rawInput); final Gson gson = PlatformClient.getService(Gson.class); final KeycloakOpenidConnectResult result = gson.fromJson(input, KeycloakOpenidConnectResult.class); connectResult = result; tokenCreation = System.currentTimeMillis(); }</code><technical_language>Unused variable</technical_language>

Target:
private void receiveTokenFromKeycloak(final String content) throws IOException { LOG.debug("receiving new token from keycloak server"); final byte[] rawContent = content.getBytes(PlatformConstants.CHARSET); final URL url = new URL(authEndpoint + "/auth/realms/" + realmName + "/protocol/openid-connect/token"); final HttpURLConnection connection = new DefaultHttpURLConnectionFactory().create(url); connection.setRequestMethod(RequestMethod.POST.getRawName()); connection.setRequestProperty("charset", "UTF-8"); connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); connection.setRequestProperty("Content-Length", rawContent.length + ""); connection.setDoOutput(true); connection.setDoInput(true); final OutputStream w = connection.getOutputStream(); w.write(rawContent); w.close(); final InputStream is = connection.getInputStream(); final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int read = is.read(); while (read != -1) { byteArrayOutputStream.write(read); read = is.read(); } final byte[] rawInput = byteArrayOutputStream.toByteArray(); final String input = new String(rawInput); final Gson gson = PlatformClient.getService(Gson.class); final KeycloakOpenidConnectResult result = gson.fromJson(input, KeycloakOpenidConnectResult.class); connectResult = result; tokenCreation = System.currentTimeMillis(); }
Source:
<code>public void stop(boolean stopGracefully) { Preconditions.checkState(started, "not started"); log.info("Beginning shutdown of KafkaSupervisor[%s]", dataSource); try { scheduledExec.shutdownNow(); Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner(); if (taskRunner.isPresent()) { taskRunner.get().unregisterListener(supervisorId); } synchronized (stopLock) { if (stopGracefully) { log.info("Posting GracefulShutdownNotice, signalling managed tasks to complete and publish"); notices.add(new GracefulShutdownNotice()); } else { log.info("Posting ShutdownNotice"); notices.add(new ShutdownNotice()); } while (!stopped) { <START> stopLock.wait(); <END> } } log.info("Shutdown notice handled"); exec.shutdownNow(); started = false; log.info("KafkaSupervisor[%s] has stopped", dataSource); } catch (Exception e) { log.makeAlert(e, "Exception stopping KafkaSupervisor[%s]", dataSource) .emit(); } }</code><technical_language>Wondering if shutdown takes forever. If add a timeout, happen then</technical_language>

Target:
public void stop(boolean stopGracefully) { synchronized (stateChangeLock) { Preconditions.checkState(started, "not started"); log.info("Beginning shutdown of KafkaSupervisor[%s]", dataSource); try { scheduledExec.shutdownNow(); Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner(); if (taskRunner.isPresent()) { taskRunner.get().unregisterListener(supervisorId); } synchronized (stopLock) { if (stopGracefully) { log.info("Posting GracefulShutdownNotice, signalling managed tasks to complete and publish"); notices.add(new GracefulShutdownNotice()); } else { log.info("Posting ShutdownNotice"); notices.add(new ShutdownNotice()); } long endTime = System.currentTimeMillis() + SHUTDOWN_TIMEOUT_MILLIS; while (!stopped) { long sleepTime = endTime - System.currentTimeMillis(); if (sleepTime <= 0) { log.info("Timed out while waiting for shutdown"); stopped = true; break; } stopLock.wait(sleepTime); } } log.info("Shutdown notice handled"); exec.shutdownNow(); started = false; log.info("KafkaSupervisor[%s] has stopped", dataSource); } catch (Exception e) { log.makeAlert(e, "Exception stopping KafkaSupervisor[%s]", dataSource) .emit(); } } }
Source:
<code>private boolean hasServiceClientAnnotation(DetailAST classDefToken) { final DetailAST modifiersToken = classDefToken.findFirstToken(TokenTypes.MODIFIERS); final Optional<DetailAST> serviceClientAnnotationOption = TokenUtil.findFirstTokenByPredicate(modifiersToken, <START> node -> node.getType() == TokenTypes.ANNOTATION && node.findFirstToken(TokenTypes.IDENT) != null <END> && SERVICE_CLIENT.equals(node.findFirstToken(TokenTypes.IDENT).getText())); if (serviceClientAnnotationOption.isPresent()) { isAsync = isAsyncServiceClient(serviceClientAnnotationOption.get()); return true; } return false; }</code><technical_language>nice expression lambdas, node.findFirstToken(TokenTypes.IDENT) results in evaluating node twice. Assign a local variable</technical_language>

Target:
private boolean hasServiceClientAnnotation(DetailAST classDefToken) { final DetailAST modifiersToken = classDefToken.findFirstToken(TokenTypes.MODIFIERS); final Optional<DetailAST> serviceClientAnnotationOption = TokenUtil.findFirstTokenByPredicate(modifiersToken, node -> { if (node.getType() != TokenTypes.ANNOTATION) { return false; } final DetailAST annotationIdentToken = node.findFirstToken(TokenTypes.IDENT); return annotationIdentToken != null && SERVICE_CLIENT.equals(annotationIdentToken.getText()); } ); if (serviceClientAnnotationOption.isPresent()) { isAsync = isAsyncServiceClient(serviceClientAnnotationOption.get()); return true; } return false; }
Source:
<code>public <C> C getCacheManager(Config.Scope config) { try { InputStream configurationStream = loadConfiguration(config); ConfigurationBuilderHolder builder = new ParserRegistry().parse(configurationStream); <START> boolean isClustered = builder.getNamedConfigurationBuilders().get("sessions").clustering().cacheMode().isClustered(); if (isClustered) { configureTransportStack(config, builder); } return (C) new DefaultCacheManager(builder, isClustered); <END> } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>this do JPA Liquibase</technical_language>

Target:
public <C> C getCacheManager(Config.Scope config) { try { InputStream configurationStream = loadConfiguration(config); ConfigurationBuilderHolder builder = new ParserRegistry().parse(configurationStream); if (builder.getNamedConfigurationBuilders().get("sessions").clustering().cacheMode().isClustered()) { configureTransportStack(config, builder); } return (C) new DefaultCacheManager(builder, true); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>public static void main(String[] args) { example(false); try { example(true); } catch (Exception ignore) { } breakStatement(); catchNotExecuted(); emptyCatch(); <START> nested(); <END> emptyTry(); alwaysCompletesAbruptly(); }</code><technical_language>@Godin I get a warning in Eclipse, annotate method @SuppressWarnings("finally")</technical_language>

Target:
public static void main(String[] args) { example(false); try { example(true); } catch (Exception ignore) { } breakStatement(); catchNotExecuted(); emptyCatch(); twoRegions(); nested(); emptyTry(); alwaysCompletesAbruptly(); }
Source:
<code>public Row map(Row value) throws Exception { <START> assert value.getField(1).equals(currentTaskIndex); <END> return value; }</code><technical_language>need turn -ea switch (enable assertions), assert instructions run JVM</technical_language>

Target:
public Row map(Row value) throws Exception { int expectedPartitionIndex = (Integer) (value.getField(1)) % getRuntimeContext() .getNumberOfParallelSubtasks(); if (expectedPartitionIndex != currentTaskIndex) { throw new RuntimeException(String.format("the data: Row<%s> was sent to the wrong partition[%d], " + "expected partition is [%d].", value.toString(), currentTaskIndex, expectedPartitionIndex)); } return value; }
Source:
<code>public String getFileContents(String filePath, String branch, String repositoryId) { Repository repo; try { repo = service.getRepository(gitUsername, repositoryId); } catch (IOException ex) { <START> LOG.info(gitUsername + ": Repo: has no descriptor file "); <END> return null; } return readFileFromRepo(filePath, branch, repo); }</code><technical_language>descriptor files file</technical_language>

Target:
public String getFileContents(String filePath, String branch, String repositoryId) { Repository repo; try { repo = service.getRepository(gitUsername, repositoryId); } catch (IOException ex) { LOG.info(gitUsername + ": Repo " + repositoryId + " does not contain " + filePath + " on " + branch); return null; } return readFileFromRepo(filePath, branch, repo); }
Source:
<code><START> public boolean isNetmaskValid(String netmask) { <END> long addressInBits = IpAddressConverter.getInstance().covnertIpToLong(netmask); long mask = 1; boolean isFirstOneFound = false; for (int i = 0; i < 32; i++) { if (isFirstOneFound && (mask & addressInBits) != 1) { return false; } if ((mask & addressInBits) == 1) { isFirstOneFound = true; } addressInBits >>= 1; } return true; }</code><technical_language>issue naming above, compared isMaskValid()</technical_language>

Target:
private boolean isNetmaskValid(String netmask) { long addressInBits = IpAddressConverter.getInstance().convertIpToLong(netmask); long mask = 1; boolean isFirstOneFound = false; for (int i = 0; i < 32; i++) { if (isFirstOneFound && (mask & addressInBits) != 1) { return false; } if ((mask & addressInBits) == 1) { isFirstOneFound = true; } addressInBits >>= 1; } return true; }
Source:
<code>private BasicInvocationStage visitGetCommand(InvocationContext ctx, AbstractDataCommand command) throws Throwable { Object key = command.getKey(); CacheEntry entry = ctx.lookupEntry(key); if (entry == null) { if (ctx.isOriginLocal()) { if (readNeedsRemoteValue(ctx, command)) { return invokeNextAsync(ctx, command, remoteGet(ctx, command, false)); } } else { CacheTopology cacheTopology = checkTopologyId(command); if (!cacheTopology.getReadConsistentHash().isKeyLocalToNode(rpcManager.getAddress(), key)) { if (trace) log.tracef("In topology %d this (%s) is not an owner of %s, owners are %s", cacheTopology.getTopologyId(), rpcManager.getAddress(), key, cacheTopology.getReadConsistentHash().locateOwners(key)); <START> return returnWith(UnsuccessfulResponse.INSTANCE); <END> } } } return invokeNext(ctx, command); }</code><technical_language>possible, if topology id matches. OTOH retry based ownership topology id..</technical_language>

Target:
private BasicInvocationStage visitGetCommand(InvocationContext ctx, AbstractDataCommand command) throws Throwable { Object key = command.getKey(); CacheEntry entry = ctx.lookupEntry(key); if (entry == null) { if (ctx.isOriginLocal()) { if (readNeedsRemoteValue(ctx, command)) { return invokeNextAsync(ctx, command, remoteGet(ctx, command, command.getKey(), false)); } else { return returnWith(null); } } else { return handleMissingEntryOnRead(command); } } return invokeNext(ctx, command); }
Source:
<code>public void run() { try { log.info(format("[Task %d] >> Sleep start", actionId)); for ( int i = 0 ; i < 10 ; i++ ) <START> Lib.sleep(sleepMilli/10); <END> log.info(format("[Task %d] << Sleep finish", actionId)); } catch (Exception ex) { log.info(format("[Task %d] **** Exception", actionId), ex); } }</code><technical_language>Out of curiosity, / 10? Is yield control other get a chance run 1/10th of sleep time</technical_language>

Target:
public void run() { try { log.info(format("[Task %d] >> Sleep start", actionId)); Lib.sleep(sleepMilli); log.info(format("[Task %d] << Sleep finish", actionId)); } catch (Exception ex) { log.info(format("[Task %d] **** Exception", actionId), ex); } }
Source:
<code>private CisConversionResult convertToPdf(File file, String filename, ConversionOption conversionOption) { CisConversionResult result = null; MediaType mediaType = getMediaType(file, filename); if (isPasswordProtected(mediaType)) { result = CisConversionResult.createPasswordFailureResult(filename, conversionOption, mediaType); } else { Convertor convertor = convertorFactory.getConvertor(mediaType); if (convertor == null) { String message = "Omzetten naar PDF mislukt! Reden: bestandstype wordt niet ondersteund (mediaType: " + mediaType + ")"; result = createFailureResult(filename, conversionOption, mediaType, message); } else { long startTime = System.currentTimeMillis(); result = convertor.convertToPdf(mediaType, filename, file, conversionOption); <START> LOGGER.info(String.format("Convert (in %d msec): mediatype: %s, filename: %s, attachmentoptions: %s", <END> System.currentTimeMillis() - startTime, mediaType, filename, conversionOption)); } } return result; }</code><technical_language>This is a debug message</technical_language>

Target:
private CisConversionResult convertToPdf(File file, String filename, ConversionOption conversionOption) { CisConversionResult result = null; MediaType mediaType = getMediaType(file, filename); if (isPasswordProtected(mediaType)) { result = CisConversionResult.createPasswordFailureResult(filename, conversionOption, mediaType); } else { Convertor convertor = convertorFactory.getConvertor(mediaType); if (convertor == null) { String message = "Omzetten naar PDF mislukt! Reden: bestandstype wordt niet ondersteund (mediaType: " + mediaType + ")"; result = createFailureResult(filename, conversionOption, mediaType, message); } else { long startTime = System.currentTimeMillis(); result = convertor.convertToPdf(mediaType, filename, file, conversionOption); LOGGER.debug(String.format("Convert (in %d msec): mediatype: %s, filename: %s, attachmentoptions: %s", System.currentTimeMillis() - startTime, mediaType, filename, conversionOption)); } } return result; }
Source:
<code>public void run() throws InterruptedException { final int fieldCount = rel.getLeft().getRowType().getFieldCount() + rel.getRight().getRowType().getFieldCount(); context.values = new Object[fieldCount]; <START> Source baseSource = leftSource; <END> Source joinSource = rightSource; if (rel.getJoinType() == JoinRelType.RIGHT) { baseSource = rightSource; joinSource = leftSource; } Row baseRow = null; List<Row> joinRows = null; Set<Row> matchRowSet = new HashSet<>(); while ((baseRow = baseSource.receive()) != null) { if (joinRows == null) { joinRows = new ArrayList<Row>(); Row joinRow = null; while ((joinRow = joinSource.receive()) != null) { joinRows.add(joinRow); } } matchRowSet.addAll(doJoin(baseRow, joinRows, rel.getJoinType())); } if (rel.getJoinType() == JoinRelType.FULL) { List<Row> empty = new ArrayList<>(); for (Row row: joinRows) { if (matchRowSet.contains(row)) { continue; } doSend(row, empty, JoinRelType.RIGHT); } } }</code><technical_language>call outer/inner source</technical_language>

Target:
public void run() throws InterruptedException { final int fieldCount = rel.getLeft().getRowType().getFieldCount() + rel.getRight().getRowType().getFieldCount(); context.values = new Object[fieldCount]; Source outerSource = leftSource; Source innerSource = rightSource; if (rel.getJoinType() == JoinRelType.RIGHT) { outerSource = rightSource; innerSource = leftSource; } Row outerRow = null; List<Row> innerRows = null; Set<Row> matchRowSet = new HashSet<>(); while ((outerRow = outerSource.receive()) != null) { if (innerRows == null) { innerRows = new ArrayList<Row>(); Row innerRow = null; while ((innerRow = innerSource.receive()) != null) { innerRows.add(innerRow); } } matchRowSet.addAll(doJoin(outerRow, innerRows, rel.getJoinType())); } if (rel.getJoinType() == JoinRelType.FULL) { List<Row> empty = new ArrayList<>(); for (Row row: innerRows) { if (matchRowSet.contains(row)) { continue; } doSend(row, empty, JoinRelType.RIGHT); } } }
Source:
<code>public void sendMessage(byte[] message) { waitForConnect(); send(new Message().send() .withHeader(HEADER_DESTINATION, REQUEST_QUEUE) <START> .withContent(new String(message, Charset.forName("UTF-8"))) <END> .build()); }</code><technical_language>put Charset.forName(...) reuse it</technical_language>

Target:
public void sendMessage(byte[] message) { waitForConnect(); send(new Message().send() .withHeader(HEADER_DESTINATION, REQUEST_QUEUE) .withContent(new String(message,UTF8)) .build()); }
Source:
<code>private boolean containsTokens(String searchString, SyntaxObjectType... tokens) { <START> String upperSearchString = searchString.toUpperCase(); <END> ISyntaxChecker syntaxChecker = getAutoCompleteModel().getSyntaxChecker(); SyntaxContainer syntaxCont = syntaxChecker.analyzeSyntaxState(upperSearchString, true); Set<SyntaxObjectType> searchStringSet = new HashSet<SyntaxObjectType>(); Iterator<SyntaxObject> iterator = syntaxCont.iterator(); while(iterator.hasNext()) { searchStringSet.add(iterator.next().getType()); } Set<SyntaxObjectType> tokenSet = new HashSet<SyntaxObjectType>(); tokenSet.addAll(Arrays.asList(tokens)); searchStringSet.retainAll(tokenSet); return !searchStringSet.isEmpty(); }</code><technical_language>Is this necessary? expect syntax checker handle character case own</technical_language>

Target:
private boolean containsTokens(String searchString, SyntaxObjectType... tokens) { if (tokens == null) { return false; } ISyntaxChecker syntaxChecker = getAutoCompleteModel().getSyntaxChecker(); SyntaxContainer syntaxCont = syntaxChecker.analyzeSyntaxState(searchString, true); Set<SyntaxObjectType> searchTokenSet = new HashSet<SyntaxObjectType>(); Iterator<SyntaxObject> iterator = syntaxCont.iterator(); while(iterator.hasNext()) { searchTokenSet.add(iterator.next().getType()); } Set<SyntaxObjectType> tokenSet = new HashSet<SyntaxObjectType>(); tokenSet.addAll(Arrays.asList(tokens)); searchTokenSet.retainAll(tokenSet); return !searchTokenSet.isEmpty(); }
Source:
<code>public ServerContext(Map<String, Object> serverConfig) { this.serverConfig = serverConfig; this.dataStore = new DataStore(serverConfig, this::dataStoreFileCleanup); generateNodeId(); this.failureHandlerPolicy = new ConservativeFailureHandlerPolicy(); final boolean providedEventLoops = getChannelImplementation().equals(ChannelImplementation.LOCAL); if (providedEventLoops) { clientGroup = getServerConfig(EventLoopGroup.class, "client"); workerGroup = getServerConfig(EventLoopGroup.class, "worker"); bossGroup = getServerConfig(EventLoopGroup.class, "boss"); } else { clientGroup = getNewClientGroup(); workerGroup = getNewWorkerGroup(); bossGroup = getNewBossGroup(); } nodeLocator = NodeLocator .parseString(serverConfig.get("--address") + ":" + serverConfig.get("<port>")); localEndpoint = nodeLocator.toEndpointUrl(); if (!isMetricsReportingSetUp(metrics)) { MetricsUtils.metricsReportingSetup(metrics); logMetricsSize(); } FileChannelPerf.setupParameters(OP_SPIKE_CNT, OP_SPIKE_LATENCY, false); <START> logMetricsSize (); <END> }</code><technical_language>Please reformat code</technical_language>

Target:
public ServerContext(Map<String, Object> serverConfig) { this.serverConfig = serverConfig; this.dataStore = new DataStore(serverConfig, this::dataStoreFileCleanup); generateNodeId(); this.failureHandlerPolicy = new ConservativeFailureHandlerPolicy(); final boolean providedEventLoops = getChannelImplementation().equals(ChannelImplementation.LOCAL); if (providedEventLoops) { clientGroup = getServerConfig(EventLoopGroup.class, "client"); workerGroup = getServerConfig(EventLoopGroup.class, "worker"); bossGroup = getServerConfig(EventLoopGroup.class, "boss"); } else { clientGroup = getNewClientGroup(); workerGroup = getNewWorkerGroup(); bossGroup = getNewBossGroup(); } nodeLocator = NodeLocator .parseString(serverConfig.get("--address") + ":" + serverConfig.get("<port>")); localEndpoint = nodeLocator.toEndpointUrl(); if (!isMetricsReportingSetUp(metrics)) { MetricsUtils.metricsReportingSetup(metrics); } FileChannelPerf.setupParameters(OP_SPIKE_CNT, OP_SPIKE_LATENCY, false); logMetricsSize(); }
Source:
<code>private void doPoll() { try { messageProcessingManager .processMessage(new SchedulerFlowProcessingTemplate(listener, notificationFunctions, this), <START> new SchedulerProcessContext()); <END> } catch (Exception e) { muleContext.getExceptionListener().handleException(e); } }</code><technical_language>reuse instance instead of creating a new time</technical_language>

Target:
private void doPoll() { try { setCurrentEvent(InternalEvent.builder(EventContextFactory.create(flowConstruct, getLocation())).message(Message.of(null)) .build()); messageProcessingManager.processMessage(flowProcessingTemplate, flowProcessContext); } catch (Exception e) { muleContext.getExceptionListener().handleException(e); } }
Source:
<code>private void updateCustView(OoyalaNotification notification) { <START> VideoData data = (VideoData) notification.getData(); <END> if (data != null) { castViewManager.configureCastView(data.getTitle(), data.getDescription(), data.getUrl()); } else { castViewManager.configureCastView( player.getCurrentItem().getTitle(), player.getCurrentItem().getDescription(), player.getCurrentItem().getPromoImageURL(0, 0) ); } }</code><technical_language>check data is VideoData</technical_language>

Target:
private void updateCustView(OoyalaNotification notification) { if (notification != null && notification.getData() != null && notification.getData() instanceof VideoData) { VideoData data = (VideoData) notification.getData(); castViewManager.configureCastView(data.getTitle(), data.getDescription(), data.getUrl()); } else if (player != null && player.getCurrentItem() != null) { castViewManager.configureCastView( player.getCurrentItem().getTitle(), player.getCurrentItem().getDescription(), player.getCurrentItem().getPromoImageURL(0, 0) ); } }
Source:
<code>public static void copyDeps(OkBuckExtension extension) { FileUtil.copyResourceToProject("d8/" + RT_STUB_JAR, new File(D8_CACHE, RT_STUB_JAR)); List<Rule> d8 = Collections.singletonList( new Prebuilt() .prebuiltType(RuleType.PREBUILT_JAR.getProperties().get(0)) .prebuilt(RT_STUB_JAR) .ruleType(RuleType.PREBUILT_JAR.getBuckName()) .name(RT_STUB_JAR)); Multimap<String, String> loadStatements = LoadStatementsUtil.getLoadStatements(d8, extension.getRuleOverridesExtension()); <START> FileUtil.writeToBuckFile(loadStatements, d8, new File(D8_CACHE, "BUCK")); <END> }</code><technical_language>OkBuckGradlePlugin.BUCK constant</technical_language>

Target:
public static void copyDeps(OkBuckExtension extension) { FileUtil.copyResourceToProject("d8/" + RT_STUB_JAR, new File(D8_CACHE, RT_STUB_JAR)); List<Rule> d8 = Collections.singletonList( new Prebuilt() .prebuiltType(RuleType.PREBUILT_JAR.getProperties().get(0)) .prebuilt(RT_STUB_JAR) .ruleType(RuleType.PREBUILT_JAR.getBuckName()) .name(RT_STUB_JAR)); Multimap<String, String> loadStatements = LoadStatementsUtil.getLoadStatements(d8, extension.getRuleOverridesExtension()); FileUtil.writeToBuckFile(loadStatements, d8, new File(D8_CACHE, OkBuckGradlePlugin.BUCK)); }
Source:
<code><START> public synchronized void resetData() { <END> this.selectedSed = (ExtSed) ws.getSedManager().getSelected(); setTitle(); setDataTables(); setSelectedStarTable(0); }</code><technical_language>[minor note] -- MetadataBrowserView.java reset() method, a note this method synchronized: // Multiple threads resetting this simultaneously do weird // JList JTable objects. note remain in case road wonders synchronized</technical_language>

Target:
public void resetData() { this.selectedSed = (ExtSed) ws.getSedManager().getSelected(); setTitle(); setDataTables(); setSelectedStarTable(0); }
Source:
<code><START> public E createEntity(A entityToAdd) throws InvalidParametersException, EntityAlreadyExistsException { <END> Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, entityToAdd); entityToAdd.sanitizeForSaving(); if (!entityToAdd.isValid()) { throw new InvalidParametersException(entityToAdd.getInvalidityInfo()); } if (hasEntity(entityToAdd)) { String error = String.format(ERROR_CREATE_ENTITY_ALREADY_EXISTS, entityToAdd.getEntityTypeAsString()) + entityToAdd.getIdentificationString(); log.info(error); throw new EntityAlreadyExistsException(error); } E entity = entityToAdd.toEntity(); saveEntity(entity, entityToAdd); return entity; }</code><technical_language>this createEntityWithoutExistenceCheck? some duplication of code here</technical_language>

Target:
public E createEntity(A entityToAdd) throws InvalidParametersException, EntityAlreadyExistsException { return createEntity(entityToAdd, true); }