auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void delete(ClaudiaData claudiaData, TierInstance tierInstance, EnvironmentInstance envInstance) throws InfrastructureException, InvalidEntityException, EntityNotFoundException { <START> log.error("before infrastructureManager.deleteVMReplica"); <END> infrastructureManager.deleteVMReplica(claudiaData, tierInstance); log.error("before envInstance.removeTierInstance(tierInstance)"); envInstance.removeTierInstance(tierInstance); log.error("beforeenvironmentInstanceManager.update()"); environmentInstanceManager.update(envInstance); log.error("before removeSecurityGroup(claudiaData, tierInstance)"); removeSecurityGroup(claudiaData, tierInstance); log.error("before remove(tierInstance)"); remove(tierInstance); log.error("f"); }</code><technical_language>need put log.error messages</technical_language>

Target:
public void delete(ClaudiaData claudiaData, TierInstance tierInstance, EnvironmentInstance envInstance) throws InfrastructureException, InvalidEntityException, EntityNotFoundException { infrastructureManager.deleteVMReplica(claudiaData, tierInstance); envInstance.removeTierInstance(tierInstance); environmentInstanceManager.update(envInstance); removeSecurityGroup(claudiaData, tierInstance); remove(tierInstance); }
Source:
<code>private int weigh(DataType cqlType, int level) { switch (cqlType.getName()) { default: <START> return 0; <END> case LIST: case SET: case MAP: { int weight = level; for (DataType eltType : cqlType.getTypeArguments()) { weight += weigh(eltType, level + 1); } return weight; } case UDT: { int weight = level; for (UserType.Field field : ((UserType)cqlType)) { weight += weigh(field.getType(), level + 1); } return weight == 0 ? 1 : weight; } case TUPLE: { int weight = level; for (DataType componentType : ((TupleType)cqlType).getComponentTypes()) { weight += weigh(componentType, level + 1); } return weight == 0 ? 1 : weight; } case CUSTOM: return 1; } }</code><technical_language>I this confusing. I works (TBH I wrote a test verify it), give pause reading code. For sake of conventions, default clause last</technical_language>

Target:
private int weigh(DataType cqlType, int level) { switch (cqlType.getName()) { case LIST: case SET: case MAP: { int weight = level; for (DataType eltType : cqlType.getTypeArguments()) { weight += weigh(eltType, level + 1); } return weight; } case UDT: { int weight = level; for (UserType.Field field : ((UserType)cqlType)) { weight += weigh(field.getType(), level + 1); } return weight == 0 ? 1 : weight; } case TUPLE: { int weight = level; for (DataType componentType : ((TupleType)cqlType).getComponentTypes()) { weight += weigh(componentType, level + 1); } return weight == 0 ? 1 : weight; } case CUSTOM: return 1; default: return 0; } }
Source:
<code>public FloatDictionary(DictionaryPage dictionaryPage) throws IOException { super(dictionaryPage.getEncoding()); content = new float[dictionaryPage.getDictionarySize()]; FloatPlainValuesReader floatReader = new FloatPlainValuesReader(); <START> final ByteBufferInputStream in = ByteBufferInputStream.wrap(ByteBuffer.wrap(dictionaryPage.getSlice().getBytes())); <END> floatReader.initFromPage(dictionaryPage.getDictionarySize(), in); for (int i = 0; i < content.length; i++) { content[i] = floatReader.readFloat(); } }</code><technical_language>ditto naming(in -> inputStream) final modifer</technical_language>

Target:
public FloatDictionary(DictionaryPage dictionaryPage) throws IOException { super(dictionaryPage.getEncoding()); content = new float[dictionaryPage.getDictionarySize()]; FloatPlainValuesReader floatReader = new FloatPlainValuesReader(); ByteBuffer byteBuffer = ByteBuffer.wrap(dictionaryPage.getSlice().getBytes()); ByteBufferInputStream inputStream = ByteBufferInputStream.wrap(ImmutableList.of(byteBuffer)); floatReader.initFromPage(dictionaryPage.getDictionarySize(), inputStream); for (int i = 0; i < content.length; i++) { content[i] = floatReader.readFloat(); } }
Source:
<code>public Object[][] getTestData() { String variant1="Can inject only one of <ITestContext, XmlTest> into a @%s annotated "; <START> String variant2="Can inject only one of <ITestContext, XmlTest, Method, Object[]> into a @%s annotated "; <END> String variant3="Can inject only one of <ITestContext, XmlTest, Method, Object[], ITestResult> into a @%s annotated "; return new Object[][] { {BadBeforeSuiteSample.class, "beforeSuite", String.format(variant1, BeforeSuite.class.getSimpleName())}, {BadBeforeTestSample.class, "beforeTest",String.format(variant1, BeforeTest.class.getSimpleName())}, {BadBeforeClassSample.class, "beforeClass",String.format(variant1, BeforeClass.class.getSimpleName())}, {BadBeforeMethodSample.class, "beforeMethod",String.format(variant3, BeforeMethod.class.getSimpleName())}, {BadAfterMethodSample.class, "afterMethod",String.format(variant3, AfterMethod.class.getSimpleName())}, {BadAfterClassSample.class, "afterClass",String.format(variant1, AfterClass.class.getSimpleName())}, {BadAfterTestSample.class, "afterTest",String.format(variant1, AfterTest.class.getSimpleName())}, {BadAfterSuiteSample.class, "afterSuite",String.format(variant1, AfterSuite.class.getSimpleName())}, {BadBeforeGroupsSample.class, "beforeGroups",String.format(variant1, BeforeGroups.class.getSimpleName())}, {BadAfterGroupsSample.class, "afterGroups",String.format(variant1, AfterGroups.class.getSimpleName())} }; }</code><technical_language>variant2 is more tested. find case remove variant</technical_language>

Target:
public Object[][] getTestData() { String variant1="Can inject only one of <ITestContext, XmlTest> into a @%s annotated "; String variant2="Can inject only one of <ITestContext, XmlTest, Method, Object[], ITestResult> into a @%s annotated "; return new Object[][] { {BadBeforeSuiteSample.class, "beforeSuite", String.format(variant1, BeforeSuite.class.getSimpleName())}, {BadBeforeTestSample.class, "beforeTest",String.format(variant1, BeforeTest.class.getSimpleName())}, {BadBeforeClassSample.class, "beforeClass",String.format(variant1, BeforeClass.class.getSimpleName())}, {BadBeforeMethodSample.class, "beforeMethod",String.format(variant2, BeforeMethod.class.getSimpleName())}, {BadAfterMethodSample.class, "afterMethod",String.format(variant2, AfterMethod.class.getSimpleName())}, {BadAfterClassSample.class, "afterClass",String.format(variant1, AfterClass.class.getSimpleName())}, {BadAfterTestSample.class, "afterTest",String.format(variant1, AfterTest.class.getSimpleName())}, {BadAfterSuiteSample.class, "afterSuite",String.format(variant1, AfterSuite.class.getSimpleName())}, {BadBeforeGroupsSample.class, "beforeGroups",String.format(variant1, BeforeGroups.class.getSimpleName())}, {BadAfterGroupsSample.class, "afterGroups",String.format(variant1, AfterGroups.class.getSimpleName())} }; }
Source:
<code>public void addModAsResource(ModContainer container) { Class<?> resourcePackType = container.getCustomResourcePackClass(); if (resourcePackType != null) { try { IResourcePack pack = (IResourcePack) resourcePackType.getConstructor(ModContainer.class).newInstance(container); PackMetadataSection meta = (PackMetadataSection)pack.getPackMetadata(this.metaSerializer, "pack"); if (meta != null && meta.getPackFormat() == 2) { pack = new LegacyV2Adapter(pack); } resourcePackList.add(pack); resourcePackMap.put(container.getModId(), pack); } catch (NoSuchMethodException e) { FMLLog.log.error("The container (type {}) returned an invalid class for it's resource pack.", container.getName(), container.getClass().getName()); } catch (Exception e) { FMLLog.log.error("An unexpected exception occurred constructing the custom resource pack for {}", container.getName(), e); Throwables.throwIfUnchecked(e); <START> throw new RuntimeException(e); <END> } } }</code><technical_language>I place log error rethrowing a caught exception written a way. putting message exception, shows in exception "caused by" chain instead of hidden in log crash. For example, this be: java throw new RuntimeException("An unexpected exception occurred constructing custom resource pack for " + container.getName(), e); update these? If not, I update this is merged</technical_language>

Target:
public void addModAsResource(ModContainer container) { Class<?> resourcePackType = container.getCustomResourcePackClass(); if (resourcePackType != null) { try { IResourcePack pack = (IResourcePack) resourcePackType.getConstructor(ModContainer.class).newInstance(container); PackMetadataSection meta = (PackMetadataSection)pack.getPackMetadata(this.metaSerializer, "pack"); if (meta != null && meta.getPackFormat() == 2) { pack = new LegacyV2Adapter(pack); } resourcePackList.add(pack); resourcePackMap.put(container.getModId(), pack); } catch (NoSuchMethodException e) { FMLLog.log.error("The container (type {}) returned an invalid class for it's resource pack.", container.getName(), container.getClass().getName()); } catch (Exception e) { throw new RuntimeException("An unexpected exception occurred constructing the custom resource pack for " + container.getName(), e); } } }
Source:
<code>public ApplicationStatus getApplicationStatus() { <START> ApplicationStatus applicationStatus = new ApplicationStatus(); <END> DiffViewerStatus status = new DiffViewerStatus(); applicationStatus.setDiffViewerStatus(status); applicationStatus.setConfiguration(getConfiguration()); applicationStatus.setSearchEngineStatus(SearchEngineStatus.create()); applicationStatus.setVersion(ApplicationVersionHolder.INSTANCE.getApplicationVersion()); return applicationStatus; }</code><technical_language>This class Constructor getter/setter used</technical_language>

Target:
public ApplicationStatus getApplicationStatus() { ApplicationStatus applicationStatus = new ApplicationStatus(); applicationStatus.setConfiguration(getConfiguration()); applicationStatus.setSearchEngineStatus(SearchEngineStatus.create()); applicationStatus.setVersion(ApplicationVersionHolder.INSTANCE.getApplicationVersion()); return applicationStatus; }
Source:
<code>MetricValueCatcher getCatcherOrNull() { <START> return gaugeSource instanceof DoubleMetricValueCatcher ? (DoubleMetricValueCatcher) gaugeSource : null; <END> }</code><technical_language>like, gaugeSource replaced concurrently, gaugeSource instanceof DoubleMetricValueCatcher succeed, next cast fail a ClassCastException gaugeSource is swapped ProbeInstanceGaugeSource object. applies LongGaugeImpl#getCatcherOrNull</technical_language>

Target:
MetricValueCatcher getCatcherOrNull() { DoubleGaugeSource gaugeSourceCopy = this.gaugeSource; return gaugeSourceCopy instanceof DoubleMetricValueCatcher ? (DoubleMetricValueCatcher) gaugeSourceCopy : null; }
Source:
<code>public void refresh() { start(); <START> super.refresh(true); <END> }</code><technical_language>force of refreshes</technical_language>

Target:
public void refresh() { start(); super.refresh(); }
Source:
<code>public boolean isInvalid() { try { getSynonymFor(); return false; <START> } catch (DbException e) { <END> return true; } }</code><technical_language>urrgh, nice. catching exceptions in control flow. especially catching general exceptions</technical_language>

Target:
public boolean isInvalid() { return data.synonymForSchema.findTableOrView(data.session, data.synonymFor) == null; }
Source:
<code>public List<ID3v2ChapterFrameData> getChapters() { if (obseleteFormat) { <START> return Collections.emptyList(); <END> } return extractChapterFrameData(ID_CHAPTER); }</code><technical_language>Changing returning null returning empty collection changes SDK's interface, affect applications it. prefer a breaking change absolutely neccessary</technical_language>

Target:
public ArrayList<ID3v2ChapterFrameData> getChapters() { if (obseleteFormat) { return null; } return new ArrayList<>(extractChapterFrameData(ID_CHAPTER)); }
Source:
<code>public boolean send(final StompConnection connection, final StompFrame frame) { if (ActiveMQServerLogger.LOGGER.isTraceEnabled()) { ActiveMQServerLogger.LOGGER.trace("sent " + frame); } invokeInterceptors(this.outgoingInterceptors, frame, connection); synchronized (connection) { if (connection.isDestroyed()) { <START> new Exception("trace").printStackTrace(); <END> ActiveMQStompProtocolLogger.LOGGER.connectionClosed(connection); return false; } try { connection.physicalSend(frame); } catch (Exception e) { ActiveMQStompProtocolLogger.LOGGER.errorSendingFrame(e, frame); return false; } return true; } }</code><technical_language>I this left mistake</technical_language>

Target:
public boolean send(final StompConnection connection, final StompFrame frame) { if (ActiveMQServerLogger.LOGGER.isTraceEnabled()) { ActiveMQServerLogger.LOGGER.trace("sent " + frame); } invokeInterceptors(this.outgoingInterceptors, frame, connection); synchronized (connection) { if (connection.isDestroyed()) { ActiveMQStompProtocolLogger.LOGGER.connectionClosed(connection); return false; } try { connection.physicalSend(frame); } catch (Exception e) { ActiveMQStompProtocolLogger.LOGGER.errorSendingFrame(e, frame); return false; } return true; } }
Source:
<code>public RefreshItem(String keyInCache, AuthenticationRequest request, TokenCacheItem item) { if (item == null) { <START> throw new IllegalArgumentException("item"); <END> } mKey = keyInCache; mMultiResource = item.getIsMultiResourceRefreshToken(); mRefreshToken = item.getRefreshToken(); mUserInfo = item.getUserInfo(); mRawIdToken = item.getRawIdToken(); mTenantId = item.getTenantId(); if (item.getUserInfo() != null) { mKeyWithUserId = CacheKey.createCacheKey(request, item.getUserInfo() .getUserId()); mKeyWithDisplayableId = CacheKey.createCacheKey(request, item.getUserInfo() .getDisplayableId()); } }</code><technical_language>I throw IllegalArgumentException in code, throw validating input calling app</technical_language>

Target:
public RefreshItem(String keyInCache, AuthenticationRequest request, TokenCacheItem item) { if (item == null) { throw new IllegalArgumentException("item"); } mKey = keyInCache; mMultiResource = item.getIsMultiResourceRefreshToken(); mRefreshToken = item.getRefreshToken(); mUserInfo = item.getUserInfo(); mRawIdToken = item.getRawIdToken(); mTenantId = item.getTenantId(); final UserInfo userInfo = item.getUserInfo(); if (userInfo != null) { mKeyWithUserId = CacheKey.createCacheKey(request, userInfo.getUserId()); mKeyWithDisplayableId = CacheKey.createCacheKey(request, userInfo.getDisplayableId()); } }
Source:
<code>public String format(final String input) { Objects.requireNonNull(input); <START> if (regex == null || replacement == null) { <END> return input; } Matcher matcherOpeningCurlyBrace = PATTERN_ESCAPED_OPENING_CURLY_BRACE.matcher(input); final String openingCurlyBraceReplaced = matcherOpeningCurlyBrace.replaceAll(PLACEHOLDER_FOR_OPENING_CURLY_BRACE); Matcher matcherClosingCurlyBrace = PATTERN_ESCAPED_CLOSING_CURLY_BRACE.matcher(openingCurlyBraceReplaced); final String closingCurlyBraceReplaced = matcherClosingCurlyBrace.replaceAll(PLACEHOLDER_FOR_CLOSING_CURLY_BRACE); final String regexApplied = replaceHonoringProtectedGroups(closingCurlyBraceReplaced); return regexApplied .replaceAll(PLACEHOLDER_FOR_OPENING_CURLY_BRACE, "\\\\{") .replaceAll(PLACEHOLDER_FOR_CLOSING_CURLY_BRACE, "\\\\}"); }</code><technical_language>switch Optional<String> datatype for regex replacement? JabRef wants get rid null</technical_language>

Target:
public String format(final String input) { Objects.requireNonNull(input); if (regex == null || replacement == null) { return input; } Matcher escapedOpeningCurlyBrace = ESCAPED_OPENING_CURLY_BRACE.matcher(input); String inputWithPlaceholder = escapedOpeningCurlyBrace.replaceAll(PLACEHOLDER_FOR_OPENING_CURLY_BRACE); Matcher escapedClosingCurlyBrace = ESCAPED_CLOSING_CURLY_BRACE.matcher(inputWithPlaceholder); inputWithPlaceholder = escapedClosingCurlyBrace.replaceAll(PLACEHOLDER_FOR_CLOSING_CURLY_BRACE); final String regexMatchesReplaced = replaceHonoringProtectedGroups(inputWithPlaceholder); return regexMatchesReplaced .replaceAll(PLACEHOLDER_FOR_OPENING_CURLY_BRACE, "\\\\{") .replaceAll(PLACEHOLDER_FOR_CLOSING_CURLY_BRACE, "\\\\}"); }
Source:
<code>private boolean runQuery(HttpServletRequest request, HttpServletResponse response, String sessionID) { BackendInternal backend = null; VdcQueryParametersBase params = null; VdcQueryReturnValue queryReturnValue = null; boolean returnValue = false; backend = (BackendInternal) EjbUtils.findBean(BeanType.BACKEND, BeanProxyType.LOCAL); log.debug("Calling ValidateSession query"); params = new VdcQueryParametersBase(); params.setHttpSessionId(sessionID); queryReturnValue = backend.runInternalQuery(VdcQueryType.ValidateSession, params); if (queryReturnValue != null) { returnValue = queryReturnValue.getSucceeded(); if (returnValue) { VdcUser vdcUser = (VdcUser) queryReturnValue.getReturnValue(); if (isAdminUser(vdcUser)) { log.debug("Getting user name"); printUPNToResponse(response, getUPN(vdcUser)); } else { <START> log.error("User is not an administrator"); <END> returnValue = false; } } } else { log.error("Got NULL from backend.RunQuery"); } return returnValue; }</code><technical_language>I security wise write this DEBUG error</technical_language>

Target:
private boolean runQuery(HttpServletRequest request, HttpServletResponse response, String sessionID) { BackendInternal backend = null; VdcQueryParametersBase params = null; VdcQueryReturnValue queryReturnValue = null; boolean returnValue = false; backend = (BackendInternal) EjbUtils.findBean(BeanType.BACKEND, BeanProxyType.LOCAL); log.debug("Calling ValidateSession query"); params = new VdcQueryParametersBase(); params.setHttpSessionId(sessionID); queryReturnValue = backend.runInternalQuery(VdcQueryType.ValidateSession, params); if (queryReturnValue != null) { returnValue = queryReturnValue.getSucceeded(); if (returnValue) { VdcUser vdcUser = (VdcUser) queryReturnValue.getReturnValue(); if (isAdminUser(vdcUser)) { log.debug("Getting user name"); printUPNToResponse(response, getUPN(vdcUser)); } else { log.error("User is not authorized to perform operation"); returnValue = false; } } } else { log.error("Got NULL from backend.RunQuery"); } return returnValue; }
Source:
<code><START> public synchronized void clear() { <END> fZoom.setFullRange(0L, 0L); fZoom.setNewRange(0L, 0L); fZoom.stop(); super.clear(); }</code><technical_language>null check is necessary clear is called super class in constructor</technical_language>

Target:
public synchronized void clear() { if (fZoom != null) { fZoom.setFullRange(0L, 0L); fZoom.setNewRange(0L, 0L); fZoom.stop(); } super.clear(); }
Source:
<code>private void process(OpenGuiMessage msg) { EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity(); <START> WorldClient world = FMLClientHandler.instance().getWorldClient(); <END> Object owner = msg.provider.getOwner(player, world); if(owner == null) return; Object gui = msg.provider.getClientGuiElement(player, world, owner); FMLClientHandler.instance().showGuiScreen(gui); }</code><technical_language>server WorldClient</technical_language>

Target:
private void process(OpenGuiMessage msg) { EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity(); Object owner = msg.provider.getInstance().getOwner(player.worldObj, player); if(owner == null) return; Object gui = msg.provider.getInstance().clientElement(player.worldObj, player); FMLClientHandler.instance().showGuiScreen(gui); player.openContainer.windowId = msg.identifier; }
Source:
<code>public <T extends JestResult> T retry(JestClient client, Action<T> clientRequest) { LOG.debug("Retry request"); if (cooldownInMs > 0) { LOG.debug("Sleep " + cooldownInMs + " before retrying"); try { Thread.sleep(cooldownInMs); <START> } catch (InterruptedException e) { <END> } } LOG.debug("Retrying now"); final T result = execute(client, clientRequest); return result; }</code><technical_language>If get interrupted while retrying i.e. application stop, abort instead of swallowing exception continuing retry</technical_language>

Target:
public <T extends JestResult> T retry(JestClient client, Action<T> clientRequest) { LOG.debug("Retry request"); if (cooldownInMs > 0) { LOG.debug("Sleep " + cooldownInMs + " before retrying"); try { Thread.sleep(cooldownInMs); } catch (InterruptedException e) { throw new RuntimeException("Thread interrupted.", e); } } LOG.debug("Retrying now"); final T result = execute(client, clientRequest); return result; }
Source:
<code>private void dropReplicationSlot() throws SQLException { try { Statement dropStatement = sqlConnection.createStatement(); dropStatement.execute("select pg_drop_replication_slot('" + SLOT_NAME + "')"); dropStatement.close(); } catch (PSQLException e) { <START> if ("55006".equals(e.getSQLState())) { <END> Statement terminateStatement = sqlConnection.createStatement(); terminateStatement.execute("select pg_terminate_backend(active_pid) from pg_replication_slots " + "where active = true and slot_name='" + SLOT_NAME + "'" ); terminateStatement.close(); dropReplicationSlot(); } else { throw e; } } }</code><technical_language>Please add entry PSQLState</technical_language>

Target:
private void dropReplicationSlot() throws SQLException { try { Statement dropStatement = sqlConnection.createStatement(); dropStatement.execute("select pg_drop_replication_slot('" + SLOT_NAME + "')"); dropStatement.close(); } catch (PSQLException e) { if (PSQLState.OBJECT_IN_USE.equals(new PSQLState(e.getSQLState()))) { Statement terminateStatement = sqlConnection.createStatement(); terminateStatement.execute("select pg_terminate_backend(active_pid) from pg_replication_slots " + "where active = true and slot_name='" + SLOT_NAME + "'" ); terminateStatement.close(); dropReplicationSlot(); } else { throw e; } } }
Source:
<code><START> public Object compute(final Map<String, Object> combinedAggregators) <END> { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return new double[] {sketch.getEstimate(), sketch.getLowerBound(numStdDevs), sketch.getUpperBound(numStdDevs)}; }</code><technical_language>Please change return type double[] for type safety</technical_language>

Target:
public double[] compute(final Map<String, Object> combinedAggregators) { final ArrayOfDoublesSketch sketch = (ArrayOfDoublesSketch) getField().compute(combinedAggregators); return new double[] {sketch.getEstimate(), sketch.getLowerBound(numStdDevs), sketch.getUpperBound(numStdDevs)}; }
Source:
<code>private ServiceResponse<?> validateReleaseAndMode(String preffix, ReleaseId releaseId) { if(releaseId == null) { return new ServiceResponse(ResponseType.FAILURE, preffix + "Release Id is null"); } boolean isSnapshot = KieServerUtils.isSnapshot(releaseId); if(isSnapshot) { if(mode.equals(KieServerMode.REGULAR)) { <START> return new ServiceResponse(ResponseType.FAILURE, preffix + "KieServers running on REGULAR mode doesn't support deploying SNAPSHOT modules."); <END> } } else { if(mode.equals(KieServerMode.DEVELOPMENT)) { return new ServiceResponse(ResponseType.FAILURE, preffix + "KieServers running on DEVELOPMENT mode only support deploying SNAPSHOT modules."); } } return null; }</code><technical_language>KieServers(plural) ... support (instead of doesn't)</technical_language>

Target:
private <T> ServiceResponse<T> validateReleaseAndMode(String preffix, ReleaseId releaseId) { if (releaseId == null) { return new ServiceResponse<>(ResponseType.FAILURE, preffix + " Release Id is null"); } boolean isSnapshot = KieServerUtils.isSnapshot(releaseId); if (isSnapshot) { if (mode.equals(KieServerMode.REGULAR)) { return new ServiceResponse<>(ResponseType.FAILURE, preffix + " KieServer running on REGULAR mode doesn't support deploying SNAPSHOT modules."); } } else { if (mode.equals(KieServerMode.DEVELOPMENT)) { return new ServiceResponse<>(ResponseType.FAILURE, preffix + " KieServer running on DEVELOPMENT mode only support deploying SNAPSHOT modules."); } } return null; }
Source:
<code><START> public void restrictPaginationByArrayed(Criteria criteria, boolean isArrayed, Consumer<String> errorHandler) { <END> DetachedCriteria subquery = DetachedCriteria.forClass(Array.class) .createAlias("samples", "sample") .setProjection(Projections.property("sample.id")); criteria.add(Property.forName("id").in(subquery)); }</code><technical_language>parameter isArrayed</technical_language>

Target:
public void restrictPaginationByArrayed(Criteria criteria, boolean isArrayed, Consumer<String> errorHandler) { DetachedCriteria subquery = DetachedCriteria.forClass(Array.class) .createAlias("samples", "sample") .setProjection(Projections.property("sample.id")); if (isArrayed) { criteria.add(Property.forName("id").in(subquery)); } else { criteria.add(Property.forName("id").notIn(subquery)); } }
Source:
<code>public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); String timeZoneStr = _configDao.getValue(Config.UsageAggregationTimezone.toString()); String aggregationRange = _configDao.getValue(Config.UsageStatsJobAggregationRange.toString()); if (timeZoneStr == null) { timeZoneStr = "GMT"; } _usageTimezone = TimeZone.getTimeZone(timeZoneStr); _aggregationDuration = Integer.parseInt(aggregationRange); if (_aggregationDuration < UsageUtils.USAGE_AGGREGATION_RANGE_MIN) { s_logger.warn("Usage stats job aggregation range is to small, using the minimum value of " + UsageUtils.USAGE_AGGREGATION_RANGE_MIN); _aggregationDuration = UsageUtils.USAGE_AGGREGATION_RANGE_MIN; } <START> s_logger.info("Usage timezone = " + _usageTimezone + " AggregationDuration=" + _aggregationDuration); <END> return true; }</code><technical_language>INFO level log message contextual information for a system administrator. This messages lacks context. logged DEBUG context information added it</technical_language>

Target:
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException { super.configure(name, params); String timeZoneStr = _configDao.getValue(Config.UsageAggregationTimezone.toString()); String aggregationRange = _configDao.getValue(Config.UsageStatsJobAggregationRange.toString()); if (timeZoneStr == null) { timeZoneStr = "GMT"; } _usageTimezone = TimeZone.getTimeZone(timeZoneStr); _aggregationDuration = Integer.parseInt(aggregationRange); if (_aggregationDuration < UsageUtils.USAGE_AGGREGATION_RANGE_MIN) { s_logger.warn("Usage stats job aggregation range is to small, using the minimum value of " + UsageUtils.USAGE_AGGREGATION_RANGE_MIN); _aggregationDuration = UsageUtils.USAGE_AGGREGATION_RANGE_MIN; } if (s_logger.isDebugEnabled()){ s_logger.debug("Usage timezone = " + _usageTimezone + " AggregationDuration=" + _aggregationDuration); } return true; }
Source:
<code><START> public Boolean serializeZxidDigest(OutputArchive oa) throws IOException { <END> if (!DigestCalculator.digestEnabled()) { return false; } ZxidDigest zxidDigest = lastProcessedZxidDigest; if (zxidDigest == null) { zxidDigest = new ZxidDigest(); } zxidDigest.serialize(oa); return true; }</code><technical_language>Nit: boolean Boolean</technical_language>

Target:
public boolean serializeZxidDigest(OutputArchive oa) throws IOException { if (!DigestCalculator.digestEnabled()) { return false; } ZxidDigest zxidDigest = lastProcessedZxidDigest; if (zxidDigest == null) { zxidDigest = new ZxidDigest(); } zxidDigest.serialize(oa); return true; }
Source:
<code>private String getDataServiceClassName(int transportType) { String className; int resourceId; String carrierConfig; switch (transportType) { case AccessNetworkConstants.TRANSPORT_TYPE_WWAN: resourceId = com.android.internal.R.string.config_wwan_data_service_class; carrierConfig = CarrierConfigManager .KEY_CARRIER_DATA_SERVICE_WWAN_CLASS_OVERRIDE_STRING; break; case AccessNetworkConstants.TRANSPORT_TYPE_WLAN: resourceId = com.android.internal.R.string.config_wlan_data_service_class; carrierConfig = CarrierConfigManager .KEY_CARRIER_DATA_SERVICE_WLAN_CLASS_OVERRIDE_STRING; break; default: throw new IllegalStateException("Transport type not WWAN or WLAN. type=" + transportType); } className = mPhone.getContext().getResources().getString(resourceId); PersistableBundle b = mCarrierConfigManager.getConfigForSubId(mPhone.getSubId()); if (b != null && !TextUtils.isEmpty(b.getString(carrierConfig))) { className = b.getString(carrierConfig, className); } <START> List<ResolveInfo> resolveInfo = mPhone.getContext().getPackageManager().queryIntentServices( new Intent(DataService.SERVICE_INTERFACE), PackageManager.MATCH_SYSTEM_ONLY); if (resolveInfo != null) { for (ResolveInfo info : resolveInfo) { if (info.serviceInfo == null) continue; if ((info.serviceInfo.name).contains(className)) { className = info.serviceInfo.name; break; } } } <END> return className; }</code><technical_language>remove this part</technical_language>

Target:
private String getDataServiceClassName(int transportType) { String className; int resourceId; String carrierConfig; switch (transportType) { case AccessNetworkConstants.TRANSPORT_TYPE_WWAN: resourceId = com.android.internal.R.string.config_wwan_data_service_class; carrierConfig = CarrierConfigManager .KEY_CARRIER_DATA_SERVICE_WWAN_CLASS_OVERRIDE_STRING; break; case AccessNetworkConstants.TRANSPORT_TYPE_WLAN: resourceId = com.android.internal.R.string.config_wlan_data_service_class; carrierConfig = CarrierConfigManager .KEY_CARRIER_DATA_SERVICE_WLAN_CLASS_OVERRIDE_STRING; break; default: throw new IllegalStateException("Transport type not WWAN or WLAN. type=" + transportType); } className = mPhone.getContext().getResources().getString(resourceId); PersistableBundle b = mCarrierConfigManager.getConfigForSubId(mPhone.getSubId()); if (b != null && !TextUtils.isEmpty(b.getString(carrierConfig))) { className = b.getString(carrierConfig, className); } return className; }
Source:
<code>EclipseResourceImpl(org.eclipse.core.resources.IResource delegate) { if (delegate == null) throw new NullPointerException("delegate is null"); this.delegate = delegate; if (delegate.getProject() != null) referencePoint = <START> new EclipseReferencePointImpl(new EclipsePathImpl(delegate.getProject().getLocation())); <END> }</code><technical_language>getLocation return null I do point working absolute file paths in Eclipse environment</technical_language>

Target:
EclipseResourceImpl(org.eclipse.core.resources.IResource delegate) { if (delegate == null) throw new NullPointerException("delegate is null"); this.delegate = delegate; if (delegate.getProject() != null) this.referencePoint = new ReferencePointImpl(new EclipsePathImpl(delegate.getProject().getFullPath())); }
Source:
<code>void resolvePluginDependencies() throws IOException { List<String> missingDependencies = new ArrayList<String>(); for (Dependency d : dependencies) { <START> if (parent.getPlugin(d.shortName) == null || !(parent.getPlugin(d.shortName).active)) <END> missingDependencies.add(d.toString()); } if (!missingDependencies.isEmpty()) throw new IOException("Dependency "+Util.join(missingDependencies, ", ")+" doesn't exist"); for (Dependency d : optionalDependencies) { if (parent.getPlugin(d.shortName) != null || !(parent.getPlugin(d.shortName).active)) dependencies.add(d); } }</code><technical_language>copy a diff #2001 a commit hash something</technical_language>

Target:
void resolvePluginDependencies() throws IOException { List<String> missingDependencies = new ArrayList<String>(); for (Dependency d : dependencies) { if (parent.getPlugin(d.shortName) == null || !(parent.getPlugin(d.shortName).active)) missingDependencies.add(d.toString()); } if (!missingDependencies.isEmpty()) throw new IOException("Dependency "+Util.join(missingDependencies, ", ")+" doesn't exist"); for (Dependency d : optionalDependencies) { if (parent.getPlugin(d.shortName) != null && parent.getPlugin(d.shortName).active) dependencies.add(d); } }
Source:
<code>public static void skipContent(@Nonnull JayceInternalReaderImpl in) throws IOException { NodeLevel nodeLevel = in.getNodeLevel(); in.skipInt(); in.skipId(); if (nodeLevel != NodeLevel.TYPES) { <START> in.skipId(); in.skipIds(); in.skipId(); in.skipId(); in.skipId(); in.skipIds(); <END> in.skipNodes(NField.class); in.skipNodes(NMethod.class); in.skipNodes(NAnnotation.class); in.skipNodes(NMarker.class); } }</code><technical_language>be: in.skipIds(); in.skipId(); in.skipIds();</technical_language>

Target:
public static void skipContent(@Nonnull JayceInternalReaderImpl in) throws IOException { NodeLevel nodeLevel = in.getNodeLevel(); in.skipInt(); in.skipId(); if (nodeLevel != NodeLevel.TYPES) { in.skipIds(); in.skipId(); in.skipIds(); in.skipNodes(NField.class); in.skipNodes(NMethod.class); in.skipNodes(NAnnotation.class); in.skipNodes(NMarker.class); } }
Source:
<code>private String compactPrefix() { <START> if (sharedPrefix.length() > contextLength) { <END> return ELLIPSIS + sharedPrefix.substring(sharedPrefix.length() - contextLength); } return sharedPrefix; }</code><technical_language>This is a nit, I _personally_ prefer inverting this if statement: if (sharedPrefix.length() <= contextLength) { return sharedPrefix; } ... way, 1) simplest part of code is care of front 2) indented line is short line, long line</technical_language>

Target:
public String compactPrefix() { if (sharedPrefix.length() <= contextLength) { return sharedPrefix; } return ELLIPSIS + sharedPrefix.substring(sharedPrefix.length() - contextLength); }
Source:
<code>public void deleteError(final ProgramError error) { synchronized (errors) { errors.remove(error); <START> eventBus.publish(new ProgramErrorDeletedEvent(error)); <END> } }</code><technical_language>firing events holding locks things... If receives a ProgramErrorDeletedEvent access ErrorManager (which is altogether unreasonable!) end a nasty deadlock. errors a ConcurrentSkipListSet drop synchronization</technical_language>

Target:
public void deleteError(final ProgramError error) { errors.remove(error); eventBus.publish(new ProgramErrorDeletedEvent(error)); }
Source:
<code>public boolean isSitePublished(String siteId) { boolean siteIsPublished = false; try { Site site = SiteService.getSite(siteId); <START> if (site != null) { <END> siteIsPublished = site.isPublished(); } } catch (IdUnusedException e) { } return siteIsPublished; }</code><technical_language>Null check is redundant happen</technical_language>

Target:
public boolean isSitePublished(String siteId) { boolean siteIsPublished = false; try { Site site = SiteService.getSite(siteId); siteIsPublished = site.isPublished(); } catch (IdUnusedException e) { } return siteIsPublished; }
Source:
<code>public Collection<Citation> getCitationsByKey(BibEntry entry) { <START> return getCitationsByKey(Objects.requireNonNull(entry.getCiteKeyOptional().orElse(null))); <END> }</code><technical_language>better: return entry.getCiteKeyOptional().map(this::getCitationsByKey).orElse(Collections.empty())</technical_language>

Target:
public Collection<Citation> getCitationsByKey(BibEntry entry) { return entry.getCiteKeyOptional().map(this::getCitationsByKey).orElse(Collections.emptyList()); }
Source:
<code>public void downloadExistingExport( @Context HttpServletResponse response, @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @PathParam("export_id") String exportId) { Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); <START> if (consumer.getType() == null || !consumer.getType().isManifest()) { <END> log.error("Invalid consumer type specified for the manifest download"); throw new NotFoundException( i18n.tr("The specified file does not exist, or can not be accessed.")); } manifestManager.writeStoredExportToResponse(exportId, consumer, response); manifestManager.deleteStoredManifest(exportId); }</code><technical_language>other places perform validation. scope for reducing redundancy</technical_language>

Target:
public void downloadExistingExport( @Context HttpServletResponse response, @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @PathParam("export_id") String exportId) { manifestManager.writeStoredExportToResponse(exportId, consumerUuid, response); manifestManager.deleteStoredManifest(exportId); }
Source:
<code>public SetPushSetupSmsRequestDataDto mkeSetPushSetupSmsRequestDataDto() { final CosemObisCodeDto cosemCode = new CosemObisCodeDto(1, 1, 1, 1, 1, 1); final List<CosemObjectDefinitionDto> objectDefinitions = new ArrayList<>(); final SendDestinationAndMethodDto destinationAndMethod = new SendDestinationAndMethodDto( <START> TransportServiceTypeDto.TCP, "todo", MessageTypeDto.XML_ENCODED_X_DLMS_APDU); <END> final List<WindowElementDto> windowElemenents = new ArrayList<>(); final PushSetupSmsDto setupSms = new PushSetupSmsDto(cosemCode, objectDefinitions, destinationAndMethod, windowElemenents, 1, 1, 1); final SetPushSetupSmsRequestDataDto result = new SetPushSetupSmsRequestDataDto(setupSms); return result; }</code><technical_language>todo is actual a destination</technical_language>

Target:
public SetPushSetupSmsRequestDataDto mkeSetPushSetupSmsRequestDataDto() { final CosemObisCodeDto cosemCode = new CosemObisCodeDto(1, 1, 1, 1, 1, 1); final List<CosemObjectDefinitionDto> objectDefinitions = new ArrayList<>(); final SendDestinationAndMethodDto destinationAndMethod = new SendDestinationAndMethodDto( TransportServiceTypeDto.TCP, "destination", MessageTypeDto.XML_ENCODED_X_DLMS_APDU); final List<WindowElementDto> windowElemenents = new ArrayList<>(); final PushSetupSmsDto setupSms = new PushSetupSmsDto(cosemCode, objectDefinitions, destinationAndMethod, windowElemenents, 1, 1, 1); final SetPushSetupSmsRequestDataDto result = new SetPushSetupSmsRequestDataDto(setupSms); return result; }
Source:
<code>public void setUp() throws Exception { initMocks(this); <START> mockBundleContext = mock(BundleContext.class); <END> mockEndpointUtil = mock(EndpointUtil.class); mockRequest = mock(Request.class); mockResponse = mock(Response.class); mockCqlQueryResponse = mock(CqlQueryResponse.class); mockQueryResponse = mock(QueryResponse.class); mockServiceReference = mock(QueryResponseTransformer.class); mockQueryResponseTransformer = mock(ServiceReference.class); mockServletOutputStream = mock(ServletOutputStream.class); mockHttpServiceResponse = mock(HttpServletResponse.class); queryResponseTransformers = new ArrayList<>(); when(mockQueryResponseTransformer.getProperty(Core.ID)).thenReturn(RETURN_ID); MimeType mimeType = new MimeType(MIME_TYPE); mockBinaryContent = new BinaryContentImpl(new ByteArrayInputStream(CONTENT.getBytes()), mimeType); queryResponseTransformers.add(mockQueryResponseTransformer); cqlTransformHandler = new CqlTransformHandler(queryResponseTransformers, mockBundleContext); cqlTransformHandler.setEndpointUtil(mockEndpointUtil); when(mockEndpointUtil.safeGetBody(mockRequest)).thenReturn(SAFE_BODY); when(mockEndpointUtil.executeCqlQuery(any(CqlRequest.class))).thenReturn(mockCqlQueryResponse); when(mockCqlQueryResponse.getQueryResponse()).thenReturn(mockQueryResponse); when(mockBundleContext.getService(mockQueryResponseTransformer)) .thenReturn(mockServiceReference); when(mockServiceReference.transform(mockQueryResponse, Collections.emptyMap())) .thenReturn(mockBinaryContent); when(mockResponse.raw()).thenReturn(mockHttpServiceResponse); when(mockHttpServiceResponse.getOutputStream()).thenReturn(mockServletOutputStream); }</code><technical_language>calling initMocks(this), annotate mock objects @Mock remove mock() calls</technical_language>

Target:
public void setUp() throws Exception { initMocks(this); when(mockHttpServletResponse.getOutputStream()).thenReturn(mockServletOutputStream); mockResponse = new MockResponse(mockHttpServletResponse); queryResponseTransformers = new ArrayList<>(); when(mockServiceReference.getProperty(Core.ID)).thenReturn(RETURN_ID); MimeType mimeType = new MimeType(MIME_TYPE); binaryContent = new BinaryContentImpl(new ByteArrayInputStream(CONTENT.getBytes()), mimeType); queryResponseTransformers.add(mockServiceReference); cqlTransformHandler = new CqlTransformHandler(queryResponseTransformers, mockBundleContext, mockEndpointUtil); when(mockEndpointUtil.safeGetBody(mockRequest)).thenReturn(SAFE_BODY); when(mockEndpointUtil.executeCqlQuery(any(CqlRequest.class))).thenReturn(mockCqlQueryResponse); when(mockCqlQueryResponse.getQueryResponse()).thenReturn(mockQueryResponse); when(mockBundleContext.getService(mockServiceReference)) .thenReturn(mockQueryResponseTransformer); when(mockQueryResponseTransformer.transform(any(QueryResponse.class), anyMap())) .thenReturn(binaryContent); }
Source:
<code>public HostNetworkProviderModel() { getNetworkProviders().setIsChangeable(!getUseClusterDefaultNetworkProvider().getEntity()); getUseClusterDefaultNetworkProvider().getEntityChangedEvent().addListener((ev, sender, args) -> <START> getNetworkProviders().setIsChangeable(!getUseClusterDefaultNetworkProvider().getEntity())); <END> getNetworkProviders().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { Provider<OpenstackNetworkProviderProperties> provider = getNetworkProviders().getSelectedItem(); getNetworkProviderType().setIsAvailable(provider != null); getNetworkProviderType().setSelectedItem(provider == null ? null : provider.getType()); boolean isNeutron = getNetworkProviderType().getSelectedItem() == ProviderType.OPENSTACK_NETWORK; getNeutronAgentModel().init(isNeutron && provider != null ? provider : new Provider<>()); getNeutronAgentModel().setIsAvailable(isNeutron); }); getUseClusterDefaultNetworkProvider().getEntityChangedEvent().addListener( (ev, sender, args) -> selectDefaultProvider()); getNetworkProviderType().setIsChangeable(false); getNetworkProviderType().setIsAvailable(false); getNeutronAgentModel().setIsAvailable(false); initNetworkProvidersList(); }</code><technical_language>invoke 'selectDefaultProvider()' in case 'getUseClusterDefaultNetworkProvider().getEntity()) == true'</technical_language>

Target:
public HostNetworkProviderModel() { getNetworkProviders().setIsChangeable(!getUseClusterDefaultNetworkProvider().getEntity()); getUseClusterDefaultNetworkProvider().getEntityChangedEvent().addListener((ev, sender, args) -> getNetworkProviders().setIsChangeable(!getUseClusterDefaultNetworkProvider().getEntity())); getUseClusterDefaultNetworkProvider().getEntityChangedEvent().addListener( (ev, sender, args) -> selectDefaultProvider()); getNetworkProviders().getSelectedItemChangedEvent().addListener((ev, sender, args) -> { Provider<OpenstackNetworkProviderProperties> provider = getNetworkProviders().getSelectedItem(); getNetworkProviderType().setIsAvailable(provider != null); getNetworkProviderType().setSelectedItem(provider == null ? null : provider.getType()); boolean isNeutron = getNetworkProviderType().getSelectedItem() == ProviderType.OPENSTACK_NETWORK; getNeutronAgentModel().init(isNeutron && provider != null ? provider : new Provider<>()); getNeutronAgentModel().setIsAvailable(isNeutron); }); getNetworkProviderType().setIsChangeable(false); getNetworkProviderType().setIsAvailable(false); getNeutronAgentModel().setIsAvailable(false); initNetworkProvidersList(); }
Source:
<code>void insert(MemberInfo info) { <START> Comparator<MemberInfo> c = new Comparator<MemberInfo>() { <END> @Override public int compare(MemberInfo a, MemberInfo b) { int cmp = nullToEmpty(a.fullName()).compareTo(nullToEmpty(b.fullName())); if (cmp != 0) { return cmp; } cmp = nullToEmpty(a.preferredEmail()).compareTo( nullToEmpty(b.preferredEmail())); if (cmp != 0) { return cmp; } return a.getAccountId().get() - b.getAccountId().get(); } public String nullToEmpty(String str) { return str == null ? "" : str; } }; for (int row = 1; row < table.getRowCount(); row++) { final MemberInfo i = getRowItem(row); if (i != null) { if (c.compare(info, i) < 0) { table.insertRow(row); applyDataRowStyle(row); populate(row, info); return; } } } final int row = table.getRowCount(); table.insertRow(row); applyDataRowStyle(row); populate(row, info); }</code><technical_language>Is this comparator logic done else? shared logic sets ordering table in place</technical_language>

Target:
void insert(MemberInfo info) { Comparator<MemberInfo> c = new Comparator<MemberInfo>() { @Override public int compare(MemberInfo a, MemberInfo b) { int cmp = nullToEmpty(a.fullName()).compareTo(nullToEmpty(b.fullName())); if (cmp != 0) { return cmp; } cmp = nullToEmpty(a.preferredEmail()).compareTo( nullToEmpty(b.preferredEmail())); if (cmp != 0) { return cmp; } return a.getAccountId().get() - b.getAccountId().get(); } public String nullToEmpty(String str) { return str == null ? "" : str; } }; int insertPosition = table.getRowCount(); int left = 1; int right = table.getRowCount() - 1; while (left <= right) { int middle = (left + right) >>> 1; MemberInfo i = getRowItem(middle); int cmp = c.compare(i, info); if (cmp < 0) { left = middle + 1; } else if (cmp > 0) { right = middle - 1; } else { return; } } insertPosition = left; table.insertRow(insertPosition); applyDataRowStyle(insertPosition); populate(insertPosition, info); }
Source:
<code>public void setUp() throws Exception { super.setUp(); home = new File(trash, "home"); <START> assertTrue(home.mkdir()); <END> configFile = new File(new File(home, ".ssh"), "config"); assertTrue(configFile.getParentFile().mkdir()); System.setProperty("user.name", "jex_junit"); osc = new OpenSshConfig(home, configFile); }</code><technical_language>FileUtils.mkdirs</technical_language>

Target:
public void setUp() throws Exception { super.setUp(); home = new File(trash, "home"); FileUtils.mkdir(home); configFile = new File(new File(home, ".ssh"), "config"); FileUtils.mkdir(configFile.getParentFile()); System.setProperty("user.name", "jex_junit"); osc = new OpenSshConfig(home, configFile); }
Source:
<code>public void testPrometheusCaseMetrics() { String caseId = startUserTaskCase(USER_YODA, USER_JOHN); assertThat(caseId).isNotEmpty(); assertThat(getMetrics()).contains( "kie_server_case_started_total{case_definition_id=\"" + CASE_DEF_ID + "\",", "kie_server_case_running_total{case_definition_id=\"" + CASE_DEF_ID + "\",} 1.0" ); caseClient.cancelCaseInstance(CONTAINER_ID_CASE, caseId); assertThat(getMetrics()).contains( "kie_server_case_started_total{case_definition_id=\"" + CASE_DEF_ID + "\",", "kie_server_case_running_total{case_definition_id=\"" + CASE_DEF_ID + "\",} 0.0", "kie_server_case_duration_seconds_count{case_definition_id=\"" + CASE_DEF_ID + "\",", <START> "kie_server_case_duration_seconds_sum{case_definition_id=\"" + CASE_DEF_ID + "\"," <END> ); }</code><technical_language>@sutaakar potential timing issues get counter 0</technical_language>

Target:
public void testPrometheusCaseMetrics() { String caseId = startUserTaskCase(USER_YODA, USER_JOHN); assertThat(caseId).isNotEmpty(); assertThat(getMetrics()).contains( "kie_server_case_started_total{case_definition_id=\"" + CASE_DEF_ID + "\",", "kie_server_case_running_total{case_definition_id=\"" + CASE_DEF_ID + "\"," ); caseClient.cancelCaseInstance(CONTAINER_ID_CASE, caseId); assertThat(getMetrics()).contains( "kie_server_case_started_total{case_definition_id=\"" + CASE_DEF_ID + "\",", "kie_server_case_running_total{case_definition_id=\"" + CASE_DEF_ID + "\",", "kie_server_case_duration_seconds_count{case_definition_id=\"" + CASE_DEF_ID + "\",", "kie_server_case_duration_seconds_sum{case_definition_id=\"" + CASE_DEF_ID + "\"," ); }
Source:
<code>public void onCollide(ICollidable other) { if (other instanceof EnemyFish) { EnemyFish fish = (EnemyFish) other; if (fish.isDead()) { return; } double tsize = this.getBoundingArea().getSize(); double osize = fish.getBoundingArea().getSize(); if (tsize > osize * FISH_EAT_THRESHOLD) { State old = getState(); fish.setDead(); <START> notifyObservers(old, getState()); <END> this.addPoints((int) (osize / 200)); double dSize = GROWTH_SPEED * osize / tsize; getBoundingArea().increaseSize(dSize); } else if (osize > tsize * FISH_EAT_THRESHOLD) { State old = getState(); this.removeLife(); notifyObservers(old, getState(), "lives"); } } }</code><technical_language>do notifyObservers(old, getState(), "death"); <bug</technical_language>

Target:
public void onCollide(ICollidable other) { if (other instanceof EnemyFish) { EnemyFish fish = (EnemyFish) other; if (fish.isDead()) { return; } double tsize = this.getBoundingArea().getSize(); double osize = fish.getBoundingArea().getSize(); if (tsize > osize * FISH_EAT_THRESHOLD) { State old = getState(); fish.setDead(); notifyObservers(old, getState(), "EnemyKill"); this.addPoints((int) (osize / 200)); double dSize = GROWTH_SPEED * osize / tsize; getBoundingArea().increaseSize(dSize); } else if (osize > tsize * FISH_EAT_THRESHOLD) { if (isInvincible()) { return; } State old = getState(); this.removeLife(); notifyObservers(old, getState(), "lives"); } } }